diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/Fields.cs b/src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/Fields.cs index 9d7ab4e5e85..3a403a07978 100644 --- a/src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/Fields.cs +++ b/src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/Fields.cs @@ -15,32 +15,28 @@ namespace Elastic.Clients.Elasticsearch; -// TODO - Converter - internal sealed class FieldsConverter : JsonConverter { public override Fields? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - reader.Read(); - - if (reader.TokenType != JsonTokenType.StartArray) + if (reader.TokenType == JsonTokenType.String) { - return null; + Fields fields = reader.GetString(); + return fields; } - - var fields = new List(); - while (reader.Read()) + else if (reader.TokenType == JsonTokenType.StartArray) { - if (reader.TokenType == JsonTokenType.EndArray) - break; - - var field = JsonSerializer.Deserialize(ref reader, typeof(Field), options); - - if (field is Field f) - fields.Add(f); + var fields = new List(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + var field = JsonSerializer.Deserialize(ref reader, options); + fields.Add(field); + } + return new Fields(fields); } - return new Fields(fields); + reader.Read(); + return null; } public override void Write(Utf8JsonWriter writer, Fields value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Indices/Indices.cs b/src/Elastic.Clients.Elasticsearch/Common/Infer/Indices/Indices.cs index 0517b9e1be4..e0be1f16f60 100644 --- a/src/Elastic.Clients.Elasticsearch/Common/Infer/Indices/Indices.cs +++ b/src/Elastic.Clients.Elasticsearch/Common/Infer/Indices/Indices.cs @@ -22,6 +22,8 @@ internal Indices(ManyIndices indices) : base(indices) { } internal Indices(IEnumerable indices) : base(new ManyIndices(indices)) { } + internal Indices(IEnumerable indices) : base(new ManyIndices(indices)) { } + /// All indices. Represents _all public static Indices All { get; } = new Indices(new AllIndicesMarker()); @@ -153,6 +155,16 @@ internal sealed class IndicesJsonConverter : JsonConverter Indices indices = reader.GetString(); return indices; } + else if (reader.TokenType == JsonTokenType.StartArray) + { + var indices = new List(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + var index = reader.GetString(); + indices.Add(index); + } + return new Indices(indices); + } reader.Read(); return null; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs index 3111f005ed5..e320b4c2ba6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs @@ -32,6 +32,11 @@ internal static class ApiUrlsLookups internal static ApiUrls NoNamespaceCount = new ApiUrls(new[] { "/_count", "/{index}/_count" }); internal static ApiUrls NoNamespaceCreate = new ApiUrls(new[] { "/{index}/_create/{id}" }); internal static ApiUrls NoNamespaceDelete = new ApiUrls(new[] { "/{index}/_doc/{id}" }); + internal static ApiUrls EnrichDeletePolicy = new ApiUrls(new[] { "/_enrich/policy/{name}" }); + internal static ApiUrls EnrichExecutePolicy = new ApiUrls(new[] { "/_enrich/policy/{name}/_execute" }); + internal static ApiUrls EnrichGetPolicy = new ApiUrls(new[] { "/_enrich/policy/{name}", "/_enrich/policy" }); + internal static ApiUrls EnrichPutPolicy = new ApiUrls(new[] { "/_enrich/policy/{name}" }); + internal static ApiUrls EnrichStats = new ApiUrls(new[] { "/_enrich/_stats" }); internal static ApiUrls EqlDelete = new ApiUrls(new[] { "/_eql/search/{id}" }); internal static ApiUrls EqlGetStatus = new ApiUrls(new[] { "/_eql/search/status/{id}" }); internal static ApiUrls EqlSearch = new ApiUrls(new[] { "/{index}/_eql/search" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichDeletePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichDeletePolicyRequest.g.cs new file mode 100644 index 00000000000..bf04584d6c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichDeletePolicyRequest.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public class EnrichDeletePolicyRequestParameters : RequestParameters + { + } + + public partial class EnrichDeletePolicyRequest : PlainRequestBase + { + public EnrichDeletePolicyRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichDeletePolicy; + protected override HttpMethod HttpMethod => HttpMethod.DELETE; + protected override bool SupportsBody => false; + } + + public sealed partial class EnrichDeletePolicyRequestDescriptor : RequestDescriptorBase + { + internal EnrichDeletePolicyRequestDescriptor(Action configure) => configure.Invoke(this); + public EnrichDeletePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal EnrichDeletePolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichDeletePolicy; + protected override HttpMethod HttpMethod => HttpMethod.DELETE; + protected override bool SupportsBody => false; + public EnrichDeletePolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + 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/_Generated/Api/Enrich/EnrichDeletePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichDeletePolicyResponse.g.cs new file mode 100644 index 00000000000..020a812a886 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichDeletePolicyResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public partial class EnrichDeletePolicyResponse : ElasticsearchResponseBase + { + [JsonInclude] + [JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichExecutePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichExecutePolicyRequest.g.cs new file mode 100644 index 00000000000..b52a7e901bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichExecutePolicyRequest.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public class EnrichExecutePolicyRequestParameters : RequestParameters + { + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + } + + public partial class EnrichExecutePolicyRequest : PlainRequestBase + { + public EnrichExecutePolicyRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichExecutePolicy; + protected override HttpMethod HttpMethod => HttpMethod.PUT; + protected override bool SupportsBody => false; + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + } + + public sealed partial class EnrichExecutePolicyRequestDescriptor : RequestDescriptorBase + { + internal EnrichExecutePolicyRequestDescriptor(Action configure) => configure.Invoke(this); + public EnrichExecutePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal EnrichExecutePolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichExecutePolicy; + protected override HttpMethod HttpMethod => HttpMethod.PUT; + protected override bool SupportsBody => false; + public EnrichExecutePolicyRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + public EnrichExecutePolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + 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/_Generated/Api/Enrich/EnrichExecutePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichExecutePolicyResponse.g.cs new file mode 100644 index 00000000000..26e941b7455 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichExecutePolicyResponse.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. +// +// ------------------------------------------------ + +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public partial class EnrichExecutePolicyResponse : ElasticsearchResponseBase + { + [JsonInclude] + [JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Enrich.ExecutePolicy.ExecuteEnrichPolicyStatus Status { get; init; } + + [JsonInclude] + [JsonPropertyName("task_id")] + public Elastic.Clients.Elasticsearch.TaskId? TaskId { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichGetPolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichGetPolicyRequest.g.cs new file mode 100644 index 00000000000..1767eab0dd7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichGetPolicyRequest.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public class EnrichGetPolicyRequestParameters : RequestParameters + { + } + + public partial class EnrichGetPolicyRequest : PlainRequestBase + { + public EnrichGetPolicyRequest() + { + } + + public EnrichGetPolicyRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichGetPolicy; + protected override HttpMethod HttpMethod => HttpMethod.GET; + protected override bool SupportsBody => false; + } + + public sealed partial class EnrichGetPolicyRequestDescriptor : RequestDescriptorBase + { + internal EnrichGetPolicyRequestDescriptor(Action configure) => configure.Invoke(this); + public EnrichGetPolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichGetPolicy; + protected override HttpMethod HttpMethod => HttpMethod.GET; + protected override bool SupportsBody => false; + public EnrichGetPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names? name) + { + RouteValues.Optional("name", name); + 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/_Generated/Api/Enrich/EnrichGetPolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichGetPolicyResponse.g.cs new file mode 100644 index 00000000000..0057a65bb0d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichGetPolicyResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public partial class EnrichGetPolicyResponse : ElasticsearchResponseBase + { + [JsonInclude] + [JsonPropertyName("policies")] + public IReadOnlyCollection Policies { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichPutPolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichPutPolicyRequest.g.cs new file mode 100644 index 00000000000..5853df833cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichPutPolicyRequest.g.cs @@ -0,0 +1,287 @@ +// 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. +// +// ------------------------------------------------ + +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public class EnrichPutPolicyRequestParameters : RequestParameters + { + } + + public partial class EnrichPutPolicyRequest : PlainRequestBase + { + public EnrichPutPolicyRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichPutPolicy; + protected override HttpMethod HttpMethod => HttpMethod.PUT; + protected override bool SupportsBody => true; + [JsonInclude] + [JsonPropertyName("geo_match")] + public Elastic.Clients.Elasticsearch.Enrich.Policy? GeoMatch { get; set; } + + [JsonInclude] + [JsonPropertyName("match")] + public Elastic.Clients.Elasticsearch.Enrich.Policy? Match { get; set; } + } + + public sealed partial class EnrichPutPolicyRequestDescriptor : RequestDescriptorBase, EnrichPutPolicyRequestParameters> + { + internal EnrichPutPolicyRequestDescriptor(Action> configure) => configure.Invoke(this); + public EnrichPutPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal EnrichPutPolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichPutPolicy; + protected override HttpMethod HttpMethod => HttpMethod.PUT; + protected override bool SupportsBody => true; + public EnrichPutPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Enrich.Policy? GeoMatchValue { get; set; } + + private PolicyDescriptor GeoMatchDescriptor { get; set; } + + private Action> GeoMatchDescriptorAction { get; set; } + + private Elastic.Clients.Elasticsearch.Enrich.Policy? MatchValue { get; set; } + + private PolicyDescriptor MatchDescriptor { get; set; } + + private Action> MatchDescriptorAction { get; set; } + + public EnrichPutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Enrich.Policy? geoMatch) + { + GeoMatchDescriptor = null; + GeoMatchDescriptorAction = null; + GeoMatchValue = geoMatch; + return Self; + } + + public EnrichPutPolicyRequestDescriptor GeoMatch(Enrich.PolicyDescriptor descriptor) + { + GeoMatchValue = null; + GeoMatchDescriptorAction = null; + GeoMatchDescriptor = descriptor; + return Self; + } + + public EnrichPutPolicyRequestDescriptor GeoMatch(Action> configure) + { + GeoMatchValue = null; + GeoMatchDescriptorAction = null; + GeoMatchDescriptorAction = configure; + return Self; + } + + public EnrichPutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Enrich.Policy? match) + { + MatchDescriptor = null; + MatchDescriptorAction = null; + MatchValue = match; + return Self; + } + + public EnrichPutPolicyRequestDescriptor Match(Enrich.PolicyDescriptor descriptor) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptor = descriptor; + return Self; + } + + public EnrichPutPolicyRequestDescriptor Match(Action> configure) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (GeoMatchDescriptor is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, GeoMatchDescriptor, options); + } + else if (GeoMatchDescriptorAction is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, new Enrich.PolicyDescriptor(GeoMatchDescriptorAction), options); + } + else if (GeoMatchValue is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, GeoMatchValue, options); + } + + if (MatchDescriptor is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchDescriptor, options); + } + else if (MatchDescriptorAction is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, new Enrich.PolicyDescriptor(MatchDescriptorAction), options); + } + else if (MatchValue is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchValue, options); + } + + writer.WriteEndObject(); + } + } + + public sealed partial class EnrichPutPolicyRequestDescriptor : RequestDescriptorBase + { + internal EnrichPutPolicyRequestDescriptor(Action configure) => configure.Invoke(this); + public EnrichPutPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal EnrichPutPolicyRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichPutPolicy; + protected override HttpMethod HttpMethod => HttpMethod.PUT; + protected override bool SupportsBody => true; + public EnrichPutPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Enrich.Policy? GeoMatchValue { get; set; } + + private PolicyDescriptor GeoMatchDescriptor { get; set; } + + private Action GeoMatchDescriptorAction { get; set; } + + private Elastic.Clients.Elasticsearch.Enrich.Policy? MatchValue { get; set; } + + private PolicyDescriptor MatchDescriptor { get; set; } + + private Action MatchDescriptorAction { get; set; } + + public EnrichPutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Enrich.Policy? geoMatch) + { + GeoMatchDescriptor = null; + GeoMatchDescriptorAction = null; + GeoMatchValue = geoMatch; + return Self; + } + + public EnrichPutPolicyRequestDescriptor GeoMatch(Enrich.PolicyDescriptor descriptor) + { + GeoMatchValue = null; + GeoMatchDescriptorAction = null; + GeoMatchDescriptor = descriptor; + return Self; + } + + public EnrichPutPolicyRequestDescriptor GeoMatch(Action configure) + { + GeoMatchValue = null; + GeoMatchDescriptorAction = null; + GeoMatchDescriptorAction = configure; + return Self; + } + + public EnrichPutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Enrich.Policy? match) + { + MatchDescriptor = null; + MatchDescriptorAction = null; + MatchValue = match; + return Self; + } + + public EnrichPutPolicyRequestDescriptor Match(Enrich.PolicyDescriptor descriptor) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptor = descriptor; + return Self; + } + + public EnrichPutPolicyRequestDescriptor Match(Action configure) + { + MatchValue = null; + MatchDescriptorAction = null; + MatchDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (GeoMatchDescriptor is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, GeoMatchDescriptor, options); + } + else if (GeoMatchDescriptorAction is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, new Enrich.PolicyDescriptor(GeoMatchDescriptorAction), options); + } + else if (GeoMatchValue is not null) + { + writer.WritePropertyName("geo_match"); + JsonSerializer.Serialize(writer, GeoMatchValue, options); + } + + if (MatchDescriptor is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchDescriptor, options); + } + else if (MatchDescriptorAction is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, new Enrich.PolicyDescriptor(MatchDescriptorAction), options); + } + else if (MatchValue is not null) + { + writer.WritePropertyName("match"); + JsonSerializer.Serialize(writer, MatchValue, options); + } + + writer.WriteEndObject(); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichPutPolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichPutPolicyResponse.g.cs new file mode 100644 index 00000000000..560848bda97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichPutPolicyResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public partial class EnrichPutPolicyResponse : ElasticsearchResponseBase + { + [JsonInclude] + [JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.g.cs new file mode 100644 index 00000000000..084e174edab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public class EnrichStatsRequestParameters : RequestParameters + { + } + + public partial class EnrichStatsRequest : PlainRequestBase + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichStats; + protected override HttpMethod HttpMethod => HttpMethod.GET; + protected override bool SupportsBody => false; + } + + public sealed partial class EnrichStatsRequestDescriptor : RequestDescriptorBase + { + internal EnrichStatsRequestDescriptor(Action configure) => configure.Invoke(this); + public EnrichStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.EnrichStats; + protected override HttpMethod HttpMethod => HttpMethod.GET; + protected override bool SupportsBody => false; + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs new file mode 100644 index 00000000000..d2b56767a45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.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. +// +// ------------------------------------------------ + +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public partial class EnrichStatsResponse : ElasticsearchResponseBase + { + [JsonInclude] + [JsonPropertyName("cache_stats")] + public IReadOnlyCollection? CacheStats { get; init; } + + [JsonInclude] + [JsonPropertyName("coordinator_stats")] + public IReadOnlyCollection CoordinatorStats { get; init; } + + [JsonInclude] + [JsonPropertyName("executing_policies")] + public IReadOnlyCollection ExecutingPolicies { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs new file mode 100644 index 00000000000..c1ffe5360e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs @@ -0,0 +1,171 @@ +// 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. +// +// ------------------------------------------------ + +using System; +using System.Threading; +using System.Threading.Tasks; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public class EnrichNamespace : NamespacedClientProxy + { + internal EnrichNamespace(ElasticsearchClient client) : base(client) + { + } + + public EnrichDeletePolicyResponse DeletePolicy(EnrichDeletePolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public Task DeletePolicyAsync(EnrichDeletePolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public EnrichDeletePolicyResponse DeletePolicy(Elastic.Clients.Elasticsearch.Name name, Action configureRequest = null) + { + var descriptor = new EnrichDeletePolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + public Task DeletePolicyAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest = null, CancellationToken cancellationToken = default) + { + var descriptor = new EnrichDeletePolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor); + } + + public EnrichExecutePolicyResponse ExecutePolicy(EnrichExecutePolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public Task ExecutePolicyAsync(EnrichExecutePolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public EnrichExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch.Name name, Action configureRequest = null) + { + var descriptor = new EnrichExecutePolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + public Task ExecutePolicyAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest = null, CancellationToken cancellationToken = default) + { + var descriptor = new EnrichExecutePolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor); + } + + public EnrichGetPolicyResponse GetPolicy(EnrichGetPolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public Task GetPolicyAsync(EnrichGetPolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public EnrichGetPolicyResponse GetPolicy(Action configureRequest = null) + { + var descriptor = new EnrichGetPolicyRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + public Task GetPolicyAsync(Action configureRequest = null, CancellationToken cancellationToken = default) + { + var descriptor = new EnrichGetPolicyRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor); + } + + public EnrichPutPolicyResponse PutPolicy(EnrichPutPolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public Task PutPolicyAsync(EnrichPutPolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public EnrichPutPolicyResponse PutPolicy(Elastic.Clients.Elasticsearch.Name name, Action configureRequest = null) + { + var descriptor = new EnrichPutPolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + public Task PutPolicyAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest = null, CancellationToken cancellationToken = default) + { + var descriptor = new EnrichPutPolicyRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor); + } + + public EnrichStatsResponse Stats(EnrichStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public Task StatsAsync(EnrichStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public EnrichStatsResponse Stats(Action configureRequest = null) + { + var descriptor = new EnrichStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + public Task StatsAsync(Action configureRequest = null, CancellationToken cancellationToken = default) + { + var descriptor = new EnrichStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor); + } + } +} \ 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 50ef9ab56ce..7aef43912ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -17,6 +17,7 @@ using Elastic.Clients.Elasticsearch.AsyncSearch; using Elastic.Clients.Elasticsearch.Cluster; +using Elastic.Clients.Elasticsearch.Enrich; using Elastic.Clients.Elasticsearch.Eql; using Elastic.Clients.Elasticsearch.Graph; using Elastic.Clients.Elasticsearch.IndexManagement; @@ -35,6 +36,8 @@ public partial class ElasticsearchClient public ClusterNamespace Cluster { get; private set; } + public EnrichNamespace Enrich { get; private set; } + public EqlNamespace Eql { get; private set; } public GraphNamespace Graph { get; private set; } @@ -49,6 +52,7 @@ private partial void SetupNamespaces() { AsyncSearch = new AsyncSearchNamespace(this); Cluster = new ClusterNamespace(this); + Enrich = new EnrichNamespace(this); Eql = new EqlNamespace(this); Graph = new GraphNamespace(this); IndexManagement = new IndexManagementNamespace(this); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.g.cs new file mode 100644 index 00000000000..f9c83acc351 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich.Stats +{ + public partial class CacheStats + { + [JsonInclude] + [JsonPropertyName("count")] + public int Count { get; init; } + + [JsonInclude] + [JsonPropertyName("evictions")] + public int Evictions { get; init; } + + [JsonInclude] + [JsonPropertyName("hits")] + public int Hits { get; init; } + + [JsonInclude] + [JsonPropertyName("misses")] + public int Misses { get; init; } + + [JsonInclude] + [JsonPropertyName("node_id")] + public string NodeId { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Configuration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Configuration.g.cs new file mode 100644 index 00000000000..0bd49b70437 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Configuration.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public partial class Configuration + { + [JsonInclude] + [JsonPropertyName("geo_match")] + public Elastic.Clients.Elasticsearch.Enrich.Policy? GeoMatch { get; init; } + + [JsonInclude] + [JsonPropertyName("match")] + public Elastic.Clients.Elasticsearch.Enrich.Policy Match { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.g.cs new file mode 100644 index 00000000000..25b19a5ae17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich.Stats +{ + public partial class CoordinatorStats + { + [JsonInclude] + [JsonPropertyName("executed_searches_total")] + public long ExecutedSearchesTotal { get; init; } + + [JsonInclude] + [JsonPropertyName("node_id")] + public string NodeId { get; init; } + + [JsonInclude] + [JsonPropertyName("queue_size")] + public int QueueSize { get; init; } + + [JsonInclude] + [JsonPropertyName("remote_requests_current")] + public int RemoteRequestsCurrent { get; init; } + + [JsonInclude] + [JsonPropertyName("remote_requests_total")] + public long RemoteRequestsTotal { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs new file mode 100644 index 00000000000..31c9bf60440 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.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. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich.ExecutePolicy +{ + public partial class ExecuteEnrichPolicyStatus + { + [JsonInclude] + [JsonPropertyName("phase")] + public Elastic.Clients.Elasticsearch.Enrich.ExecutePolicy.EnrichPolicyPhase Phase { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.g.cs new file mode 100644 index 00000000000..9e7841074d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich.Stats +{ + public partial class ExecutingPolicy + { + [JsonInclude] + [JsonPropertyName("name")] + public string Name { get; init; } + + [JsonInclude] + [JsonPropertyName("task")] + public Elastic.Clients.Elasticsearch.Tasks.TaskInfo Task { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Policy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Policy.g.cs new file mode 100644 index 00000000000..d0217d306c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Policy.g.cs @@ -0,0 +1,229 @@ +// 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. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public partial class Policy + { + [JsonInclude] + [JsonPropertyName("enrich_fields")] + public Elastic.Clients.Elasticsearch.Fields EnrichFields { get; set; } + + [JsonInclude] + [JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Indices Indices { get; set; } + + [JsonInclude] + [JsonPropertyName("match_field")] + public Elastic.Clients.Elasticsearch.Field MatchField { get; set; } + + [JsonInclude] + [JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Name? Name { get; set; } + + [JsonInclude] + [JsonPropertyName("query")] + public string? Query { get; set; } + } + + public sealed partial class PolicyDescriptor : DescriptorBase> + { + internal PolicyDescriptor(Action> configure) => configure.Invoke(this); + public PolicyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Fields EnrichFieldsValue { get; set; } + + private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } + + private Elastic.Clients.Elasticsearch.Field MatchFieldValue { get; set; } + + private Elastic.Clients.Elasticsearch.Name? NameValue { get; set; } + + private string? QueryValue { get; set; } + + public PolicyDescriptor EnrichFields(Elastic.Clients.Elasticsearch.Fields enrichFields) + { + EnrichFieldsValue = enrichFields; + return Self; + } + + public PolicyDescriptor EnrichFields(Expression> enrichFields) + { + EnrichFieldsValue = enrichFields; + return Self; + } + + public PolicyDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + IndicesValue = indices; + return Self; + } + + public PolicyDescriptor MatchField(Elastic.Clients.Elasticsearch.Field matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public PolicyDescriptor MatchField(Expression> matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public PolicyDescriptor Name(Elastic.Clients.Elasticsearch.Name? name) + { + NameValue = name; + return Self; + } + + public PolicyDescriptor Query(string? query) + { + QueryValue = query; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("enrich_fields"); + JsonSerializer.Serialize(writer, EnrichFieldsValue, options); + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + writer.WritePropertyName("match_field"); + JsonSerializer.Serialize(writer, MatchFieldValue, options); + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + if (!string.IsNullOrEmpty(QueryValue)) + { + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + } + + writer.WriteEndObject(); + } + } + + public sealed partial class PolicyDescriptor : DescriptorBase + { + internal PolicyDescriptor(Action configure) => configure.Invoke(this); + public PolicyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Fields EnrichFieldsValue { get; set; } + + private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } + + private Elastic.Clients.Elasticsearch.Field MatchFieldValue { get; set; } + + private Elastic.Clients.Elasticsearch.Name? NameValue { get; set; } + + private string? QueryValue { get; set; } + + public PolicyDescriptor EnrichFields(Elastic.Clients.Elasticsearch.Fields enrichFields) + { + EnrichFieldsValue = enrichFields; + return Self; + } + + public PolicyDescriptor EnrichFields(Expression> enrichFields) + { + EnrichFieldsValue = enrichFields; + return Self; + } + + public PolicyDescriptor EnrichFields(Expression> enrichFields) + { + EnrichFieldsValue = enrichFields; + return Self; + } + + public PolicyDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + IndicesValue = indices; + return Self; + } + + public PolicyDescriptor MatchField(Elastic.Clients.Elasticsearch.Field matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public PolicyDescriptor MatchField(Expression> matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public PolicyDescriptor MatchField(Expression> matchField) + { + MatchFieldValue = matchField; + return Self; + } + + public PolicyDescriptor Name(Elastic.Clients.Elasticsearch.Name? name) + { + NameValue = name; + return Self; + } + + public PolicyDescriptor Query(string? query) + { + QueryValue = query; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("enrich_fields"); + JsonSerializer.Serialize(writer, EnrichFieldsValue, options); + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + writer.WritePropertyName("match_field"); + JsonSerializer.Serialize(writer, MatchFieldValue, options); + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + if (!string.IsNullOrEmpty(QueryValue)) + { + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + } + + writer.WriteEndObject(); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Summary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Summary.g.cs new file mode 100644 index 00000000000..524298ab34f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/Summary.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. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich +{ + public partial class Summary + { + [JsonInclude] + [JsonPropertyName("config")] + public Elastic.Clients.Elasticsearch.Enrich.Configuration Config { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.ExecutePolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.ExecutePolicy.g.cs new file mode 100644 index 00000000000..58664019076 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.ExecutePolicy.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. +// +// ------------------------------------------------ + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Runtime.Serialization; +using Elastic.Transport; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Enrich.ExecutePolicy +{ + [JsonConverter(typeof(EnrichPolicyPhaseConverter))] + public enum EnrichPolicyPhase + { + [EnumMember(Value = "SCHEDULED")] + Scheduled, + [EnumMember(Value = "RUNNING")] + Running, + [EnumMember(Value = "FAILED")] + Failed, + [EnumMember(Value = "COMPLETE")] + Complete + } + + internal sealed class EnrichPolicyPhaseConverter : JsonConverter + { + public override EnrichPolicyPhase Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "SCHEDULED": + return EnrichPolicyPhase.Scheduled; + case "RUNNING": + return EnrichPolicyPhase.Running; + case "FAILED": + return EnrichPolicyPhase.Failed; + case "COMPLETE": + return EnrichPolicyPhase.Complete; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, EnrichPolicyPhase value, JsonSerializerOptions options) + { + switch (value) + { + case EnrichPolicyPhase.Scheduled: + writer.WriteStringValue("SCHEDULED"); + return; + case EnrichPolicyPhase.Running: + writer.WriteStringValue("RUNNING"); + return; + case EnrichPolicyPhase.Failed: + writer.WriteStringValue("FAILED"); + return; + case EnrichPolicyPhase.Complete: + writer.WriteStringValue("COMPLETE"); + return; + } + + writer.WriteNullValue(); + } + } +} \ No newline at end of file