diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs index 5aaa3c540a6..64589ab7ff2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs @@ -208,6 +208,13 @@ 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 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}" }); + internal static ApiUrls QueryRulesGetRuleset = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); + internal static ApiUrls QueryRulesListRulesets = new ApiUrls(new[] { "_query_rules" }); + internal static ApiUrls QueryRulesPutRule = new ApiUrls(new[] { "_query_rules/{ruleset_id}/_rule/{rule_id}" }); + internal static ApiUrls QueryRulesPutRuleset = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); internal static ApiUrls SnapshotCleanupRepository = new ApiUrls(new[] { "_snapshot/{repository}/_cleanup" }); internal static ApiUrls SnapshotClone = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}" }); internal static ApiUrls SnapshotCreate = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}" }); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs index 6f6e42ad21b..80f171d1634 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs @@ -43,7 +43,7 @@ public sealed partial class DeleteIndexTemplateRequestParameters : RequestParame } /// -/// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+/// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
///
public sealed partial class DeleteIndexTemplateRequest : PlainRequest { @@ -73,7 +73,7 @@ public DeleteIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Names } /// -/// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+/// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
///
public sealed partial class DeleteIndexTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs index b72b10a6b53..d30ca99d99a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs @@ -53,7 +53,7 @@ public sealed partial class GetIndexTemplateRequestParameters : RequestParameter } /// -/// Returns information about one or more index templates. +/// Get index templates.
Returns information about one or more index templates.
///
public sealed partial class GetIndexTemplateRequest : PlainRequest { @@ -99,7 +99,7 @@ public GetIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name? na } /// -/// Returns information about one or more index templates. +/// Get index templates.
Returns information about one or more index templates.
///
public sealed partial class GetIndexTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs index 50e8b9d90b3..5382446ebe4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs @@ -48,7 +48,7 @@ public sealed partial class PutIndexTemplateRequestParameters : RequestParameter } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutIndexTemplateRequest : PlainRequest { @@ -144,7 +144,7 @@ public PutIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name nam } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutIndexTemplateRequestDescriptor : RequestDescriptor, PutIndexTemplateRequestParameters> { @@ -401,7 +401,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutIndexTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs index 9c03c96df9f..eb6c337cfb0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs @@ -45,7 +45,7 @@ public sealed partial class PutTemplateRequestParameters : RequestParameters } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutTemplateRequest : PlainRequest { @@ -116,7 +116,7 @@ public PutTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor, PutTemplateRequestParameters> { @@ -310,7 +310,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs index 96bec2b3d3d..671fac8b7f5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs @@ -42,6 +42,9 @@ public sealed partial class SimulateIndexTemplateRequestParameters : RequestPara public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } +/// +/// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
+///
public sealed partial class SimulateIndexTemplateRequest : PlainRequest { public SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) @@ -69,6 +72,9 @@ public SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Nam public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } +/// +/// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
+///
public sealed partial class SimulateIndexTemplateRequestDescriptor : RequestDescriptor { internal SimulateIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs index ed54b91e737..149b96a6610 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs @@ -48,7 +48,7 @@ public sealed partial class SimulateTemplateRequestParameters : RequestParameter } /// -/// Returns the index configuration that would be applied by a particular index template. +/// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
///
public sealed partial class SimulateTemplateRequest : PlainRequest { @@ -148,7 +148,7 @@ public SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name? na } /// -/// Returns the index configuration that would be applied by a particular index template. +/// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
///
public sealed partial class SimulateTemplateRequestDescriptor : RequestDescriptor, SimulateTemplateRequestParameters> { @@ -409,7 +409,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } /// -/// Returns the index configuration that would be applied by a particular index template. +/// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
///
public sealed partial class SimulateTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRuleRequest.g.cs new file mode 100644 index 00000000000..54b45ec3bc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRuleRequest.g.cs @@ -0,0 +1,88 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class DeleteRuleRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a query rule within a query ruleset. +/// +public sealed partial class DeleteRuleRequest : PlainRequest +{ + public DeleteRuleRequest(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("ruleset_id", rulesetId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesDeleteRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.delete_rule"; +} + +/// +/// Deletes a query rule within a query ruleset. +/// +public sealed partial class DeleteRuleRequestDescriptor : RequestDescriptor +{ + internal DeleteRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("ruleset_id", rulesetId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesDeleteRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.delete_rule"; + + public DeleteRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Serverless.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public DeleteRuleRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRuleResponse.g.cs new file mode 100644 index 00000000000..0dfb148a64b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRuleResponse.g.cs @@ -0,0 +1,36 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class DeleteRuleResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs new file mode 100644 index 00000000000..324be39c977 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRulesetRequest.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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class DeleteRulesetRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a query ruleset. +/// +public sealed partial class DeleteRulesetRequest : PlainRequest +{ + public DeleteRulesetRequest(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesDeleteRuleset; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.delete_ruleset"; +} + +/// +/// Deletes a query ruleset. +/// +public sealed partial class DeleteRulesetRequestDescriptor : RequestDescriptor +{ + internal DeleteRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesDeleteRuleset; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.delete_ruleset"; + + public DeleteRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs new file mode 100644 index 00000000000..4508411c472 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs @@ -0,0 +1,36 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class DeleteRulesetResponse : ElasticsearchResponse +{ + /// + /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRuleRequest.g.cs new file mode 100644 index 00000000000..94e2620eac7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRuleRequest.g.cs @@ -0,0 +1,88 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class GetRuleRequestParameters : RequestParameters +{ +} + +/// +/// Returns the details about a query rule within a query ruleset +/// +public sealed partial class GetRuleRequest : PlainRequest +{ + public GetRuleRequest(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("ruleset_id", rulesetId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesGetRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.get_rule"; +} + +/// +/// Returns the details about a query rule within a query ruleset +/// +public sealed partial class GetRuleRequestDescriptor : RequestDescriptor +{ + internal GetRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("ruleset_id", rulesetId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesGetRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.get_rule"; + + public GetRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Serverless.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public GetRuleRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRuleResponse.g.cs new file mode 100644 index 00000000000..63d2fc47f3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRuleResponse.g.cs @@ -0,0 +1,39 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class GetRuleResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("actions")] + public Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActions Actions { get; init; } + [JsonInclude, JsonPropertyName("criteria")] + public IReadOnlyCollection Criteria { get; init; } + [JsonInclude, JsonPropertyName("rule_id")] + public string RuleId { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleType Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRulesetRequest.g.cs new file mode 100644 index 00000000000..4269db61e68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRulesetRequest.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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class GetRulesetRequestParameters : RequestParameters +{ +} + +/// +/// Returns the details about a query ruleset +/// +public sealed partial class GetRulesetRequest : PlainRequest +{ + public GetRulesetRequest(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesGetRuleset; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.get_ruleset"; +} + +/// +/// Returns the details about a query ruleset +/// +public sealed partial class GetRulesetRequestDescriptor : RequestDescriptor +{ + internal GetRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesGetRuleset; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.get_ruleset"; + + public GetRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRulesetResponse.g.cs similarity index 68% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RangeQuery.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRulesetResponse.g.cs index 7efbdcec56c..9fb90479f2d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/GetRulesetResponse.g.cs @@ -17,26 +17,26 @@ #nullable restore -using Elastic.Clients.Elasticsearch.Serverless.Core; using Elastic.Clients.Elasticsearch.Serverless.Fluent; using Elastic.Clients.Elasticsearch.Serverless.Serialization; -using Elastic.Transport; +using Elastic.Transport.Products.Elasticsearch; using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; -public sealed partial class RangeQuery : Union +public sealed partial class GetRulesetResponse : ElasticsearchResponse { - public RangeQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateRangeQuery Date) : base(Date) - { - } + /// + /// Rules associated with the query ruleset + /// + [JsonInclude, JsonPropertyName("rules")] + public IReadOnlyCollection Rules { get; init; } - public RangeQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumberRangeQuery Number) : base(Number) - { - } + /// + /// Query Ruleset unique identifier + /// + [JsonInclude, JsonPropertyName("ruleset_id")] + public string RulesetId { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs new file mode 100644 index 00000000000..23d37ac752e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs @@ -0,0 +1,96 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class ListRulesetsRequestParameters : RequestParameters +{ + /// + /// Starting offset (default: 0) + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of results to get + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Returns summarized information about existing query rulesets. +/// +public sealed partial class ListRulesetsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesListRulesets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.list_rulesets"; + + /// + /// Starting offset (default: 0) + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of results to get + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Returns summarized information about existing query rulesets. +/// +public sealed partial class ListRulesetsRequestDescriptor : RequestDescriptor +{ + internal ListRulesetsRequestDescriptor(Action configure) => configure.Invoke(this); + + public ListRulesetsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesListRulesets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_rules.list_rulesets"; + + public ListRulesetsRequestDescriptor From(int? from) => Qs("from", from); + public ListRulesetsRequestDescriptor Size(int? size) => Qs("size", size); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs new file mode 100644 index 00000000000..f318fa1003c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class ListRulesetsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("results")] + public IReadOnlyCollection Results { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRuleRequest.g.cs new file mode 100644 index 00000000000..89f9792991b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRuleRequest.g.cs @@ -0,0 +1,221 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class PutRuleRequestParameters : RequestParameters +{ +} + +/// +/// Creates or updates a query rule within a query ruleset. +/// +public sealed partial class PutRuleRequest : PlainRequest +{ + public PutRuleRequest(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("ruleset_id", rulesetId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesPutRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "query_rules.put_rule"; + + [JsonInclude, JsonPropertyName("actions")] + public Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActions Actions { get; set; } + [JsonInclude, JsonPropertyName("criteria")] + public ICollection Criteria { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleType Type { get; set; } +} + +/// +/// Creates or updates a query rule within a query ruleset. +/// +public sealed partial class PutRuleRequestDescriptor : RequestDescriptor +{ + internal PutRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("ruleset_id", rulesetId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesPutRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "query_rules.put_rule"; + + public PutRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Serverless.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public PutRuleRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActions ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActionsDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private ICollection CriteriaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaDescriptor CriteriaDescriptor { get; set; } + private Action CriteriaDescriptorAction { get; set; } + private Action[] CriteriaDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleType TypeValue { get; set; } + + public PutRuleRequestDescriptor Actions(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActions actions) + { + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsValue = actions; + return Self; + } + + public PutRuleRequestDescriptor Actions(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActionsDescriptor descriptor) + { + ActionsValue = null; + ActionsDescriptorAction = null; + ActionsDescriptor = descriptor; + return Self; + } + + public PutRuleRequestDescriptor Actions(Action configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorAction = configure; + return Self; + } + + public PutRuleRequestDescriptor Criteria(ICollection criteria) + { + CriteriaDescriptor = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = null; + CriteriaValue = criteria; + return Self; + } + + public PutRuleRequestDescriptor Criteria(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaDescriptor descriptor) + { + CriteriaValue = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = null; + CriteriaDescriptor = descriptor; + return Self; + } + + public PutRuleRequestDescriptor Criteria(Action configure) + { + CriteriaValue = null; + CriteriaDescriptor = null; + CriteriaDescriptorActions = null; + CriteriaDescriptorAction = configure; + return Self; + } + + public PutRuleRequestDescriptor Criteria(params Action[] configure) + { + CriteriaValue = null; + CriteriaDescriptor = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = configure; + return Self; + } + + public PutRuleRequestDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleType type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsDescriptor is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsDescriptor, options); + } + else if (ActionsDescriptorAction is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActionsDescriptor(ActionsDescriptorAction), options); + } + else + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + if (CriteriaDescriptor is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, CriteriaDescriptor, options); + writer.WriteEndArray(); + } + else if (CriteriaDescriptorAction is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaDescriptor(CriteriaDescriptorAction), options); + writer.WriteEndArray(); + } + else if (CriteriaDescriptorActions is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + foreach (var action in CriteriaDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("criteria"); + JsonSerializer.Serialize(writer, CriteriaValue, options); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRuleResponse.g.cs new file mode 100644 index 00000000000..aa8c2bc922d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRuleResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class PutRuleResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRulesetRequest.g.cs new file mode 100644 index 00000000000..d82f1073db1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRulesetRequest.g.cs @@ -0,0 +1,159 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Requests; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class PutRulesetRequestParameters : RequestParameters +{ +} + +/// +/// Creates or updates a query ruleset. +/// +public sealed partial class PutRulesetRequest : PlainRequest +{ + public PutRulesetRequest(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesPutRuleset; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "query_rules.put_ruleset"; + + [JsonInclude, JsonPropertyName("rules")] + public ICollection Rules { get; set; } +} + +/// +/// Creates or updates a query ruleset. +/// +public sealed partial class PutRulesetRequestDescriptor : RequestDescriptor +{ + internal PutRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesPutRuleset; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "query_rules.put_ruleset"; + + public PutRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + return Self; + } + + private ICollection RulesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleDescriptor RulesDescriptor { get; set; } + private Action RulesDescriptorAction { get; set; } + private Action[] RulesDescriptorActions { get; set; } + + public PutRulesetRequestDescriptor Rules(ICollection rules) + { + RulesDescriptor = null; + RulesDescriptorAction = null; + RulesDescriptorActions = null; + RulesValue = rules; + return Self; + } + + public PutRulesetRequestDescriptor Rules(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleDescriptor descriptor) + { + RulesValue = null; + RulesDescriptorAction = null; + RulesDescriptorActions = null; + RulesDescriptor = descriptor; + return Self; + } + + public PutRulesetRequestDescriptor Rules(Action configure) + { + RulesValue = null; + RulesDescriptor = null; + RulesDescriptorActions = null; + RulesDescriptorAction = configure; + return Self; + } + + public PutRulesetRequestDescriptor Rules(params Action[] configure) + { + RulesValue = null; + RulesDescriptor = null; + RulesDescriptorAction = null; + RulesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RulesDescriptor is not null) + { + writer.WritePropertyName("rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RulesDescriptor, options); + writer.WriteEndArray(); + } + else if (RulesDescriptorAction is not null) + { + writer.WritePropertyName("rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleDescriptor(RulesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RulesDescriptorActions is not null) + { + writer.WritePropertyName("rules"); + writer.WriteStartArray(); + foreach (var action in RulesDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("rules"); + JsonSerializer.Serialize(writer, RulesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRulesetResponse.g.cs new file mode 100644 index 00000000000..3500ffe97f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/QueryRules/PutRulesetResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class PutRulesetResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs index fcb5a2fb5e6..ee0ca420c9f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -873,7 +873,7 @@ public virtual Task DeleteDataStreamAsync(Elastic.Clie } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequest request, CancellationToken cancellationToken = default) @@ -883,7 +883,7 @@ public virtual Task DeleteIndexTemplateAsync(Delete } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -893,7 +893,7 @@ public virtual Task DeleteIndexTemplateAsync(Delete } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) @@ -904,7 +904,7 @@ public virtual Task DeleteIndexTemplateAsync(Elasti } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) @@ -1853,7 +1853,7 @@ public virtual Task GetDataStreamAsync(Action - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequest request, CancellationToken cancellationToken = default) @@ -1863,7 +1863,7 @@ public virtual Task GetIndexTemplateAsync(GetIndexTemp } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -1873,7 +1873,7 @@ public virtual Task GetIndexTemplateAsync(GetIndexTemp } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name? name, CancellationToken cancellationToken = default) @@ -1884,7 +1884,7 @@ public virtual Task GetIndexTemplateAsync(Elastic.Clie } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name? name, Action configureRequest, CancellationToken cancellationToken = default) @@ -1896,7 +1896,7 @@ public virtual Task GetIndexTemplateAsync(Elastic.Clie } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(CancellationToken cancellationToken = default) @@ -1907,7 +1907,7 @@ public virtual Task GetIndexTemplateAsync(Cancellation } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) @@ -2490,7 +2490,7 @@ public virtual Task PutDataLifecycleAsync(Elastic.Clie } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequest request, CancellationToken cancellationToken = default) @@ -2500,7 +2500,7 @@ public virtual Task PutIndexTemplateAsync(PutIndexTemp } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -2510,7 +2510,7 @@ public virtual Task PutIndexTemplateAsync(P } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) @@ -2521,7 +2521,7 @@ public virtual Task PutIndexTemplateAsync(E } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) @@ -2533,7 +2533,7 @@ public virtual Task PutIndexTemplateAsync(E } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -2543,7 +2543,7 @@ public virtual Task PutIndexTemplateAsync(PutIndexTemp } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) @@ -2554,7 +2554,7 @@ public virtual Task PutIndexTemplateAsync(Elastic.Clie } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) @@ -2787,7 +2787,7 @@ public virtual Task PutSettingsAsync(Elastic.Clients } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(PutTemplateRequest request, CancellationToken cancellationToken = default) @@ -2797,7 +2797,7 @@ public virtual Task PutTemplateAsync(PutTemplateRequest req } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -2807,7 +2807,7 @@ public virtual Task PutTemplateAsync(PutTemplate } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) @@ -2818,7 +2818,7 @@ public virtual Task PutTemplateAsync(Elastic.Cli } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) @@ -2830,7 +2830,7 @@ public virtual Task PutTemplateAsync(Elastic.Cli } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -2840,7 +2840,7 @@ public virtual Task PutTemplateAsync(PutTemplateRequestDesc } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) @@ -2851,7 +2851,7 @@ public virtual Task PutTemplateAsync(Elastic.Clients.Elasti } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) @@ -3394,6 +3394,7 @@ public virtual Task SegmentsAsync(Action + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequest request, CancellationToken cancellationToken = default) @@ -3403,6 +3404,7 @@ public virtual Task SimulateIndexTemplateAsync(Si } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -3412,6 +3414,7 @@ public virtual Task SimulateIndexTemplateAsync(Si } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) @@ -3422,6 +3425,7 @@ public virtual Task SimulateIndexTemplateAsync(El } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) @@ -3433,7 +3437,7 @@ public virtual Task SimulateIndexTemplateAsync(El } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(SimulateTemplateRequest request, CancellationToken cancellationToken = default) @@ -3443,7 +3447,7 @@ public virtual Task SimulateTemplateAsync(SimulateTemp } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(SimulateTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -3453,7 +3457,7 @@ public virtual Task SimulateTemplateAsync(S } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name? name, CancellationToken cancellationToken = default) @@ -3464,7 +3468,7 @@ public virtual Task SimulateTemplateAsync(E } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name? name, Action> configureRequest, CancellationToken cancellationToken = default) @@ -3476,7 +3480,7 @@ public virtual Task SimulateTemplateAsync(E } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(CancellationToken cancellationToken = default) @@ -3487,7 +3491,7 @@ public virtual Task SimulateTemplateAsync(C } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Action> configureRequest, CancellationToken cancellationToken = default) @@ -3499,7 +3503,7 @@ public virtual Task SimulateTemplateAsync(A } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(SimulateTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -3509,7 +3513,7 @@ public virtual Task SimulateTemplateAsync(SimulateTemp } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name? name, CancellationToken cancellationToken = default) @@ -3520,7 +3524,7 @@ public virtual Task SimulateTemplateAsync(Elastic.Clie } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name? name, Action configureRequest, CancellationToken cancellationToken = default) @@ -3532,7 +3536,7 @@ public virtual Task SimulateTemplateAsync(Elastic.Clie } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(CancellationToken cancellationToken = default) @@ -3543,7 +3547,7 @@ public virtual Task SimulateTemplateAsync(Cancellation } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.QueryRules.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.QueryRules.g.cs new file mode 100644 index 00000000000..e44e5035f6f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.QueryRules.g.cs @@ -0,0 +1,340 @@ +// 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public partial class QueryRulesNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected QueryRulesNamespacedClient() : base() + { + } + + internal QueryRulesNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes a query rule within a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRuleAsync(DeleteRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a query rule within a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRuleAsync(DeleteRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a query rule within a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRuleRequestDescriptor(rulesetId, ruleId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a query rule within a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRuleRequestDescriptor(rulesetId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRulesetAsync(DeleteRulesetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRulesetAsync(DeleteRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRulesetRequestDescriptor(rulesetId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query rule within a query ruleset + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRuleAsync(GetRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the details about a query rule within a query ruleset + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRuleAsync(GetRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query rule within a query ruleset + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, CancellationToken cancellationToken = default) + { + var descriptor = new GetRuleRequestDescriptor(rulesetId, ruleId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query rule within a query ruleset + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRuleRequestDescriptor(rulesetId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query ruleset + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRulesetAsync(GetRulesetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the details about a query ruleset + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRulesetAsync(GetRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query ruleset + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, CancellationToken cancellationToken = default) + { + var descriptor = new GetRulesetRequestDescriptor(rulesetId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query ruleset + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns summarized information about existing query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListRulesetsAsync(ListRulesetsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns summarized information about existing query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListRulesetsAsync(ListRulesetsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns summarized information about existing query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListRulesetsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ListRulesetsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns summarized information about existing query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListRulesetsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ListRulesetsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a query rule within a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutRuleAsync(PutRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a query rule within a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutRuleAsync(PutRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a query rule within a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, CancellationToken cancellationToken = default) + { + var descriptor = new PutRuleRequestDescriptor(rulesetId, ruleId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a query rule within a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutRuleRequestDescriptor(rulesetId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutRulesetAsync(PutRulesetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutRulesetAsync(PutRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, CancellationToken cancellationToken = default) + { + var descriptor = new PutRulesetRequestDescriptor(rulesetId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs index a4d88416a60..fb87956944f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs @@ -27,6 +27,7 @@ using Elastic.Clients.Elasticsearch.Serverless.LicenseManagement; using Elastic.Clients.Elasticsearch.Serverless.MachineLearning; using Elastic.Clients.Elasticsearch.Serverless.Nodes; +using Elastic.Clients.Elasticsearch.Serverless.QueryRules; using Elastic.Clients.Elasticsearch.Serverless.Snapshot; using Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; using Elastic.Clients.Elasticsearch.Serverless.Sql; @@ -53,6 +54,7 @@ public partial class ElasticsearchClient public virtual LicenseManagementNamespacedClient LicenseManagement { get; private set; } public virtual MachineLearningNamespacedClient MachineLearning { get; private set; } public virtual NodesNamespacedClient Nodes { get; private set; } + public virtual QueryRulesNamespacedClient QueryRules { get; private set; } public virtual SnapshotNamespacedClient Snapshot { get; private set; } public virtual SnapshotLifecycleManagementNamespacedClient SnapshotLifecycleManagement { get; private set; } public virtual SqlNamespacedClient Sql { get; private set; } @@ -73,6 +75,7 @@ private partial void SetupNamespaces() LicenseManagement = new LicenseManagementNamespacedClient(this); MachineLearning = new MachineLearningNamespacedClient(this); Nodes = new NodesNamespacedClient(this); + QueryRules = new QueryRulesNamespacedClient(this); Snapshot = new SnapshotNamespacedClient(this); SnapshotLifecycleManagement = new SnapshotLifecycleManagementNamespacedClient(this); Sql = new SqlNamespacedClient(this); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs index 79811752991..9a8d543b219 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs @@ -86,6 +86,12 @@ public sealed partial class TermsAggregation [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ [JsonInclude, JsonPropertyName("shard_min_doc_count")] + public long? ShardMinDocCount { get; set; } + /// /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
///
@@ -134,6 +140,7 @@ public TermsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private long? ShardMinDocCountValue { get; set; } private int? ShardSizeValue { get; set; } private bool? ShowTermDocCountErrorValue { get; set; } private int? SizeValue { get; set; } @@ -253,6 +260,15 @@ public TermsAggregationDescriptor Script(Elastic.Clients.Elasticsearc return Self; } + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public TermsAggregationDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + /// /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
///
@@ -364,6 +380,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + if (ShardSizeValue.HasValue) { writer.WritePropertyName("shard_size"); @@ -412,6 +434,7 @@ public TermsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private long? ShardMinDocCountValue { get; set; } private int? ShardSizeValue { get; set; } private bool? ShowTermDocCountErrorValue { get; set; } private int? SizeValue { get; set; } @@ -531,6 +554,15 @@ public TermsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverles return Self; } + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public TermsAggregationDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + /// /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
///
@@ -642,6 +674,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + if (ShardSizeValue.HasValue) { writer.WritePropertyName("shard_size"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryDsl.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryDsl.g.cs index 285be0f6877..0355cac3b29 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryDsl.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryDsl.g.cs @@ -540,6 +540,74 @@ public override void Write(Utf8JsonWriter writer, GeoValidationMethod value, Jso } } +[JsonConverter(typeof(MultiValueModeConverter))] +public enum MultiValueMode +{ + /// + /// Distance is the sum of all distances. + /// + [EnumMember(Value = "sum")] + Sum, + /// + /// Distance is the minimum distance. + /// + [EnumMember(Value = "min")] + Min, + /// + /// Distance is the maximum distance. + /// + [EnumMember(Value = "max")] + Max, + /// + /// Distance is the average distance. + /// + [EnumMember(Value = "avg")] + Avg +} + +internal sealed class MultiValueModeConverter : JsonConverter +{ + public override MultiValueMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "sum": + return MultiValueMode.Sum; + case "min": + return MultiValueMode.Min; + case "max": + return MultiValueMode.Max; + case "avg": + return MultiValueMode.Avg; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, MultiValueMode value, JsonSerializerOptions options) + { + switch (value) + { + case MultiValueMode.Sum: + writer.WriteStringValue("sum"); + return; + case MultiValueMode.Min: + writer.WriteStringValue("min"); + return; + case MultiValueMode.Max: + writer.WriteStringValue("max"); + return; + case MultiValueMode.Avg: + writer.WriteStringValue("avg"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(OperatorConverter))] public enum Operator { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryRules.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryRules.g.cs new file mode 100644 index 00000000000..6569028993b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.QueryRules.g.cs @@ -0,0 +1,169 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +[JsonConverter(typeof(QueryRuleCriteriaTypeConverter))] +public enum QueryRuleCriteriaType +{ + [EnumMember(Value = "suffix")] + Suffix, + [EnumMember(Value = "prefix")] + Prefix, + [EnumMember(Value = "lte")] + Lte, + [EnumMember(Value = "lt")] + Lt, + [EnumMember(Value = "gte")] + Gte, + [EnumMember(Value = "gt")] + Gt, + [EnumMember(Value = "global")] + Global, + [EnumMember(Value = "exact_fuzzy")] + ExactFuzzy, + [EnumMember(Value = "exact")] + Exact, + [EnumMember(Value = "contains")] + Contains, + [EnumMember(Value = "always")] + Always +} + +internal sealed class QueryRuleCriteriaTypeConverter : JsonConverter +{ + public override QueryRuleCriteriaType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "suffix": + return QueryRuleCriteriaType.Suffix; + case "prefix": + return QueryRuleCriteriaType.Prefix; + case "lte": + return QueryRuleCriteriaType.Lte; + case "lt": + return QueryRuleCriteriaType.Lt; + case "gte": + return QueryRuleCriteriaType.Gte; + case "gt": + return QueryRuleCriteriaType.Gt; + case "global": + return QueryRuleCriteriaType.Global; + case "exact_fuzzy": + return QueryRuleCriteriaType.ExactFuzzy; + case "exact": + return QueryRuleCriteriaType.Exact; + case "contains": + return QueryRuleCriteriaType.Contains; + case "always": + return QueryRuleCriteriaType.Always; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, QueryRuleCriteriaType value, JsonSerializerOptions options) + { + switch (value) + { + case QueryRuleCriteriaType.Suffix: + writer.WriteStringValue("suffix"); + return; + case QueryRuleCriteriaType.Prefix: + writer.WriteStringValue("prefix"); + return; + case QueryRuleCriteriaType.Lte: + writer.WriteStringValue("lte"); + return; + case QueryRuleCriteriaType.Lt: + writer.WriteStringValue("lt"); + return; + case QueryRuleCriteriaType.Gte: + writer.WriteStringValue("gte"); + return; + case QueryRuleCriteriaType.Gt: + writer.WriteStringValue("gt"); + return; + case QueryRuleCriteriaType.Global: + writer.WriteStringValue("global"); + return; + case QueryRuleCriteriaType.ExactFuzzy: + writer.WriteStringValue("exact_fuzzy"); + return; + case QueryRuleCriteriaType.Exact: + writer.WriteStringValue("exact"); + return; + case QueryRuleCriteriaType.Contains: + writer.WriteStringValue("contains"); + return; + case QueryRuleCriteriaType.Always: + writer.WriteStringValue("always"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(QueryRuleTypeConverter))] +public enum QueryRuleType +{ + [EnumMember(Value = "pinned")] + Pinned +} + +internal sealed class QueryRuleTypeConverter : JsonConverter +{ + public override QueryRuleType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "pinned": + return QueryRuleType.Pinned; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, QueryRuleType value, JsonSerializerOptions options) + { + switch (value) + { + case QueryRuleType.Pinned: + writer.WriteStringValue("pinned"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs index 3b26d70b295..a6974a18d28 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs @@ -29,6 +29,12 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class MappingLimitSettingsTotalFields { + /// + /// This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set
to false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail
with the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail.
Instead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false.
The fields that were not added to the mapping will be added to the _ignored field.
+ ///
+ [JsonInclude, JsonPropertyName("ignore_dynamic_beyond_limit")] + public bool? IgnoreDynamicBeyondLimit { get; set; } + /// /// The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit.
The limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance
degradations and memory issues, especially in clusters with a high load or few resources.
///
@@ -44,8 +50,18 @@ public MappingLimitSettingsTotalFieldsDescriptor() : base() { } + private bool? IgnoreDynamicBeyondLimitValue { get; set; } private long? LimitValue { get; set; } + /// + /// This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set
to false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail
with the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail.
Instead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false.
The fields that were not added to the mapping will be added to the _ignored field.
+ ///
+ public MappingLimitSettingsTotalFieldsDescriptor IgnoreDynamicBeyondLimit(bool? ignoreDynamicBeyondLimit = true) + { + IgnoreDynamicBeyondLimitValue = ignoreDynamicBeyondLimit; + return Self; + } + /// /// The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit.
The limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance
degradations and memory issues, especially in clusters with a high load or few resources.
///
@@ -58,6 +74,12 @@ public MappingLimitSettingsTotalFieldsDescriptor Limit(long? limit) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (IgnoreDynamicBeyondLimitValue.HasValue) + { + writer.WritePropertyName("ignore_dynamic_beyond_limit"); + writer.WriteBooleanValue(IgnoreDynamicBeyondLimitValue.Value); + } + if (LimitValue.HasValue) { writer.WritePropertyName("limit"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateDecayFunction.g.cs new file mode 100644 index 00000000000..fdbc4cfbc58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateDecayFunction.g.cs @@ -0,0 +1,222 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class DateDecayFunctionConverter : JsonConverter +{ + public override DateDecayFunction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new DateDecayFunction(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "multi_value_mode") + { + variant.MultiValueMode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Placement = JsonSerializer.Deserialize>(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, DateDecayFunction value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Placement is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Placement, options); + } + + if (value.MultiValueMode is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, value.MultiValueMode, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DateDecayFunctionConverter))] +public sealed partial class DateDecayFunction +{ + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueMode { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement Placement { get; set; } +} + +public sealed partial class DateDecayFunctionDescriptor : SerializableDescriptor> +{ + internal DateDecayFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public DateDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public DateDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public DateDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DateDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public DateDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public DateDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateDecayFunctionDescriptor : SerializableDescriptor +{ + internal DateDecayFunctionDescriptor(Action configure) => configure.Invoke(this); + + public DateDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public DateDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public DateDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DateDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public DateDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public DateDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs new file mode 100644 index 00000000000..8aa3661bbb0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs @@ -0,0 +1,255 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class DateDistanceFeatureQuery +{ + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ [JsonInclude, JsonPropertyName("origin")] + public Elastic.Clients.Elasticsearch.Serverless.DateMath Origin { get; set; } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.Serverless.Duration Pivot { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } +} + +public sealed partial class DateDistanceFeatureQueryDescriptor : SerializableDescriptor> +{ + internal DateDistanceFeatureQueryDescriptor(Action> configure) => configure.Invoke(this); + + public DateDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath OriginValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public DateDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public DateDistanceFeatureQueryDescriptor Origin(Elastic.Clients.Elasticsearch.Serverless.DateMath origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public DateDistanceFeatureQueryDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.Duration pivot) + { + PivotValue = pivot; + return Self; + } + + public DateDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateDistanceFeatureQueryDescriptor : SerializableDescriptor +{ + internal DateDistanceFeatureQueryDescriptor(Action configure) => configure.Invoke(this); + + public DateDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.DateMath OriginValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public DateDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public DateDistanceFeatureQueryDescriptor Origin(Elastic.Clients.Elasticsearch.Serverless.DateMath origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public DateDistanceFeatureQueryDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.Duration pivot) + { + PivotValue = pivot; + return Self; + } + + public DateDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DecayPlacement.g.cs similarity index 58% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DecayPlacement.g.cs index 4ddfcc70046..464bf430d7d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DecayPlacement.g.cs @@ -27,33 +27,32 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class GeoPolygonPoints +public sealed partial class DecayPlacement { - [JsonInclude, JsonPropertyName("points")] - public ICollection Points { get; set; } -} - -public sealed partial class GeoPolygonPointsDescriptor : SerializableDescriptor -{ - internal GeoPolygonPointsDescriptor(Action configure) => configure.Invoke(this); - - public GeoPolygonPointsDescriptor() : base() - { - } - - private ICollection PointsValue { get; set; } - - public GeoPolygonPointsDescriptor Points(ICollection points) - { - PointsValue = points; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - writer.WritePropertyName("points"); - JsonSerializer.Serialize(writer, PointsValue, options); - writer.WriteEndObject(); - } + /// + /// Defines how documents are scored at the distance given at scale. + /// + [JsonInclude, JsonPropertyName("decay")] + public double? Decay { get; set; } + + /// + /// If defined, the decay function will only compute the decay function for documents with a distance greater than the defined `offset`. + /// + [JsonInclude, JsonPropertyName("offset")] + [SourceConverter] + public TScale? Offset { get; set; } + + /// + /// The point of origin used for calculating distance. Must be given as a number for numeric field, date for date fields and geo point for geo fields. + /// + [JsonInclude, JsonPropertyName("origin")] + [SourceConverter] + public TOrigin? Origin { get; set; } + + /// + /// Defines the distance from origin + offset at which the computed score will equal `decay` parameter. + /// + [JsonInclude, JsonPropertyName("scale")] + [SourceConverter] + public TScale? Scale { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs index 111761c4e56..08762e35737 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs @@ -46,7 +46,19 @@ internal FunctionScore(string variantName, object variant) internal object Variant { get; } internal string VariantName { get; } + public static FunctionScore Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => new FunctionScore("exp", decayFunction); + public static FunctionScore Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => new FunctionScore("exp", decayFunction); + public static FunctionScore Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => new FunctionScore("exp", decayFunction); + public static FunctionScore Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => new FunctionScore("exp", decayFunction); public static FunctionScore FieldValueFactor(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => new FunctionScore("field_value_factor", fieldValueFactorScoreFunction); + public static FunctionScore Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => new FunctionScore("gauss", decayFunction); + public static FunctionScore Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => new FunctionScore("gauss", decayFunction); + public static FunctionScore Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => new FunctionScore("gauss", decayFunction); + public static FunctionScore Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => new FunctionScore("gauss", decayFunction); + public static FunctionScore Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => new FunctionScore("linear", decayFunction); + public static FunctionScore Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => new FunctionScore("linear", decayFunction); + public static FunctionScore Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => new FunctionScore("linear", decayFunction); + public static FunctionScore Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => new FunctionScore("linear", decayFunction); public static FunctionScore RandomScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RandomScoreFunction randomScoreFunction) => new FunctionScore("random_score", randomScoreFunction); public static FunctionScore ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreFunction scriptScoreFunction) => new FunctionScore("script_score", scriptScoreFunction); @@ -107,6 +119,13 @@ public override FunctionScore Read(ref Utf8JsonReader reader, Type typeToConvert continue; } + if (propertyName == "exp") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "field_value_factor") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -114,6 +133,20 @@ public override FunctionScore Read(ref Utf8JsonReader reader, Type typeToConvert continue; } + if (propertyName == "gauss") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "linear") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "random_score") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -157,9 +190,18 @@ public override void Write(Utf8JsonWriter writer, FunctionScore value, JsonSeria writer.WritePropertyName(value.VariantName); switch (value.VariantName) { + case "exp": + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); + break; case "field_value_factor": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorScoreFunction)value.Variant, options); break; + case "gauss": + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); + break; + case "linear": + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); + break; case "random_score": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RandomScoreFunction)value.Variant, options); break; @@ -219,8 +261,20 @@ public FunctionScoreDescriptor Weight(double? weight) return Self; } + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "exp"); public FunctionScoreDescriptor FieldValueFactor(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); public FunctionScoreDescriptor FieldValueFactor(Action> configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "linear"); public FunctionScoreDescriptor RandomScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); public FunctionScoreDescriptor RandomScore(Action> configure) => Set(configure, "random_score"); public FunctionScoreDescriptor ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreFunction scriptScoreFunction) => Set(scriptScoreFunction, "script_score"); @@ -304,8 +358,20 @@ public FunctionScoreDescriptor Weight(double? weight) return Self; } + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "exp"); public FunctionScoreDescriptor FieldValueFactor(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); public FunctionScoreDescriptor FieldValueFactor(Action configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "linear"); public FunctionScoreDescriptor RandomScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); public FunctionScoreDescriptor RandomScore(Action configure) => Set(configure, "random_score"); public FunctionScoreDescriptor ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreFunction scriptScoreFunction) => Set(scriptScoreFunction, "script_score"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs new file mode 100644 index 00000000000..61704d7d419 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs @@ -0,0 +1,222 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class GeoDecayFunctionConverter : JsonConverter +{ + public override GeoDecayFunction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new GeoDecayFunction(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "multi_value_mode") + { + variant.MultiValueMode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Placement = JsonSerializer.Deserialize>(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, GeoDecayFunction value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Placement is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Placement, options); + } + + if (value.MultiValueMode is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, value.MultiValueMode, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoDecayFunctionConverter))] +public sealed partial class GeoDecayFunction +{ + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueMode { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement Placement { get; set; } +} + +public sealed partial class GeoDecayFunctionDescriptor : SerializableDescriptor> +{ + internal GeoDecayFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public GeoDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public GeoDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public GeoDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public GeoDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoDecayFunctionDescriptor : SerializableDescriptor +{ + internal GeoDecayFunctionDescriptor(Action configure) => configure.Invoke(this); + + public GeoDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public GeoDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public GeoDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public GeoDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public GeoDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs new file mode 100644 index 00000000000..a7dd8fa562a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs @@ -0,0 +1,255 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class GeoDistanceFeatureQuery +{ + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ [JsonInclude, JsonPropertyName("origin")] + public Elastic.Clients.Elasticsearch.Serverless.GeoLocation Origin { get; set; } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public string Pivot { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } +} + +public sealed partial class GeoDistanceFeatureQueryDescriptor : SerializableDescriptor> +{ + internal GeoDistanceFeatureQueryDescriptor(Action> configure) => configure.Invoke(this); + + public GeoDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation OriginValue { get; set; } + private string PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Origin(Elastic.Clients.Elasticsearch.Serverless.GeoLocation origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Pivot(string pivot) + { + PivotValue = pivot; + return Self; + } + + public GeoDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + writer.WriteStringValue(PivotValue); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoDistanceFeatureQueryDescriptor : SerializableDescriptor +{ + internal GeoDistanceFeatureQueryDescriptor(Action configure) => configure.Invoke(this); + + public GeoDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation OriginValue { get; set; } + private string PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Origin(Elastic.Clients.Elasticsearch.Serverless.GeoLocation origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Pivot(string pivot) + { + PivotValue = pivot; + return Self; + } + + public GeoDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + writer.WriteStringValue(PivotValue); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs deleted file mode 100644 index 8cfb6c8141b..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs +++ /dev/null @@ -1,380 +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 Elastic.Clients.Elasticsearch.Serverless.Fluent; -using Elastic.Clients.Elasticsearch.Serverless.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; - -internal sealed partial class GeoPolygonQueryConverter : JsonConverter -{ - public override GeoPolygonQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.StartObject) - throw new JsonException("Unexpected JSON detected."); - var variant = new GeoPolygonQuery(); - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) - { - if (reader.TokenType == JsonTokenType.PropertyName) - { - var property = reader.GetString(); - if (property == "boost") - { - variant.Boost = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "ignore_unmapped") - { - variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "_name") - { - variant.QueryName = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "validation_method") - { - variant.ValidationMethod = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - variant.Field = property; - reader.Read(); - variant.Polygon = JsonSerializer.Deserialize(ref reader, options); - } - } - - return variant; - } - - public override void Write(Utf8JsonWriter writer, GeoPolygonQuery value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - if (value.Field is not null && value.Polygon is not null) - { - if (!options.TryGetClientSettings(out var settings)) - { - ThrowHelper.ThrowJsonExceptionForMissingSettings(); - } - - var propertyName = settings.Inferrer.Field(value.Field); - writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, value.Polygon, options); - } - - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (value.IgnoreUnmapped.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(value.IgnoreUnmapped.Value); - } - - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } - - if (value.ValidationMethod is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, value.ValidationMethod, options); - } - - writer.WriteEndObject(); - } -} - -[JsonConverter(typeof(GeoPolygonQueryConverter))] -public sealed partial class GeoPolygonQuery -{ - /// - /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
- ///
- public float? Boost { get; set; } - public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } - public bool? IgnoreUnmapped { get; set; } - public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints Polygon { get; set; } - public string? QueryName { get; set; } - public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethod { get; set; } - - public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(GeoPolygonQuery geoPolygonQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.GeoPolygon(geoPolygonQuery); -} - -public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor> -{ - internal GeoPolygonQueryDescriptor(Action> configure) => configure.Invoke(this); - - public GeoPolygonQueryDescriptor() : base() - { - } - - private float? BoostValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } - private bool? IgnoreUnmappedValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } - private Action PolygonDescriptorAction { get; set; } - private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - /// - /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
- ///
- public GeoPolygonQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints polygon) - { - PolygonDescriptor = null; - PolygonDescriptorAction = null; - PolygonValue = polygon; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPointsDescriptor descriptor) - { - PolygonValue = null; - PolygonDescriptorAction = null; - PolygonDescriptor = descriptor; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Action configure) - { - PolygonValue = null; - PolygonDescriptor = null; - PolygonDescriptorAction = configure; - return Self; - } - - public GeoPolygonQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (FieldValue is not null && PolygonValue is not null) - { - var propertyName = settings.Inferrer.Field(FieldValue); - writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, PolygonValue, options); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} - -public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor -{ - internal GeoPolygonQueryDescriptor(Action configure) => configure.Invoke(this); - - public GeoPolygonQueryDescriptor() : base() - { - } - - private float? BoostValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } - private bool? IgnoreUnmappedValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } - private Action PolygonDescriptorAction { get; set; } - private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - /// - /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
- ///
- public GeoPolygonQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints polygon) - { - PolygonDescriptor = null; - PolygonDescriptorAction = null; - PolygonValue = polygon; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPointsDescriptor descriptor) - { - PolygonValue = null; - PolygonDescriptorAction = null; - PolygonDescriptor = descriptor; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Action configure) - { - PolygonValue = null; - PolygonDescriptor = null; - PolygonDescriptorAction = configure; - return Self; - } - - public GeoPolygonQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (FieldValue is not null && PolygonValue is not null) - { - var propertyName = settings.Inferrer.Field(FieldValue); - writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, PolygonValue, options); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs new file mode 100644 index 00000000000..8685418dc14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs @@ -0,0 +1,222 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class NumericDecayFunctionConverter : JsonConverter +{ + public override NumericDecayFunction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new NumericDecayFunction(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "multi_value_mode") + { + variant.MultiValueMode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Placement = JsonSerializer.Deserialize>(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, NumericDecayFunction value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Placement is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Placement, options); + } + + if (value.MultiValueMode is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, value.MultiValueMode, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(NumericDecayFunctionConverter))] +public sealed partial class NumericDecayFunction +{ + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueMode { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement Placement { get; set; } +} + +public sealed partial class NumericDecayFunctionDescriptor : SerializableDescriptor> +{ + internal NumericDecayFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public NumericDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public NumericDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public NumericDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public NumericDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public NumericDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public NumericDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class NumericDecayFunctionDescriptor : SerializableDescriptor +{ + internal NumericDecayFunctionDescriptor(Action configure) => configure.Invoke(this); + + public NumericDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public NumericDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public NumericDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public NumericDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public NumericDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public NumericDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs index 2d4810f3d0d..3bd9a18aaf2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs @@ -54,12 +54,14 @@ internal Query(string variantName, object variant) public static Query CombinedFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsQuery combinedFieldsQuery) => new Query("combined_fields", combinedFieldsQuery); public static Query ConstantScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ConstantScoreQuery constantScoreQuery) => new Query("constant_score", constantScoreQuery); public static Query DisMax(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DisMaxQuery disMaxQuery) => new Query("dis_max", disMaxQuery); + public static Query DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDistanceFeatureQuery distanceFeatureQuery) => new Query("distance_feature", distanceFeatureQuery); + public static Query DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceFeatureQuery distanceFeatureQuery) => new Query("distance_feature", distanceFeatureQuery); + public static Query DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDistanceFeatureQuery distanceFeatureQuery) => new Query("distance_feature", distanceFeatureQuery); public static Query Exists(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ExistsQuery existsQuery) => new Query("exists", existsQuery); public static Query FunctionScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreQuery functionScoreQuery) => new Query("function_score", functionScoreQuery); public static Query Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FuzzyQuery fuzzyQuery) => new Query("fuzzy", fuzzyQuery); public static Query GeoBoundingBox(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoBoundingBoxQuery geoBoundingBoxQuery) => new Query("geo_bounding_box", geoBoundingBoxQuery); public static Query GeoDistance(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceQuery geoDistanceQuery) => new Query("geo_distance", geoDistanceQuery); - public static Query GeoPolygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonQuery geoPolygonQuery) => new Query("geo_polygon", geoPolygonQuery); public static Query HasChild(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasChildQuery hasChildQuery) => new Query("has_child", hasChildQuery); public static Query HasParent(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasParentQuery hasParentQuery) => new Query("has_parent", hasParentQuery); public static Query Ids(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IdsQuery idsQuery) => new Query("ids", idsQuery); @@ -79,11 +81,14 @@ internal Query(string variantName, object variant) public static Query Pinned(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedQuery pinnedQuery) => new Query("pinned", pinnedQuery); public static Query Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PrefixQuery prefixQuery) => new Query("prefix", prefixQuery); public static Query QueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryStringQuery queryStringQuery) => new Query("query_string", queryStringQuery); - public static Query Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedRangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateRangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumberRangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermRangeQuery rangeQuery) => new Query("range", rangeQuery); public static Query RankFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureQuery rankFeatureQuery) => new Query("rank_feature", rankFeatureQuery); public static Query RawJson(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RawJsonQuery rawJsonQuery) => new Query("raw_json", rawJsonQuery); public static Query Regexp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RegexpQuery regexpQuery) => new Query("regexp", regexpQuery); - public static Query RuleQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => new Query("rule_query", ruleQuery); + public static Query Rule(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => new Query("rule", ruleQuery); public static Query Script(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptQuery scriptQuery) => new Query("script", scriptQuery); public static Query ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreQuery scriptScoreQuery) => new Query("script_score", scriptScoreQuery); public static Query Semantic(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SemanticQuery semanticQuery) => new Query("semantic", semanticQuery); @@ -97,6 +102,7 @@ internal Query(string variantName, object variant) public static Query SpanOr(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery spanOrQuery) => new Query("span_or", spanOrQuery); public static Query SpanTerm(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery spanTermQuery) => new Query("span_term", spanTermQuery); public static Query SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery spanWithinQuery) => new Query("span_within", spanWithinQuery); + public static Query SparseVector(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SparseVectorQuery sparseVectorQuery) => new Query("sparse_vector", sparseVectorQuery); public static Query Term(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermQuery termQuery) => new Query("term", termQuery); public static Query Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQuery termsQuery) => new Query("terms", termsQuery); public static Query TermsSet(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsSetQuery termsSetQuery) => new Query("terms_set", termsSetQuery); @@ -178,6 +184,13 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe continue; } + if (propertyName == "distance_feature") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "exists") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -213,13 +226,6 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe continue; } - if (propertyName == "geo_polygon") - { - variantValue = JsonSerializer.Deserialize(ref reader, options); - variantNameValue = propertyName; - continue; - } - if (propertyName == "has_child") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -355,7 +361,7 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe if (propertyName == "range") { - variantValue = JsonSerializer.Deserialize(ref reader, options); + variantValue = JsonSerializer.Deserialize(ref reader, options); variantNameValue = propertyName; continue; } @@ -381,7 +387,7 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe continue; } - if (propertyName == "rule_query") + if (propertyName == "rule") { variantValue = JsonSerializer.Deserialize(ref reader, options); variantNameValue = propertyName; @@ -479,6 +485,13 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe continue; } + if (propertyName == "sparse_vector") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "term") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -558,6 +571,9 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "dis_max": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DisMaxQuery)value.Variant, options); break; + case "distance_feature": + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); + break; case "exists": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ExistsQuery)value.Variant, options); break; @@ -573,9 +589,6 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "geo_distance": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceQuery)value.Variant, options); break; - case "geo_polygon": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonQuery)value.Variant, options); - break; case "has_child": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasChildQuery)value.Variant, options); break; @@ -634,7 +647,7 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryStringQuery)value.Variant, options); break; case "range": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeQuery)value.Variant, options); + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); break; case "rank_feature": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureQuery)value.Variant, options); @@ -645,7 +658,7 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "regexp": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RegexpQuery)value.Variant, options); break; - case "rule_query": + case "rule": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery)value.Variant, options); break; case "script": @@ -687,6 +700,9 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "span_within": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery)value.Variant, options); break; + case "sparse_vector": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SparseVectorQuery)value.Variant, options); + break; case "term": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermQuery)value.Variant, options); break; @@ -756,6 +772,9 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor ConstantScore(Action> configure) => Set(configure, "constant_score"); public QueryDescriptor DisMax(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); public QueryDescriptor DisMax(Action> configure) => Set(configure, "dis_max"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); public QueryDescriptor Exists(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ExistsQuery existsQuery) => Set(existsQuery, "exists"); public QueryDescriptor Exists(Action> configure) => Set(configure, "exists"); public QueryDescriptor FunctionScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); @@ -766,8 +785,6 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor GeoBoundingBox(Action> configure) => Set(configure, "geo_bounding_box"); public QueryDescriptor GeoDistance(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); public QueryDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); - public QueryDescriptor GeoPolygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); - public QueryDescriptor GeoPolygon(Action> configure) => Set(configure, "geo_polygon"); public QueryDescriptor HasChild(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); public QueryDescriptor HasChild(Action> configure) => Set(configure, "has_child"); public QueryDescriptor HasParent(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); @@ -806,14 +823,17 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); public QueryDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); public QueryDescriptor QueryString(Action> configure) => Set(configure, "query_string"); - public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumberRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermRangeQuery rangeQuery) => Set(rangeQuery, "range"); public QueryDescriptor RankFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureQuery rankFeatureQuery) => Set(rankFeatureQuery, "rank_feature"); public QueryDescriptor RankFeature(Action> configure) => Set(configure, "rank_feature"); public QueryDescriptor RawJson(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RawJsonQuery rawJsonQuery) => Set(rawJsonQuery, "raw_json"); public QueryDescriptor Regexp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); public QueryDescriptor Regexp(Action> configure) => Set(configure, "regexp"); - public QueryDescriptor RuleQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); - public QueryDescriptor RuleQuery(Action> configure) => Set(configure, "rule_query"); + public QueryDescriptor Rule(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule"); + public QueryDescriptor Rule(Action> configure) => Set(configure, "rule"); public QueryDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptQuery scriptQuery) => Set(scriptQuery, "script"); public QueryDescriptor Script(Action configure) => Set(configure, "script"); public QueryDescriptor ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); @@ -840,6 +860,8 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); public QueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); public QueryDescriptor SpanWithin(Action> configure) => Set(configure, "span_within"); + public QueryDescriptor SparseVector(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SparseVectorQuery sparseVectorQuery) => Set(sparseVectorQuery, "sparse_vector"); + public QueryDescriptor SparseVector(Action> configure) => Set(configure, "sparse_vector"); public QueryDescriptor Term(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermQuery termQuery) => Set(termQuery, "term"); public QueryDescriptor Term(Action> configure) => Set(configure, "term"); public QueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQuery termsQuery) => Set(termsQuery, "terms"); @@ -916,6 +938,9 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor ConstantScore(Action configure) => Set(configure, "constant_score"); public QueryDescriptor DisMax(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); public QueryDescriptor DisMax(Action configure) => Set(configure, "dis_max"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); public QueryDescriptor Exists(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ExistsQuery existsQuery) => Set(existsQuery, "exists"); public QueryDescriptor Exists(Action configure) => Set(configure, "exists"); public QueryDescriptor FunctionScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); @@ -926,8 +951,6 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor GeoBoundingBox(Action configure) => Set(configure, "geo_bounding_box"); public QueryDescriptor GeoDistance(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); public QueryDescriptor GeoDistance(Action configure) => Set(configure, "geo_distance"); - public QueryDescriptor GeoPolygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); - public QueryDescriptor GeoPolygon(Action configure) => Set(configure, "geo_polygon"); public QueryDescriptor HasChild(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); public QueryDescriptor HasChild(Action configure) => Set(configure, "has_child"); public QueryDescriptor HasParent(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); @@ -966,14 +989,17 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor Prefix(Action configure) => Set(configure, "prefix"); public QueryDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); public QueryDescriptor QueryString(Action configure) => Set(configure, "query_string"); - public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.UntypedRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumberRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermRangeQuery rangeQuery) => Set(rangeQuery, "range"); public QueryDescriptor RankFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureQuery rankFeatureQuery) => Set(rankFeatureQuery, "rank_feature"); public QueryDescriptor RankFeature(Action configure) => Set(configure, "rank_feature"); public QueryDescriptor RawJson(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RawJsonQuery rawJsonQuery) => Set(rawJsonQuery, "raw_json"); public QueryDescriptor Regexp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); public QueryDescriptor Regexp(Action configure) => Set(configure, "regexp"); - public QueryDescriptor RuleQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); - public QueryDescriptor RuleQuery(Action configure) => Set(configure, "rule_query"); + public QueryDescriptor Rule(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule"); + public QueryDescriptor Rule(Action configure) => Set(configure, "rule"); public QueryDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptQuery scriptQuery) => Set(scriptQuery, "script"); public QueryDescriptor Script(Action configure) => Set(configure, "script"); public QueryDescriptor ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); @@ -1000,6 +1026,8 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor SpanTerm(Action configure) => Set(configure, "span_term"); public QueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); public QueryDescriptor SpanWithin(Action configure) => Set(configure, "span_within"); + public QueryDescriptor SparseVector(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SparseVectorQuery sparseVectorQuery) => Set(sparseVectorQuery, "sparse_vector"); + public QueryDescriptor SparseVector(Action configure) => Set(configure, "sparse_vector"); public QueryDescriptor Term(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermQuery termQuery) => Set(termQuery, "term"); public QueryDescriptor Term(Action configure) => Set(configure, "term"); public QueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQuery termsQuery) => Set(termsQuery, "terms"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs index 79108b7ff56..56b4a8a1b1f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs @@ -40,10 +40,10 @@ public sealed partial class RuleQuery public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Organic { get; set; } [JsonInclude, JsonPropertyName("_name")] public string? QueryName { get; set; } - [JsonInclude, JsonPropertyName("ruleset_id")] - public Elastic.Clients.Elasticsearch.Serverless.Id RulesetId { get; set; } + [JsonInclude, JsonPropertyName("ruleset_ids")] + public ICollection RulesetIds { get; set; } - public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(RuleQuery ruleQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.RuleQuery(ruleQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(RuleQuery ruleQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Rule(ruleQuery); } public sealed partial class RuleQueryDescriptor : SerializableDescriptor> @@ -60,7 +60,7 @@ public RuleQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor OrganicDescriptor { get; set; } private Action> OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Id RulesetIdValue { get; set; } + private ICollection RulesetIdsValue { get; set; } /// /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
@@ -107,9 +107,9 @@ public RuleQueryDescriptor QueryName(string? queryName) return Self; } - public RuleQueryDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + public RuleQueryDescriptor RulesetIds(ICollection rulesetIds) { - RulesetIdValue = rulesetId; + RulesetIdsValue = rulesetIds; return Self; } @@ -146,8 +146,8 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - writer.WritePropertyName("ruleset_id"); - JsonSerializer.Serialize(writer, RulesetIdValue, options); + writer.WritePropertyName("ruleset_ids"); + JsonSerializer.Serialize(writer, RulesetIdsValue, options); writer.WriteEndObject(); } } @@ -166,7 +166,7 @@ public RuleQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor OrganicDescriptor { get; set; } private Action OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Id RulesetIdValue { get; set; } + private ICollection RulesetIdsValue { get; set; } /// /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
@@ -213,9 +213,9 @@ public RuleQueryDescriptor QueryName(string? queryName) return Self; } - public RuleQueryDescriptor RulesetId(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId) + public RuleQueryDescriptor RulesetIds(ICollection rulesetIds) { - RulesetIdValue = rulesetId; + RulesetIdsValue = rulesetIds; return Self; } @@ -252,8 +252,8 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - writer.WritePropertyName("ruleset_id"); - JsonSerializer.Serialize(writer, RulesetIdValue, options); + writer.WritePropertyName("ruleset_ids"); + JsonSerializer.Serialize(writer, RulesetIdsValue, options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs new file mode 100644 index 00000000000..2800ecd3dba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs @@ -0,0 +1,461 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +[JsonConverter(typeof(SparseVectorQueryConverter))] +public sealed partial class SparseVectorQuery +{ + internal SparseVectorQuery(string variantName, object variant) + { + if (variantName is null) + throw new ArgumentNullException(nameof(variantName)); + if (variant is null) + throw new ArgumentNullException(nameof(variant)); + if (string.IsNullOrWhiteSpace(variantName)) + throw new ArgumentException("Variant name must not be empty or whitespace."); + VariantName = variantName; + Variant = variant; + } + + internal object Variant { get; } + internal string VariantName { get; } + + public static SparseVectorQuery InferenceId(Elastic.Clients.Elasticsearch.Serverless.Id id) => new SparseVectorQuery("inference_id", id); + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// The name of the field that contains the token-weight pairs to be searched against.
This field must be a mapped sparse_vector field.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// The query text you want to use for search.
If inference_id is specified, query must also be specified.
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public string? Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class SparseVectorQueryConverter : JsonConverter +{ + public override SparseVectorQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException("Expected start token."); + } + + object? variantValue = default; + string? variantNameValue = default; + float? boostValue = default; + Elastic.Clients.Elasticsearch.Serverless.Field fieldValue = default; + string? queryValue = default; + string? queryNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } + + var propertyName = reader.GetString(); + reader.Read(); + if (propertyName == "boost") + { + boostValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "field") + { + fieldValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "query") + { + queryValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "_name") + { + queryNameValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (propertyName == "inference_id") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'SparseVectorQuery' from the response."); + } + + var result = new SparseVectorQuery(variantNameValue, variantValue); + result.Boost = boostValue; + result.Field = fieldValue; + result.Query = queryValue; + result.QueryName = queryNameValue; + return result; + } + + public override void Write(Utf8JsonWriter writer, SparseVectorQuery value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.Field is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, value.Field, options); + } + + if (!string.IsNullOrEmpty(value.Query)) + { + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "inference_id": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Id)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SparseVectorQueryDescriptor : SerializableDescriptor> +{ + internal SparseVectorQueryDescriptor(Action> configure) => configure.Invoke(this); + + public SparseVectorQueryDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SparseVectorQueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private SparseVectorQueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? QueryValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public SparseVectorQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The name of the field that contains the token-weight pairs to be searched against.
This field must be a mapped sparse_vector field.
+ ///
+ public SparseVectorQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field that contains the token-weight pairs to be searched against.
This field must be a mapped sparse_vector field.
+ ///
+ public SparseVectorQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field that contains the token-weight pairs to be searched against.
This field must be a mapped sparse_vector field.
+ ///
+ public SparseVectorQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The query text you want to use for search.
If inference_id is specified, query must also be specified.
+ ///
+ public SparseVectorQueryDescriptor Query(string? query) + { + QueryValue = query; + return Self; + } + + public SparseVectorQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SparseVectorQueryDescriptor InferenceId(Elastic.Clients.Elasticsearch.Serverless.Id id) => Set(id, "inference_id"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(QueryValue)) + { + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SparseVectorQueryDescriptor : SerializableDescriptor +{ + internal SparseVectorQueryDescriptor(Action configure) => configure.Invoke(this); + + public SparseVectorQueryDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SparseVectorQueryDescriptor Set(Action descriptorAction, string variantName) where T : Descriptor + { + ContainedVariantName = variantName; + ContainsVariant = true; + var descriptor = (T)Activator.CreateInstance(typeof(T), true); + descriptorAction?.Invoke(descriptor); + Descriptor = descriptor; + return Self; + } + + private SparseVectorQueryDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? QueryValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public SparseVectorQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// The name of the field that contains the token-weight pairs to be searched against.
This field must be a mapped sparse_vector field.
+ ///
+ public SparseVectorQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field that contains the token-weight pairs to be searched against.
This field must be a mapped sparse_vector field.
+ ///
+ public SparseVectorQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field that contains the token-weight pairs to be searched against.
This field must be a mapped sparse_vector field.
+ ///
+ public SparseVectorQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The query text you want to use for search.
If inference_id is specified, query must also be specified.
+ ///
+ public SparseVectorQueryDescriptor Query(string? query) + { + QueryValue = query; + return Self; + } + + public SparseVectorQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + public SparseVectorQueryDescriptor InferenceId(Elastic.Clients.Elasticsearch.Serverless.Id id) => Set(id, "inference_id"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(QueryValue)) + { + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (!string.IsNullOrEmpty(ContainedVariantName)) + { + writer.WritePropertyName(ContainedVariantName); + if (Variant is not null) + { + JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); + writer.WriteEndObject(); + return; + } + + JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermRangeQuery.g.cs new file mode 100644 index 00000000000..67b701bb40a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermRangeQuery.g.cs @@ -0,0 +1,566 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class TermRangeQueryConverter : JsonConverter +{ + public override TermRangeQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new TermRangeQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gt") + { + variant.Gt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gte") + { + variant.Gte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lt") + { + variant.Lt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lte") + { + variant.Lte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "relation") + { + variant.Relation = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to") + { + variant.To = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, TermRangeQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize TermRangeQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (!string.IsNullOrEmpty(value.From)) + { + writer.WritePropertyName("from"); + writer.WriteStringValue(value.From); + } + + if (!string.IsNullOrEmpty(value.Gt)) + { + writer.WritePropertyName("gt"); + writer.WriteStringValue(value.Gt); + } + + if (!string.IsNullOrEmpty(value.Gte)) + { + writer.WritePropertyName("gte"); + writer.WriteStringValue(value.Gte); + } + + if (!string.IsNullOrEmpty(value.Lt)) + { + writer.WritePropertyName("lt"); + writer.WriteStringValue(value.Lt); + } + + if (!string.IsNullOrEmpty(value.Lte)) + { + writer.WritePropertyName("lte"); + writer.WriteStringValue(value.Lte); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } + + if (!string.IsNullOrEmpty(value.To)) + { + writer.WritePropertyName("to"); + writer.WriteStringValue(value.To); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(TermRangeQueryConverter))] +public sealed partial class TermRangeQuery +{ + public TermRangeQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public string? From { get; set; } + + /// + /// Greater than. + /// + public string? Gt { get; set; } + + /// + /// Greater than or equal to. + /// + public string? Gte { get; set; } + + /// + /// Less than. + /// + public string? Lt { get; set; } + + /// + /// Less than or equal to. + /// + public string? Lte { get; set; } + public string? QueryName { get; set; } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? Relation { get; set; } + public string? To { get; set; } +} + +public sealed partial class TermRangeQueryDescriptor : SerializableDescriptor> +{ + internal TermRangeQueryDescriptor(Action> configure) => configure.Invoke(this); + + public TermRangeQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FromValue { get; set; } + private string? GtValue { get; set; } + private string? GteValue { get; set; } + private string? LtValue { get; set; } + private string? LteValue { get; set; } + private string? QueryNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? ToValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public TermRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TermRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor From(string? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public TermRangeQueryDescriptor Gt(string? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public TermRangeQueryDescriptor Gte(string? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public TermRangeQueryDescriptor Lt(string? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public TermRangeQueryDescriptor Lte(string? lte) + { + LteValue = lte; + return Self; + } + + public TermRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public TermRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + public TermRangeQueryDescriptor To(string? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(FromValue)) + { + writer.WritePropertyName("from"); + writer.WriteStringValue(FromValue); + } + + if (!string.IsNullOrEmpty(GtValue)) + { + writer.WritePropertyName("gt"); + writer.WriteStringValue(GtValue); + } + + if (!string.IsNullOrEmpty(GteValue)) + { + writer.WritePropertyName("gte"); + writer.WriteStringValue(GteValue); + } + + if (!string.IsNullOrEmpty(LtValue)) + { + writer.WritePropertyName("lt"); + writer.WriteStringValue(LtValue); + } + + if (!string.IsNullOrEmpty(LteValue)) + { + writer.WritePropertyName("lte"); + writer.WriteStringValue(LteValue); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (!string.IsNullOrEmpty(ToValue)) + { + writer.WritePropertyName("to"); + writer.WriteStringValue(ToValue); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class TermRangeQueryDescriptor : SerializableDescriptor +{ + internal TermRangeQueryDescriptor(Action configure) => configure.Invoke(this); + + public TermRangeQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FromValue { get; set; } + private string? GtValue { get; set; } + private string? GteValue { get; set; } + private string? LtValue { get; set; } + private string? LteValue { get; set; } + private string? QueryNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? ToValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public TermRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TermRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor From(string? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public TermRangeQueryDescriptor Gt(string? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public TermRangeQueryDescriptor Gte(string? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public TermRangeQueryDescriptor Lt(string? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public TermRangeQueryDescriptor Lte(string? lte) + { + LteValue = lte; + return Self; + } + + public TermRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public TermRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + public TermRangeQueryDescriptor To(string? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(FromValue)) + { + writer.WritePropertyName("from"); + writer.WriteStringValue(FromValue); + } + + if (!string.IsNullOrEmpty(GtValue)) + { + writer.WritePropertyName("gt"); + writer.WriteStringValue(GtValue); + } + + if (!string.IsNullOrEmpty(GteValue)) + { + writer.WritePropertyName("gte"); + writer.WriteStringValue(GteValue); + } + + if (!string.IsNullOrEmpty(LtValue)) + { + writer.WritePropertyName("lt"); + writer.WriteStringValue(LtValue); + } + + if (!string.IsNullOrEmpty(LteValue)) + { + writer.WritePropertyName("lte"); + writer.WriteStringValue(LteValue); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (!string.IsNullOrEmpty(ToValue)) + { + writer.WritePropertyName("to"); + writer.WriteStringValue(ToValue); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs index 7367075ee5d..1b28329b4e7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs @@ -53,7 +53,7 @@ public override TermsQuery Read(ref Utf8JsonReader reader, Type typeToConvert, J variant.Field = property; reader.Read(); - variant.Terms = JsonSerializer.Deserialize(ref reader, options); + variant.Term = JsonSerializer.Deserialize(ref reader, options); } } @@ -63,7 +63,7 @@ public override TermsQuery Read(ref Utf8JsonReader reader, Type typeToConvert, J public override void Write(Utf8JsonWriter writer, TermsQuery value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.Field is not null && value.Terms is not null) + if (value.Field is not null && value.Term is not null) { if (!options.TryGetClientSettings(out var settings)) { @@ -72,7 +72,7 @@ public override void Write(Utf8JsonWriter writer, TermsQuery value, JsonSerializ var propertyName = settings.Inferrer.Field(value.Field); writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, value.Terms, options); + JsonSerializer.Serialize(writer, value.Term, options); } if (value.Boost.HasValue) @@ -100,7 +100,7 @@ public sealed partial class TermsQuery public float? Boost { get; set; } public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } public string? QueryName { get; set; } - public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField Terms { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField Term { get; set; } public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(TermsQuery termsQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Terms(termsQuery); } @@ -116,7 +116,7 @@ public TermsQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField TermValue { get; set; } /// /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
@@ -151,20 +151,20 @@ public TermsQueryDescriptor QueryName(string? queryName) return Self; } - public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField terms) + public TermsQueryDescriptor Term(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField term) { - TermsValue = terms; + TermValue = term; return Self; } protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (FieldValue is not null && TermsValue is not null) + if (FieldValue is not null && TermValue is not null) { var propertyName = settings.Inferrer.Field(FieldValue); writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, TermsValue, options); + JsonSerializer.Serialize(writer, TermValue, options); } if (BoostValue.HasValue) @@ -194,7 +194,7 @@ public TermsQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField TermValue { get; set; } /// /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
@@ -229,20 +229,20 @@ public TermsQueryDescriptor QueryName(string? queryName) return Self; } - public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField terms) + public TermsQueryDescriptor Term(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField term) { - TermsValue = terms; + TermValue = term; return Self; } protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (FieldValue is not null && TermsValue is not null) + if (FieldValue is not null && TermValue is not null) { var propertyName = settings.Inferrer.Field(FieldValue); writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, TermsValue, options); + JsonSerializer.Serialize(writer, TermValue, options); } if (BoostValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs new file mode 100644 index 00000000000..4a3f9bb2911 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs @@ -0,0 +1,222 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class UntypedDecayFunctionConverter : JsonConverter +{ + public override UntypedDecayFunction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new UntypedDecayFunction(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "multi_value_mode") + { + variant.MultiValueMode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Placement = JsonSerializer.Deserialize(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, UntypedDecayFunction value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Placement is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Placement, options); + } + + if (value.MultiValueMode is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, value.MultiValueMode, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(UntypedDecayFunctionConverter))] +public sealed partial class UntypedDecayFunction +{ + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueMode { get; set; } + public object Placement { get; set; } +} + +public sealed partial class UntypedDecayFunctionDescriptor : SerializableDescriptor> +{ + internal UntypedDecayFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public UntypedDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private object PlacementValue { get; set; } + + public UntypedDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public UntypedDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UntypedDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public UntypedDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public UntypedDecayFunctionDescriptor Placement(object placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UntypedDecayFunctionDescriptor : SerializableDescriptor +{ + internal UntypedDecayFunctionDescriptor(Action configure) => configure.Invoke(this); + + public UntypedDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private object PlacementValue { get; set; } + + public UntypedDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public UntypedDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UntypedDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public UntypedDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public UntypedDecayFunctionDescriptor Placement(object placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs new file mode 100644 index 00000000000..879b523387b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs @@ -0,0 +1,255 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +public sealed partial class UntypedDistanceFeatureQuery +{ + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ [JsonInclude, JsonPropertyName("origin")] + public object Origin { get; set; } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public object Pivot { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } +} + +public sealed partial class UntypedDistanceFeatureQueryDescriptor : SerializableDescriptor> +{ + internal UntypedDistanceFeatureQueryDescriptor(Action> configure) => configure.Invoke(this); + + public UntypedDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private object OriginValue { get; set; } + private object PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Origin(object origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Pivot(object pivot) + { + PivotValue = pivot; + return Self; + } + + public UntypedDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UntypedDistanceFeatureQueryDescriptor : SerializableDescriptor +{ + internal UntypedDistanceFeatureQueryDescriptor(Action configure) => configure.Invoke(this); + + public UntypedDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private object OriginValue { get; set; } + private object PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Origin(object origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Pivot(object pivot) + { + PivotValue = pivot; + return Self; + } + + public UntypedDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs new file mode 100644 index 00000000000..9db11aab60b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs @@ -0,0 +1,664 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; + +internal sealed partial class UntypedRangeQueryConverter : JsonConverter +{ + public override UntypedRangeQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new UntypedRangeQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "format") + { + variant.Format = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gt") + { + variant.Gt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gte") + { + variant.Gte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lt") + { + variant.Lt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lte") + { + variant.Lte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "relation") + { + variant.Relation = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "time_zone") + { + variant.TimeZone = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to") + { + variant.To = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, UntypedRangeQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize UntypedRangeQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.From is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, value.From, options); + } + + if (value.Gt is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, value.Gt, options); + } + + if (value.Gte is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, value.Gte, options); + } + + if (value.Lt is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, value.Lt, options); + } + + if (value.Lte is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, value.Lte, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } + + if (!string.IsNullOrEmpty(value.TimeZone)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(value.TimeZone); + } + + if (value.To is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, value.To, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(UntypedRangeQueryConverter))] +public sealed partial class UntypedRangeQuery +{ + public UntypedRangeQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Date format used to convert `date` values in the query. + /// + public string? Format { get; set; } + public object? From { get; set; } + + /// + /// Greater than. + /// + public object? Gt { get; set; } + + /// + /// Greater than or equal to. + /// + public object? Gte { get; set; } + + /// + /// Less than. + /// + public object? Lt { get; set; } + + /// + /// Less than or equal to. + /// + public object? Lte { get; set; } + public string? QueryName { get; set; } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? Relation { get; set; } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public string? TimeZone { get; set; } + public object? To { get; set; } +} + +public sealed partial class UntypedRangeQueryDescriptor : SerializableDescriptor> +{ + internal UntypedRangeQueryDescriptor(Action> configure) => configure.Invoke(this); + + public UntypedRangeQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + private object? FromValue { get; set; } + private object? GtValue { get; set; } + private object? GteValue { get; set; } + private object? LtValue { get; set; } + private object? LteValue { get; set; } + private string? QueryNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? TimeZoneValue { get; set; } + private object? ToValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public UntypedRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date format used to convert `date` values in the query. + /// + public UntypedRangeQueryDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public UntypedRangeQueryDescriptor From(object? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public UntypedRangeQueryDescriptor Gt(object? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public UntypedRangeQueryDescriptor Gte(object? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public UntypedRangeQueryDescriptor Lt(object? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public UntypedRangeQueryDescriptor Lte(object? lte) + { + LteValue = lte; + return Self; + } + + public UntypedRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public UntypedRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public UntypedRangeQueryDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public UntypedRangeQueryDescriptor To(object? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (FromValue is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, FromValue, options); + } + + if (GtValue is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, GtValue, options); + } + + if (GteValue is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, GteValue, options); + } + + if (LtValue is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, LtValue, options); + } + + if (LteValue is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, LteValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + if (ToValue is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, ToValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class UntypedRangeQueryDescriptor : SerializableDescriptor +{ + internal UntypedRangeQueryDescriptor(Action configure) => configure.Invoke(this); + + public UntypedRangeQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + private object? FromValue { get; set; } + private object? GtValue { get; set; } + private object? GteValue { get; set; } + private object? LtValue { get; set; } + private object? LteValue { get; set; } + private string? QueryNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? TimeZoneValue { get; set; } + private object? ToValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public UntypedRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date format used to convert `date` values in the query. + /// + public UntypedRangeQueryDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public UntypedRangeQueryDescriptor From(object? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public UntypedRangeQueryDescriptor Gt(object? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public UntypedRangeQueryDescriptor Gte(object? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public UntypedRangeQueryDescriptor Lt(object? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public UntypedRangeQueryDescriptor Lte(object? lte) + { + LteValue = lte; + return Self; + } + + public UntypedRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public UntypedRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public UntypedRangeQueryDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public UntypedRangeQueryDescriptor To(object? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (FromValue is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, FromValue, options); + } + + if (GtValue is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, GtValue, options); + } + + if (GteValue is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, GteValue, options); + } + + if (LtValue is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, LtValue, options); + } + + if (LteValue is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, LteValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + if (ToValue is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, ToValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRule.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRule.g.cs new file mode 100644 index 00000000000..1c9411c76c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRule.g.cs @@ -0,0 +1,188 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class QueryRule +{ + [JsonInclude, JsonPropertyName("actions")] + public Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActions Actions { get; set; } + [JsonInclude, JsonPropertyName("criteria")] + public ICollection Criteria { get; set; } + [JsonInclude, JsonPropertyName("rule_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id RuleId { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleType Type { get; set; } +} + +public sealed partial class QueryRuleDescriptor : SerializableDescriptor +{ + internal QueryRuleDescriptor(Action configure) => configure.Invoke(this); + + public QueryRuleDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActions ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActionsDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private ICollection CriteriaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaDescriptor CriteriaDescriptor { get; set; } + private Action CriteriaDescriptorAction { get; set; } + private Action[] CriteriaDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id RuleIdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleType TypeValue { get; set; } + + public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActions actions) + { + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsValue = actions; + return Self; + } + + public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActionsDescriptor descriptor) + { + ActionsValue = null; + ActionsDescriptorAction = null; + ActionsDescriptor = descriptor; + return Self; + } + + public QueryRuleDescriptor Actions(Action configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorAction = configure; + return Self; + } + + public QueryRuleDescriptor Criteria(ICollection criteria) + { + CriteriaDescriptor = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = null; + CriteriaValue = criteria; + return Self; + } + + public QueryRuleDescriptor Criteria(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaDescriptor descriptor) + { + CriteriaValue = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = null; + CriteriaDescriptor = descriptor; + return Self; + } + + public QueryRuleDescriptor Criteria(Action configure) + { + CriteriaValue = null; + CriteriaDescriptor = null; + CriteriaDescriptorActions = null; + CriteriaDescriptorAction = configure; + return Self; + } + + public QueryRuleDescriptor Criteria(params Action[] configure) + { + CriteriaValue = null; + CriteriaDescriptor = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = configure; + return Self; + } + + public QueryRuleDescriptor RuleId(Elastic.Clients.Elasticsearch.Serverless.Id ruleId) + { + RuleIdValue = ruleId; + return Self; + } + + public QueryRuleDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleType type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsDescriptor is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsDescriptor, options); + } + else if (ActionsDescriptorAction is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleActionsDescriptor(ActionsDescriptorAction), options); + } + else + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + if (CriteriaDescriptor is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, CriteriaDescriptor, options); + writer.WriteEndArray(); + } + else if (CriteriaDescriptorAction is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaDescriptor(CriteriaDescriptorAction), options); + writer.WriteEndArray(); + } + else if (CriteriaDescriptorActions is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + foreach (var action in CriteriaDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("criteria"); + JsonSerializer.Serialize(writer, CriteriaValue, options); + } + + writer.WritePropertyName("rule_id"); + JsonSerializer.Serialize(writer, RuleIdValue, options); + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRuleActions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRuleActions.g.cs new file mode 100644 index 00000000000..4b7f4cc77af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRuleActions.g.cs @@ -0,0 +1,136 @@ +// 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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class QueryRuleActions +{ + [JsonInclude, JsonPropertyName("docs")] + public ICollection? Docs { get; set; } + [JsonInclude, JsonPropertyName("ids")] + public ICollection? Ids { get; set; } +} + +public sealed partial class QueryRuleActionsDescriptor : SerializableDescriptor +{ + internal QueryRuleActionsDescriptor(Action configure) => configure.Invoke(this); + + public QueryRuleActionsDescriptor() : base() + { + } + + private ICollection? DocsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedDocDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } + private ICollection? IdsValue { get; set; } + + public QueryRuleActionsDescriptor Docs(ICollection? docs) + { + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsValue = docs; + return Self; + } + + public QueryRuleActionsDescriptor Docs(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedDocDescriptor descriptor) + { + DocsValue = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsDescriptor = descriptor; + return Self; + } + + public QueryRuleActionsDescriptor Docs(Action configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorActions = null; + DocsDescriptorAction = configure; + return Self; + } + + public QueryRuleActionsDescriptor Docs(params Action[] configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = configure; + return Self; + } + + public QueryRuleActionsDescriptor Ids(ICollection? ids) + { + IdsValue = ids; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DocsDescriptor is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocsDescriptorAction is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedDocDescriptor(DocsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocsDescriptorActions is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + foreach (var action in DocsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedDocDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocsValue is not null) + { + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + } + + if (IdsValue is not null) + { + writer.WritePropertyName("ids"); + JsonSerializer.Serialize(writer, IdsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs new file mode 100644 index 00000000000..502a841f2e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRuleCriteria.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 Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; + +public sealed partial class QueryRuleCriteria +{ + [JsonInclude, JsonPropertyName("metadata")] + public string? Metadata { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaType Type { get; set; } + [JsonInclude, JsonPropertyName("values")] + public ICollection? Values { get; set; } +} + +public sealed partial class QueryRuleCriteriaDescriptor : SerializableDescriptor +{ + internal QueryRuleCriteriaDescriptor(Action configure) => configure.Invoke(this); + + public QueryRuleCriteriaDescriptor() : base() + { + } + + private string? MetadataValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaType TypeValue { get; set; } + private ICollection? ValuesValue { get; set; } + + public QueryRuleCriteriaDescriptor Metadata(string? metadata) + { + MetadataValue = metadata; + return Self; + } + + public QueryRuleCriteriaDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.QueryRules.QueryRuleCriteriaType type) + { + TypeValue = type; + return Self; + } + + public QueryRuleCriteriaDescriptor Values(ICollection? values) + { + ValuesValue = values; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(MetadataValue)) + { + writer.WritePropertyName("metadata"); + writer.WriteStringValue(MetadataValue); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + if (ValuesValue is not null) + { + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, ValuesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs similarity index 61% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs index 21533f145cd..68e6094d2f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs @@ -17,26 +17,33 @@ #nullable restore -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryDsl; +namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules; -public sealed partial class RangeQuery : Union +public sealed partial class QueryRulesetListItem { - public RangeQuery(Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Date) : base(Date) - { - } + /// + /// A map of criteria type to the number of rules of that type + /// + [JsonInclude, JsonPropertyName("rule_criteria_types_counts")] + public IReadOnlyDictionary RuleCriteriaTypesCounts { get; init; } - public RangeQuery(Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Number) : base(Number) - { - } + /// + /// Ruleset unique identifier + /// + [JsonInclude, JsonPropertyName("ruleset_id")] + public string RulesetId { get; init; } + + /// + /// The number of rules associated with this ruleset + /// + [JsonInclude, JsonPropertyName("rule_total_count")] + public int RuleTotalCount { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs index 269e2c247eb..220dde1f328 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs @@ -66,6 +66,9 @@ public RangeQueryDescriptor NumberRange(Action DateRange(Action> configure) => SetResult(configure); + + public RangeQueryDescriptor TermRange(Action> configure) => + SetResult(configure); } public sealed class RangeQueryDescriptor : ProxiedDescriptor @@ -77,14 +80,23 @@ public sealed class RangeQueryDescriptor : ProxiedDescriptor configure) => SetResult(configure); public RangeQueryDescriptor DateRange(Action> configure) => SetResult(configure); + + public RangeQueryDescriptor TermRange(Action configure) => SetResult(configure); + + public RangeQueryDescriptor TermRange(Action> configure) => SetResult(configure); } public sealed partial class NumberRangeQuery { - public static implicit operator Query(NumberRangeQuery numberRangeQuery) => Query.Range(new RangeQuery(numberRangeQuery)); + public static implicit operator Query(NumberRangeQuery numberRangeQuery) => Query.Range(numberRangeQuery); } public sealed partial class DateRangeQuery { - public static implicit operator Query(DateRangeQuery dateRangeQuery) => Query.Range(new RangeQuery(dateRangeQuery)); + public static implicit operator Query(DateRangeQuery dateRangeQuery) => Query.Range(dateRangeQuery); +} + +public sealed partial class TermRangeQuery +{ + public static implicit operator Query(TermRangeQuery termRangeQuery) => Query.Range(termRangeQuery); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs index 87299ed9338..b31d881cc58 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs @@ -269,10 +269,10 @@ 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 QueryRulesetDelete = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); - internal static ApiUrls QueryRulesetGet = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); - internal static ApiUrls QueryRulesetList = new ApiUrls(new[] { "_query_rules" }); - internal static ApiUrls QueryRulesetPut = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); + internal static ApiUrls QueryRulesDeleteRuleset = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); + internal static ApiUrls QueryRulesGetRuleset = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); + internal static ApiUrls QueryRulesListRulesets = new ApiUrls(new[] { "_query_rules" }); + internal static ApiUrls QueryRulesPutRuleset = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); internal static ApiUrls RollupDeleteJob = new ApiUrls(new[] { "_rollup/job/{id}" }); internal static ApiUrls RollupGetJobs = new ApiUrls(new[] { "_rollup/job/{id}", "_rollup/job" }); internal static ApiUrls RollupGetRollupCaps = new ApiUrls(new[] { "_rollup/data/{id}", "_rollup/data" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs index 5c56786f72a..572b547eb8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs @@ -43,7 +43,7 @@ public sealed partial class DeleteIndexTemplateRequestParameters : RequestParame } /// -/// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+/// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
///
public sealed partial class DeleteIndexTemplateRequest : PlainRequest { @@ -73,7 +73,7 @@ public DeleteIndexTemplateRequest(Elastic.Clients.Elasticsearch.Names name) : ba } /// -/// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+/// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
///
public sealed partial class DeleteIndexTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs index 4fdb47b699b..3365a999300 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs @@ -48,7 +48,7 @@ public sealed partial class ExistsTemplateRequestParameters : RequestParameters } /// -/// Returns information about whether a particular index template exists. +/// Check existence of index templates.
Returns information about whether a particular index template exists.
///
public sealed partial class ExistsTemplateRequest : PlainRequest { @@ -84,7 +84,7 @@ public ExistsTemplateRequest(Elastic.Clients.Elasticsearch.Names name) : base(r } /// -/// Returns information about whether a particular index template exists. +/// Check existence of index templates.
Returns information about whether a particular index template exists.
///
public sealed partial class ExistsTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs index f228e56a8fe..e067c3d629c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs @@ -53,7 +53,7 @@ public sealed partial class GetIndexTemplateRequestParameters : RequestParameter } /// -/// Returns information about one or more index templates. +/// Get index templates.
Returns information about one or more index templates.
///
public sealed partial class GetIndexTemplateRequest : PlainRequest { @@ -99,7 +99,7 @@ public GetIndexTemplateRequest(Elastic.Clients.Elasticsearch.Name? name) : base( } /// -/// Returns information about one or more index templates. +/// Get index templates.
Returns information about one or more index templates.
///
public sealed partial class GetIndexTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs index 34778267083..1f20d7a1d04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs @@ -48,7 +48,7 @@ public sealed partial class GetTemplateRequestParameters : RequestParameters } /// -/// Retrieves information about one or more index templates. +/// Get index templates.
Retrieves information about one or more index templates.
///
public sealed partial class GetTemplateRequest : PlainRequest { @@ -88,7 +88,7 @@ public GetTemplateRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => } /// -/// Retrieves information about one or more index templates. +/// Get index templates.
Retrieves information about one or more index templates.
///
public sealed partial class GetTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs index f8ffe5243fa..4d168841066 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs @@ -48,7 +48,7 @@ public sealed partial class PutIndexTemplateRequestParameters : RequestParameter } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutIndexTemplateRequest : PlainRequest { @@ -144,7 +144,7 @@ public PutIndexTemplateRequest(Elastic.Clients.Elasticsearch.Name name) : base(r } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutIndexTemplateRequestDescriptor : RequestDescriptor, PutIndexTemplateRequestParameters> { @@ -401,7 +401,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutIndexTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs index 5a806ae94a1..d96cd33e814 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs @@ -45,7 +45,7 @@ public sealed partial class PutTemplateRequestParameters : RequestParameters } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutTemplateRequest : PlainRequest { @@ -116,7 +116,7 @@ public PutTemplateRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor, PutTemplateRequestParameters> { @@ -310,7 +310,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } /// -/// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+/// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
///
public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs index a7eeabab7c9..2f66f385148 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs @@ -42,6 +42,9 @@ public sealed partial class SimulateIndexTemplateRequestParameters : RequestPara public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } +/// +/// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
+///
public sealed partial class SimulateIndexTemplateRequest : PlainRequest { public SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) @@ -69,6 +72,9 @@ public SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Name name) : b public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } +/// +/// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
+///
public sealed partial class SimulateIndexTemplateRequestDescriptor : RequestDescriptor { internal SimulateIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs index 1c1edb2d009..8786cb98dcc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs @@ -48,7 +48,7 @@ public sealed partial class SimulateTemplateRequestParameters : RequestParameter } /// -/// Returns the index configuration that would be applied by a particular index template. +/// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
///
public sealed partial class SimulateTemplateRequest : PlainRequest { @@ -148,7 +148,7 @@ public SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Name? name) : base( } /// -/// Returns the index configuration that would be applied by a particular index template. +/// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
///
public sealed partial class SimulateTemplateRequestDescriptor : RequestDescriptor, SimulateTemplateRequestParameters> { @@ -409,7 +409,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } /// -/// Returns the index configuration that would be applied by a particular index template. +/// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
///
public sealed partial class SimulateTemplateRequestDescriptor : RequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs similarity index 64% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetRequest.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs index bb747a746c1..4eafd31e9d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs @@ -27,50 +27,50 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public sealed partial class DeleteQueryRulesetRequestParameters : RequestParameters +public sealed partial class DeleteRulesetRequestParameters : RequestParameters { } /// /// Deletes a query ruleset. /// -public sealed partial class DeleteQueryRulesetRequest : PlainRequest +public sealed partial class DeleteRulesetRequest : PlainRequest { - public DeleteQueryRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + public DeleteRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) { } - internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetDelete; + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesDeleteRuleset; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; internal override bool SupportsBody => false; - internal override string OperationName => "query_ruleset.delete"; + internal override string OperationName => "query_rules.delete_ruleset"; } /// /// Deletes a query ruleset. /// -public sealed partial class DeleteQueryRulesetRequestDescriptor : RequestDescriptor +public sealed partial class DeleteRulesetRequestDescriptor : RequestDescriptor { - internal DeleteQueryRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + internal DeleteRulesetRequestDescriptor(Action configure) => configure.Invoke(this); - public DeleteQueryRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + public DeleteRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) { } - internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetDelete; + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesDeleteRuleset; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; internal override bool SupportsBody => false; - internal override string OperationName => "query_ruleset.delete"; + internal override string OperationName => "query_rules.delete_ruleset"; - public DeleteQueryRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) + public DeleteRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) { RouteValues.Required("ruleset_id", rulesetId); return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs index 78aa51fd513..bd5791b7db2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs @@ -24,9 +24,9 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public sealed partial class DeleteQueryRulesetResponse : ElasticsearchResponse +public sealed partial class DeleteRulesetResponse : ElasticsearchResponse { /// /// For a successful response, this value is always true. On failure, an exception is returned instead. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.g.cs similarity index 65% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetRequest.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.g.cs index 19c9d8aa9da..edea075b64e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.g.cs @@ -27,50 +27,50 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public sealed partial class GetQueryRulesetRequestParameters : RequestParameters +public sealed partial class GetRulesetRequestParameters : RequestParameters { } /// /// Returns the details about a query ruleset /// -public sealed partial class GetQueryRulesetRequest : PlainRequest +public sealed partial class GetRulesetRequest : PlainRequest { - public GetQueryRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + public GetRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) { } - internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetGet; + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesGetRuleset; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; internal override bool SupportsBody => false; - internal override string OperationName => "query_ruleset.get"; + internal override string OperationName => "query_rules.get_ruleset"; } /// /// Returns the details about a query ruleset /// -public sealed partial class GetQueryRulesetRequestDescriptor : RequestDescriptor +public sealed partial class GetRulesetRequestDescriptor : RequestDescriptor { - internal GetQueryRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + internal GetRulesetRequestDescriptor(Action configure) => configure.Invoke(this); - public GetQueryRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + public GetRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) { } - internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetGet; + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesGetRuleset; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; internal override bool SupportsBody => false; - internal override string OperationName => "query_ruleset.get"; + internal override string OperationName => "query_rules.get_ruleset"; - public GetQueryRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) + public GetRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) { RouteValues.Required("ruleset_id", rulesetId); return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.g.cs similarity index 91% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.g.cs index 6c21e60f001..5b50050fe39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.g.cs @@ -24,15 +24,15 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public sealed partial class GetQueryRulesetResponse : ElasticsearchResponse +public sealed partial class GetRulesetResponse : ElasticsearchResponse { /// /// Rules associated with the query ruleset /// [JsonInclude, JsonPropertyName("rules")] - public IReadOnlyCollection Rules { get; init; } + public IReadOnlyCollection Rules { get; init; } /// /// Query Ruleset unique identifier diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListRequest.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs index c2115d8a3e4..2340836a6bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs @@ -27,9 +27,9 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public sealed partial class ListRequestParameters : RequestParameters +public sealed partial class ListRulesetsRequestParameters : RequestParameters { /// /// Starting offset (default: 0) @@ -45,15 +45,15 @@ public sealed partial class ListRequestParameters : RequestParameters /// /// Returns summarized information about existing query rulesets. /// -public sealed partial class ListRequest : PlainRequest +public sealed partial class ListRulesetsRequest : PlainRequest { - internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetList; + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesListRulesets; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; internal override bool SupportsBody => false; - internal override string OperationName => "query_ruleset.list"; + internal override string OperationName => "query_rules.list_rulesets"; /// /// Starting offset (default: 0) @@ -71,24 +71,24 @@ public sealed partial class ListRequest : PlainRequest /// /// Returns summarized information about existing query rulesets. /// -public sealed partial class ListRequestDescriptor : RequestDescriptor +public sealed partial class ListRulesetsRequestDescriptor : RequestDescriptor { - internal ListRequestDescriptor(Action configure) => configure.Invoke(this); + internal ListRulesetsRequestDescriptor(Action configure) => configure.Invoke(this); - public ListRequestDescriptor() + public ListRulesetsRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetList; + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesListRulesets; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; internal override bool SupportsBody => false; - internal override string OperationName => "query_ruleset.list"; + internal override string OperationName => "query_rules.list_rulesets"; - public ListRequestDescriptor From(int? from) => Qs("from", from); - public ListRequestDescriptor Size(int? size) => Qs("size", size); + public ListRulesetsRequestDescriptor From(int? from) => Qs("from", from); + public ListRulesetsRequestDescriptor Size(int? size) => Qs("size", size); protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs similarity index 90% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs index be8e382517f..dc7e677080a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs @@ -24,12 +24,12 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public sealed partial class ListResponse : ElasticsearchResponse +public sealed partial class ListRulesetsResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("count")] public long Count { get; init; } [JsonInclude, JsonPropertyName("results")] - public IReadOnlyCollection Results { get; init; } + public IReadOnlyCollection Results { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.g.cs similarity index 60% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetRequest.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.g.cs index cd94a7006bb..4bea43300d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.g.cs @@ -27,64 +27,64 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public sealed partial class PutQueryRulesetRequestParameters : RequestParameters +public sealed partial class PutRulesetRequestParameters : RequestParameters { } /// /// Creates or updates a query ruleset. /// -public sealed partial class PutQueryRulesetRequest : PlainRequest +public sealed partial class PutRulesetRequest : PlainRequest { - public PutQueryRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + public PutRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) { } - internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetPut; + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesPutRuleset; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; internal override bool SupportsBody => true; - internal override string OperationName => "query_ruleset.put"; + internal override string OperationName => "query_rules.put_ruleset"; [JsonInclude, JsonPropertyName("rules")] - public ICollection Rules { get; set; } + public ICollection Rules { get; set; } } /// /// Creates or updates a query ruleset. /// -public sealed partial class PutQueryRulesetRequestDescriptor : RequestDescriptor +public sealed partial class PutRulesetRequestDescriptor : RequestDescriptor { - internal PutQueryRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + internal PutRulesetRequestDescriptor(Action configure) => configure.Invoke(this); - public PutQueryRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + public PutRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) { } - internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetPut; + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesPutRuleset; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; internal override bool SupportsBody => true; - internal override string OperationName => "query_ruleset.put"; + internal override string OperationName => "query_rules.put_ruleset"; - public PutQueryRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) + public PutRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) { RouteValues.Required("ruleset_id", rulesetId); return Self; } - private ICollection RulesValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleDescriptor RulesDescriptor { get; set; } - private Action RulesDescriptorAction { get; set; } - private Action[] RulesDescriptorActions { get; set; } + private ICollection RulesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRules.QueryRuleDescriptor RulesDescriptor { get; set; } + private Action RulesDescriptorAction { get; set; } + private Action[] RulesDescriptorActions { get; set; } - public PutQueryRulesetRequestDescriptor Rules(ICollection rules) + public PutRulesetRequestDescriptor Rules(ICollection rules) { RulesDescriptor = null; RulesDescriptorAction = null; @@ -93,7 +93,7 @@ public PutQueryRulesetRequestDescriptor Rules(ICollection configure) + public PutRulesetRequestDescriptor Rules(Action configure) { RulesValue = null; RulesDescriptor = null; @@ -111,7 +111,7 @@ public PutQueryRulesetRequestDescriptor Rules(Action[] configure) + public PutRulesetRequestDescriptor Rules(params Action[] configure) { RulesValue = null; RulesDescriptor = null; @@ -134,7 +134,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("rules"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleDescriptor(RulesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleDescriptor(RulesDescriptorAction), options); writer.WriteEndArray(); } else if (RulesDescriptorActions is not null) @@ -143,7 +143,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RulesDescriptorActions) { - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.g.cs similarity index 92% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.g.cs index 441c7879a7c..23c35068711 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.g.cs @@ -24,9 +24,9 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public sealed partial class PutQueryRulesetResponse : ElasticsearchResponse +public sealed partial class PutRulesetResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("result")] public Elastic.Clients.Elasticsearch.Result Result { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs index 722c81548eb..86d765c27da 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -1991,7 +1991,7 @@ public virtual Task DeleteDataStreamAsync(Elastic.Clie } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -2002,7 +2002,7 @@ public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(DeleteIndexTempla } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequest request, CancellationToken cancellationToken = default) @@ -2012,7 +2012,7 @@ public virtual Task DeleteIndexTemplateAsync(Delete } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -2023,7 +2023,7 @@ public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(DeleteIndexTempla } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -2035,7 +2035,7 @@ public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(Elastic.Clients.E } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -2048,7 +2048,7 @@ public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(Elastic.Clients.E } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -2058,7 +2058,7 @@ public virtual Task DeleteIndexTemplateAsync(Delete } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) @@ -2069,7 +2069,7 @@ public virtual Task DeleteIndexTemplateAsync(Elasti } /// - /// The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
+ /// Delete an index template.
The provided may contain multiple template names separated by a comma. If multiple template
names are specified then there is no wildcard support and the provided names should match completely with
existing templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) @@ -3089,7 +3089,7 @@ public virtual Task ExistsIndexTemplateAsync(Elasti } /// - /// Returns information about whether a particular index template exists. + /// Check existence of index templates.
Returns information about whether a particular index template exists.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -3100,7 +3100,7 @@ public virtual ExistsTemplateResponse ExistsTemplate(ExistsTemplateRequest reque } /// - /// Returns information about whether a particular index template exists. + /// Check existence of index templates.
Returns information about whether a particular index template exists.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task ExistsTemplateAsync(ExistsTemplateRequest request, CancellationToken cancellationToken = default) @@ -3110,7 +3110,7 @@ public virtual Task ExistsTemplateAsync(ExistsTemplateRe } /// - /// Returns information about whether a particular index template exists. + /// Check existence of index templates.
Returns information about whether a particular index template exists.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -3121,7 +3121,7 @@ public virtual ExistsTemplateResponse ExistsTemplate(ExistsTemplateRequestDescri } /// - /// Returns information about whether a particular index template exists. + /// Check existence of index templates.
Returns information about whether a particular index template exists.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -3133,7 +3133,7 @@ public virtual ExistsTemplateResponse ExistsTemplate(Elastic.Clients.Elasticsear } /// - /// Returns information about whether a particular index template exists. + /// Check existence of index templates.
Returns information about whether a particular index template exists.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -3146,7 +3146,7 @@ public virtual ExistsTemplateResponse ExistsTemplate(Elastic.Clients.Elasticsear } /// - /// Returns information about whether a particular index template exists. + /// Check existence of index templates.
Returns information about whether a particular index template exists.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task ExistsTemplateAsync(ExistsTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -3156,7 +3156,7 @@ public virtual Task ExistsTemplateAsync(ExistsTemplateRe } /// - /// Returns information about whether a particular index template exists. + /// Check existence of index templates.
Returns information about whether a particular index template exists.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task ExistsTemplateAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) @@ -3167,7 +3167,7 @@ public virtual Task ExistsTemplateAsync(Elastic.Clients. } /// - /// Returns information about whether a particular index template exists. + /// Check existence of index templates.
Returns information about whether a particular index template exists.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task ExistsTemplateAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) @@ -5048,7 +5048,7 @@ public virtual Task GetFieldMappingAsync(Elastic.Client } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5059,7 +5059,7 @@ public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequest } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequest request, CancellationToken cancellationToken = default) @@ -5069,7 +5069,7 @@ public virtual Task GetIndexTemplateAsync(GetIndexTemp } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5080,7 +5080,7 @@ public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequest } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5092,7 +5092,7 @@ public virtual GetIndexTemplateResponse GetIndexTemplate(Elastic.Clients.Elastic } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5105,7 +5105,7 @@ public virtual GetIndexTemplateResponse GetIndexTemplate(Elastic.Clients.Elastic } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5117,7 +5117,7 @@ public virtual GetIndexTemplateResponse GetIndexTemplate() } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5130,7 +5130,7 @@ public virtual GetIndexTemplateResponse GetIndexTemplate(Action - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -5140,7 +5140,7 @@ public virtual Task GetIndexTemplateAsync(GetIndexTemp } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name? name, CancellationToken cancellationToken = default) @@ -5151,7 +5151,7 @@ public virtual Task GetIndexTemplateAsync(Elastic.Clie } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name? name, Action configureRequest, CancellationToken cancellationToken = default) @@ -5163,7 +5163,7 @@ public virtual Task GetIndexTemplateAsync(Elastic.Clie } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(CancellationToken cancellationToken = default) @@ -5174,7 +5174,7 @@ public virtual Task GetIndexTemplateAsync(Cancellation } /// - /// Returns information about one or more index templates. + /// Get index templates.
Returns information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetIndexTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) @@ -5696,7 +5696,7 @@ public virtual Task GetSettingsAsync(Action - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5707,7 +5707,7 @@ public virtual GetTemplateResponse GetTemplate(GetTemplateRequest request) } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetTemplateAsync(GetTemplateRequest request, CancellationToken cancellationToken = default) @@ -5717,7 +5717,7 @@ public virtual Task GetTemplateAsync(GetTemplateRequest req } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5728,7 +5728,7 @@ public virtual GetTemplateResponse GetTemplate(GetTemplateRequestDescriptor desc } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5740,7 +5740,7 @@ public virtual GetTemplateResponse GetTemplate(Elastic.Clients.Elasticsearch.Nam } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5753,7 +5753,7 @@ public virtual GetTemplateResponse GetTemplate(Elastic.Clients.Elasticsearch.Nam } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5765,7 +5765,7 @@ public virtual GetTemplateResponse GetTemplate() } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -5778,7 +5778,7 @@ public virtual GetTemplateResponse GetTemplate(Action - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetTemplateAsync(GetTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -5788,7 +5788,7 @@ public virtual Task GetTemplateAsync(GetTemplateRequestDesc } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetTemplateAsync(Elastic.Clients.Elasticsearch.Names? name, CancellationToken cancellationToken = default) @@ -5799,7 +5799,7 @@ public virtual Task GetTemplateAsync(Elastic.Clients.Elasti } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetTemplateAsync(Elastic.Clients.Elasticsearch.Names? name, Action configureRequest, CancellationToken cancellationToken = default) @@ -5811,7 +5811,7 @@ public virtual Task GetTemplateAsync(Elastic.Clients.Elasti } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetTemplateAsync(CancellationToken cancellationToken = default) @@ -5822,7 +5822,7 @@ public virtual Task GetTemplateAsync(CancellationToken canc } /// - /// Retrieves information about one or more index templates. + /// Get index templates.
Retrieves information about one or more index templates.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task GetTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) @@ -6608,7 +6608,7 @@ public virtual Task PutDataLifecycleAsync(Elastic.Clie } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -6619,7 +6619,7 @@ public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequest } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequest request, CancellationToken cancellationToken = default) @@ -6629,7 +6629,7 @@ public virtual Task PutIndexTemplateAsync(PutIndexTemp } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -6640,7 +6640,7 @@ public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemp } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -6652,7 +6652,7 @@ public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clie } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -6665,7 +6665,7 @@ public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clie } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -6676,7 +6676,7 @@ public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequest } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -6688,7 +6688,7 @@ public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clients.Elastic } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -6701,7 +6701,7 @@ public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clients.Elastic } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -6711,7 +6711,7 @@ public virtual Task PutIndexTemplateAsync(P } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) @@ -6722,7 +6722,7 @@ public virtual Task PutIndexTemplateAsync(E } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) @@ -6734,7 +6734,7 @@ public virtual Task PutIndexTemplateAsync(E } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -6744,7 +6744,7 @@ public virtual Task PutIndexTemplateAsync(PutIndexTemp } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) @@ -6755,7 +6755,7 @@ public virtual Task PutIndexTemplateAsync(Elastic.Clie } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) @@ -7229,7 +7229,7 @@ public virtual Task PutSettingsAsync(Elastic.Clients } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -7240,7 +7240,7 @@ public virtual PutTemplateResponse PutTemplate(PutTemplateRequest request) } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(PutTemplateRequest request, CancellationToken cancellationToken = default) @@ -7250,7 +7250,7 @@ public virtual Task PutTemplateAsync(PutTemplateRequest req } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -7261,7 +7261,7 @@ public virtual PutTemplateResponse PutTemplate(PutTemplateRequestDesc } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -7273,7 +7273,7 @@ public virtual PutTemplateResponse PutTemplate(Elastic.Clients.Elasti } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -7286,7 +7286,7 @@ public virtual PutTemplateResponse PutTemplate(Elastic.Clients.Elasti } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -7297,7 +7297,7 @@ public virtual PutTemplateResponse PutTemplate(PutTemplateRequestDescriptor desc } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -7309,7 +7309,7 @@ public virtual PutTemplateResponse PutTemplate(Elastic.Clients.Elasticsearch.Nam } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -7322,7 +7322,7 @@ public virtual PutTemplateResponse PutTemplate(Elastic.Clients.Elasticsearch.Nam } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -7332,7 +7332,7 @@ public virtual Task PutTemplateAsync(PutTemplate } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) @@ -7343,7 +7343,7 @@ public virtual Task PutTemplateAsync(Elastic.Cli } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) @@ -7355,7 +7355,7 @@ public virtual Task PutTemplateAsync(Elastic.Cli } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -7365,7 +7365,7 @@ public virtual Task PutTemplateAsync(PutTemplateRequestDesc } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) @@ -7376,7 +7376,7 @@ public virtual Task PutTemplateAsync(Elastic.Clients.Elasti } /// - /// Creates or updates an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
+ /// Create or update an index template.
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) @@ -9209,6 +9209,7 @@ public virtual Task ShrinkAsync(Elastic.Clients.Elasticsear } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9219,6 +9220,7 @@ public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndex } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequest request, CancellationToken cancellationToken = default) @@ -9228,6 +9230,7 @@ public virtual Task SimulateIndexTemplateAsync(Si } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9238,6 +9241,7 @@ public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndex } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9249,6 +9253,7 @@ public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clien } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9261,6 +9266,7 @@ public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clien } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -9270,6 +9276,7 @@ public virtual Task SimulateIndexTemplateAsync(Si } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) @@ -9280,6 +9287,7 @@ public virtual Task SimulateIndexTemplateAsync(El } /// + /// Simulate an index.
Returns the index configuration that would be applied to the specified index from an existing index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) @@ -9291,7 +9299,7 @@ public virtual Task SimulateIndexTemplateAsync(El } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9302,7 +9310,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemplateRequest } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(SimulateTemplateRequest request, CancellationToken cancellationToken = default) @@ -9312,7 +9320,7 @@ public virtual Task SimulateTemplateAsync(SimulateTemp } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9323,7 +9331,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemp } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9335,7 +9343,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(Elastic.Clie } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9348,7 +9356,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(Elastic.Clie } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9360,7 +9368,7 @@ public virtual SimulateTemplateResponse SimulateTemplate() } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9373,7 +9381,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(Action - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9384,7 +9392,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemplateRequest } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9396,7 +9404,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(Elastic.Clients.Elastic } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9409,7 +9417,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(Elastic.Clients.Elastic } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9421,7 +9429,7 @@ public virtual SimulateTemplateResponse SimulateTemplate() } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] @@ -9434,7 +9442,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(Action - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. /// public virtual Task SimulateTemplateAsync(SimulateTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -9444,7 +9452,7 @@ public virtual Task SimulateTemplateAsync(S } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Elastic.Clients.Elasticsearch.Name? name, CancellationToken cancellationToken = default) @@ -9455,7 +9463,7 @@ public virtual Task SimulateTemplateAsync(E } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Elastic.Clients.Elasticsearch.Name? name, Action> configureRequest, CancellationToken cancellationToken = default) @@ -9467,7 +9475,7 @@ public virtual Task SimulateTemplateAsync(E } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(CancellationToken cancellationToken = default) @@ -9478,7 +9486,7 @@ public virtual Task SimulateTemplateAsync(C } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Action> configureRequest, CancellationToken cancellationToken = default) @@ -9490,7 +9498,7 @@ public virtual Task SimulateTemplateAsync(A } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(SimulateTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) @@ -9500,7 +9508,7 @@ public virtual Task SimulateTemplateAsync(SimulateTemp } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Elastic.Clients.Elasticsearch.Name? name, CancellationToken cancellationToken = default) @@ -9511,7 +9519,7 @@ public virtual Task SimulateTemplateAsync(Elastic.Clie } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Elastic.Clients.Elasticsearch.Name? name, Action configureRequest, CancellationToken cancellationToken = default) @@ -9523,7 +9531,7 @@ public virtual Task SimulateTemplateAsync(Elastic.Clie } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(CancellationToken cancellationToken = default) @@ -9534,7 +9542,7 @@ public virtual Task SimulateTemplateAsync(Cancellation } /// - /// Returns the index configuration that would be applied by a particular index template. + /// Simulate an index template.
Returns the index configuration that would be applied by a particular index template.
/// Learn more about this API in the Elasticsearch documentation. ///
public virtual Task SimulateTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRuleset.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRules.g.cs similarity index 58% rename from src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRuleset.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRules.g.cs index 76a626ce758..76e75f38ede 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRuleset.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRules.g.cs @@ -22,18 +22,18 @@ using System.Threading; using System.Threading.Tasks; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; -public partial class QueryRulesetNamespacedClient : NamespacedClientProxy +public partial class QueryRulesNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// - protected QueryRulesetNamespacedClient() : base() + protected QueryRulesNamespacedClient() : base() { } - internal QueryRulesetNamespacedClient(ElasticsearchClient client) : base(client) + internal QueryRulesNamespacedClient(ElasticsearchClient client) : base(client) { } @@ -42,20 +42,20 @@ internal QueryRulesetNamespacedClient(ElasticsearchClient client) : base(client) /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual DeleteQueryRulesetResponse Delete(DeleteQueryRulesetRequest request) + public virtual DeleteRulesetResponse DeleteRuleset(DeleteRulesetRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// /// Deletes a query ruleset. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteQueryRulesetRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteRulesetAsync(DeleteRulesetRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// @@ -63,10 +63,10 @@ public virtual Task DeleteAsync(DeleteQueryRulesetRe /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual DeleteQueryRulesetResponse Delete(DeleteQueryRulesetRequestDescriptor descriptor) + public virtual DeleteRulesetResponse DeleteRuleset(DeleteRulesetRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// @@ -74,11 +74,11 @@ public virtual DeleteQueryRulesetResponse Delete(DeleteQueryRulesetRequestDescri /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual DeleteQueryRulesetResponse Delete(Elastic.Clients.Elasticsearch.Id rulesetId) + public virtual DeleteRulesetResponse DeleteRuleset(Elastic.Clients.Elasticsearch.Id rulesetId) { - var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new DeleteRulesetRequestDescriptor(rulesetId); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// @@ -86,45 +86,45 @@ public virtual DeleteQueryRulesetResponse Delete(Elastic.Clients.Elasticsearch.I /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual DeleteQueryRulesetResponse Delete(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) + public virtual DeleteRulesetResponse DeleteRuleset(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) { - var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new DeleteRulesetRequestDescriptor(rulesetId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// /// Deletes a query ruleset. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteRulesetAsync(DeleteRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes a query ruleset. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default) + public virtual Task DeleteRulesetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default) { - var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new DeleteRulesetRequestDescriptor(rulesetId); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes a query ruleset. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteRulesetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new DeleteRulesetRequestDescriptor(rulesetId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// @@ -132,20 +132,20 @@ public virtual Task DeleteAsync(Elastic.Clients.Elas /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetQueryRulesetResponse Get(GetQueryRulesetRequest request) + public virtual GetRulesetResponse GetRuleset(GetRulesetRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// /// Returns the details about a query ruleset /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(GetQueryRulesetRequest request, CancellationToken cancellationToken = default) + public virtual Task GetRulesetAsync(GetRulesetRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// @@ -153,10 +153,10 @@ public virtual Task GetAsync(GetQueryRulesetRequest req /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetQueryRulesetResponse Get(GetQueryRulesetRequestDescriptor descriptor) + public virtual GetRulesetResponse GetRuleset(GetRulesetRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// @@ -164,11 +164,11 @@ public virtual GetQueryRulesetResponse Get(GetQueryRulesetRequestDescriptor desc /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetQueryRulesetResponse Get(Elastic.Clients.Elasticsearch.Id rulesetId) + public virtual GetRulesetResponse GetRuleset(Elastic.Clients.Elasticsearch.Id rulesetId) { - var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new GetRulesetRequestDescriptor(rulesetId); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// @@ -176,45 +176,45 @@ public virtual GetQueryRulesetResponse Get(Elastic.Clients.Elasticsearch.Id rule /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetQueryRulesetResponse Get(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) + public virtual GetRulesetResponse GetRuleset(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) { - var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new GetRulesetRequestDescriptor(rulesetId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// /// Returns the details about a query ruleset /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(GetQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetRulesetAsync(GetRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Returns the details about a query ruleset /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default) + public virtual Task GetRulesetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default) { - var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new GetRulesetRequestDescriptor(rulesetId); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Returns the details about a query ruleset /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetRulesetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new GetRulesetRequestDescriptor(rulesetId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// @@ -222,20 +222,20 @@ public virtual Task GetAsync(Elastic.Clients.Elasticsea /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ListResponse List(ListRequest request) + public virtual ListRulesetsResponse ListRulesets(ListRulesetsRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// /// Returns summarized information about existing query rulesets. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ListAsync(ListRequest request, CancellationToken cancellationToken = default) + public virtual Task ListRulesetsAsync(ListRulesetsRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// @@ -243,10 +243,10 @@ public virtual Task ListAsync(ListRequest request, CancellationTok /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ListResponse List(ListRequestDescriptor descriptor) + public virtual ListRulesetsResponse ListRulesets(ListRulesetsRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// @@ -254,11 +254,11 @@ public virtual ListResponse List(ListRequestDescriptor descriptor) /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ListResponse List() + public virtual ListRulesetsResponse ListRulesets() { - var descriptor = new ListRequestDescriptor(); + var descriptor = new ListRulesetsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// @@ -266,45 +266,45 @@ public virtual ListResponse List() /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ListResponse List(Action configureRequest) + public virtual ListRulesetsResponse ListRulesets(Action configureRequest) { - var descriptor = new ListRequestDescriptor(); + var descriptor = new ListRulesetsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// /// Returns summarized information about existing query rulesets. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ListAsync(ListRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ListRulesetsAsync(ListRulesetsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Returns summarized information about existing query rulesets. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ListAsync(CancellationToken cancellationToken = default) + public virtual Task ListRulesetsAsync(CancellationToken cancellationToken = default) { - var descriptor = new ListRequestDescriptor(); + var descriptor = new ListRulesetsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Returns summarized information about existing query rulesets. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ListAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ListRulesetsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ListRequestDescriptor(); + var descriptor = new ListRulesetsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// @@ -312,20 +312,20 @@ public virtual Task ListAsync(Action config /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual PutQueryRulesetResponse Put(PutQueryRulesetRequest request) + public virtual PutRulesetResponse PutRuleset(PutRulesetRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// /// Creates or updates a query ruleset. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAsync(PutQueryRulesetRequest request, CancellationToken cancellationToken = default) + public virtual Task PutRulesetAsync(PutRulesetRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// @@ -333,10 +333,10 @@ public virtual Task PutAsync(PutQueryRulesetRequest req /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual PutQueryRulesetResponse Put(PutQueryRulesetRequestDescriptor descriptor) + public virtual PutRulesetResponse PutRuleset(PutRulesetRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// @@ -344,11 +344,11 @@ public virtual PutQueryRulesetResponse Put(PutQueryRulesetRequestDescriptor desc /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual PutQueryRulesetResponse Put(Elastic.Clients.Elasticsearch.Id rulesetId) + public virtual PutRulesetResponse PutRuleset(Elastic.Clients.Elasticsearch.Id rulesetId) { - var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new PutRulesetRequestDescriptor(rulesetId); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// @@ -356,44 +356,44 @@ public virtual PutQueryRulesetResponse Put(Elastic.Clients.Elasticsearch.Id rule /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual PutQueryRulesetResponse Put(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) + public virtual PutRulesetResponse PutRuleset(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) { - var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new PutRulesetRequestDescriptor(rulesetId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// /// Creates or updates a query ruleset. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAsync(PutQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutRulesetAsync(PutRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Creates or updates a query ruleset. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default) + public virtual Task PutRulesetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default) { - var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new PutRulesetRequestDescriptor(rulesetId); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Creates or updates a query ruleset. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutRulesetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId); + var descriptor = new PutRulesetRequestDescriptor(rulesetId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index 5ecec1d5041..059bddadd11 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -33,7 +33,7 @@ using Elastic.Clients.Elasticsearch.LicenseManagement; using Elastic.Clients.Elasticsearch.MachineLearning; using Elastic.Clients.Elasticsearch.Nodes; -using Elastic.Clients.Elasticsearch.QueryRuleset; +using Elastic.Clients.Elasticsearch.QueryRules; using Elastic.Clients.Elasticsearch.Rollup; using Elastic.Clients.Elasticsearch.SearchableSnapshots; using Elastic.Clients.Elasticsearch.SearchApplication; @@ -70,7 +70,7 @@ public partial class ElasticsearchClient public virtual LicenseManagementNamespacedClient LicenseManagement { get; private set; } public virtual MachineLearningNamespacedClient MachineLearning { get; private set; } public virtual NodesNamespacedClient Nodes { get; private set; } - public virtual QueryRulesetNamespacedClient QueryRuleset { get; private set; } + public virtual QueryRulesNamespacedClient QueryRules { get; private set; } public virtual RollupNamespacedClient Rollup { get; private set; } public virtual SearchableSnapshotsNamespacedClient SearchableSnapshots { get; private set; } public virtual SearchApplicationNamespacedClient SearchApplication { get; private set; } @@ -101,7 +101,7 @@ private partial void SetupNamespaces() LicenseManagement = new LicenseManagementNamespacedClient(this); MachineLearning = new MachineLearningNamespacedClient(this); Nodes = new NodesNamespacedClient(this); - QueryRuleset = new QueryRulesetNamespacedClient(this); + QueryRules = new QueryRulesNamespacedClient(this); Rollup = new RollupNamespacedClient(this); SearchableSnapshots = new SearchableSnapshotsNamespacedClient(this); SearchApplication = new SearchApplicationNamespacedClient(this); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs index 03ea9fb5af9..f50259de807 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs @@ -86,6 +86,12 @@ public sealed partial class TermsAggregation [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ [JsonInclude, JsonPropertyName("shard_min_doc_count")] + public long? ShardMinDocCount { get; set; } + /// /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
///
@@ -134,6 +140,7 @@ public TermsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private long? ShardMinDocCountValue { get; set; } private int? ShardSizeValue { get; set; } private bool? ShowTermDocCountErrorValue { get; set; } private int? SizeValue { get; set; } @@ -253,6 +260,15 @@ public TermsAggregationDescriptor Script(Elastic.Clients.Elasticsearc return Self; } + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public TermsAggregationDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + /// /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
///
@@ -364,6 +380,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + if (ShardSizeValue.HasValue) { writer.WritePropertyName("shard_size"); @@ -412,6 +434,7 @@ public TermsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private long? ShardMinDocCountValue { get; set; } private int? ShardSizeValue { get; set; } private bool? ShowTermDocCountErrorValue { get; set; } private int? SizeValue { get; set; } @@ -531,6 +554,15 @@ public TermsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? s return Self; } + /// + /// Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`.
Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public TermsAggregationDescriptor ShardMinDocCount(long? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + /// /// The number of candidate terms produced by each shard.
By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter.
///
@@ -642,6 +674,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } + if (ShardMinDocCountValue.HasValue) + { + writer.WritePropertyName("shard_min_doc_count"); + writer.WriteNumberValue(ShardMinDocCountValue.Value); + } + if (ShardSizeValue.HasValue) { writer.WritePropertyName("shard_size"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs index aa614d766cf..bb3f57e10cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs @@ -540,6 +540,74 @@ public override void Write(Utf8JsonWriter writer, GeoValidationMethod value, Jso } } +[JsonConverter(typeof(MultiValueModeConverter))] +public enum MultiValueMode +{ + /// + /// Distance is the sum of all distances. + /// + [EnumMember(Value = "sum")] + Sum, + /// + /// Distance is the minimum distance. + /// + [EnumMember(Value = "min")] + Min, + /// + /// Distance is the maximum distance. + /// + [EnumMember(Value = "max")] + Max, + /// + /// Distance is the average distance. + /// + [EnumMember(Value = "avg")] + Avg +} + +internal sealed class MultiValueModeConverter : JsonConverter +{ + public override MultiValueMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "sum": + return MultiValueMode.Sum; + case "min": + return MultiValueMode.Min; + case "max": + return MultiValueMode.Max; + case "avg": + return MultiValueMode.Avg; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, MultiValueMode value, JsonSerializerOptions options) + { + switch (value) + { + case MultiValueMode.Sum: + writer.WriteStringValue("sum"); + return; + case MultiValueMode.Min: + writer.WriteStringValue("min"); + return; + case MultiValueMode.Max: + writer.WriteStringValue("max"); + return; + case MultiValueMode.Avg: + writer.WriteStringValue("avg"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(OperatorConverter))] public enum Operator { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRuleset.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRules.g.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRuleset.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRules.g.cs index a3ecf1dde11..e2890ec5230 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRuleset.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRules.g.cs @@ -26,7 +26,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; [JsonConverter(typeof(QueryRuleCriteriaTypeConverter))] public enum QueryRuleCriteriaType @@ -50,7 +50,9 @@ public enum QueryRuleCriteriaType [EnumMember(Value = "exact")] Exact, [EnumMember(Value = "contains")] - Contains + Contains, + [EnumMember(Value = "always")] + Always } internal sealed class QueryRuleCriteriaTypeConverter : JsonConverter @@ -80,6 +82,8 @@ public override QueryRuleCriteriaType Read(ref Utf8JsonReader reader, Type typeT return QueryRuleCriteriaType.Exact; case "contains": return QueryRuleCriteriaType.Contains; + case "always": + return QueryRuleCriteriaType.Always; } ThrowHelper.ThrowJsonException(); @@ -120,6 +124,9 @@ public override void Write(Utf8JsonWriter writer, QueryRuleCriteriaType value, J case QueryRuleCriteriaType.Contains: writer.WriteStringValue("contains"); return; + case QueryRuleCriteriaType.Always: + writer.WriteStringValue("always"); + return; } writer.WriteNullValue(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs index ceb4d3c3aef..c2134fe5d6d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs @@ -29,6 +29,12 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class MappingLimitSettingsTotalFields { + /// + /// This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set
to false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail
with the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail.
Instead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false.
The fields that were not added to the mapping will be added to the _ignored field.
+ ///
+ [JsonInclude, JsonPropertyName("ignore_dynamic_beyond_limit")] + public bool? IgnoreDynamicBeyondLimit { get; set; } + /// /// The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit.
The limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance
degradations and memory issues, especially in clusters with a high load or few resources.
///
@@ -44,8 +50,18 @@ public MappingLimitSettingsTotalFieldsDescriptor() : base() { } + private bool? IgnoreDynamicBeyondLimitValue { get; set; } private long? LimitValue { get; set; } + /// + /// This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set
to false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail
with the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail.
Instead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false.
The fields that were not added to the mapping will be added to the _ignored field.
+ ///
+ public MappingLimitSettingsTotalFieldsDescriptor IgnoreDynamicBeyondLimit(bool? ignoreDynamicBeyondLimit = true) + { + IgnoreDynamicBeyondLimitValue = ignoreDynamicBeyondLimit; + return Self; + } + /// /// The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit.
The limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance
degradations and memory issues, especially in clusters with a high load or few resources.
///
@@ -58,6 +74,12 @@ public MappingLimitSettingsTotalFieldsDescriptor Limit(long? limit) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (IgnoreDynamicBeyondLimitValue.HasValue) + { + writer.WritePropertyName("ignore_dynamic_beyond_limit"); + writer.WriteBooleanValue(IgnoreDynamicBeyondLimitValue.Value); + } + if (LimitValue.HasValue) { writer.WritePropertyName("limit"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.g.cs new file mode 100644 index 00000000000..243f63141e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.g.cs @@ -0,0 +1,222 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +internal sealed partial class DateDecayFunctionConverter : JsonConverter +{ + public override DateDecayFunction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new DateDecayFunction(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "multi_value_mode") + { + variant.MultiValueMode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Placement = JsonSerializer.Deserialize>(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, DateDecayFunction value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Placement is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Placement, options); + } + + if (value.MultiValueMode is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, value.MultiValueMode, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DateDecayFunctionConverter))] +public sealed partial class DateDecayFunction +{ + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueMode { get; set; } + public Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement Placement { get; set; } +} + +public sealed partial class DateDecayFunctionDescriptor : SerializableDescriptor> +{ + internal DateDecayFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public DateDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public DateDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public DateDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DateDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public DateDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public DateDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateDecayFunctionDescriptor : SerializableDescriptor +{ + internal DateDecayFunctionDescriptor(Action configure) => configure.Invoke(this); + + public DateDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public DateDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public DateDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DateDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public DateDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public DateDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs new file mode 100644 index 00000000000..7cc3037b694 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs @@ -0,0 +1,255 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +public sealed partial class DateDistanceFeatureQuery +{ + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ [JsonInclude, JsonPropertyName("origin")] + public Elastic.Clients.Elasticsearch.DateMath Origin { get; set; } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.Duration Pivot { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } +} + +public sealed partial class DateDistanceFeatureQueryDescriptor : SerializableDescriptor> +{ + internal DateDistanceFeatureQueryDescriptor(Action> configure) => configure.Invoke(this); + + public DateDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.DateMath OriginValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public DateDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public DateDistanceFeatureQueryDescriptor Origin(Elastic.Clients.Elasticsearch.DateMath origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public DateDistanceFeatureQueryDescriptor Pivot(Elastic.Clients.Elasticsearch.Duration pivot) + { + PivotValue = pivot; + return Self; + } + + public DateDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateDistanceFeatureQueryDescriptor : SerializableDescriptor +{ + internal DateDistanceFeatureQueryDescriptor(Action configure) => configure.Invoke(this); + + public DateDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.DateMath OriginValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public DateDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public DateDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public DateDistanceFeatureQueryDescriptor Origin(Elastic.Clients.Elasticsearch.DateMath origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public DateDistanceFeatureQueryDescriptor Pivot(Elastic.Clients.Elasticsearch.Duration pivot) + { + PivotValue = pivot; + return Self; + } + + public DateDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.g.cs similarity index 57% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.g.cs index a6b9d292fe5..b3e8bf77522 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.g.cs @@ -27,33 +27,32 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class GeoPolygonPoints +public sealed partial class DecayPlacement { - [JsonInclude, JsonPropertyName("points")] - public ICollection Points { get; set; } -} - -public sealed partial class GeoPolygonPointsDescriptor : SerializableDescriptor -{ - internal GeoPolygonPointsDescriptor(Action configure) => configure.Invoke(this); - - public GeoPolygonPointsDescriptor() : base() - { - } - - private ICollection PointsValue { get; set; } - - public GeoPolygonPointsDescriptor Points(ICollection points) - { - PointsValue = points; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - writer.WritePropertyName("points"); - JsonSerializer.Serialize(writer, PointsValue, options); - writer.WriteEndObject(); - } + /// + /// Defines how documents are scored at the distance given at scale. + /// + [JsonInclude, JsonPropertyName("decay")] + public double? Decay { get; set; } + + /// + /// If defined, the decay function will only compute the decay function for documents with a distance greater than the defined `offset`. + /// + [JsonInclude, JsonPropertyName("offset")] + [SourceConverter] + public TScale? Offset { get; set; } + + /// + /// The point of origin used for calculating distance. Must be given as a number for numeric field, date for date fields and geo point for geo fields. + /// + [JsonInclude, JsonPropertyName("origin")] + [SourceConverter] + public TOrigin? Origin { get; set; } + + /// + /// Defines the distance from origin + offset at which the computed score will equal `decay` parameter. + /// + [JsonInclude, JsonPropertyName("scale")] + [SourceConverter] + public TScale? Scale { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs index 7af39077b63..15eea6a6ae2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs @@ -46,7 +46,19 @@ internal FunctionScore(string variantName, object variant) internal object Variant { get; } internal string VariantName { get; } + public static FunctionScore Exp(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => new FunctionScore("exp", decayFunction); + public static FunctionScore Exp(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => new FunctionScore("exp", decayFunction); + public static FunctionScore Exp(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => new FunctionScore("exp", decayFunction); + public static FunctionScore Exp(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => new FunctionScore("exp", decayFunction); public static FunctionScore FieldValueFactor(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => new FunctionScore("field_value_factor", fieldValueFactorScoreFunction); + public static FunctionScore Gauss(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => new FunctionScore("gauss", decayFunction); + public static FunctionScore Gauss(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => new FunctionScore("gauss", decayFunction); + public static FunctionScore Gauss(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => new FunctionScore("gauss", decayFunction); + public static FunctionScore Gauss(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => new FunctionScore("gauss", decayFunction); + public static FunctionScore Linear(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => new FunctionScore("linear", decayFunction); + public static FunctionScore Linear(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => new FunctionScore("linear", decayFunction); + public static FunctionScore Linear(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => new FunctionScore("linear", decayFunction); + public static FunctionScore Linear(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => new FunctionScore("linear", decayFunction); public static FunctionScore RandomScore(Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction randomScoreFunction) => new FunctionScore("random_score", randomScoreFunction); public static FunctionScore ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction scriptScoreFunction) => new FunctionScore("script_score", scriptScoreFunction); @@ -107,6 +119,13 @@ public override FunctionScore Read(ref Utf8JsonReader reader, Type typeToConvert continue; } + if (propertyName == "exp") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "field_value_factor") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -114,6 +133,20 @@ public override FunctionScore Read(ref Utf8JsonReader reader, Type typeToConvert continue; } + if (propertyName == "gauss") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "linear") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "random_score") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -157,9 +190,18 @@ public override void Write(Utf8JsonWriter writer, FunctionScore value, JsonSeria writer.WritePropertyName(value.VariantName); switch (value.VariantName) { + case "exp": + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); + break; case "field_value_factor": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction)value.Variant, options); break; + case "gauss": + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); + break; + case "linear": + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); + break; case "random_score": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction)value.Variant, options); break; @@ -219,8 +261,20 @@ public FunctionScoreDescriptor Weight(double? weight) return Self; } + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "exp"); public FunctionScoreDescriptor FieldValueFactor(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); public FunctionScoreDescriptor FieldValueFactor(Action> configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "linear"); public FunctionScoreDescriptor RandomScore(Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); public FunctionScoreDescriptor RandomScore(Action> configure) => Set(configure, "random_score"); public FunctionScoreDescriptor ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction scriptScoreFunction) => Set(scriptScoreFunction, "script_score"); @@ -304,8 +358,20 @@ public FunctionScoreDescriptor Weight(double? weight) return Self; } + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "exp"); + public FunctionScoreDescriptor Exp(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "exp"); public FunctionScoreDescriptor FieldValueFactor(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); public FunctionScoreDescriptor FieldValueFactor(Action configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Gauss(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "gauss"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction decayFunction) => Set(decayFunction, "linear"); + public FunctionScoreDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction decayFunction) => Set(decayFunction, "linear"); public FunctionScoreDescriptor RandomScore(Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); public FunctionScoreDescriptor RandomScore(Action configure) => Set(configure, "random_score"); public FunctionScoreDescriptor ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction scriptScoreFunction) => Set(scriptScoreFunction, "script_score"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs new file mode 100644 index 00000000000..05087127468 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs @@ -0,0 +1,222 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +internal sealed partial class GeoDecayFunctionConverter : JsonConverter +{ + public override GeoDecayFunction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new GeoDecayFunction(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "multi_value_mode") + { + variant.MultiValueMode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Placement = JsonSerializer.Deserialize>(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, GeoDecayFunction value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Placement is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Placement, options); + } + + if (value.MultiValueMode is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, value.MultiValueMode, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(GeoDecayFunctionConverter))] +public sealed partial class GeoDecayFunction +{ + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueMode { get; set; } + public Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement Placement { get; set; } +} + +public sealed partial class GeoDecayFunctionDescriptor : SerializableDescriptor> +{ + internal GeoDecayFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public GeoDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public GeoDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public GeoDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public GeoDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public GeoDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoDecayFunctionDescriptor : SerializableDescriptor +{ + internal GeoDecayFunctionDescriptor(Action configure) => configure.Invoke(this); + + public GeoDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public GeoDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public GeoDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public GeoDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public GeoDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public GeoDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs new file mode 100644 index 00000000000..1c98556dfcb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs @@ -0,0 +1,255 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +public sealed partial class GeoDistanceFeatureQuery +{ + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ [JsonInclude, JsonPropertyName("origin")] + public Elastic.Clients.Elasticsearch.GeoLocation Origin { get; set; } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public string Pivot { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } +} + +public sealed partial class GeoDistanceFeatureQueryDescriptor : SerializableDescriptor> +{ + internal GeoDistanceFeatureQueryDescriptor(Action> configure) => configure.Invoke(this); + + public GeoDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.GeoLocation OriginValue { get; set; } + private string PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Origin(Elastic.Clients.Elasticsearch.GeoLocation origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Pivot(string pivot) + { + PivotValue = pivot; + return Self; + } + + public GeoDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + writer.WriteStringValue(PivotValue); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GeoDistanceFeatureQueryDescriptor : SerializableDescriptor +{ + internal GeoDistanceFeatureQueryDescriptor(Action configure) => configure.Invoke(this); + + public GeoDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.GeoLocation OriginValue { get; set; } + private string PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Origin(Elastic.Clients.Elasticsearch.GeoLocation origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public GeoDistanceFeatureQueryDescriptor Pivot(string pivot) + { + PivotValue = pivot; + return Self; + } + + public GeoDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + writer.WriteStringValue(PivotValue); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs deleted file mode 100644 index 34223005677..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs +++ /dev/null @@ -1,380 +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 Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Elastic.Clients.Elasticsearch.QueryDsl; - -internal sealed partial class GeoPolygonQueryConverter : JsonConverter -{ - public override GeoPolygonQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.StartObject) - throw new JsonException("Unexpected JSON detected."); - var variant = new GeoPolygonQuery(); - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) - { - if (reader.TokenType == JsonTokenType.PropertyName) - { - var property = reader.GetString(); - if (property == "boost") - { - variant.Boost = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "ignore_unmapped") - { - variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "_name") - { - variant.QueryName = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "validation_method") - { - variant.ValidationMethod = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - variant.Field = property; - reader.Read(); - variant.Polygon = JsonSerializer.Deserialize(ref reader, options); - } - } - - return variant; - } - - public override void Write(Utf8JsonWriter writer, GeoPolygonQuery value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - if (value.Field is not null && value.Polygon is not null) - { - if (!options.TryGetClientSettings(out var settings)) - { - ThrowHelper.ThrowJsonExceptionForMissingSettings(); - } - - var propertyName = settings.Inferrer.Field(value.Field); - writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, value.Polygon, options); - } - - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (value.IgnoreUnmapped.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(value.IgnoreUnmapped.Value); - } - - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } - - if (value.ValidationMethod is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, value.ValidationMethod, options); - } - - writer.WriteEndObject(); - } -} - -[JsonConverter(typeof(GeoPolygonQueryConverter))] -public sealed partial class GeoPolygonQuery -{ - /// - /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
- ///
- public float? Boost { get; set; } - public Elastic.Clients.Elasticsearch.Field Field { get; set; } - public bool? IgnoreUnmapped { get; set; } - public Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints Polygon { get; set; } - public string? QueryName { get; set; } - public Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethod { get; set; } - - public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(GeoPolygonQuery geoPolygonQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.GeoPolygon(geoPolygonQuery); -} - -public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor> -{ - internal GeoPolygonQueryDescriptor(Action> configure) => configure.Invoke(this); - - public GeoPolygonQueryDescriptor() : base() - { - } - - private float? BoostValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private bool? IgnoreUnmappedValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } - private Action PolygonDescriptorAction { get; set; } - private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - /// - /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
- ///
- public GeoPolygonQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints polygon) - { - PolygonDescriptor = null; - PolygonDescriptorAction = null; - PolygonValue = polygon; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsDescriptor descriptor) - { - PolygonValue = null; - PolygonDescriptorAction = null; - PolygonDescriptor = descriptor; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Action configure) - { - PolygonValue = null; - PolygonDescriptor = null; - PolygonDescriptorAction = configure; - return Self; - } - - public GeoPolygonQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (FieldValue is not null && PolygonValue is not null) - { - var propertyName = settings.Inferrer.Field(FieldValue); - writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, PolygonValue, options); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} - -public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor -{ - internal GeoPolygonQueryDescriptor(Action configure) => configure.Invoke(this); - - public GeoPolygonQueryDescriptor() : base() - { - } - - private float? BoostValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private bool? IgnoreUnmappedValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } - private Action PolygonDescriptorAction { get; set; } - private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - /// - /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
- ///
- public GeoPolygonQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints polygon) - { - PolygonDescriptor = null; - PolygonDescriptorAction = null; - PolygonValue = polygon; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsDescriptor descriptor) - { - PolygonValue = null; - PolygonDescriptorAction = null; - PolygonDescriptor = descriptor; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Action configure) - { - PolygonValue = null; - PolygonDescriptor = null; - PolygonDescriptorAction = configure; - return Self; - } - - public GeoPolygonQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (FieldValue is not null && PolygonValue is not null) - { - var propertyName = settings.Inferrer.Field(FieldValue); - writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, PolygonValue, options); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs new file mode 100644 index 00000000000..81edd496472 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs @@ -0,0 +1,222 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +internal sealed partial class NumericDecayFunctionConverter : JsonConverter +{ + public override NumericDecayFunction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new NumericDecayFunction(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "multi_value_mode") + { + variant.MultiValueMode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Placement = JsonSerializer.Deserialize>(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, NumericDecayFunction value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Placement is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Placement, options); + } + + if (value.MultiValueMode is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, value.MultiValueMode, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(NumericDecayFunctionConverter))] +public sealed partial class NumericDecayFunction +{ + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueMode { get; set; } + public Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement Placement { get; set; } +} + +public sealed partial class NumericDecayFunctionDescriptor : SerializableDescriptor> +{ + internal NumericDecayFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public NumericDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public NumericDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public NumericDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public NumericDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public NumericDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public NumericDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class NumericDecayFunctionDescriptor : SerializableDescriptor +{ + internal NumericDecayFunctionDescriptor(Action configure) => configure.Invoke(this); + + public NumericDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement PlacementValue { get; set; } + + public NumericDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public NumericDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public NumericDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public NumericDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public NumericDecayFunctionDescriptor Placement(Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs index 2a86dba2b3d..292ebfac668 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs @@ -54,12 +54,14 @@ internal Query(string variantName, object variant) public static Query CombinedFields(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery combinedFieldsQuery) => new Query("combined_fields", combinedFieldsQuery); public static Query ConstantScore(Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery constantScoreQuery) => new Query("constant_score", constantScoreQuery); public static Query DisMax(Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery disMaxQuery) => new Query("dis_max", disMaxQuery); + public static Query DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery distanceFeatureQuery) => new Query("distance_feature", distanceFeatureQuery); + public static Query DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery distanceFeatureQuery) => new Query("distance_feature", distanceFeatureQuery); + public static Query DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery distanceFeatureQuery) => new Query("distance_feature", distanceFeatureQuery); public static Query Exists(Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery existsQuery) => new Query("exists", existsQuery); public static Query FunctionScore(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery functionScoreQuery) => new Query("function_score", functionScoreQuery); public static Query Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery fuzzyQuery) => new Query("fuzzy", fuzzyQuery); public static Query GeoBoundingBox(Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery geoBoundingBoxQuery) => new Query("geo_bounding_box", geoBoundingBoxQuery); public static Query GeoDistance(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery geoDistanceQuery) => new Query("geo_distance", geoDistanceQuery); - public static Query GeoPolygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery geoPolygonQuery) => new Query("geo_polygon", geoPolygonQuery); public static Query HasChild(Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery hasChildQuery) => new Query("has_child", hasChildQuery); public static Query HasParent(Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery hasParentQuery) => new Query("has_parent", hasParentQuery); public static Query Ids(Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery idsQuery) => new Query("ids", idsQuery); @@ -79,11 +81,14 @@ internal Query(string variantName, object variant) public static Query Pinned(Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery pinnedQuery) => new Query("pinned", pinnedQuery); public static Query Prefix(Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery prefixQuery) => new Query("prefix", prefixQuery); public static Query QueryString(Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery queryStringQuery) => new Query("query_string", queryStringQuery); - public static Query Range(Elastic.Clients.Elasticsearch.QueryDsl.RangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query Range(Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query Range(Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query Range(Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery rangeQuery) => new Query("range", rangeQuery); + public static Query Range(Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery rangeQuery) => new Query("range", rangeQuery); public static Query RankFeature(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery rankFeatureQuery) => new Query("rank_feature", rankFeatureQuery); public static Query RawJson(Elastic.Clients.Elasticsearch.QueryDsl.RawJsonQuery rawJsonQuery) => new Query("raw_json", rawJsonQuery); public static Query Regexp(Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery regexpQuery) => new Query("regexp", regexpQuery); - public static Query RuleQuery(Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery ruleQuery) => new Query("rule_query", ruleQuery); + public static Query Rule(Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery ruleQuery) => new Query("rule", ruleQuery); public static Query Script(Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery scriptQuery) => new Query("script", scriptQuery); public static Query ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery scriptScoreQuery) => new Query("script_score", scriptScoreQuery); public static Query SimpleQueryString(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery simpleQueryStringQuery) => new Query("simple_query_string", simpleQueryStringQuery); @@ -177,6 +182,13 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe continue; } + if (propertyName == "distance_feature") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "exists") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -212,13 +224,6 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe continue; } - if (propertyName == "geo_polygon") - { - variantValue = JsonSerializer.Deserialize(ref reader, options); - variantNameValue = propertyName; - continue; - } - if (propertyName == "has_child") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -354,7 +359,7 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe if (propertyName == "range") { - variantValue = JsonSerializer.Deserialize(ref reader, options); + variantValue = JsonSerializer.Deserialize(ref reader, options); variantNameValue = propertyName; continue; } @@ -380,7 +385,7 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe continue; } - if (propertyName == "rule_query") + if (propertyName == "rule") { variantValue = JsonSerializer.Deserialize(ref reader, options); variantNameValue = propertyName; @@ -550,6 +555,9 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "dis_max": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery)value.Variant, options); break; + case "distance_feature": + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); + break; case "exists": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, options); break; @@ -565,9 +573,6 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "geo_distance": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery)value.Variant, options); break; - case "geo_polygon": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery)value.Variant, options); - break; case "has_child": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery)value.Variant, options); break; @@ -626,7 +631,7 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery)value.Variant, options); break; case "range": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.RangeQuery)value.Variant, options); + JsonSerializer.Serialize(writer, value.Variant, value.Variant.GetType(), options); break; case "rank_feature": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery)value.Variant, options); @@ -637,7 +642,7 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "regexp": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery)value.Variant, options); break; - case "rule_query": + case "rule": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery)value.Variant, options); break; case "script": @@ -745,6 +750,9 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor ConstantScore(Action> configure) => Set(configure, "constant_score"); public QueryDescriptor DisMax(Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); public QueryDescriptor DisMax(Action> configure) => Set(configure, "dis_max"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); public QueryDescriptor Exists(Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery existsQuery) => Set(existsQuery, "exists"); public QueryDescriptor Exists(Action> configure) => Set(configure, "exists"); public QueryDescriptor FunctionScore(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); @@ -755,8 +763,6 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor GeoBoundingBox(Action> configure) => Set(configure, "geo_bounding_box"); public QueryDescriptor GeoDistance(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); public QueryDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); - public QueryDescriptor GeoPolygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); - public QueryDescriptor GeoPolygon(Action> configure) => Set(configure, "geo_polygon"); public QueryDescriptor HasChild(Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); public QueryDescriptor HasChild(Action> configure) => Set(configure, "has_child"); public QueryDescriptor HasParent(Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); @@ -795,14 +801,17 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); public QueryDescriptor QueryString(Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); public QueryDescriptor QueryString(Action> configure) => Set(configure, "query_string"); - public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery rangeQuery) => Set(rangeQuery, "range"); public QueryDescriptor RankFeature(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery rankFeatureQuery) => Set(rankFeatureQuery, "rank_feature"); public QueryDescriptor RankFeature(Action> configure) => Set(configure, "rank_feature"); public QueryDescriptor RawJson(Elastic.Clients.Elasticsearch.QueryDsl.RawJsonQuery rawJsonQuery) => Set(rawJsonQuery, "raw_json"); public QueryDescriptor Regexp(Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); public QueryDescriptor Regexp(Action> configure) => Set(configure, "regexp"); - public QueryDescriptor RuleQuery(Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); - public QueryDescriptor RuleQuery(Action> configure) => Set(configure, "rule_query"); + public QueryDescriptor Rule(Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule"); + public QueryDescriptor Rule(Action> configure) => Set(configure, "rule"); public QueryDescriptor Script(Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery scriptQuery) => Set(scriptQuery, "script"); public QueryDescriptor Script(Action configure) => Set(configure, "script"); public QueryDescriptor ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); @@ -903,6 +912,9 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor ConstantScore(Action configure) => Set(configure, "constant_score"); public QueryDescriptor DisMax(Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); public QueryDescriptor DisMax(Action configure) => Set(configure, "dis_max"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); + public QueryDescriptor DistanceFeature(Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery distanceFeatureQuery) => Set(distanceFeatureQuery, "distance_feature"); public QueryDescriptor Exists(Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery existsQuery) => Set(existsQuery, "exists"); public QueryDescriptor Exists(Action configure) => Set(configure, "exists"); public QueryDescriptor FunctionScore(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); @@ -913,8 +925,6 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor GeoBoundingBox(Action configure) => Set(configure, "geo_bounding_box"); public QueryDescriptor GeoDistance(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); public QueryDescriptor GeoDistance(Action configure) => Set(configure, "geo_distance"); - public QueryDescriptor GeoPolygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); - public QueryDescriptor GeoPolygon(Action configure) => Set(configure, "geo_polygon"); public QueryDescriptor HasChild(Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); public QueryDescriptor HasChild(Action configure) => Set(configure, "has_child"); public QueryDescriptor HasParent(Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); @@ -953,14 +963,17 @@ private QueryDescriptor Set(object variant, string variantName) public QueryDescriptor Prefix(Action configure) => Set(configure, "prefix"); public QueryDescriptor QueryString(Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); public QueryDescriptor QueryString(Action configure) => Set(configure, "query_string"); - public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery rangeQuery) => Set(rangeQuery, "range"); public QueryDescriptor RankFeature(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery rankFeatureQuery) => Set(rankFeatureQuery, "rank_feature"); public QueryDescriptor RankFeature(Action configure) => Set(configure, "rank_feature"); public QueryDescriptor RawJson(Elastic.Clients.Elasticsearch.QueryDsl.RawJsonQuery rawJsonQuery) => Set(rawJsonQuery, "raw_json"); public QueryDescriptor Regexp(Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); public QueryDescriptor Regexp(Action configure) => Set(configure, "regexp"); - public QueryDescriptor RuleQuery(Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); - public QueryDescriptor RuleQuery(Action configure) => Set(configure, "rule_query"); + public QueryDescriptor Rule(Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule"); + public QueryDescriptor Rule(Action configure) => Set(configure, "rule"); public QueryDescriptor Script(Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery scriptQuery) => Set(scriptQuery, "script"); public QueryDescriptor Script(Action configure) => Set(configure, "script"); public QueryDescriptor ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs index 4a1ec43bb88..af6daf97bd6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs @@ -40,10 +40,10 @@ public sealed partial class RuleQuery public Elastic.Clients.Elasticsearch.QueryDsl.Query Organic { get; set; } [JsonInclude, JsonPropertyName("_name")] public string? QueryName { get; set; } - [JsonInclude, JsonPropertyName("ruleset_id")] - public Elastic.Clients.Elasticsearch.Id RulesetId { get; set; } + [JsonInclude, JsonPropertyName("ruleset_ids")] + public ICollection RulesetIds { get; set; } - public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(RuleQuery ruleQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.RuleQuery(ruleQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(RuleQuery ruleQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Rule(ruleQuery); } public sealed partial class RuleQueryDescriptor : SerializableDescriptor> @@ -60,7 +60,7 @@ public RuleQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor OrganicDescriptor { get; set; } private Action> OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.Id RulesetIdValue { get; set; } + private ICollection RulesetIdsValue { get; set; } /// /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
@@ -107,9 +107,9 @@ public RuleQueryDescriptor QueryName(string? queryName) return Self; } - public RuleQueryDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) + public RuleQueryDescriptor RulesetIds(ICollection rulesetIds) { - RulesetIdValue = rulesetId; + RulesetIdsValue = rulesetIds; return Self; } @@ -146,8 +146,8 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - writer.WritePropertyName("ruleset_id"); - JsonSerializer.Serialize(writer, RulesetIdValue, options); + writer.WritePropertyName("ruleset_ids"); + JsonSerializer.Serialize(writer, RulesetIdsValue, options); writer.WriteEndObject(); } } @@ -166,7 +166,7 @@ public RuleQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor OrganicDescriptor { get; set; } private Action OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.Id RulesetIdValue { get; set; } + private ICollection RulesetIdsValue { get; set; } /// /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
@@ -213,9 +213,9 @@ public RuleQueryDescriptor QueryName(string? queryName) return Self; } - public RuleQueryDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) + public RuleQueryDescriptor RulesetIds(ICollection rulesetIds) { - RulesetIdValue = rulesetId; + RulesetIdsValue = rulesetIds; return Self; } @@ -252,8 +252,8 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - writer.WritePropertyName("ruleset_id"); - JsonSerializer.Serialize(writer, RulesetIdValue, options); + writer.WritePropertyName("ruleset_ids"); + JsonSerializer.Serialize(writer, RulesetIdsValue, options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs new file mode 100644 index 00000000000..9f1bae14a88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs @@ -0,0 +1,566 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +internal sealed partial class TermRangeQueryConverter : JsonConverter +{ + public override TermRangeQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new TermRangeQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gt") + { + variant.Gt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gte") + { + variant.Gte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lt") + { + variant.Lt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lte") + { + variant.Lte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "relation") + { + variant.Relation = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to") + { + variant.To = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, TermRangeQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize TermRangeQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (!string.IsNullOrEmpty(value.From)) + { + writer.WritePropertyName("from"); + writer.WriteStringValue(value.From); + } + + if (!string.IsNullOrEmpty(value.Gt)) + { + writer.WritePropertyName("gt"); + writer.WriteStringValue(value.Gt); + } + + if (!string.IsNullOrEmpty(value.Gte)) + { + writer.WritePropertyName("gte"); + writer.WriteStringValue(value.Gte); + } + + if (!string.IsNullOrEmpty(value.Lt)) + { + writer.WritePropertyName("lt"); + writer.WriteStringValue(value.Lt); + } + + if (!string.IsNullOrEmpty(value.Lte)) + { + writer.WritePropertyName("lte"); + writer.WriteStringValue(value.Lte); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } + + if (!string.IsNullOrEmpty(value.To)) + { + writer.WritePropertyName("to"); + writer.WriteStringValue(value.To); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(TermRangeQueryConverter))] +public sealed partial class TermRangeQuery +{ + public TermRangeQuery(Elastic.Clients.Elasticsearch.Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + public string? From { get; set; } + + /// + /// Greater than. + /// + public string? Gt { get; set; } + + /// + /// Greater than or equal to. + /// + public string? Gte { get; set; } + + /// + /// Less than. + /// + public string? Lt { get; set; } + + /// + /// Less than or equal to. + /// + public string? Lte { get; set; } + public string? QueryName { get; set; } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? Relation { get; set; } + public string? To { get; set; } +} + +public sealed partial class TermRangeQueryDescriptor : SerializableDescriptor> +{ + internal TermRangeQueryDescriptor(Action> configure) => configure.Invoke(this); + + public TermRangeQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? FromValue { get; set; } + private string? GtValue { get; set; } + private string? GteValue { get; set; } + private string? LtValue { get; set; } + private string? LteValue { get; set; } + private string? QueryNameValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? ToValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public TermRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TermRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor From(string? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public TermRangeQueryDescriptor Gt(string? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public TermRangeQueryDescriptor Gte(string? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public TermRangeQueryDescriptor Lt(string? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public TermRangeQueryDescriptor Lte(string? lte) + { + LteValue = lte; + return Self; + } + + public TermRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public TermRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + public TermRangeQueryDescriptor To(string? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(FromValue)) + { + writer.WritePropertyName("from"); + writer.WriteStringValue(FromValue); + } + + if (!string.IsNullOrEmpty(GtValue)) + { + writer.WritePropertyName("gt"); + writer.WriteStringValue(GtValue); + } + + if (!string.IsNullOrEmpty(GteValue)) + { + writer.WritePropertyName("gte"); + writer.WriteStringValue(GteValue); + } + + if (!string.IsNullOrEmpty(LtValue)) + { + writer.WritePropertyName("lt"); + writer.WriteStringValue(LtValue); + } + + if (!string.IsNullOrEmpty(LteValue)) + { + writer.WritePropertyName("lte"); + writer.WriteStringValue(LteValue); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (!string.IsNullOrEmpty(ToValue)) + { + writer.WritePropertyName("to"); + writer.WriteStringValue(ToValue); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class TermRangeQueryDescriptor : SerializableDescriptor +{ + internal TermRangeQueryDescriptor(Action configure) => configure.Invoke(this); + + public TermRangeQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? FromValue { get; set; } + private string? GtValue { get; set; } + private string? GteValue { get; set; } + private string? LtValue { get; set; } + private string? LteValue { get; set; } + private string? QueryNameValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? ToValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public TermRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public TermRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public TermRangeQueryDescriptor From(string? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public TermRangeQueryDescriptor Gt(string? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public TermRangeQueryDescriptor Gte(string? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public TermRangeQueryDescriptor Lt(string? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public TermRangeQueryDescriptor Lte(string? lte) + { + LteValue = lte; + return Self; + } + + public TermRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public TermRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + public TermRangeQueryDescriptor To(string? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(FromValue)) + { + writer.WritePropertyName("from"); + writer.WriteStringValue(FromValue); + } + + if (!string.IsNullOrEmpty(GtValue)) + { + writer.WritePropertyName("gt"); + writer.WriteStringValue(GtValue); + } + + if (!string.IsNullOrEmpty(GteValue)) + { + writer.WritePropertyName("gte"); + writer.WriteStringValue(GteValue); + } + + if (!string.IsNullOrEmpty(LtValue)) + { + writer.WritePropertyName("lt"); + writer.WriteStringValue(LtValue); + } + + if (!string.IsNullOrEmpty(LteValue)) + { + writer.WritePropertyName("lte"); + writer.WriteStringValue(LteValue); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (!string.IsNullOrEmpty(ToValue)) + { + writer.WritePropertyName("to"); + writer.WriteStringValue(ToValue); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs index cccaea2d829..f2708c15610 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs @@ -53,7 +53,7 @@ public override TermsQuery Read(ref Utf8JsonReader reader, Type typeToConvert, J variant.Field = property; reader.Read(); - variant.Terms = JsonSerializer.Deserialize(ref reader, options); + variant.Term = JsonSerializer.Deserialize(ref reader, options); } } @@ -63,7 +63,7 @@ public override TermsQuery Read(ref Utf8JsonReader reader, Type typeToConvert, J public override void Write(Utf8JsonWriter writer, TermsQuery value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.Field is not null && value.Terms is not null) + if (value.Field is not null && value.Term is not null) { if (!options.TryGetClientSettings(out var settings)) { @@ -72,7 +72,7 @@ public override void Write(Utf8JsonWriter writer, TermsQuery value, JsonSerializ var propertyName = settings.Inferrer.Field(value.Field); writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, value.Terms, options); + JsonSerializer.Serialize(writer, value.Term, options); } if (value.Boost.HasValue) @@ -100,7 +100,7 @@ public sealed partial class TermsQuery public float? Boost { get; set; } public Elastic.Clients.Elasticsearch.Field Field { get; set; } public string? QueryName { get; set; } - public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Terms { get; set; } + public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Term { get; set; } public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(TermsQuery termsQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Terms(termsQuery); } @@ -116,7 +116,7 @@ public TermsQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField TermValue { get; set; } /// /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
@@ -151,20 +151,20 @@ public TermsQueryDescriptor QueryName(string? queryName) return Self; } - public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField terms) + public TermsQueryDescriptor Term(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField term) { - TermsValue = terms; + TermValue = term; return Self; } protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (FieldValue is not null && TermsValue is not null) + if (FieldValue is not null && TermValue is not null) { var propertyName = settings.Inferrer.Field(FieldValue); writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, TermsValue, options); + JsonSerializer.Serialize(writer, TermValue, options); } if (BoostValue.HasValue) @@ -194,7 +194,7 @@ public TermsQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField TermValue { get; set; } /// /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
@@ -229,20 +229,20 @@ public TermsQueryDescriptor QueryName(string? queryName) return Self; } - public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField terms) + public TermsQueryDescriptor Term(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField term) { - TermsValue = terms; + TermValue = term; return Self; } protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (FieldValue is not null && TermsValue is not null) + if (FieldValue is not null && TermValue is not null) { var propertyName = settings.Inferrer.Field(FieldValue); writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, TermsValue, options); + JsonSerializer.Serialize(writer, TermValue, options); } if (BoostValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs new file mode 100644 index 00000000000..57d2218ab8f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs @@ -0,0 +1,222 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +internal sealed partial class UntypedDecayFunctionConverter : JsonConverter +{ + public override UntypedDecayFunction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new UntypedDecayFunction(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "multi_value_mode") + { + variant.MultiValueMode = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + variant.Field = property; + reader.Read(); + variant.Placement = JsonSerializer.Deserialize(ref reader, options); + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, UntypedDecayFunction value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Field is not null && value.Placement is not null) + { + if (!options.TryGetClientSettings(out var settings)) + { + ThrowHelper.ThrowJsonExceptionForMissingSettings(); + } + + var propertyName = settings.Inferrer.Field(value.Field); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, value.Placement, options); + } + + if (value.MultiValueMode is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, value.MultiValueMode, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(UntypedDecayFunctionConverter))] +public sealed partial class UntypedDecayFunction +{ + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueMode { get; set; } + public object Placement { get; set; } +} + +public sealed partial class UntypedDecayFunctionDescriptor : SerializableDescriptor> +{ + internal UntypedDecayFunctionDescriptor(Action> configure) => configure.Invoke(this); + + public UntypedDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private object PlacementValue { get; set; } + + public UntypedDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public UntypedDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UntypedDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public UntypedDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public UntypedDecayFunctionDescriptor Placement(object placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UntypedDecayFunctionDescriptor : SerializableDescriptor +{ + internal UntypedDecayFunctionDescriptor(Action configure) => configure.Invoke(this); + + public UntypedDecayFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? MultiValueModeValue { get; set; } + private object PlacementValue { get; set; } + + public UntypedDecayFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public UntypedDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UntypedDecayFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Determines how the distance is calculated when a field used for computing the decay contains multiple values. + /// + public UntypedDecayFunctionDescriptor MultiValueMode(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? multiValueMode) + { + MultiValueModeValue = multiValueMode; + return Self; + } + + public UntypedDecayFunctionDescriptor Placement(object placement) + { + PlacementValue = placement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FieldValue is not null && PlacementValue is not null) + { + var propertyName = settings.Inferrer.Field(FieldValue); + writer.WritePropertyName(propertyName); + JsonSerializer.Serialize(writer, PlacementValue, options); + } + + if (MultiValueModeValue is not null) + { + writer.WritePropertyName("multi_value_mode"); + JsonSerializer.Serialize(writer, MultiValueModeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs new file mode 100644 index 00000000000..d0c3928421f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs @@ -0,0 +1,255 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +public sealed partial class UntypedDistanceFeatureQuery +{ + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ [JsonInclude, JsonPropertyName("boost")] + public float? Boost { get; set; } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ [JsonInclude, JsonPropertyName("origin")] + public object Origin { get; set; } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public object Pivot { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } +} + +public sealed partial class UntypedDistanceFeatureQueryDescriptor : SerializableDescriptor> +{ + internal UntypedDistanceFeatureQueryDescriptor(Action> configure) => configure.Invoke(this); + + public UntypedDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private object OriginValue { get; set; } + private object PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Origin(object origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Pivot(object pivot) + { + PivotValue = pivot; + return Self; + } + + public UntypedDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UntypedDistanceFeatureQueryDescriptor : SerializableDescriptor +{ + internal UntypedDistanceFeatureQueryDescriptor(Action configure) => configure.Invoke(this); + + public UntypedDistanceFeatureQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private object OriginValue { get; set; } + private object PivotValue { get; set; } + private string? QueryNameValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Name of the field used to calculate distances. This field must meet the following criteria:
be a `date`, `date_nanos` or `geo_point` field;
have an `index` mapping parameter value of `true`, which is the default;
have an `doc_values` mapping parameter value of `true`, which is the default.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date or point of origin used to calculate distances.
If the `field` value is a `date` or `date_nanos` field, the `origin` value must be a date.
Date Math, such as `now-1h`, is supported.
If the field value is a `geo_point` field, the `origin` value must be a geopoint.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Origin(object origin) + { + OriginValue = origin; + return Self; + } + + /// + /// Distance from the `origin` at which relevance scores receive half of the `boost` value.
If the `field` value is a `date` or `date_nanos` field, the `pivot` value must be a time unit, such as `1h` or `10d`. If the `field` value is a `geo_point` field, the `pivot` value must be a distance unit, such as `1km` or `12m`.
+ ///
+ public UntypedDistanceFeatureQueryDescriptor Pivot(object pivot) + { + PivotValue = pivot; + return Self; + } + + public UntypedDistanceFeatureQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("origin"); + JsonSerializer.Serialize(writer, OriginValue, options); + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs new file mode 100644 index 00000000000..74f784dc5bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs @@ -0,0 +1,664 @@ +// 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 Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +internal sealed partial class UntypedRangeQueryConverter : JsonConverter +{ + public override UntypedRangeQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + reader.Read(); + var fieldName = reader.GetString(); + reader.Read(); + var variant = new UntypedRangeQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "format") + { + variant.Format = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from") + { + variant.From = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gt") + { + variant.Gt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "gte") + { + variant.Gte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lt") + { + variant.Lt = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lte") + { + variant.Lte = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "relation") + { + variant.Relation = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "time_zone") + { + variant.TimeZone = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to") + { + variant.To = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, UntypedRangeQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize UntypedRangeQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } + + if (value.From is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, value.From, options); + } + + if (value.Gt is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, value.Gt, options); + } + + if (value.Gte is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, value.Gte, options); + } + + if (value.Lt is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, value.Lt, options); + } + + if (value.Lte is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, value.Lte, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } + + if (!string.IsNullOrEmpty(value.TimeZone)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(value.TimeZone); + } + + if (value.To is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, value.To, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(UntypedRangeQueryConverter))] +public sealed partial class UntypedRangeQuery +{ + public UntypedRangeQuery(Elastic.Clients.Elasticsearch.Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Date format used to convert `date` values in the query. + /// + public string? Format { get; set; } + public object? From { get; set; } + + /// + /// Greater than. + /// + public object? Gt { get; set; } + + /// + /// Greater than or equal to. + /// + public object? Gte { get; set; } + + /// + /// Less than. + /// + public object? Lt { get; set; } + + /// + /// Less than or equal to. + /// + public object? Lte { get; set; } + public string? QueryName { get; set; } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? Relation { get; set; } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public string? TimeZone { get; set; } + public object? To { get; set; } +} + +public sealed partial class UntypedRangeQueryDescriptor : SerializableDescriptor> +{ + internal UntypedRangeQueryDescriptor(Action> configure) => configure.Invoke(this); + + public UntypedRangeQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + private object? FromValue { get; set; } + private object? GtValue { get; set; } + private object? GteValue { get; set; } + private object? LtValue { get; set; } + private object? LteValue { get; set; } + private string? QueryNameValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? TimeZoneValue { get; set; } + private object? ToValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public UntypedRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date format used to convert `date` values in the query. + /// + public UntypedRangeQueryDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public UntypedRangeQueryDescriptor From(object? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public UntypedRangeQueryDescriptor Gt(object? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public UntypedRangeQueryDescriptor Gte(object? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public UntypedRangeQueryDescriptor Lt(object? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public UntypedRangeQueryDescriptor Lte(object? lte) + { + LteValue = lte; + return Self; + } + + public UntypedRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public UntypedRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public UntypedRangeQueryDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public UntypedRangeQueryDescriptor To(object? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (FromValue is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, FromValue, options); + } + + if (GtValue is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, GtValue, options); + } + + if (GteValue is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, GteValue, options); + } + + if (LtValue is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, LtValue, options); + } + + if (LteValue is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, LteValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + if (ToValue is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, ToValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class UntypedRangeQueryDescriptor : SerializableDescriptor +{ + internal UntypedRangeQueryDescriptor(Action configure) => configure.Invoke(this); + + public UntypedRangeQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? FormatValue { get; set; } + private object? FromValue { get; set; } + private object? GtValue { get; set; } + private object? GteValue { get; set; } + private object? LtValue { get; set; } + private object? LteValue { get; set; } + private string? QueryNameValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? RelationValue { get; set; } + private string? TimeZoneValue { get; set; } + private object? ToValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public UntypedRangeQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public UntypedRangeQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Date format used to convert `date` values in the query. + /// + public UntypedRangeQueryDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public UntypedRangeQueryDescriptor From(object? from) + { + FromValue = from; + return Self; + } + + /// + /// Greater than. + /// + public UntypedRangeQueryDescriptor Gt(object? gt) + { + GtValue = gt; + return Self; + } + + /// + /// Greater than or equal to. + /// + public UntypedRangeQueryDescriptor Gte(object? gte) + { + GteValue = gte; + return Self; + } + + /// + /// Less than. + /// + public UntypedRangeQueryDescriptor Lt(object? lt) + { + LtValue = lt; + return Self; + } + + /// + /// Less than or equal to. + /// + public UntypedRangeQueryDescriptor Lte(object? lte) + { + LteValue = lte; + return Self; + } + + public UntypedRangeQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// Indicates how the range query matches values for `range` fields. + /// + public UntypedRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? relation) + { + RelationValue = relation; + return Self; + } + + /// + /// Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC. + /// + public UntypedRangeQueryDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public UntypedRangeQueryDescriptor To(object? to) + { + ToValue = to; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + if (FieldValue is null) + throw new JsonException("Unable to serialize field name query descriptor with a null field. Ensure you use a suitable descriptor constructor or call the Field method, passing a non-null value for the field argument."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(FieldValue)); + writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (FromValue is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, FromValue, options); + } + + if (GtValue is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, GtValue, options); + } + + if (GteValue is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, GteValue, options); + } + + if (LtValue is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, LtValue, options); + } + + if (LteValue is not null) + { + writer.WritePropertyName("lte"); + JsonSerializer.Serialize(writer, LteValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + if (RelationValue is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, RelationValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + if (ToValue is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, ToValue, options); + } + + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.g.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRule.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.g.cs index 878c42c5a54..9ddf4641093 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRule.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.g.cs @@ -25,18 +25,18 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; public sealed partial class QueryRule { [JsonInclude, JsonPropertyName("actions")] - public Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActions Actions { get; set; } + public Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions Actions { get; set; } [JsonInclude, JsonPropertyName("criteria")] - public ICollection Criteria { get; set; } + public ICollection Criteria { get; set; } [JsonInclude, JsonPropertyName("rule_id")] public Elastic.Clients.Elasticsearch.Id RuleId { get; set; } [JsonInclude, JsonPropertyName("type")] - public Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleType Type { get; set; } + public Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType Type { get; set; } } public sealed partial class QueryRuleDescriptor : SerializableDescriptor @@ -47,17 +47,17 @@ public QueryRuleDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActions ActionsValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActionsDescriptor ActionsDescriptor { get; set; } - private Action ActionsDescriptorAction { get; set; } - private ICollection CriteriaValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaDescriptor CriteriaDescriptor { get; set; } - private Action CriteriaDescriptorAction { get; set; } - private Action[] CriteriaDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActionsDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private ICollection CriteriaValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaDescriptor CriteriaDescriptor { get; set; } + private Action CriteriaDescriptorAction { get; set; } + private Action[] CriteriaDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Id RuleIdValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleType TypeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType TypeValue { get; set; } - public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActions actions) + public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions actions) { ActionsDescriptor = null; ActionsDescriptorAction = null; @@ -65,7 +65,7 @@ public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.QueryRuleset.Qu return Self; } - public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActionsDescriptor descriptor) + public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActionsDescriptor descriptor) { ActionsValue = null; ActionsDescriptorAction = null; @@ -73,7 +73,7 @@ public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.QueryRuleset.Qu return Self; } - public QueryRuleDescriptor Actions(Action configure) + public QueryRuleDescriptor Actions(Action configure) { ActionsValue = null; ActionsDescriptor = null; @@ -81,7 +81,7 @@ public QueryRuleDescriptor Actions(Action criteria) + public QueryRuleDescriptor Criteria(ICollection criteria) { CriteriaDescriptor = null; CriteriaDescriptorAction = null; @@ -90,7 +90,7 @@ public QueryRuleDescriptor Criteria(ICollection configure) + public QueryRuleDescriptor Criteria(Action configure) { CriteriaValue = null; CriteriaDescriptor = null; @@ -108,7 +108,7 @@ public QueryRuleDescriptor Criteria(Action[] configure) + public QueryRuleDescriptor Criteria(params Action[] configure) { CriteriaValue = null; CriteriaDescriptor = null; @@ -123,7 +123,7 @@ public QueryRuleDescriptor RuleId(Elastic.Clients.Elasticsearch.Id ruleId) return Self; } - public QueryRuleDescriptor Type(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleType type) + public QueryRuleDescriptor Type(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType type) { TypeValue = type; return Self; @@ -140,7 +140,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ActionsDescriptorAction is not null) { writer.WritePropertyName("actions"); - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActionsDescriptor(ActionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActionsDescriptor(ActionsDescriptorAction), options); } else { @@ -159,7 +159,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("criteria"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaDescriptor(CriteriaDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaDescriptor(CriteriaDescriptorAction), options); writer.WriteEndArray(); } else if (CriteriaDescriptorActions is not null) @@ -168,7 +168,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in CriteriaDescriptorActions) { - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleActions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.g.cs similarity index 98% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleActions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.g.cs index 9eea979c195..b8db32502f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleActions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; public sealed partial class QueryRuleActions { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleCriteria.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleCriteria.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs index 05b88647b75..f29c12c6a80 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleCriteria.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs @@ -25,14 +25,14 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; public sealed partial class QueryRuleCriteria { [JsonInclude, JsonPropertyName("metadata")] - public string Metadata { get; set; } + public string? Metadata { get; set; } [JsonInclude, JsonPropertyName("type")] - public Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaType Type { get; set; } + public Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType Type { get; set; } [JsonInclude, JsonPropertyName("values")] public ICollection? Values { get; set; } } @@ -45,17 +45,17 @@ public QueryRuleCriteriaDescriptor() : base() { } - private string MetadataValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaType TypeValue { get; set; } + private string? MetadataValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType TypeValue { get; set; } private ICollection? ValuesValue { get; set; } - public QueryRuleCriteriaDescriptor Metadata(string metadata) + public QueryRuleCriteriaDescriptor Metadata(string? metadata) { MetadataValue = metadata; return Self; } - public QueryRuleCriteriaDescriptor Type(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaType type) + public QueryRuleCriteriaDescriptor Type(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaType type) { TypeValue = type; return Self; @@ -70,8 +70,12 @@ public QueryRuleCriteriaDescriptor Values(ICollection? values) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("metadata"); - writer.WriteStringValue(MetadataValue); + if (!string.IsNullOrEmpty(MetadataValue)) + { + writer.WritePropertyName("metadata"); + writer.WriteStringValue(MetadataValue); + } + writer.WritePropertyName("type"); JsonSerializer.Serialize(writer, TypeValue, options); if (ValuesValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRulesetListItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRulesetListItem.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs index e42e31365e2..dca222d0ba1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRulesetListItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs @@ -25,19 +25,25 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRuleset; +namespace Elastic.Clients.Elasticsearch.QueryRules; public sealed partial class QueryRulesetListItem { /// - /// The number of rules associated with this ruleset + /// A map of criteria type to the number of rules of that type /// - [JsonInclude, JsonPropertyName("rules_count")] - public int RulesCount { get; init; } + [JsonInclude, JsonPropertyName("rule_criteria_types_counts")] + public IReadOnlyDictionary RuleCriteriaTypesCounts { get; init; } /// /// Ruleset unique identifier /// [JsonInclude, JsonPropertyName("ruleset_id")] public string RulesetId { get; init; } + + /// + /// The number of rules associated with this ruleset + /// + [JsonInclude, JsonPropertyName("rule_total_count")] + public int RuleTotalCount { get; init; } } \ No newline at end of file