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 3d651e7607..5384356e45 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs @@ -89,11 +89,13 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementStats = new ApiUrls(new[] { "_stats", "_stats/{metric}", "{index}/_stats", "{index}/_stats/{metric}" }); internal static ApiUrls IndexManagementUpdateAliases = new ApiUrls(new[] { "_aliases" }); internal static ApiUrls IndexManagementValidateQuery = new ApiUrls(new[] { "_validate/query", "{index}/_validate/query" }); + internal static ApiUrls IngestDeleteGeoipDatabase = new ApiUrls(new[] { "_ingest/geoip/database/{id}" }); internal static ApiUrls IngestDeletePipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" }); internal static ApiUrls IngestGeoIpStats = new ApiUrls(new[] { "_ingest/geoip/stats" }); internal static ApiUrls IngestGetGeoipDatabase = new ApiUrls(new[] { "_ingest/geoip/database", "_ingest/geoip/database/{id}" }); internal static ApiUrls IngestGetPipeline = new ApiUrls(new[] { "_ingest/pipeline", "_ingest/pipeline/{id}" }); internal static ApiUrls IngestProcessorGrok = new ApiUrls(new[] { "_ingest/processor/grok" }); + internal static ApiUrls IngestPutGeoipDatabase = new ApiUrls(new[] { "_ingest/geoip/database/{id}" }); internal static ApiUrls IngestPutPipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" }); internal static ApiUrls IngestSimulate = new ApiUrls(new[] { "_ingest/pipeline/_simulate", "_ingest/pipeline/{id}/_simulate" }); internal static ApiUrls LicenseManagementGet = new ApiUrls(new[] { "_license" }); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs new file mode 100644 index 0000000000..3832abe96c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs @@ -0,0 +1,155 @@ +// 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.Ingest; + +public sealed partial class DeleteGeoipDatabaseRequestParameters : RequestParameters +{ + /// + /// + /// Period to wait for a connection to the master node. + /// If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Deletes a geoip database configuration. +/// +/// +public sealed partial class DeleteGeoipDatabaseRequest : PlainRequest +{ + public DeleteGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Serverless.Ids id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeleteGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_geoip_database"; + + /// + /// + /// Period to wait for a connection to the master node. + /// If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Deletes a geoip database configuration. +/// +/// +public sealed partial class DeleteGeoipDatabaseRequestDescriptor : RequestDescriptor, DeleteGeoipDatabaseRequestParameters> +{ + internal DeleteGeoipDatabaseRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteGeoipDatabaseRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ids id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeleteGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_geoip_database"; + + public DeleteGeoipDatabaseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteGeoipDatabaseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteGeoipDatabaseRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Ids id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// +/// Deletes a geoip database configuration. +/// +/// +public sealed partial class DeleteGeoipDatabaseRequestDescriptor : RequestDescriptor +{ + internal DeleteGeoipDatabaseRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteGeoipDatabaseRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ids id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeleteGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_geoip_database"; + + public DeleteGeoipDatabaseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteGeoipDatabaseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteGeoipDatabaseRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Ids id) + { + RouteValues.Required("id", id); + 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/Ingest/DeleteGeoipDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.g.cs new file mode 100644 index 0000000000..d25a7acde0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.g.cs @@ -0,0 +1,38 @@ +// 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.Ingest; + +public sealed partial class DeleteGeoipDatabaseResponse : 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/Ingest/PutGeoipDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs new file mode 100644 index 0000000000..a3301b745e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs @@ -0,0 +1,304 @@ +// 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.Ingest; + +public sealed partial class PutGeoipDatabaseRequestParameters : RequestParameters +{ + /// + /// + /// Period to wait for a connection to the master node. + /// If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Returns information about one or more geoip database configurations. +/// +/// +public sealed partial class PutGeoipDatabaseRequest : PlainRequest +{ + public PutGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_geoip_database"; + + /// + /// + /// Period to wait for a connection to the master node. + /// If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// + /// The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. + /// At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. + /// + /// + [JsonInclude, JsonPropertyName("maxmind")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.Maxmind Maxmind { get; set; } + + /// + /// + /// The provider-assigned name of the IP geolocation database to download. + /// + /// + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Name Name { get; set; } +} + +/// +/// +/// Returns information about one or more geoip database configurations. +/// +/// +public sealed partial class PutGeoipDatabaseRequestDescriptor : RequestDescriptor, PutGeoipDatabaseRequestParameters> +{ + internal PutGeoipDatabaseRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutGeoipDatabaseRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_geoip_database"; + + public PutGeoipDatabaseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutGeoipDatabaseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutGeoipDatabaseRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Ingest.Maxmind MaxmindValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.MaxmindDescriptor MaxmindDescriptor { get; set; } + private Action MaxmindDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } + + /// + /// + /// The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. + /// At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. + /// + /// + public PutGeoipDatabaseRequestDescriptor Maxmind(Elastic.Clients.Elasticsearch.Serverless.Ingest.Maxmind maxmind) + { + MaxmindDescriptor = null; + MaxmindDescriptorAction = null; + MaxmindValue = maxmind; + return Self; + } + + public PutGeoipDatabaseRequestDescriptor Maxmind(Elastic.Clients.Elasticsearch.Serverless.Ingest.MaxmindDescriptor descriptor) + { + MaxmindValue = null; + MaxmindDescriptorAction = null; + MaxmindDescriptor = descriptor; + return Self; + } + + public PutGeoipDatabaseRequestDescriptor Maxmind(Action configure) + { + MaxmindValue = null; + MaxmindDescriptor = null; + MaxmindDescriptorAction = configure; + return Self; + } + + /// + /// + /// The provider-assigned name of the IP geolocation database to download. + /// + /// + public PutGeoipDatabaseRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxmindDescriptor is not null) + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, MaxmindDescriptor, options); + } + else if (MaxmindDescriptorAction is not null) + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.MaxmindDescriptor(MaxmindDescriptorAction), options); + } + else + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, MaxmindValue, options); + } + + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + writer.WriteEndObject(); + } +} + +/// +/// +/// Returns information about one or more geoip database configurations. +/// +/// +public sealed partial class PutGeoipDatabaseRequestDescriptor : RequestDescriptor +{ + internal PutGeoipDatabaseRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutGeoipDatabaseRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_geoip_database"; + + public PutGeoipDatabaseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutGeoipDatabaseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutGeoipDatabaseRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Ingest.Maxmind MaxmindValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.MaxmindDescriptor MaxmindDescriptor { get; set; } + private Action MaxmindDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } + + /// + /// + /// The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. + /// At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. + /// + /// + public PutGeoipDatabaseRequestDescriptor Maxmind(Elastic.Clients.Elasticsearch.Serverless.Ingest.Maxmind maxmind) + { + MaxmindDescriptor = null; + MaxmindDescriptorAction = null; + MaxmindValue = maxmind; + return Self; + } + + public PutGeoipDatabaseRequestDescriptor Maxmind(Elastic.Clients.Elasticsearch.Serverless.Ingest.MaxmindDescriptor descriptor) + { + MaxmindValue = null; + MaxmindDescriptorAction = null; + MaxmindDescriptor = descriptor; + return Self; + } + + public PutGeoipDatabaseRequestDescriptor Maxmind(Action configure) + { + MaxmindValue = null; + MaxmindDescriptor = null; + MaxmindDescriptorAction = configure; + return Self; + } + + /// + /// + /// The provider-assigned name of the IP geolocation database to download. + /// + /// + public PutGeoipDatabaseRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxmindDescriptor is not null) + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, MaxmindDescriptor, options); + } + else if (MaxmindDescriptorAction is not null) + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.MaxmindDescriptor(MaxmindDescriptorAction), options); + } + else + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, MaxmindValue, options); + } + + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs new file mode 100644 index 0000000000..c098d37a2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs @@ -0,0 +1,38 @@ +// 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.Ingest; + +public sealed partial class PutGeoipDatabaseResponse : 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/Ingest/SimulateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs index 0d7136e317..836ce51919 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs @@ -76,7 +76,7 @@ public SimulateRequest(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r /// /// [JsonInclude, JsonPropertyName("docs")] - public ICollection? Docs { get; set; } + public ICollection Docs { get; set; } /// /// @@ -122,7 +122,7 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Ser return Self; } - private ICollection? DocsValue { get; set; } + private ICollection DocsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor DocsDescriptor { get; set; } private Action DocsDescriptorAction { get; set; } private Action[] DocsDescriptorActions { get; set; } @@ -135,7 +135,7 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Ser /// Sample documents to test in the pipeline. /// /// - public SimulateRequestDescriptor Docs(ICollection? docs) + public SimulateRequestDescriptor Docs(ICollection docs) { DocsDescriptor = null; DocsDescriptorAction = null; @@ -230,7 +230,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndArray(); } - else if (DocsValue is not null) + else { writer.WritePropertyName("docs"); JsonSerializer.Serialize(writer, DocsValue, options); @@ -289,7 +289,7 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? return Self; } - private ICollection? DocsValue { get; set; } + private ICollection DocsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor DocsDescriptor { get; set; } private Action DocsDescriptorAction { get; set; } private Action[] DocsDescriptorActions { get; set; } @@ -302,7 +302,7 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? /// Sample documents to test in the pipeline. /// /// - public SimulateRequestDescriptor Docs(ICollection? docs) + public SimulateRequestDescriptor Docs(ICollection docs) { DocsDescriptor = null; DocsDescriptorAction = null; @@ -397,7 +397,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndArray(); } - else if (DocsValue is not null) + else { writer.WritePropertyName("docs"); JsonSerializer.Serialize(writer, DocsValue, options); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs index 6b6ab17049..ce9751221e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs @@ -29,5 +29,5 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class SimulateResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("docs")] - public IReadOnlyCollection Docs { get; init; } + public IReadOnlyCollection Docs { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs index 9ccae372b5..903fa74a8f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs @@ -39,6 +39,96 @@ internal IngestNamespacedClient(ElasticsearchClient client) : base(client) { } + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(DeleteGeoipDatabaseRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(DeleteGeoipDatabaseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Serverless.Ids id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Serverless.Ids id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(DeleteGeoipDatabaseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Serverless.Ids id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Serverless.Ids id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + /// /// /// Deletes one or more existing ingest pipeline. @@ -538,6 +628,96 @@ public virtual Task ProcessorGrokAsync(Action(descriptor, cancellationToken); } + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(PutGeoipDatabaseRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(PutGeoipDatabaseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(PutGeoipDatabaseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + /// /// /// Creates or updates an ingest pipeline. diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DatabaseConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DatabaseConfiguration.g.cs index 80cedf53bc..3c5f7090bd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DatabaseConfiguration.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DatabaseConfiguration.g.cs @@ -29,8 +29,20 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class DatabaseConfiguration { + /// + /// + /// The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. + /// At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. + /// + /// [JsonInclude, JsonPropertyName("maxmind")] public Elastic.Clients.Elasticsearch.Serverless.Ingest.Maxmind Maxmind { get; init; } + + /// + /// + /// The provider-assigned name of the IP geolocation database to download. + /// + /// [JsonInclude, JsonPropertyName("name")] public string Name { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs index 7bd81559f2..053f79ee61 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs @@ -34,8 +34,16 @@ public sealed partial class GeoIpDownloadStatistics /// Current number of databases available for use. /// /// - [JsonInclude, JsonPropertyName("database_count")] - public int DatabaseCount { get; init; } + [JsonInclude, JsonPropertyName("databases_count")] + public int DatabasesCount { get; init; } + + /// + /// + /// Total number of databases not updated after 30 days + /// + /// + [JsonInclude, JsonPropertyName("expired_databases")] + public int ExpiredDatabases { get; init; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/HtmlStripProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/HtmlStripProcessor.g.cs new file mode 100644 index 0000000000..82fd1b22c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/HtmlStripProcessor.g.cs @@ -0,0 +1,626 @@ +// 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.Ingest; + +public sealed partial class HtmlStripProcessor +{ + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// + /// Conditionally execute the processor. + /// + /// + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + + /// + /// + /// Ignore failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document, + /// + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(HtmlStripProcessor htmlStripProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.HtmlStrip(htmlStripProcessor); +} + +public sealed partial class HtmlStripProcessorDescriptor : SerializableDescriptor> +{ + internal HtmlStripProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public HtmlStripProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public HtmlStripProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public HtmlStripProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public HtmlStripProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document, + /// + /// + public HtmlStripProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public HtmlStripProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public HtmlStripProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class HtmlStripProcessorDescriptor : SerializableDescriptor +{ + internal HtmlStripProcessorDescriptor(Action configure) => configure.Invoke(this); + + public HtmlStripProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public HtmlStripProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public HtmlStripProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public HtmlStripProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document, + /// + /// + public HtmlStripProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public HtmlStripProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public HtmlStripProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Maxmind.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Maxmind.g.cs index 3a6b1d4386..8adb54ec87 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Maxmind.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Maxmind.g.cs @@ -30,5 +30,30 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class Maxmind { [JsonInclude, JsonPropertyName("account_id")] - public string AccountId { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Id AccountId { get; set; } +} + +public sealed partial class MaxmindDescriptor : SerializableDescriptor +{ + internal MaxmindDescriptor(Action configure) => configure.Invoke(this); + + public MaxmindDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id AccountIdValue { get; set; } + + public MaxmindDescriptor AccountId(Elastic.Clients.Elasticsearch.Serverless.Id accountId) + { + AccountIdValue = accountId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("account_id"); + JsonSerializer.Serialize(writer, AccountIdValue, options); + writer.WriteEndObject(); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineSimulation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineSimulation.g.cs index 989ce5bf41..085de55061 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineSimulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineSimulation.g.cs @@ -29,10 +29,14 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class PipelineSimulation { + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } [JsonInclude, JsonPropertyName("doc")] public Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentSimulation? Doc { get; init; } - [JsonInclude, JsonPropertyName("processor_results")] - public IReadOnlyCollection? ProcessorResults { get; init; } + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("ignored_error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause? IgnoredError { get; init; } [JsonInclude, JsonPropertyName("processor_type")] public string? ProcessorType { get; init; } [JsonInclude, JsonPropertyName("status")] diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs index a59672225c..2480b2f8bc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs @@ -63,6 +63,7 @@ internal Processor(string variantName, object variant) public static Processor Geoip(Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoIpProcessor geoIpProcessor) => new Processor("geoip", geoIpProcessor); public static Processor Grok(Elastic.Clients.Elasticsearch.Serverless.Ingest.GrokProcessor grokProcessor) => new Processor("grok", grokProcessor); public static Processor Gsub(Elastic.Clients.Elasticsearch.Serverless.Ingest.GsubProcessor gsubProcessor) => new Processor("gsub", gsubProcessor); + public static Processor HtmlStrip(Elastic.Clients.Elasticsearch.Serverless.Ingest.HtmlStripProcessor htmlStripProcessor) => new Processor("html_strip", htmlStripProcessor); public static Processor Inference(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceProcessor inferenceProcessor) => new Processor("inference", inferenceProcessor); public static Processor Join(Elastic.Clients.Elasticsearch.Serverless.Ingest.JoinProcessor joinProcessor) => new Processor("join", joinProcessor); public static Processor Json(Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessor jsonProcessor) => new Processor("json", jsonProcessor); @@ -79,6 +80,7 @@ internal Processor(string variantName, object variant) public static Processor Split(Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor splitProcessor) => new Processor("split", splitProcessor); public static Processor Trim(Elastic.Clients.Elasticsearch.Serverless.Ingest.TrimProcessor trimProcessor) => new Processor("trim", trimProcessor); public static Processor Uppercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor uppercaseProcessor) => new Processor("uppercase", uppercaseProcessor); + public static Processor UriParts(Elastic.Clients.Elasticsearch.Serverless.Ingest.UriPartsProcessor uriPartsProcessor) => new Processor("uri_parts", uriPartsProcessor); public static Processor UrlDecode(Elastic.Clients.Elasticsearch.Serverless.Ingest.UrlDecodeProcessor urlDecodeProcessor) => new Processor("urldecode", urlDecodeProcessor); public static Processor UserAgent(Elastic.Clients.Elasticsearch.Serverless.Ingest.UserAgentProcessor userAgentProcessor) => new Processor("user_agent", userAgentProcessor); @@ -239,6 +241,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "html_strip") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "inference") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -351,6 +360,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "uri_parts") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "urldecode") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -431,6 +447,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "gsub": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.GsubProcessor)value.Variant, options); break; + case "html_strip": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.HtmlStripProcessor)value.Variant, options); + break; case "inference": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceProcessor)value.Variant, options); break; @@ -479,6 +498,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "uppercase": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor)value.Variant, options); break; + case "uri_parts": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.UriPartsProcessor)value.Variant, options); + break; case "urldecode": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.UrlDecodeProcessor)value.Variant, options); break; @@ -557,6 +579,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Grok(Action> configure) => Set(configure, "grok"); public ProcessorDescriptor Gsub(Elastic.Clients.Elasticsearch.Serverless.Ingest.GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); public ProcessorDescriptor Gsub(Action> configure) => Set(configure, "gsub"); + public ProcessorDescriptor HtmlStrip(Elastic.Clients.Elasticsearch.Serverless.Ingest.HtmlStripProcessor htmlStripProcessor) => Set(htmlStripProcessor, "html_strip"); + public ProcessorDescriptor HtmlStrip(Action> configure) => Set(configure, "html_strip"); public ProcessorDescriptor Inference(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); public ProcessorDescriptor Inference(Action> configure) => Set(configure, "inference"); public ProcessorDescriptor Join(Elastic.Clients.Elasticsearch.Serverless.Ingest.JoinProcessor joinProcessor) => Set(joinProcessor, "join"); @@ -589,6 +613,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Trim(Action> configure) => Set(configure, "trim"); public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); public ProcessorDescriptor Uppercase(Action> configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UriParts(Elastic.Clients.Elasticsearch.Serverless.Ingest.UriPartsProcessor uriPartsProcessor) => Set(uriPartsProcessor, "uri_parts"); + public ProcessorDescriptor UriParts(Action> configure) => Set(configure, "uri_parts"); public ProcessorDescriptor UrlDecode(Elastic.Clients.Elasticsearch.Serverless.Ingest.UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); public ProcessorDescriptor UrlDecode(Action> configure) => Set(configure, "urldecode"); public ProcessorDescriptor UserAgent(Elastic.Clients.Elasticsearch.Serverless.Ingest.UserAgentProcessor userAgentProcessor) => Set(userAgentProcessor, "user_agent"); @@ -679,6 +705,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Grok(Action configure) => Set(configure, "grok"); public ProcessorDescriptor Gsub(Elastic.Clients.Elasticsearch.Serverless.Ingest.GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); public ProcessorDescriptor Gsub(Action configure) => Set(configure, "gsub"); + public ProcessorDescriptor HtmlStrip(Elastic.Clients.Elasticsearch.Serverless.Ingest.HtmlStripProcessor htmlStripProcessor) => Set(htmlStripProcessor, "html_strip"); + public ProcessorDescriptor HtmlStrip(Action configure) => Set(configure, "html_strip"); public ProcessorDescriptor Inference(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); public ProcessorDescriptor Inference(Action configure) => Set(configure, "inference"); public ProcessorDescriptor Join(Elastic.Clients.Elasticsearch.Serverless.Ingest.JoinProcessor joinProcessor) => Set(joinProcessor, "join"); @@ -711,6 +739,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Trim(Action configure) => Set(configure, "trim"); public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); public ProcessorDescriptor Uppercase(Action configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UriParts(Elastic.Clients.Elasticsearch.Serverless.Ingest.UriPartsProcessor uriPartsProcessor) => Set(uriPartsProcessor, "uri_parts"); + public ProcessorDescriptor UriParts(Action configure) => Set(configure, "uri_parts"); public ProcessorDescriptor UrlDecode(Elastic.Clients.Elasticsearch.Serverless.Ingest.UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); public ProcessorDescriptor UrlDecode(Action configure) => Set(configure, "urldecode"); public ProcessorDescriptor UserAgent(Elastic.Clients.Elasticsearch.Serverless.Ingest.UserAgentProcessor userAgentProcessor) => Set(userAgentProcessor, "user_agent"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SimulateDocumentResult.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SimulateDocumentResult.g.cs new file mode 100644 index 0000000000..81d5e102c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SimulateDocumentResult.g.cs @@ -0,0 +1,38 @@ +// 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.Ingest; + +public sealed partial class SimulateDocumentResult +{ + [JsonInclude, JsonPropertyName("doc")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentSimulation? Doc { get; init; } + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("processor_results")] + public IReadOnlyCollection? ProcessorResults { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UriPartsProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UriPartsProcessor.g.cs new file mode 100644 index 0000000000..10b91f78d0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UriPartsProcessor.g.cs @@ -0,0 +1,710 @@ +// 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.Ingest; + +public sealed partial class UriPartsProcessor +{ + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// Field containing the URI string. + /// + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// + /// Conditionally execute the processor. + /// + /// + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + + /// + /// + /// Ignore failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// + /// If true and field does not exist, the processor quietly exits without modifying the document. + /// + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// + /// If true, the processor copies the unparsed URI to <target_field>.original. + /// + /// + [JsonInclude, JsonPropertyName("keep_original")] + public bool? KeepOriginal { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// + /// If true, the processor removes the field after parsing the URI string. + /// If parsing fails, the processor does not remove the field. + /// + /// + [JsonInclude, JsonPropertyName("remove_if_successful")] + public bool? RemoveIfSuccessful { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// Output field for the URI object. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(UriPartsProcessor uriPartsProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.UriParts(uriPartsProcessor); +} + +public sealed partial class UriPartsProcessorDescriptor : SerializableDescriptor> +{ + internal UriPartsProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public UriPartsProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private bool? KeepOriginalValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private bool? RemoveIfSuccessfulValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public UriPartsProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public UriPartsProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public UriPartsProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and field does not exist, the processor quietly exits without modifying the document. + /// + /// + public UriPartsProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// If true, the processor copies the unparsed URI to <target_field>.original. + /// + /// + public UriPartsProcessorDescriptor KeepOriginal(bool? keepOriginal = true) + { + KeepOriginalValue = keepOriginal; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public UriPartsProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// If true, the processor removes the field after parsing the URI string. + /// If parsing fails, the processor does not remove the field. + /// + /// + public UriPartsProcessorDescriptor RemoveIfSuccessful(bool? removeIfSuccessful = true) + { + RemoveIfSuccessfulValue = removeIfSuccessful; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public UriPartsProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (KeepOriginalValue.HasValue) + { + writer.WritePropertyName("keep_original"); + writer.WriteBooleanValue(KeepOriginalValue.Value); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (RemoveIfSuccessfulValue.HasValue) + { + writer.WritePropertyName("remove_if_successful"); + writer.WriteBooleanValue(RemoveIfSuccessfulValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UriPartsProcessorDescriptor : SerializableDescriptor +{ + internal UriPartsProcessorDescriptor(Action configure) => configure.Invoke(this); + + public UriPartsProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private bool? KeepOriginalValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private bool? RemoveIfSuccessfulValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public UriPartsProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public UriPartsProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public UriPartsProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and field does not exist, the processor quietly exits without modifying the document. + /// + /// + public UriPartsProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// If true, the processor copies the unparsed URI to <target_field>.original. + /// + /// + public UriPartsProcessorDescriptor KeepOriginal(bool? keepOriginal = true) + { + KeepOriginalValue = keepOriginal; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public UriPartsProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// If true, the processor removes the field after parsing the URI string. + /// If parsing fails, the processor does not remove the field. + /// + /// + public UriPartsProcessorDescriptor RemoveIfSuccessful(bool? removeIfSuccessful = true) + { + RemoveIfSuccessfulValue = removeIfSuccessful; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public UriPartsProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (KeepOriginalValue.HasValue) + { + writer.WritePropertyName("keep_original"); + writer.WriteBooleanValue(KeepOriginalValue.Value); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (RemoveIfSuccessfulValue.HasValue) + { + writer.WritePropertyName("remove_if_successful"); + writer.WriteBooleanValue(RemoveIfSuccessfulValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs index 6389aac9dd..84661cf446 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs @@ -50,24 +50,18 @@ internal DynamicTemplate(string variantName, object variant) public static DynamicTemplate Runtime(Elastic.Clients.Elasticsearch.Serverless.Mapping.IProperty property) => new DynamicTemplate("runtime", property); [JsonInclude, JsonPropertyName("match")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Match { get; set; } [JsonInclude, JsonPropertyName("match_mapping_type")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? MatchMappingType { get; set; } [JsonInclude, JsonPropertyName("match_pattern")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.MatchType? MatchPattern { get; set; } [JsonInclude, JsonPropertyName("path_match")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? PathMatch { get; set; } [JsonInclude, JsonPropertyName("path_unmatch")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? PathUnmatch { get; set; } [JsonInclude, JsonPropertyName("unmatch")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Unmatch { get; set; } [JsonInclude, JsonPropertyName("unmatch_mapping_type")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? UnmatchMappingType { get; set; } public bool TryGet([NotNullWhen(true)] out T? result) where T : class diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs index 9ff3cbf6f7..05feceafbc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs @@ -135,11 +135,13 @@ internal static class ApiUrlLookup internal static ApiUrls InferenceGet = new ApiUrls(new[] { "_inference", "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); internal static ApiUrls InferenceInference = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); internal static ApiUrls InferencePut = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); + internal static ApiUrls IngestDeleteGeoipDatabase = new ApiUrls(new[] { "_ingest/geoip/database/{id}" }); internal static ApiUrls IngestDeletePipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" }); internal static ApiUrls IngestGeoIpStats = new ApiUrls(new[] { "_ingest/geoip/stats" }); internal static ApiUrls IngestGetGeoipDatabase = new ApiUrls(new[] { "_ingest/geoip/database", "_ingest/geoip/database/{id}" }); internal static ApiUrls IngestGetPipeline = new ApiUrls(new[] { "_ingest/pipeline", "_ingest/pipeline/{id}" }); internal static ApiUrls IngestProcessorGrok = new ApiUrls(new[] { "_ingest/processor/grok" }); + internal static ApiUrls IngestPutGeoipDatabase = new ApiUrls(new[] { "_ingest/geoip/database/{id}" }); internal static ApiUrls IngestPutPipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" }); internal static ApiUrls IngestSimulate = new ApiUrls(new[] { "_ingest/pipeline/_simulate", "_ingest/pipeline/{id}/_simulate" }); internal static ApiUrls LicenseManagementDelete = new ApiUrls(new[] { "_license" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs new file mode 100644 index 0000000000..e4dd8fa7fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs @@ -0,0 +1,155 @@ +// 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.Requests; +using Elastic.Clients.Elasticsearch.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.Ingest; + +public sealed partial class DeleteGeoipDatabaseRequestParameters : RequestParameters +{ + /// + /// + /// Period to wait for a connection to the master node. + /// If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Deletes a geoip database configuration. +/// +/// +public sealed partial class DeleteGeoipDatabaseRequest : PlainRequest +{ + public DeleteGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Ids id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeleteGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_geoip_database"; + + /// + /// + /// Period to wait for a connection to the master node. + /// If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Deletes a geoip database configuration. +/// +/// +public sealed partial class DeleteGeoipDatabaseRequestDescriptor : RequestDescriptor, DeleteGeoipDatabaseRequestParameters> +{ + internal DeleteGeoipDatabaseRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteGeoipDatabaseRequestDescriptor(Elastic.Clients.Elasticsearch.Ids id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeleteGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_geoip_database"; + + public DeleteGeoipDatabaseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteGeoipDatabaseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteGeoipDatabaseRequestDescriptor Id(Elastic.Clients.Elasticsearch.Ids id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// +/// Deletes a geoip database configuration. +/// +/// +public sealed partial class DeleteGeoipDatabaseRequestDescriptor : RequestDescriptor +{ + internal DeleteGeoipDatabaseRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteGeoipDatabaseRequestDescriptor(Elastic.Clients.Elasticsearch.Ids id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeleteGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ingest.delete_geoip_database"; + + public DeleteGeoipDatabaseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteGeoipDatabaseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteGeoipDatabaseRequestDescriptor Id(Elastic.Clients.Elasticsearch.Ids id) + { + RouteValues.Required("id", id); + 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/Ingest/DeleteGeoipDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.g.cs new file mode 100644 index 0000000000..dce6d2f572 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.g.cs @@ -0,0 +1,38 @@ +// 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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +public sealed partial class DeleteGeoipDatabaseResponse : 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/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs new file mode 100644 index 0000000000..5bef1768d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs @@ -0,0 +1,304 @@ +// 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.Requests; +using Elastic.Clients.Elasticsearch.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.Ingest; + +public sealed partial class PutGeoipDatabaseRequestParameters : RequestParameters +{ + /// + /// + /// Period to wait for a connection to the master node. + /// If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Returns information about one or more geoip database configurations. +/// +/// +public sealed partial class PutGeoipDatabaseRequest : PlainRequest +{ + public PutGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_geoip_database"; + + /// + /// + /// Period to wait for a connection to the master node. + /// If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + /// + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// + /// The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. + /// At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. + /// + /// + [JsonInclude, JsonPropertyName("maxmind")] + public Elastic.Clients.Elasticsearch.Ingest.Maxmind Maxmind { get; set; } + + /// + /// + /// The provider-assigned name of the IP geolocation database to download. + /// + /// + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Name Name { get; set; } +} + +/// +/// +/// Returns information about one or more geoip database configurations. +/// +/// +public sealed partial class PutGeoipDatabaseRequestDescriptor : RequestDescriptor, PutGeoipDatabaseRequestParameters> +{ + internal PutGeoipDatabaseRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutGeoipDatabaseRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_geoip_database"; + + public PutGeoipDatabaseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutGeoipDatabaseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutGeoipDatabaseRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.Ingest.Maxmind MaxmindValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.MaxmindDescriptor MaxmindDescriptor { get; set; } + private Action MaxmindDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Name NameValue { get; set; } + + /// + /// + /// The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. + /// At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. + /// + /// + public PutGeoipDatabaseRequestDescriptor Maxmind(Elastic.Clients.Elasticsearch.Ingest.Maxmind maxmind) + { + MaxmindDescriptor = null; + MaxmindDescriptorAction = null; + MaxmindValue = maxmind; + return Self; + } + + public PutGeoipDatabaseRequestDescriptor Maxmind(Elastic.Clients.Elasticsearch.Ingest.MaxmindDescriptor descriptor) + { + MaxmindValue = null; + MaxmindDescriptorAction = null; + MaxmindDescriptor = descriptor; + return Self; + } + + public PutGeoipDatabaseRequestDescriptor Maxmind(Action configure) + { + MaxmindValue = null; + MaxmindDescriptor = null; + MaxmindDescriptorAction = configure; + return Self; + } + + /// + /// + /// The provider-assigned name of the IP geolocation database to download. + /// + /// + public PutGeoipDatabaseRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxmindDescriptor is not null) + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, MaxmindDescriptor, options); + } + else if (MaxmindDescriptorAction is not null) + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.MaxmindDescriptor(MaxmindDescriptorAction), options); + } + else + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, MaxmindValue, options); + } + + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + writer.WriteEndObject(); + } +} + +/// +/// +/// Returns information about one or more geoip database configurations. +/// +/// +public sealed partial class PutGeoipDatabaseRequestDescriptor : RequestDescriptor +{ + internal PutGeoipDatabaseRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutGeoipDatabaseRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutGeoipDatabase; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ingest.put_geoip_database"; + + public PutGeoipDatabaseRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutGeoipDatabaseRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutGeoipDatabaseRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.Ingest.Maxmind MaxmindValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.MaxmindDescriptor MaxmindDescriptor { get; set; } + private Action MaxmindDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Name NameValue { get; set; } + + /// + /// + /// The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. + /// At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. + /// + /// + public PutGeoipDatabaseRequestDescriptor Maxmind(Elastic.Clients.Elasticsearch.Ingest.Maxmind maxmind) + { + MaxmindDescriptor = null; + MaxmindDescriptorAction = null; + MaxmindValue = maxmind; + return Self; + } + + public PutGeoipDatabaseRequestDescriptor Maxmind(Elastic.Clients.Elasticsearch.Ingest.MaxmindDescriptor descriptor) + { + MaxmindValue = null; + MaxmindDescriptorAction = null; + MaxmindDescriptor = descriptor; + return Self; + } + + public PutGeoipDatabaseRequestDescriptor Maxmind(Action configure) + { + MaxmindValue = null; + MaxmindDescriptor = null; + MaxmindDescriptorAction = configure; + return Self; + } + + /// + /// + /// The provider-assigned name of the IP geolocation database to download. + /// + /// + public PutGeoipDatabaseRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxmindDescriptor is not null) + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, MaxmindDescriptor, options); + } + else if (MaxmindDescriptorAction is not null) + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.MaxmindDescriptor(MaxmindDescriptorAction), options); + } + else + { + writer.WritePropertyName("maxmind"); + JsonSerializer.Serialize(writer, MaxmindValue, options); + } + + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs new file mode 100644 index 0000000000..9fa354707d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs @@ -0,0 +1,38 @@ +// 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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +public sealed partial class PutGeoipDatabaseResponse : 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/_Generated/Api/Ingest/SimulateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs index 4b2312514f..72b490af26 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs @@ -76,7 +76,7 @@ public SimulateRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optio /// /// [JsonInclude, JsonPropertyName("docs")] - public ICollection? Docs { get; set; } + public ICollection Docs { get; set; } /// /// @@ -122,7 +122,7 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? return Self; } - private ICollection? DocsValue { get; set; } + private ICollection DocsValue { get; set; } private Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor DocsDescriptor { get; set; } private Action DocsDescriptorAction { get; set; } private Action[] DocsDescriptorActions { get; set; } @@ -135,7 +135,7 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? /// Sample documents to test in the pipeline. /// /// - public SimulateRequestDescriptor Docs(ICollection? docs) + public SimulateRequestDescriptor Docs(ICollection docs) { DocsDescriptor = null; DocsDescriptorAction = null; @@ -230,7 +230,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndArray(); } - else if (DocsValue is not null) + else { writer.WritePropertyName("docs"); JsonSerializer.Serialize(writer, DocsValue, options); @@ -289,7 +289,7 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) return Self; } - private ICollection? DocsValue { get; set; } + private ICollection DocsValue { get; set; } private Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor DocsDescriptor { get; set; } private Action DocsDescriptorAction { get; set; } private Action[] DocsDescriptorActions { get; set; } @@ -302,7 +302,7 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) /// Sample documents to test in the pipeline. /// /// - public SimulateRequestDescriptor Docs(ICollection? docs) + public SimulateRequestDescriptor Docs(ICollection docs) { DocsDescriptor = null; DocsDescriptorAction = null; @@ -397,7 +397,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndArray(); } - else if (DocsValue is not null) + else { writer.WritePropertyName("docs"); JsonSerializer.Serialize(writer, DocsValue, options); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs index 89f21cf9de..557e500e32 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs @@ -29,5 +29,5 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class SimulateResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("docs")] - public IReadOnlyCollection Docs { get; init; } + public IReadOnlyCollection Docs { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs index 6f18a080e8..d150269be2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs @@ -39,6 +39,193 @@ internal IngestNamespacedClient(ElasticsearchClient client) : base(client) { } + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteGeoipDatabaseResponse DeleteGeoipDatabase(DeleteGeoipDatabaseRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(DeleteGeoipDatabaseRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteGeoipDatabaseResponse DeleteGeoipDatabase(DeleteGeoipDatabaseRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteGeoipDatabaseResponse DeleteGeoipDatabase(Elastic.Clients.Elasticsearch.Ids id) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteGeoipDatabaseResponse DeleteGeoipDatabase(Elastic.Clients.Elasticsearch.Ids id, Action> configureRequest) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteGeoipDatabaseResponse DeleteGeoipDatabase(DeleteGeoipDatabaseRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteGeoipDatabaseResponse DeleteGeoipDatabase(Elastic.Clients.Elasticsearch.Ids id) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteGeoipDatabaseResponse DeleteGeoipDatabase(Elastic.Clients.Elasticsearch.Ids id, Action configureRequest) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(DeleteGeoipDatabaseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Ids id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Ids id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteGeoipDatabaseResponse, DeleteGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(DeleteGeoipDatabaseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Ids id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// + /// Deletes a geoip database configuration. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Ids id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + /// /// /// Deletes one or more existing ingest pipeline. @@ -1074,6 +1261,193 @@ public virtual Task ProcessorGrokAsync(Action(descriptor, cancellationToken); } + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutGeoipDatabaseResponse PutGeoipDatabase(PutGeoipDatabaseRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(PutGeoipDatabaseRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutGeoipDatabaseResponse PutGeoipDatabase(PutGeoipDatabaseRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutGeoipDatabaseResponse PutGeoipDatabase(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutGeoipDatabaseResponse PutGeoipDatabase(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutGeoipDatabaseResponse PutGeoipDatabase(PutGeoipDatabaseRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutGeoipDatabaseResponse PutGeoipDatabase(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutGeoipDatabaseResponse PutGeoipDatabase(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(PutGeoipDatabaseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutGeoipDatabaseResponse, PutGeoipDatabaseRequestParameters>(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(PutGeoipDatabaseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// + /// Returns information about one or more geoip database configurations. + /// + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutGeoipDatabaseAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutGeoipDatabaseRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + /// /// /// Creates or updates an ingest pipeline. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.g.cs index 081c3db871..705489f941 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.g.cs @@ -29,8 +29,20 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class DatabaseConfiguration { + /// + /// + /// The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. + /// At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. + /// + /// [JsonInclude, JsonPropertyName("maxmind")] public Elastic.Clients.Elasticsearch.Ingest.Maxmind Maxmind { get; init; } + + /// + /// + /// The provider-assigned name of the IP geolocation database to download. + /// + /// [JsonInclude, JsonPropertyName("name")] public string Name { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs index 971f5f2353..70171fb6c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs @@ -34,8 +34,16 @@ public sealed partial class GeoIpDownloadStatistics /// Current number of databases available for use. /// /// - [JsonInclude, JsonPropertyName("database_count")] - public int DatabaseCount { get; init; } + [JsonInclude, JsonPropertyName("databases_count")] + public int DatabasesCount { get; init; } + + /// + /// + /// Total number of databases not updated after 30 days + /// + /// + [JsonInclude, JsonPropertyName("expired_databases")] + public int ExpiredDatabases { get; init; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.g.cs new file mode 100644 index 0000000000..c63a68a831 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.g.cs @@ -0,0 +1,626 @@ +// 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.Ingest; + +public sealed partial class HtmlStripProcessor +{ + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// + /// Conditionally execute the processor. + /// + /// + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + + /// + /// + /// Ignore failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document, + /// + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(HtmlStripProcessor htmlStripProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.HtmlStrip(htmlStripProcessor); +} + +public sealed partial class HtmlStripProcessorDescriptor : SerializableDescriptor> +{ + internal HtmlStripProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public HtmlStripProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public HtmlStripProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public HtmlStripProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public HtmlStripProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document, + /// + /// + public HtmlStripProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public HtmlStripProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public HtmlStripProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class HtmlStripProcessorDescriptor : SerializableDescriptor +{ + internal HtmlStripProcessorDescriptor(Action configure) => configure.Invoke(this); + + public HtmlStripProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public HtmlStripProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// The string-valued field to remove HTML tags from. + /// + /// + public HtmlStripProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public HtmlStripProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public HtmlStripProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and field does not exist or is null, the processor quietly exits without modifying the document, + /// + /// + public HtmlStripProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public HtmlStripProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public HtmlStripProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public HtmlStripProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// The field to assign the converted value to + /// By default, the field is updated in-place. + /// + /// + public HtmlStripProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.g.cs index 3a002d188e..95aad9d84a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.g.cs @@ -30,5 +30,30 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class Maxmind { [JsonInclude, JsonPropertyName("account_id")] - public string AccountId { get; init; } + public Elastic.Clients.Elasticsearch.Id AccountId { get; set; } +} + +public sealed partial class MaxmindDescriptor : SerializableDescriptor +{ + internal MaxmindDescriptor(Action configure) => configure.Invoke(this); + + public MaxmindDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Id AccountIdValue { get; set; } + + public MaxmindDescriptor AccountId(Elastic.Clients.Elasticsearch.Id accountId) + { + AccountIdValue = accountId; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("account_id"); + JsonSerializer.Serialize(writer, AccountIdValue, options); + writer.WriteEndObject(); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulation.g.cs index 63b4a3ee3a..5b3cad876d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulation.g.cs @@ -29,10 +29,14 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class PipelineSimulation { + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } [JsonInclude, JsonPropertyName("doc")] public Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation? Doc { get; init; } - [JsonInclude, JsonPropertyName("processor_results")] - public IReadOnlyCollection? ProcessorResults { get; init; } + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("ignored_error")] + public Elastic.Clients.Elasticsearch.ErrorCause? IgnoredError { get; init; } [JsonInclude, JsonPropertyName("processor_type")] public string? ProcessorType { get; init; } [JsonInclude, JsonPropertyName("status")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs index 0f469a8265..5ee6131892 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs @@ -63,6 +63,7 @@ internal Processor(string variantName, object variant) public static Processor Geoip(Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor geoIpProcessor) => new Processor("geoip", geoIpProcessor); public static Processor Grok(Elastic.Clients.Elasticsearch.Ingest.GrokProcessor grokProcessor) => new Processor("grok", grokProcessor); public static Processor Gsub(Elastic.Clients.Elasticsearch.Ingest.GsubProcessor gsubProcessor) => new Processor("gsub", gsubProcessor); + public static Processor HtmlStrip(Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor htmlStripProcessor) => new Processor("html_strip", htmlStripProcessor); public static Processor Inference(Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor inferenceProcessor) => new Processor("inference", inferenceProcessor); public static Processor Join(Elastic.Clients.Elasticsearch.Ingest.JoinProcessor joinProcessor) => new Processor("join", joinProcessor); public static Processor Json(Elastic.Clients.Elasticsearch.Ingest.JsonProcessor jsonProcessor) => new Processor("json", jsonProcessor); @@ -79,6 +80,7 @@ internal Processor(string variantName, object variant) public static Processor Split(Elastic.Clients.Elasticsearch.Ingest.SplitProcessor splitProcessor) => new Processor("split", splitProcessor); public static Processor Trim(Elastic.Clients.Elasticsearch.Ingest.TrimProcessor trimProcessor) => new Processor("trim", trimProcessor); public static Processor Uppercase(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor uppercaseProcessor) => new Processor("uppercase", uppercaseProcessor); + public static Processor UriParts(Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor uriPartsProcessor) => new Processor("uri_parts", uriPartsProcessor); public static Processor UrlDecode(Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor urlDecodeProcessor) => new Processor("urldecode", urlDecodeProcessor); public static Processor UserAgent(Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor userAgentProcessor) => new Processor("user_agent", userAgentProcessor); @@ -239,6 +241,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "html_strip") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "inference") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -351,6 +360,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "uri_parts") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "urldecode") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -431,6 +447,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "gsub": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.GsubProcessor)value.Variant, options); break; + case "html_strip": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor)value.Variant, options); + break; case "inference": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor)value.Variant, options); break; @@ -479,6 +498,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "uppercase": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor)value.Variant, options); break; + case "uri_parts": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor)value.Variant, options); + break; case "urldecode": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor)value.Variant, options); break; @@ -557,6 +579,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Grok(Action> configure) => Set(configure, "grok"); public ProcessorDescriptor Gsub(Elastic.Clients.Elasticsearch.Ingest.GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); public ProcessorDescriptor Gsub(Action> configure) => Set(configure, "gsub"); + public ProcessorDescriptor HtmlStrip(Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor htmlStripProcessor) => Set(htmlStripProcessor, "html_strip"); + public ProcessorDescriptor HtmlStrip(Action> configure) => Set(configure, "html_strip"); public ProcessorDescriptor Inference(Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); public ProcessorDescriptor Inference(Action> configure) => Set(configure, "inference"); public ProcessorDescriptor Join(Elastic.Clients.Elasticsearch.Ingest.JoinProcessor joinProcessor) => Set(joinProcessor, "join"); @@ -589,6 +613,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Trim(Action> configure) => Set(configure, "trim"); public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); public ProcessorDescriptor Uppercase(Action> configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UriParts(Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor uriPartsProcessor) => Set(uriPartsProcessor, "uri_parts"); + public ProcessorDescriptor UriParts(Action> configure) => Set(configure, "uri_parts"); public ProcessorDescriptor UrlDecode(Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); public ProcessorDescriptor UrlDecode(Action> configure) => Set(configure, "urldecode"); public ProcessorDescriptor UserAgent(Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor userAgentProcessor) => Set(userAgentProcessor, "user_agent"); @@ -679,6 +705,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Grok(Action configure) => Set(configure, "grok"); public ProcessorDescriptor Gsub(Elastic.Clients.Elasticsearch.Ingest.GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); public ProcessorDescriptor Gsub(Action configure) => Set(configure, "gsub"); + public ProcessorDescriptor HtmlStrip(Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor htmlStripProcessor) => Set(htmlStripProcessor, "html_strip"); + public ProcessorDescriptor HtmlStrip(Action configure) => Set(configure, "html_strip"); public ProcessorDescriptor Inference(Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); public ProcessorDescriptor Inference(Action configure) => Set(configure, "inference"); public ProcessorDescriptor Join(Elastic.Clients.Elasticsearch.Ingest.JoinProcessor joinProcessor) => Set(joinProcessor, "join"); @@ -711,6 +739,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Trim(Action configure) => Set(configure, "trim"); public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); public ProcessorDescriptor Uppercase(Action configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UriParts(Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor uriPartsProcessor) => Set(uriPartsProcessor, "uri_parts"); + public ProcessorDescriptor UriParts(Action configure) => Set(configure, "uri_parts"); public ProcessorDescriptor UrlDecode(Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); public ProcessorDescriptor UrlDecode(Action configure) => Set(configure, "urldecode"); public ProcessorDescriptor UserAgent(Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor userAgentProcessor) => Set(userAgentProcessor, "user_agent"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs new file mode 100644 index 0000000000..0fdf45f232 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs @@ -0,0 +1,38 @@ +// 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.Ingest; + +public sealed partial class SimulateDocumentResult +{ + [JsonInclude, JsonPropertyName("doc")] + public Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation? Doc { get; init; } + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("processor_results")] + public IReadOnlyCollection? ProcessorResults { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.g.cs new file mode 100644 index 0000000000..dc96910e95 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.g.cs @@ -0,0 +1,710 @@ +// 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.Ingest; + +public sealed partial class UriPartsProcessor +{ + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// Field containing the URI string. + /// + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// + /// Conditionally execute the processor. + /// + /// + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + + /// + /// + /// Ignore failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// + /// If true and field does not exist, the processor quietly exits without modifying the document. + /// + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// + /// If true, the processor copies the unparsed URI to <target_field>.original. + /// + /// + [JsonInclude, JsonPropertyName("keep_original")] + public bool? KeepOriginal { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// + /// If true, the processor removes the field after parsing the URI string. + /// If parsing fails, the processor does not remove the field. + /// + /// + [JsonInclude, JsonPropertyName("remove_if_successful")] + public bool? RemoveIfSuccessful { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// Output field for the URI object. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(UriPartsProcessor uriPartsProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.UriParts(uriPartsProcessor); +} + +public sealed partial class UriPartsProcessorDescriptor : SerializableDescriptor> +{ + internal UriPartsProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public UriPartsProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private bool? KeepOriginalValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private bool? RemoveIfSuccessfulValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public UriPartsProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public UriPartsProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public UriPartsProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and field does not exist, the processor quietly exits without modifying the document. + /// + /// + public UriPartsProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// If true, the processor copies the unparsed URI to <target_field>.original. + /// + /// + public UriPartsProcessorDescriptor KeepOriginal(bool? keepOriginal = true) + { + KeepOriginalValue = keepOriginal; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public UriPartsProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// If true, the processor removes the field after parsing the URI string. + /// If parsing fails, the processor does not remove the field. + /// + /// + public UriPartsProcessorDescriptor RemoveIfSuccessful(bool? removeIfSuccessful = true) + { + RemoveIfSuccessfulValue = removeIfSuccessful; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public UriPartsProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (KeepOriginalValue.HasValue) + { + writer.WritePropertyName("keep_original"); + writer.WriteBooleanValue(KeepOriginalValue.Value); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (RemoveIfSuccessfulValue.HasValue) + { + writer.WritePropertyName("remove_if_successful"); + writer.WriteBooleanValue(RemoveIfSuccessfulValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class UriPartsProcessorDescriptor : SerializableDescriptor +{ + internal UriPartsProcessorDescriptor(Action configure) => configure.Invoke(this); + + public UriPartsProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private bool? KeepOriginalValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private bool? RemoveIfSuccessfulValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public UriPartsProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the URI string. + /// + /// + public UriPartsProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public UriPartsProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public UriPartsProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and field does not exist, the processor quietly exits without modifying the document. + /// + /// + public UriPartsProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// If true, the processor copies the unparsed URI to <target_field>.original. + /// + /// + public UriPartsProcessorDescriptor KeepOriginal(bool? keepOriginal = true) + { + KeepOriginalValue = keepOriginal; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public UriPartsProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public UriPartsProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// If true, the processor removes the field after parsing the URI string. + /// If parsing fails, the processor does not remove the field. + /// + /// + public UriPartsProcessorDescriptor RemoveIfSuccessful(bool? removeIfSuccessful = true) + { + RemoveIfSuccessfulValue = removeIfSuccessful; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public UriPartsProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the URI object. + /// + /// + public UriPartsProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.Value); + } + + if (IgnoreMissingValue.HasValue) + { + writer.WritePropertyName("ignore_missing"); + writer.WriteBooleanValue(IgnoreMissingValue.Value); + } + + if (KeepOriginalValue.HasValue) + { + writer.WritePropertyName("keep_original"); + writer.WriteBooleanValue(KeepOriginalValue.Value); + } + + if (OnFailureDescriptor is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, OnFailureDescriptor, options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorAction is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (OnFailureDescriptorActions is not null) + { + writer.WritePropertyName("on_failure"); + writer.WriteStartArray(); + foreach (var action in OnFailureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (RemoveIfSuccessfulValue.HasValue) + { + writer.WritePropertyName("remove_if_successful"); + writer.WriteBooleanValue(RemoveIfSuccessfulValue.Value); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + if (TargetFieldValue is not null) + { + writer.WritePropertyName("target_field"); + JsonSerializer.Serialize(writer, TargetFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs index a916ae77c9..fa40241afa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs @@ -50,24 +50,18 @@ internal DynamicTemplate(string variantName, object variant) public static DynamicTemplate Runtime(Elastic.Clients.Elasticsearch.Mapping.IProperty property) => new DynamicTemplate("runtime", property); [JsonInclude, JsonPropertyName("match")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Match { get; set; } [JsonInclude, JsonPropertyName("match_mapping_type")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? MatchMappingType { get; set; } [JsonInclude, JsonPropertyName("match_pattern")] public Elastic.Clients.Elasticsearch.Mapping.MatchType? MatchPattern { get; set; } [JsonInclude, JsonPropertyName("path_match")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? PathMatch { get; set; } [JsonInclude, JsonPropertyName("path_unmatch")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? PathUnmatch { get; set; } [JsonInclude, JsonPropertyName("unmatch")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Unmatch { get; set; } [JsonInclude, JsonPropertyName("unmatch_mapping_type")] - [SingleOrManyCollectionConverter(typeof(string))] public ICollection? UnmatchMappingType { get; set; } public bool TryGet([NotNullWhen(true)] out T? result) where T : class