From 03d8c871bac08e80a14c842a2db489ae3ae9da27 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Wed, 16 Oct 2024 12:51:24 +0200 Subject: [PATCH] Regenerate client using the latest specification (#8388) --- .../_Generated/Api/ApiUrlLookup.g.cs | 1 - .../Api/Cluster/ClusterStatsRequest.g.cs | 10 +- .../IndexManagement/ClearCacheResponse.g.cs | 2 +- .../Api/IndexManagement/FlushResponse.g.cs | 2 +- .../IndexManagement/ForcemergeResponse.g.cs | 2 +- .../IndexManagement/PutTemplateRequest.g.cs | 577 -------- .../Api/IndexManagement/RefreshResponse.g.cs | 2 +- .../GetBuiltinPrivilegesResponse.g.cs | 3 +- .../Api/Snapshot/RestoreResponse.g.cs | 4 +- .../Client/ElasticsearchClient.Indices.g.cs | 97 -- .../Types/Analysis/EdgeNGramTokenizer.g.cs | 28 +- .../Types/Analysis/NGramTokenizer.g.cs | 28 +- .../_Generated/Types/Enums/Enums.Ingest.g.cs | 70 + .../_Generated/Types/Enums/Enums.Mapping.g.cs | 292 ++++ .../IndexManagement/DataStreamVisibility.g.cs | 15 + .../Types/Ingest/CommunityIDProcessor.g.cs | 1310 +++++++++++++++++ .../Types/Ingest/DateProcessor.g.cs | 47 + .../Types/Ingest/FingerprintProcessor.g.cs | 676 +++++++++ .../Types/Ingest/GrokProcessor.g.cs | 47 + .../_Generated/Types/Ingest/IngestInfo.g.cs | 2 + .../Ingest/NetworkDirectionProcessor.g.cs | 866 +++++++++++ .../_Generated/Types/Ingest/Processor.g.cs | 75 + .../Ingest/Redact.g.cs} | 13 +- .../Types/Ingest/RedactProcessor.g.cs | 44 + .../Ingest/RegisteredDomainProcessor.g.cs | 629 ++++++++ .../Types/Ingest/TerminateProcessor.g.cs | 407 +++++ .../Mapping/DenseVectorIndexOptions.g.cs | 89 +- .../Types/Mapping/DenseVectorProperty.g.cs | 175 ++- .../Types/Nodes/NodeInfoSettingsNetwork.g.cs | 3 +- .../_Generated/Types/Nodes/NodeInfoXpack.g.cs | 2 + .../Types/Nodes/NodeInfoXpackMl.g.cs | 34 + .../Types/Nodes/NodeInfoXpackSecurity.g.cs | 2 +- .../Nodes/NodeInfoXpackSecurityAuthc.g.cs | 4 +- .../Types/Security/IndicesPrivileges.g.cs | 10 +- .../Types/Security/UserIndicesPrivileges.g.cs | 1 - .../_Generated/Types/Xpack/Features.g.cs | 10 - .../Api/Cluster/ClusterStatsRequest.g.cs | 10 +- .../MoveToStepRequest.g.cs | 28 +- .../IndexManagement/ClearCacheResponse.g.cs | 2 +- .../Api/IndexManagement/FlushResponse.g.cs | 2 +- .../IndexManagement/ForcemergeResponse.g.cs | 2 +- .../Api/IndexManagement/RefreshResponse.g.cs | 2 +- .../Api/Inference/PutInferenceResponse.g.cs | 2 +- .../GetBuiltinPrivilegesResponse.g.cs | 3 +- .../Api/Snapshot/RestoreResponse.g.cs | 4 +- .../Types/Analysis/EdgeNGramTokenizer.g.cs | 28 +- .../Types/Analysis/NGramTokenizer.g.cs | 28 +- .../_Generated/Types/Enums/Enums.Ingest.g.cs | 70 + .../_Generated/Types/Enums/Enums.Mapping.g.cs | 292 ++++ .../IndexLifecycleManagement/StepKey.g.cs | 28 +- .../IndexManagement/DataStreamVisibility.g.cs | 15 + .../Types/Inference/InferenceEndpoint.g.cs | 14 +- .../Inference/InferenceEndpointInfo.g.cs | 2 +- .../Types/Ingest/CommunityIDProcessor.g.cs | 1310 +++++++++++++++++ .../Types/Ingest/DateProcessor.g.cs | 47 + .../Types/Ingest/FingerprintProcessor.g.cs | 676 +++++++++ .../Types/Ingest/GrokProcessor.g.cs | 47 + .../Ingest/NetworkDirectionProcessor.g.cs | 866 +++++++++++ .../_Generated/Types/Ingest/Processor.g.cs | 75 + .../Ingest/RegisteredDomainProcessor.g.cs | 629 ++++++++ .../Types/Ingest/TerminateProcessor.g.cs | 407 +++++ .../Mapping/DenseVectorIndexOptions.g.cs | 89 +- .../Types/Mapping/DenseVectorProperty.g.cs | 175 ++- .../Types/Nodes/NodeInfoSettingsNetwork.g.cs | 3 +- .../_Generated/Types/Nodes/NodeInfoXpack.g.cs | 2 + .../Types/Nodes/NodeInfoXpackMl.g.cs | 34 + .../Types/Nodes/NodeInfoXpackSecurity.g.cs | 2 +- .../Nodes/NodeInfoXpackSecurityAuthc.g.cs | 4 +- .../Types/Security/IndicesPrivileges.g.cs | 10 +- .../Security/RemoteIndicesPrivileges.g.cs | 10 +- .../Types/Security/UserIndicesPrivileges.g.cs | 1 - .../_Generated/Types/Xpack/Features.g.cs | 14 +- 72 files changed, 9649 insertions(+), 863 deletions(-) delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CommunityIDProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FingerprintProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/{Api/IndexManagement/PutTemplateResponse.g.cs => Types/Ingest/Redact.g.cs} (78%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TerminateProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs 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 5384356e455..a95353e6107 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs @@ -78,7 +78,6 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementPutIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" }); internal static ApiUrls IndexManagementPutMapping = new ApiUrls(new[] { "{index}/_mapping" }); internal static ApiUrls IndexManagementPutSettings = new ApiUrls(new[] { "_settings", "{index}/_settings" }); - internal static ApiUrls IndexManagementPutTemplate = new ApiUrls(new[] { "_template/{name}" }); internal static ApiUrls IndexManagementRecovery = new ApiUrls(new[] { "_recovery", "{index}/_recovery" }); internal static ApiUrls IndexManagementRefresh = new ApiUrls(new[] { "_refresh", "{index}/_refresh" }); internal static ApiUrls IndexManagementResolveIndex = new ApiUrls(new[] { "_resolve/index/{name}" }); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs index f3ac2f6392f..90fdb724cdb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs @@ -33,10 +33,10 @@ public sealed partial class ClusterStatsRequestParameters : RequestParameters { /// /// - /// If true, returns settings in flat format. + /// Include remote cluster data into the response /// /// - public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + public bool? IncludeRemotes { get => Q("include_remotes"); set => Q("include_remotes", value); } /// /// @@ -74,11 +74,11 @@ public ClusterStatsRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nod /// /// - /// If true, returns settings in flat format. + /// Include remote cluster data into the response /// /// [JsonIgnore] - public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + public bool? IncludeRemotes { get => Q("include_remotes"); set => Q("include_remotes", value); } /// /// @@ -117,7 +117,7 @@ public ClusterStatsRequestDescriptor() internal override string OperationName => "cluster.stats"; - public ClusterStatsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public ClusterStatsRequestDescriptor IncludeRemotes(bool? includeRemotes = true) => Qs("include_remotes", includeRemotes); public ClusterStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); public ClusterStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs index e81d3e2bfdf..17ef061beb2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs @@ -29,5 +29,5 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class ClearCacheResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("_shards")] - public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushResponse.g.cs index cd690796910..687c6c94df6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushResponse.g.cs @@ -29,5 +29,5 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class FlushResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("_shards")] - public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs index c2c25ee1c05..a26e677edd8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs @@ -29,7 +29,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class ForcemergeResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("_shards")] - public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs deleted file mode 100644 index f1bc42f7dbe..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs +++ /dev/null @@ -1,577 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Serverless.Fluent; -using Elastic.Clients.Elasticsearch.Serverless.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.IndexManagement; - -public sealed partial class PutTemplateRequestParameters : RequestParameters -{ - public string? Cause { get => Q("cause"); set => Q("cause", value); } - - /// - /// - /// If true, this request cannot replace or update existing index templates. - /// - /// - public bool? Create { get => Q("create"); set => Q("create", value); } - - /// - /// - /// 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); } -} - -/// -/// -/// Create or update an index template. -/// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. -/// -/// -public sealed partial class PutTemplateRequest : PlainRequest -{ - public PutTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) - { - } - - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutTemplate; - - protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; - - internal override bool SupportsBody => true; - - internal override string OperationName => "indices.put_template"; - - [JsonIgnore] - public string? Cause { get => Q("cause"); set => Q("cause", value); } - - /// - /// - /// If true, this request cannot replace or update existing index templates. - /// - /// - [JsonIgnore] - public bool? Create { get => Q("create"); set => Q("create", value); } - - /// - /// - /// 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); } - - /// - /// - /// Aliases for the index. - /// - /// - [JsonInclude, JsonPropertyName("aliases")] - public IDictionary? Aliases { get; set; } - - /// - /// - /// Array of wildcard expressions used to match the names - /// of indices during creation. - /// - /// - [JsonInclude, JsonPropertyName("index_patterns")] - [SingleOrManyCollectionConverter(typeof(string))] - public ICollection? IndexPatterns { get; set; } - - /// - /// - /// Mapping for fields in the index. - /// - /// - [JsonInclude, JsonPropertyName("mappings")] - public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Mappings { get; set; } - - /// - /// - /// Order in which Elasticsearch applies this template if index - /// matches multiple templates. - /// - /// - /// Templates with lower 'order' values are merged first. Templates with higher - /// 'order' values are merged later, overriding templates with lower values. - /// - /// - [JsonInclude, JsonPropertyName("order")] - public int? Order { get; set; } - - /// - /// - /// Configuration options for the index. - /// - /// - [JsonInclude, JsonPropertyName("settings")] - public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Settings { get; set; } - - /// - /// - /// Version number used to manage index templates externally. This number - /// is not automatically generated by Elasticsearch. - /// - /// - [JsonInclude, JsonPropertyName("version")] - public long? Version { get; set; } -} - -/// -/// -/// Create or update an index template. -/// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. -/// -/// -public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor, PutTemplateRequestParameters> -{ - internal PutTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); - - public PutTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) - { - } - - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutTemplate; - - protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; - - internal override bool SupportsBody => true; - - internal override string OperationName => "indices.put_template"; - - public PutTemplateRequestDescriptor Cause(string? cause) => Qs("cause", cause); - public PutTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); - public PutTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); - - public PutTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) - { - RouteValues.Required("name", name); - return Self; - } - - private IDictionary> AliasesValue { get; set; } - private ICollection? IndexPatternsValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action> MappingsDescriptorAction { get; set; } - private int? OrderValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action> SettingsDescriptorAction { get; set; } - private long? VersionValue { get; set; } - - /// - /// - /// Aliases for the index. - /// - /// - public PutTemplateRequestDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) - { - AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); - return Self; - } - - /// - /// - /// Array of wildcard expressions used to match the names - /// of indices during creation. - /// - /// - public PutTemplateRequestDescriptor IndexPatterns(ICollection? indexPatterns) - { - IndexPatternsValue = indexPatterns; - return Self; - } - - /// - /// - /// Mapping for fields in the index. - /// - /// - public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) - { - MappingsDescriptor = null; - MappingsDescriptorAction = null; - MappingsValue = mappings; - return Self; - } - - public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) - { - MappingsValue = null; - MappingsDescriptorAction = null; - MappingsDescriptor = descriptor; - return Self; - } - - public PutTemplateRequestDescriptor Mappings(Action> configure) - { - MappingsValue = null; - MappingsDescriptor = null; - MappingsDescriptorAction = configure; - return Self; - } - - /// - /// - /// Order in which Elasticsearch applies this template if index - /// matches multiple templates. - /// - /// - /// Templates with lower 'order' values are merged first. Templates with higher - /// 'order' values are merged later, overriding templates with lower values. - /// - /// - public PutTemplateRequestDescriptor Order(int? order) - { - OrderValue = order; - return Self; - } - - /// - /// - /// Configuration options for the index. - /// - /// - public PutTemplateRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) - { - SettingsDescriptor = null; - SettingsDescriptorAction = null; - SettingsValue = settings; - return Self; - } - - public PutTemplateRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) - { - SettingsValue = null; - SettingsDescriptorAction = null; - SettingsDescriptor = descriptor; - return Self; - } - - public PutTemplateRequestDescriptor Settings(Action> configure) - { - SettingsValue = null; - SettingsDescriptor = null; - SettingsDescriptorAction = configure; - return Self; - } - - /// - /// - /// Version number used to manage index templates externally. This number - /// is not automatically generated by Elasticsearch. - /// - /// - public PutTemplateRequestDescriptor Version(long? version) - { - VersionValue = version; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (AliasesValue is not null) - { - writer.WritePropertyName("aliases"); - JsonSerializer.Serialize(writer, AliasesValue, options); - } - - if (IndexPatternsValue is not null) - { - writer.WritePropertyName("index_patterns"); - SingleOrManySerializationHelper.Serialize(IndexPatternsValue, writer, options); - } - - if (MappingsDescriptor is not null) - { - writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, MappingsDescriptor, options); - } - else if (MappingsDescriptorAction is not null) - { - writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); - } - else if (MappingsValue is not null) - { - writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, MappingsValue, options); - } - - if (OrderValue.HasValue) - { - writer.WritePropertyName("order"); - writer.WriteNumberValue(OrderValue.Value); - } - - if (SettingsDescriptor is not null) - { - writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, SettingsDescriptor, options); - } - else if (SettingsDescriptorAction is not null) - { - writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); - } - else if (SettingsValue is not null) - { - writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, SettingsValue, options); - } - - if (VersionValue.HasValue) - { - writer.WritePropertyName("version"); - writer.WriteNumberValue(VersionValue.Value); - } - - writer.WriteEndObject(); - } -} - -/// -/// -/// Create or update an index template. -/// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. -/// -/// -public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor -{ - internal PutTemplateRequestDescriptor(Action configure) => configure.Invoke(this); - - public PutTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) - { - } - - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutTemplate; - - protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; - - internal override bool SupportsBody => true; - - internal override string OperationName => "indices.put_template"; - - public PutTemplateRequestDescriptor Cause(string? cause) => Qs("cause", cause); - public PutTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); - public PutTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); - - public PutTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) - { - RouteValues.Required("name", name); - return Self; - } - - private IDictionary AliasesValue { get; set; } - private ICollection? IndexPatternsValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action MappingsDescriptorAction { get; set; } - private int? OrderValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action SettingsDescriptorAction { get; set; } - private long? VersionValue { get; set; } - - /// - /// - /// Aliases for the index. - /// - /// - public PutTemplateRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) - { - AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); - return Self; - } - - /// - /// - /// Array of wildcard expressions used to match the names - /// of indices during creation. - /// - /// - public PutTemplateRequestDescriptor IndexPatterns(ICollection? indexPatterns) - { - IndexPatternsValue = indexPatterns; - return Self; - } - - /// - /// - /// Mapping for fields in the index. - /// - /// - public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) - { - MappingsDescriptor = null; - MappingsDescriptorAction = null; - MappingsValue = mappings; - return Self; - } - - public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) - { - MappingsValue = null; - MappingsDescriptorAction = null; - MappingsDescriptor = descriptor; - return Self; - } - - public PutTemplateRequestDescriptor Mappings(Action configure) - { - MappingsValue = null; - MappingsDescriptor = null; - MappingsDescriptorAction = configure; - return Self; - } - - /// - /// - /// Order in which Elasticsearch applies this template if index - /// matches multiple templates. - /// - /// - /// Templates with lower 'order' values are merged first. Templates with higher - /// 'order' values are merged later, overriding templates with lower values. - /// - /// - public PutTemplateRequestDescriptor Order(int? order) - { - OrderValue = order; - return Self; - } - - /// - /// - /// Configuration options for the index. - /// - /// - public PutTemplateRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) - { - SettingsDescriptor = null; - SettingsDescriptorAction = null; - SettingsValue = settings; - return Self; - } - - public PutTemplateRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) - { - SettingsValue = null; - SettingsDescriptorAction = null; - SettingsDescriptor = descriptor; - return Self; - } - - public PutTemplateRequestDescriptor Settings(Action configure) - { - SettingsValue = null; - SettingsDescriptor = null; - SettingsDescriptorAction = configure; - return Self; - } - - /// - /// - /// Version number used to manage index templates externally. This number - /// is not automatically generated by Elasticsearch. - /// - /// - public PutTemplateRequestDescriptor Version(long? version) - { - VersionValue = version; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (AliasesValue is not null) - { - writer.WritePropertyName("aliases"); - JsonSerializer.Serialize(writer, AliasesValue, options); - } - - if (IndexPatternsValue is not null) - { - writer.WritePropertyName("index_patterns"); - SingleOrManySerializationHelper.Serialize(IndexPatternsValue, writer, options); - } - - if (MappingsDescriptor is not null) - { - writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, MappingsDescriptor, options); - } - else if (MappingsDescriptorAction is not null) - { - writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); - } - else if (MappingsValue is not null) - { - writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, MappingsValue, options); - } - - if (OrderValue.HasValue) - { - writer.WritePropertyName("order"); - writer.WriteNumberValue(OrderValue.Value); - } - - if (SettingsDescriptor is not null) - { - writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, SettingsDescriptor, options); - } - else if (SettingsDescriptorAction is not null) - { - writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); - } - else if (SettingsValue is not null) - { - writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, SettingsValue, options); - } - - if (VersionValue.HasValue) - { - writer.WritePropertyName("version"); - writer.WriteNumberValue(VersionValue.Value); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshResponse.g.cs index 179549b48e9..52956bca56e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshResponse.g.cs @@ -29,5 +29,5 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class RefreshResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("_shards")] - public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs index 36890a6be56..f8523f5be5e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs @@ -31,6 +31,5 @@ public sealed partial class GetBuiltinPrivilegesResponse : ElasticsearchResponse [JsonInclude, JsonPropertyName("cluster")] public IReadOnlyCollection Cluster { get; init; } [JsonInclude, JsonPropertyName("index")] - [SingleOrManyCollectionConverter(typeof(string))] - public IReadOnlyCollection Indices { get; init; } + public IReadOnlyCollection Index { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreResponse.g.cs index aa37bbc1b03..0ee5b1548b6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreResponse.g.cs @@ -28,6 +28,8 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; public sealed partial class RestoreResponse : ElasticsearchResponse { + [JsonInclude, JsonPropertyName("accepted")] + public bool? Accepted { get; init; } [JsonInclude, JsonPropertyName("snapshot")] - public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotRestore Snapshot { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotRestore? Snapshot { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs index 5d44684be76..7b6acfce7ab 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -3600,103 +3600,6 @@ public virtual Task PutSettingsAsync(Elastic.Clients return DoRequestAsync(descriptor, cancellationToken); } - /// - /// - /// Create or update an index template. - /// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. - /// - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task PutTemplateAsync(PutTemplateRequest request, CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - /// - /// - /// Create or update an index template. - /// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. - /// - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, PutTemplateResponse, PutTemplateRequestParameters>(descriptor, cancellationToken); - } - - /// - /// - /// Create or update an index template. - /// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. - /// - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) - { - var descriptor = new PutTemplateRequestDescriptor(name); - descriptor.BeforeRequest(); - return DoRequestAsync, PutTemplateResponse, PutTemplateRequestParameters>(descriptor, cancellationToken); - } - - /// - /// - /// Create or update an index template. - /// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. - /// - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new PutTemplateRequestDescriptor(name); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, PutTemplateResponse, PutTemplateRequestParameters>(descriptor, cancellationToken); - } - - /// - /// - /// Create or update an index template. - /// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. - /// - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// - /// Create or update an index template. - /// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. - /// - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) - { - var descriptor = new PutTemplateRequestDescriptor(name); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// - /// Create or update an index template. - /// Index templates define settings, mappings, and aliases that can be applied automatically to new indices. - /// - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new PutTemplateRequestDescriptor(name); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - /// /// /// Returns information about ongoing and completed shard recoveries for one or more indices. diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs index 41b05db29a7..a4e14124507 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs @@ -32,9 +32,9 @@ public sealed partial class EdgeNGramTokenizer : ITokenizer [JsonInclude, JsonPropertyName("custom_token_chars")] public string? CustomTokenChars { get; set; } [JsonInclude, JsonPropertyName("max_gram")] - public int MaxGram { get; set; } + public int? MaxGram { get; set; } [JsonInclude, JsonPropertyName("min_gram")] - public int MinGram { get; set; } + public int? MinGram { get; set; } [JsonInclude, JsonPropertyName("token_chars")] public ICollection? TokenChars { get; set; } @@ -54,8 +54,8 @@ public EdgeNGramTokenizerDescriptor() : base() } private string? CustomTokenCharsValue { get; set; } - private int MaxGramValue { get; set; } - private int MinGramValue { get; set; } + private int? MaxGramValue { get; set; } + private int? MinGramValue { get; set; } private ICollection? TokenCharsValue { get; set; } private string? VersionValue { get; set; } @@ -65,13 +65,13 @@ public EdgeNGramTokenizerDescriptor CustomTokenChars(string? customTokenChars) return Self; } - public EdgeNGramTokenizerDescriptor MaxGram(int maxGram) + public EdgeNGramTokenizerDescriptor MaxGram(int? maxGram) { MaxGramValue = maxGram; return Self; } - public EdgeNGramTokenizerDescriptor MinGram(int minGram) + public EdgeNGramTokenizerDescriptor MinGram(int? minGram) { MinGramValue = minGram; return Self; @@ -98,10 +98,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(CustomTokenCharsValue); } - writer.WritePropertyName("max_gram"); - writer.WriteNumberValue(MaxGramValue); - writer.WritePropertyName("min_gram"); - writer.WriteNumberValue(MinGramValue); + if (MaxGramValue.HasValue) + { + writer.WritePropertyName("max_gram"); + writer.WriteNumberValue(MaxGramValue.Value); + } + + if (MinGramValue.HasValue) + { + writer.WritePropertyName("min_gram"); + writer.WriteNumberValue(MinGramValue.Value); + } + if (TokenCharsValue is not null) { writer.WritePropertyName("token_chars"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs index 1c685bd6ccf..d0fddb79b9b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs @@ -32,9 +32,9 @@ public sealed partial class NGramTokenizer : ITokenizer [JsonInclude, JsonPropertyName("custom_token_chars")] public string? CustomTokenChars { get; set; } [JsonInclude, JsonPropertyName("max_gram")] - public int MaxGram { get; set; } + public int? MaxGram { get; set; } [JsonInclude, JsonPropertyName("min_gram")] - public int MinGram { get; set; } + public int? MinGram { get; set; } [JsonInclude, JsonPropertyName("token_chars")] public ICollection? TokenChars { get; set; } @@ -54,8 +54,8 @@ public NGramTokenizerDescriptor() : base() } private string? CustomTokenCharsValue { get; set; } - private int MaxGramValue { get; set; } - private int MinGramValue { get; set; } + private int? MaxGramValue { get; set; } + private int? MinGramValue { get; set; } private ICollection? TokenCharsValue { get; set; } private string? VersionValue { get; set; } @@ -65,13 +65,13 @@ public NGramTokenizerDescriptor CustomTokenChars(string? customTokenChars) return Self; } - public NGramTokenizerDescriptor MaxGram(int maxGram) + public NGramTokenizerDescriptor MaxGram(int? maxGram) { MaxGramValue = maxGram; return Self; } - public NGramTokenizerDescriptor MinGram(int minGram) + public NGramTokenizerDescriptor MinGram(int? minGram) { MinGramValue = minGram; return Self; @@ -98,10 +98,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(CustomTokenCharsValue); } - writer.WritePropertyName("max_gram"); - writer.WriteNumberValue(MaxGramValue); - writer.WritePropertyName("min_gram"); - writer.WriteNumberValue(MinGramValue); + if (MaxGramValue.HasValue) + { + writer.WritePropertyName("max_gram"); + writer.WriteNumberValue(MaxGramValue.Value); + } + + if (MinGramValue.HasValue) + { + writer.WritePropertyName("min_gram"); + writer.WriteNumberValue(MinGramValue.Value); + } + if (TokenCharsValue is not null) { writer.WritePropertyName("token_chars"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ingest.g.cs index 6d0a3acaabb..81ceefaf2ce 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ingest.g.cs @@ -35,6 +35,8 @@ public enum ConvertType String, [EnumMember(Value = "long")] Long, + [EnumMember(Value = "ip")] + Ip, [EnumMember(Value = "integer")] Integer, [EnumMember(Value = "float")] @@ -58,6 +60,8 @@ public override ConvertType Read(ref Utf8JsonReader reader, Type typeToConvert, return ConvertType.String; case "long": return ConvertType.Long; + case "ip": + return ConvertType.Ip; case "integer": return ConvertType.Integer; case "float": @@ -84,6 +88,9 @@ public override void Write(Utf8JsonWriter writer, ConvertType value, JsonSeriali case ConvertType.Long: writer.WriteStringValue("long"); return; + case ConvertType.Ip: + writer.WriteStringValue("ip"); + return; case ConvertType.Integer: writer.WriteStringValue("integer"); return; @@ -105,6 +112,69 @@ public override void Write(Utf8JsonWriter writer, ConvertType value, JsonSeriali } } +[JsonConverter(typeof(FingerprintDigestConverter))] +public enum FingerprintDigest +{ + [EnumMember(Value = "SHA-512")] + Sha512, + [EnumMember(Value = "SHA-256")] + Sha256, + [EnumMember(Value = "SHA-1")] + Sha1, + [EnumMember(Value = "MurmurHash3")] + Murmurhash3, + [EnumMember(Value = "MD5")] + Md5 +} + +internal sealed class FingerprintDigestConverter : JsonConverter +{ + public override FingerprintDigest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "SHA-512": + return FingerprintDigest.Sha512; + case "SHA-256": + return FingerprintDigest.Sha256; + case "SHA-1": + return FingerprintDigest.Sha1; + case "MurmurHash3": + return FingerprintDigest.Murmurhash3; + case "MD5": + return FingerprintDigest.Md5; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, FingerprintDigest value, JsonSerializerOptions options) + { + switch (value) + { + case FingerprintDigest.Sha512: + writer.WriteStringValue("SHA-512"); + return; + case FingerprintDigest.Sha256: + writer.WriteStringValue("SHA-256"); + return; + case FingerprintDigest.Sha1: + writer.WriteStringValue("SHA-1"); + return; + case FingerprintDigest.Murmurhash3: + writer.WriteStringValue("MurmurHash3"); + return; + case FingerprintDigest.Md5: + writer.WriteStringValue("MD5"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(GeoGridTargetFormatConverter))] public enum GeoGridTargetFormat { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Mapping.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Mapping.g.cs index 22624d5e068..5fd4dcffbe2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Mapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Mapping.g.cs @@ -28,6 +28,298 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; +[JsonConverter(typeof(DenseVectorElementTypeConverter))] +public enum DenseVectorElementType +{ + /// + /// + /// Indexes a 4-byte floating-point value per dimension. + /// + /// + [EnumMember(Value = "float")] + Float, + /// + /// + /// Indexes a 1-byte integer value per dimension. + /// + /// + [EnumMember(Value = "byte")] + Byte, + /// + /// + /// Indexes a single bit per dimension. Useful for very high-dimensional vectors or models that specifically support + /// bit vectors. + /// + /// + /// NOTE: when using bit, the number of dimensions must be a multiple of 8 and must represent the number of bits. + /// + /// + [EnumMember(Value = "bit")] + Bit +} + +internal sealed class DenseVectorElementTypeConverter : JsonConverter +{ + public override DenseVectorElementType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "float": + return DenseVectorElementType.Float; + case "byte": + return DenseVectorElementType.Byte; + case "bit": + return DenseVectorElementType.Bit; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DenseVectorElementType value, JsonSerializerOptions options) + { + switch (value) + { + case DenseVectorElementType.Float: + writer.WriteStringValue("float"); + return; + case DenseVectorElementType.Byte: + writer.WriteStringValue("byte"); + return; + case DenseVectorElementType.Bit: + writer.WriteStringValue("bit"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DenseVectorIndexOptionsTypeConverter))] +public enum DenseVectorIndexOptionsType +{ + /// + /// + /// The default index type for float vectors. This utilizes the HNSW algorithm in addition to automatically scalar + /// quantization for scalable approximate kNN search with element_type of float. + /// + /// + /// This can reduce the memory footprint by 4x at the cost of some accuracy. + /// + /// + [EnumMember(Value = "int8_hnsw")] + Int8Hnsw, + /// + /// + /// This utilizes a brute-force search algorithm in addition to automatically scalar quantization. Only supports + /// element_type of float. + /// + /// + [EnumMember(Value = "int8_flat")] + Int8Flat, + /// + /// + /// This utilizes the HNSW algorithm in addition to automatically scalar quantization for scalable approximate kNN + /// search with element_type of float. + /// + /// + /// This can reduce the memory footprint by 8x at the cost of some accuracy. + /// + /// + [EnumMember(Value = "int4_hnsw")] + Int4Hnsw, + /// + /// + /// This utilizes a brute-force search algorithm in addition to automatically half-byte scalar quantization. + /// Only supports element_type of float. + /// + /// + [EnumMember(Value = "int4_flat")] + Int4Flat, + /// + /// + /// This utilizes the HNSW algorithm for scalable approximate kNN search. This supports all element_type values. + /// + /// + [EnumMember(Value = "hnsw")] + Hnsw, + /// + /// + /// This utilizes a brute-force search algorithm for exact kNN search. This supports all element_type values. + /// + /// + [EnumMember(Value = "flat")] + Flat +} + +internal sealed class DenseVectorIndexOptionsTypeConverter : JsonConverter +{ + public override DenseVectorIndexOptionsType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "int8_hnsw": + return DenseVectorIndexOptionsType.Int8Hnsw; + case "int8_flat": + return DenseVectorIndexOptionsType.Int8Flat; + case "int4_hnsw": + return DenseVectorIndexOptionsType.Int4Hnsw; + case "int4_flat": + return DenseVectorIndexOptionsType.Int4Flat; + case "hnsw": + return DenseVectorIndexOptionsType.Hnsw; + case "flat": + return DenseVectorIndexOptionsType.Flat; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DenseVectorIndexOptionsType value, JsonSerializerOptions options) + { + switch (value) + { + case DenseVectorIndexOptionsType.Int8Hnsw: + writer.WriteStringValue("int8_hnsw"); + return; + case DenseVectorIndexOptionsType.Int8Flat: + writer.WriteStringValue("int8_flat"); + return; + case DenseVectorIndexOptionsType.Int4Hnsw: + writer.WriteStringValue("int4_hnsw"); + return; + case DenseVectorIndexOptionsType.Int4Flat: + writer.WriteStringValue("int4_flat"); + return; + case DenseVectorIndexOptionsType.Hnsw: + writer.WriteStringValue("hnsw"); + return; + case DenseVectorIndexOptionsType.Flat: + writer.WriteStringValue("flat"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DenseVectorSimilarityConverter))] +public enum DenseVectorSimilarity +{ + /// + /// + /// Computes the maximum inner product of two vectors. This is similar to dot_product, but doesn't require vectors + /// to be normalized. This means that each vector’s magnitude can significantly effect the score. + /// + /// + /// The document _score is adjusted to prevent negative values. For max_inner_product values < 0, the _score + /// is 1 / (1 + -1 * max_inner_product(query, vector)). For non-negative max_inner_product results the _score + /// is calculated max_inner_product(query, vector) + 1. + /// + /// + [EnumMember(Value = "max_inner_product")] + MaxInnerProduct, + /// + /// + /// Computes similarity based on the L2 distance (also known as Euclidean distance) between the vectors. + /// + /// + /// The document _score is computed as 1 / (1 + l2_norm(query, vector)^2). + /// + /// + /// For bit vectors, instead of using l2_norm, the hamming distance between the vectors is used. + /// + /// + /// The _score transformation is (numBits - hamming(a, b)) / numBits. + /// + /// + [EnumMember(Value = "l2_norm")] + L2Norm, + /// + /// + /// Computes the dot product of two unit vectors. This option provides an optimized way to perform cosine similarity. + /// The constraints and computed score are defined by element_type. + /// + /// + /// When element_type is float, all vectors must be unit length, including both document and query vectors. + /// + /// + /// The document _score is computed as (1 + dot_product(query, vector)) / 2. + /// + /// + /// When element_type is byte, all vectors must have the same length including both document and query vectors or + /// results will be inaccurate. + /// + /// + /// The document _score is computed as 0.5 + (dot_product(query, vector) / (32768 * dims)) where dims is the + /// number of dimensions per vector. + /// + /// + [EnumMember(Value = "dot_product")] + DotProduct, + /// + /// + /// Computes the cosine similarity. During indexing Elasticsearch automatically normalizes vectors with cosine + /// similarity to unit length. This allows to internally use dot_product for computing similarity, which is more + /// efficient. Original un-normalized vectors can be still accessed through scripts. + /// + /// + /// The document _score is computed as (1 + cosine(query, vector)) / 2. + /// + /// + /// The cosine similarity does not allow vectors with zero magnitude, since cosine is not defined in this case. + /// + /// + [EnumMember(Value = "cosine")] + Cosine +} + +internal sealed class DenseVectorSimilarityConverter : JsonConverter +{ + public override DenseVectorSimilarity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "max_inner_product": + return DenseVectorSimilarity.MaxInnerProduct; + case "l2_norm": + return DenseVectorSimilarity.L2Norm; + case "dot_product": + return DenseVectorSimilarity.DotProduct; + case "cosine": + return DenseVectorSimilarity.Cosine; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DenseVectorSimilarity value, JsonSerializerOptions options) + { + switch (value) + { + case DenseVectorSimilarity.MaxInnerProduct: + writer.WriteStringValue("max_inner_product"); + return; + case DenseVectorSimilarity.L2Norm: + writer.WriteStringValue("l2_norm"); + return; + case DenseVectorSimilarity.DotProduct: + writer.WriteStringValue("dot_product"); + return; + case DenseVectorSimilarity.Cosine: + writer.WriteStringValue("cosine"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(DynamicMappingConverter))] public enum DynamicMapping { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs index 8c923b3233a..8cfbd13d9b7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs @@ -29,6 +29,8 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class DataStreamVisibility { + [JsonInclude, JsonPropertyName("allow_custom_routing")] + public bool? AllowCustomRouting { get; set; } [JsonInclude, JsonPropertyName("hidden")] public bool? Hidden { get; set; } } @@ -41,8 +43,15 @@ public DataStreamVisibilityDescriptor() : base() { } + private bool? AllowCustomRoutingValue { get; set; } private bool? HiddenValue { get; set; } + public DataStreamVisibilityDescriptor AllowCustomRouting(bool? allowCustomRouting = true) + { + AllowCustomRoutingValue = allowCustomRouting; + return Self; + } + public DataStreamVisibilityDescriptor Hidden(bool? hidden = true) { HiddenValue = hidden; @@ -52,6 +61,12 @@ public DataStreamVisibilityDescriptor Hidden(bool? hidden = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (AllowCustomRoutingValue.HasValue) + { + writer.WritePropertyName("allow_custom_routing"); + writer.WriteBooleanValue(AllowCustomRoutingValue.Value); + } + if (HiddenValue.HasValue) { writer.WritePropertyName("hidden"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CommunityIDProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CommunityIDProcessor.g.cs new file mode 100644 index 00000000000..5bec2b573de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CommunityIDProcessor.g.cs @@ -0,0 +1,1310 @@ +// 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 CommunityIDProcessor +{ + /// + /// + /// 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 destination IP address. + /// + /// + [JsonInclude, JsonPropertyName("destination_ip")] + public Elastic.Clients.Elasticsearch.Serverless.Field? DestinationIp { get; set; } + + /// + /// + /// Field containing the destination port. + /// + /// + [JsonInclude, JsonPropertyName("destination_port")] + public Elastic.Clients.Elasticsearch.Serverless.Field? DestinationPort { get; set; } + + /// + /// + /// Field containing the IANA number. + /// + /// + [JsonInclude, JsonPropertyName("iana_number")] + public Elastic.Clients.Elasticsearch.Serverless.Field? IanaNumber { get; set; } + + /// + /// + /// Field containing the ICMP code. + /// + /// + [JsonInclude, JsonPropertyName("icmp_code")] + public Elastic.Clients.Elasticsearch.Serverless.Field? IcmpCode { get; set; } + + /// + /// + /// Field containing the ICMP type. + /// + /// + [JsonInclude, JsonPropertyName("icmp_type")] + public Elastic.Clients.Elasticsearch.Serverless.Field? IcmpType { 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 any required fields are missing, 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; } + + /// + /// + /// Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The + /// seed can prevent hash collisions between network domains, such as a staging + /// and production network that use the same addressing scheme. + /// + /// + [JsonInclude, JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// + /// Field containing the source IP address. + /// + /// + [JsonInclude, JsonPropertyName("source_ip")] + public Elastic.Clients.Elasticsearch.Serverless.Field? SourceIp { get; set; } + + /// + /// + /// Field containing the source port. + /// + /// + [JsonInclude, JsonPropertyName("source_port")] + public Elastic.Clients.Elasticsearch.Serverless.Field? SourcePort { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// Output field for the community ID. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Transport { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(CommunityIDProcessor communityIDProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.CommunityId(communityIDProcessor); +} + +public sealed partial class CommunityIDProcessorDescriptor : SerializableDescriptor> +{ + internal CommunityIDProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public CommunityIDProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? DestinationIpValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? DestinationPortValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? IanaNumberValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? IcmpCodeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? IcmpTypeValue { 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 int? SeedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SourceIpValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SourcePortValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TransportValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public CommunityIDProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Elastic.Clients.Elasticsearch.Serverless.Field? destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Elastic.Clients.Elasticsearch.Serverless.Field? destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Expression> destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Expression> destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Elastic.Clients.Elasticsearch.Serverless.Field? ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Expression> ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Expression> ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Elastic.Clients.Elasticsearch.Serverless.Field? icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Expression> icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Expression> icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Elastic.Clients.Elasticsearch.Serverless.Field? icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Expression> icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Expression> icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public CommunityIDProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public CommunityIDProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public CommunityIDProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public CommunityIDProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The + /// seed can prevent hash collisions between network domains, such as a staging + /// and production network that use the same addressing scheme. + /// + /// + public CommunityIDProcessorDescriptor Seed(int? seed) + { + SeedValue = seed; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Elastic.Clients.Elasticsearch.Serverless.Field? sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Elastic.Clients.Elasticsearch.Serverless.Field? sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Expression> sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Expression> sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public CommunityIDProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Elastic.Clients.Elasticsearch.Serverless.Field? transport) + { + TransportValue = transport; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Expression> transport) + { + TransportValue = transport; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Expression> transport) + { + TransportValue = transport; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestinationIpValue is not null) + { + writer.WritePropertyName("destination_ip"); + JsonSerializer.Serialize(writer, DestinationIpValue, options); + } + + if (DestinationPortValue is not null) + { + writer.WritePropertyName("destination_port"); + JsonSerializer.Serialize(writer, DestinationPortValue, options); + } + + if (IanaNumberValue is not null) + { + writer.WritePropertyName("iana_number"); + JsonSerializer.Serialize(writer, IanaNumberValue, options); + } + + if (IcmpCodeValue is not null) + { + writer.WritePropertyName("icmp_code"); + JsonSerializer.Serialize(writer, IcmpCodeValue, options); + } + + if (IcmpTypeValue is not null) + { + writer.WritePropertyName("icmp_type"); + JsonSerializer.Serialize(writer, IcmpTypeValue, 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 (SeedValue.HasValue) + { + writer.WritePropertyName("seed"); + writer.WriteNumberValue(SeedValue.Value); + } + + if (SourceIpValue is not null) + { + writer.WritePropertyName("source_ip"); + JsonSerializer.Serialize(writer, SourceIpValue, options); + } + + if (SourcePortValue is not null) + { + writer.WritePropertyName("source_port"); + JsonSerializer.Serialize(writer, SourcePortValue, 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); + } + + if (TransportValue is not null) + { + writer.WritePropertyName("transport"); + JsonSerializer.Serialize(writer, TransportValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CommunityIDProcessorDescriptor : SerializableDescriptor +{ + internal CommunityIDProcessorDescriptor(Action configure) => configure.Invoke(this); + + public CommunityIDProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? DestinationIpValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? DestinationPortValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? IanaNumberValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? IcmpCodeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? IcmpTypeValue { 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 int? SeedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SourceIpValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SourcePortValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TransportValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public CommunityIDProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Elastic.Clients.Elasticsearch.Serverless.Field? destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Elastic.Clients.Elasticsearch.Serverless.Field? destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Expression> destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Expression> destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Elastic.Clients.Elasticsearch.Serverless.Field? ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Expression> ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Expression> ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Elastic.Clients.Elasticsearch.Serverless.Field? icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Expression> icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Expression> icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Elastic.Clients.Elasticsearch.Serverless.Field? icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Expression> icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Expression> icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public CommunityIDProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public CommunityIDProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public CommunityIDProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public CommunityIDProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The + /// seed can prevent hash collisions between network domains, such as a staging + /// and production network that use the same addressing scheme. + /// + /// + public CommunityIDProcessorDescriptor Seed(int? seed) + { + SeedValue = seed; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Elastic.Clients.Elasticsearch.Serverless.Field? sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Elastic.Clients.Elasticsearch.Serverless.Field? sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Expression> sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Expression> sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public CommunityIDProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Elastic.Clients.Elasticsearch.Serverless.Field? transport) + { + TransportValue = transport; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Expression> transport) + { + TransportValue = transport; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Expression> transport) + { + TransportValue = transport; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestinationIpValue is not null) + { + writer.WritePropertyName("destination_ip"); + JsonSerializer.Serialize(writer, DestinationIpValue, options); + } + + if (DestinationPortValue is not null) + { + writer.WritePropertyName("destination_port"); + JsonSerializer.Serialize(writer, DestinationPortValue, options); + } + + if (IanaNumberValue is not null) + { + writer.WritePropertyName("iana_number"); + JsonSerializer.Serialize(writer, IanaNumberValue, options); + } + + if (IcmpCodeValue is not null) + { + writer.WritePropertyName("icmp_code"); + JsonSerializer.Serialize(writer, IcmpCodeValue, options); + } + + if (IcmpTypeValue is not null) + { + writer.WritePropertyName("icmp_type"); + JsonSerializer.Serialize(writer, IcmpTypeValue, 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 (SeedValue.HasValue) + { + writer.WritePropertyName("seed"); + writer.WriteNumberValue(SeedValue.Value); + } + + if (SourceIpValue is not null) + { + writer.WritePropertyName("source_ip"); + JsonSerializer.Serialize(writer, SourceIpValue, options); + } + + if (SourcePortValue is not null) + { + writer.WritePropertyName("source_port"); + JsonSerializer.Serialize(writer, SourcePortValue, 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); + } + + if (TransportValue is not null) + { + writer.WritePropertyName("transport"); + JsonSerializer.Serialize(writer, TransportValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs index 667ad4196c0..4119d07eea1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs @@ -88,6 +88,15 @@ public sealed partial class DateProcessor [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + /// + /// + /// The format to use when writing the date to target_field. Must be a valid + /// java time pattern. + /// + /// + [JsonInclude, JsonPropertyName("output_format")] + public string? OutputFormat { get; set; } + /// /// /// Identifier for the processor. @@ -135,6 +144,7 @@ public DateProcessorDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } private Action> OnFailureDescriptorAction { get; set; } private Action>[] OnFailureDescriptorActions { get; set; } + private string? OutputFormatValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } private string? TimezoneValue { get; set; } @@ -271,6 +281,18 @@ public DateProcessorDescriptor OnFailure(params Action + /// + /// The format to use when writing the date to target_field. Must be a valid + /// java time pattern. + /// + /// + public DateProcessorDescriptor OutputFormat(string? outputFormat) + { + OutputFormatValue = outputFormat; + return Self; + } + /// /// /// Identifier for the processor. @@ -390,6 +412,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, OnFailureValue, options); } + if (!string.IsNullOrEmpty(OutputFormatValue)) + { + writer.WritePropertyName("output_format"); + writer.WriteStringValue(OutputFormatValue); + } + if (!string.IsNullOrEmpty(TagValue)) { writer.WritePropertyName("tag"); @@ -430,6 +458,7 @@ public DateProcessorDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } private Action OnFailureDescriptorAction { get; set; } private Action[] OnFailureDescriptorActions { get; set; } + private string? OutputFormatValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } private string? TimezoneValue { get; set; } @@ -566,6 +595,18 @@ public DateProcessorDescriptor OnFailure(params Action + /// + /// The format to use when writing the date to target_field. Must be a valid + /// java time pattern. + /// + /// + public DateProcessorDescriptor OutputFormat(string? outputFormat) + { + OutputFormatValue = outputFormat; + return Self; + } + /// /// /// Identifier for the processor. @@ -685,6 +726,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, OnFailureValue, options); } + if (!string.IsNullOrEmpty(OutputFormatValue)) + { + writer.WritePropertyName("output_format"); + writer.WriteStringValue(OutputFormatValue); + } + if (!string.IsNullOrEmpty(TagValue)) { writer.WritePropertyName("tag"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FingerprintProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FingerprintProcessor.g.cs new file mode 100644 index 00000000000..810dbfa3704 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FingerprintProcessor.g.cs @@ -0,0 +1,676 @@ +// 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 FingerprintProcessor +{ + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// Array of fields to include in the fingerprint. For objects, the processor + /// hashes both the field key and value. For other fields, the processor hashes + /// only the field value. + /// + /// + [JsonInclude, JsonPropertyName("fields")] + [JsonConverter(typeof(SingleOrManyFieldsConverter))] + public Elastic.Clients.Elasticsearch.Serverless.Fields Fields { 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, the processor ignores any missing fields. If all fields are + /// missing, the processor silently exits without modifying the document. + /// + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// + /// The hash method used to compute the fingerprint. Must be one of MD5, SHA-1, + /// SHA-256, SHA-512, or MurmurHash3. + /// + /// + [JsonInclude, JsonPropertyName("method")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintDigest? Method { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// + /// Salt value for the hash function. + /// + /// + [JsonInclude, JsonPropertyName("salt")] + public string? Salt { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// Output field for the fingerprint. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(FingerprintProcessor fingerprintProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Fingerprint(fingerprintProcessor); +} + +public sealed partial class FingerprintProcessorDescriptor : SerializableDescriptor> +{ + internal FingerprintProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public FingerprintProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields FieldsValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintDigest? MethodValue { 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? SaltValue { 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 FingerprintProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Array of fields to include in the fingerprint. For objects, the processor + /// hashes both the field key and value. For other fields, the processor hashes + /// only the field value. + /// + /// + public FingerprintProcessorDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public FingerprintProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public FingerprintProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true, the processor ignores any missing fields. If all fields are + /// missing, the processor silently exits without modifying the document. + /// + /// + public FingerprintProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// The hash method used to compute the fingerprint. Must be one of MD5, SHA-1, + /// SHA-256, SHA-512, or MurmurHash3. + /// + /// + public FingerprintProcessorDescriptor Method(Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintDigest? method) + { + MethodValue = method; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public FingerprintProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Salt value for the hash function. + /// + /// + public FingerprintProcessorDescriptor Salt(string? salt) + { + SaltValue = salt; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public FingerprintProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor 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("fields"); + JsonSerializer.Serialize(writer, FieldsValue, 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 (MethodValue is not null) + { + writer.WritePropertyName("method"); + JsonSerializer.Serialize(writer, MethodValue, options); + } + + 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(SaltValue)) + { + writer.WritePropertyName("salt"); + writer.WriteStringValue(SaltValue); + } + + 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 FingerprintProcessorDescriptor : SerializableDescriptor +{ + internal FingerprintProcessorDescriptor(Action configure) => configure.Invoke(this); + + public FingerprintProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields FieldsValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintDigest? MethodValue { 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? SaltValue { 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 FingerprintProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Array of fields to include in the fingerprint. For objects, the processor + /// hashes both the field key and value. For other fields, the processor hashes + /// only the field value. + /// + /// + public FingerprintProcessorDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public FingerprintProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public FingerprintProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true, the processor ignores any missing fields. If all fields are + /// missing, the processor silently exits without modifying the document. + /// + /// + public FingerprintProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// The hash method used to compute the fingerprint. Must be one of MD5, SHA-1, + /// SHA-256, SHA-512, or MurmurHash3. + /// + /// + public FingerprintProcessorDescriptor Method(Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintDigest? method) + { + MethodValue = method; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public FingerprintProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Salt value for the hash function. + /// + /// + public FingerprintProcessorDescriptor Salt(string? salt) + { + SaltValue = salt; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public FingerprintProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor 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("fields"); + JsonSerializer.Serialize(writer, FieldsValue, 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 (MethodValue is not null) + { + writer.WritePropertyName("method"); + JsonSerializer.Serialize(writer, MethodValue, options); + } + + 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(SaltValue)) + { + writer.WritePropertyName("salt"); + writer.WriteStringValue(SaltValue); + } + + 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/GrokProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs index c9ef8ec6fe7..4a802178b76 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs @@ -38,6 +38,15 @@ public sealed partial class GrokProcessor [JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } + /// + /// + /// Must be disabled or v1. If v1, the processor uses patterns with Elastic + /// Common Schema (ECS) field names. + /// + /// + [JsonInclude, JsonPropertyName("ecs_compatibility")] + public string? EcsCompatibility { get; set; } + /// /// /// The field to use for grok expression parsing. @@ -125,6 +134,7 @@ public GrokProcessorDescriptor() : base() } private string? DescriptionValue { get; set; } + private string? EcsCompatibilityValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } @@ -150,6 +160,18 @@ public GrokProcessorDescriptor Description(string? description) return Self; } + /// + /// + /// Must be disabled or v1. If v1, the processor uses patterns with Elastic + /// Common Schema (ECS) field names. + /// + /// + public GrokProcessorDescriptor EcsCompatibility(string? ecsCompatibility) + { + EcsCompatibilityValue = ecsCompatibility; + return Self; + } + /// /// /// The field to use for grok expression parsing. @@ -313,6 +335,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(DescriptionValue); } + if (!string.IsNullOrEmpty(EcsCompatibilityValue)) + { + writer.WritePropertyName("ecs_compatibility"); + writer.WriteStringValue(EcsCompatibilityValue); + } + writer.WritePropertyName("field"); JsonSerializer.Serialize(writer, FieldValue, options); if (!string.IsNullOrEmpty(IfValue)) @@ -397,6 +425,7 @@ public GrokProcessorDescriptor() : base() } private string? DescriptionValue { get; set; } + private string? EcsCompatibilityValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } @@ -422,6 +451,18 @@ public GrokProcessorDescriptor Description(string? description) return Self; } + /// + /// + /// Must be disabled or v1. If v1, the processor uses patterns with Elastic + /// Common Schema (ECS) field names. + /// + /// + public GrokProcessorDescriptor EcsCompatibility(string? ecsCompatibility) + { + EcsCompatibilityValue = ecsCompatibility; + return Self; + } + /// /// /// The field to use for grok expression parsing. @@ -585,6 +626,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(DescriptionValue); } + if (!string.IsNullOrEmpty(EcsCompatibilityValue)) + { + writer.WritePropertyName("ecs_compatibility"); + writer.WriteStringValue(EcsCompatibilityValue); + } + writer.WritePropertyName("field"); JsonSerializer.Serialize(writer, FieldValue, options); if (!string.IsNullOrEmpty(IfValue)) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/IngestInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/IngestInfo.g.cs index 781268c19f2..121ef723da6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/IngestInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/IngestInfo.g.cs @@ -31,6 +31,8 @@ public sealed partial class IngestInfo { [JsonInclude, JsonPropertyName("pipeline")] public string? Pipeline { get; init; } + [JsonInclude, JsonPropertyName("_redact")] + public Elastic.Clients.Elasticsearch.Serverless.Ingest.Redact? Redact { get; init; } [JsonInclude, JsonPropertyName("timestamp")] public DateTimeOffset Timestamp { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs new file mode 100644 index 00000000000..4f17825cabc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs @@ -0,0 +1,866 @@ +// 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 NetworkDirectionProcessor +{ + /// + /// + /// 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 destination IP address. + /// + /// + [JsonInclude, JsonPropertyName("destination_ip")] + public Elastic.Clients.Elasticsearch.Serverless.Field? DestinationIp { 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 any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// + /// List of internal networks. Supports IPv4 and IPv6 addresses and ranges in + /// CIDR notation. Also supports the named ranges listed below. These may be + /// constructed with template snippets. Must specify only one of + /// internal_networks or internal_networks_field. + /// + /// + [JsonInclude, JsonPropertyName("internal_networks")] + public ICollection? InternalNetworks { get; set; } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + [JsonInclude, JsonPropertyName("internal_networks_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? InternalNetworksField { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// + /// Field containing the source IP address. + /// + /// + [JsonInclude, JsonPropertyName("source_ip")] + public Elastic.Clients.Elasticsearch.Serverless.Field? SourceIp { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// Output field for the network direction. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(NetworkDirectionProcessor networkDirectionProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.NetworkDirection(networkDirectionProcessor); +} + +public sealed partial class NetworkDirectionProcessorDescriptor : SerializableDescriptor> +{ + internal NetworkDirectionProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public NetworkDirectionProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? DestinationIpValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? InternalNetworksValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? InternalNetworksFieldValue { 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 Elastic.Clients.Elasticsearch.Serverless.Field? SourceIpValue { 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 NetworkDirectionProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Elastic.Clients.Elasticsearch.Serverless.Field? destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public NetworkDirectionProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public NetworkDirectionProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public NetworkDirectionProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// List of internal networks. Supports IPv4 and IPv6 addresses and ranges in + /// CIDR notation. Also supports the named ranges listed below. These may be + /// constructed with template snippets. Must specify only one of + /// internal_networks or internal_networks_field. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworks(ICollection? internalNetworks) + { + InternalNetworksValue = internalNetworks; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Elastic.Clients.Elasticsearch.Serverless.Field? internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Expression> internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Expression> internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public NetworkDirectionProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Elastic.Clients.Elasticsearch.Serverless.Field? sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public NetworkDirectionProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor 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); + } + + if (DestinationIpValue is not null) + { + writer.WritePropertyName("destination_ip"); + JsonSerializer.Serialize(writer, DestinationIpValue, 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 (InternalNetworksValue is not null) + { + writer.WritePropertyName("internal_networks"); + JsonSerializer.Serialize(writer, InternalNetworksValue, options); + } + + if (InternalNetworksFieldValue is not null) + { + writer.WritePropertyName("internal_networks_field"); + JsonSerializer.Serialize(writer, InternalNetworksFieldValue, options); + } + + 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 (SourceIpValue is not null) + { + writer.WritePropertyName("source_ip"); + JsonSerializer.Serialize(writer, SourceIpValue, 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 NetworkDirectionProcessorDescriptor : SerializableDescriptor +{ + internal NetworkDirectionProcessorDescriptor(Action configure) => configure.Invoke(this); + + public NetworkDirectionProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? DestinationIpValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? InternalNetworksValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? InternalNetworksFieldValue { 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 Elastic.Clients.Elasticsearch.Serverless.Field? SourceIpValue { 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 NetworkDirectionProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Elastic.Clients.Elasticsearch.Serverless.Field? destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public NetworkDirectionProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public NetworkDirectionProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public NetworkDirectionProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// List of internal networks. Supports IPv4 and IPv6 addresses and ranges in + /// CIDR notation. Also supports the named ranges listed below. These may be + /// constructed with template snippets. Must specify only one of + /// internal_networks or internal_networks_field. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworks(ICollection? internalNetworks) + { + InternalNetworksValue = internalNetworks; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Elastic.Clients.Elasticsearch.Serverless.Field? internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Expression> internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Expression> internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public NetworkDirectionProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Elastic.Clients.Elasticsearch.Serverless.Field? sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public NetworkDirectionProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor 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); + } + + if (DestinationIpValue is not null) + { + writer.WritePropertyName("destination_ip"); + JsonSerializer.Serialize(writer, DestinationIpValue, 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 (InternalNetworksValue is not null) + { + writer.WritePropertyName("internal_networks"); + JsonSerializer.Serialize(writer, InternalNetworksValue, options); + } + + if (InternalNetworksFieldValue is not null) + { + writer.WritePropertyName("internal_networks_field"); + JsonSerializer.Serialize(writer, InternalNetworksFieldValue, options); + } + + 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 (SourceIpValue is not null) + { + writer.WritePropertyName("source_ip"); + JsonSerializer.Serialize(writer, SourceIpValue, 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/Processor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs index e55af2cc02a..a9e21af1863 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 @@ -50,6 +50,7 @@ internal Processor(string variantName, object variant) public static Processor Attachment(Elastic.Clients.Elasticsearch.Serverless.Ingest.AttachmentProcessor attachmentProcessor) => new Processor("attachment", attachmentProcessor); public static Processor Bytes(Elastic.Clients.Elasticsearch.Serverless.Ingest.BytesProcessor bytesProcessor) => new Processor("bytes", bytesProcessor); public static Processor Circle(Elastic.Clients.Elasticsearch.Serverless.Ingest.CircleProcessor circleProcessor) => new Processor("circle", circleProcessor); + public static Processor CommunityId(Elastic.Clients.Elasticsearch.Serverless.Ingest.CommunityIDProcessor communityIDProcessor) => new Processor("community_id", communityIDProcessor); public static Processor Convert(Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertProcessor convertProcessor) => new Processor("convert", convertProcessor); public static Processor Csv(Elastic.Clients.Elasticsearch.Serverless.Ingest.CsvProcessor csvProcessor) => new Processor("csv", csvProcessor); public static Processor Date(Elastic.Clients.Elasticsearch.Serverless.Ingest.DateProcessor dateProcessor) => new Processor("date", dateProcessor); @@ -59,6 +60,7 @@ internal Processor(string variantName, object variant) public static Processor Drop(Elastic.Clients.Elasticsearch.Serverless.Ingest.DropProcessor dropProcessor) => new Processor("drop", dropProcessor); public static Processor Enrich(Elastic.Clients.Elasticsearch.Serverless.Ingest.EnrichProcessor enrichProcessor) => new Processor("enrich", enrichProcessor); public static Processor Fail(Elastic.Clients.Elasticsearch.Serverless.Ingest.FailProcessor failProcessor) => new Processor("fail", failProcessor); + public static Processor Fingerprint(Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintProcessor fingerprintProcessor) => new Processor("fingerprint", fingerprintProcessor); public static Processor Foreach(Elastic.Clients.Elasticsearch.Serverless.Ingest.ForeachProcessor foreachProcessor) => new Processor("foreach", foreachProcessor); public static Processor GeoGrid(Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoGridProcessor geoGridProcessor) => new Processor("geo_grid", geoGridProcessor); public static Processor Geoip(Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoIpProcessor geoIpProcessor) => new Processor("geoip", geoIpProcessor); @@ -70,8 +72,10 @@ internal Processor(string variantName, object variant) public static Processor Json(Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessor jsonProcessor) => new Processor("json", jsonProcessor); public static Processor Kv(Elastic.Clients.Elasticsearch.Serverless.Ingest.KeyValueProcessor keyValueProcessor) => new Processor("kv", keyValueProcessor); public static Processor Lowercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.LowercaseProcessor lowercaseProcessor) => new Processor("lowercase", lowercaseProcessor); + public static Processor NetworkDirection(Elastic.Clients.Elasticsearch.Serverless.Ingest.NetworkDirectionProcessor networkDirectionProcessor) => new Processor("network_direction", networkDirectionProcessor); public static Processor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineProcessor pipelineProcessor) => new Processor("pipeline", pipelineProcessor); public static Processor Redact(Elastic.Clients.Elasticsearch.Serverless.Ingest.RedactProcessor redactProcessor) => new Processor("redact", redactProcessor); + public static Processor RegisteredDomain(Elastic.Clients.Elasticsearch.Serverless.Ingest.RegisteredDomainProcessor registeredDomainProcessor) => new Processor("registered_domain", registeredDomainProcessor); public static Processor Remove(Elastic.Clients.Elasticsearch.Serverless.Ingest.RemoveProcessor removeProcessor) => new Processor("remove", removeProcessor); public static Processor Rename(Elastic.Clients.Elasticsearch.Serverless.Ingest.RenameProcessor renameProcessor) => new Processor("rename", renameProcessor); public static Processor Reroute(Elastic.Clients.Elasticsearch.Serverless.Ingest.RerouteProcessor rerouteProcessor) => new Processor("reroute", rerouteProcessor); @@ -80,6 +84,7 @@ internal Processor(string variantName, object variant) public static Processor SetSecurityUser(Elastic.Clients.Elasticsearch.Serverless.Ingest.SetSecurityUserProcessor setSecurityUserProcessor) => new Processor("set_security_user", setSecurityUserProcessor); public static Processor Sort(Elastic.Clients.Elasticsearch.Serverless.Ingest.SortProcessor sortProcessor) => new Processor("sort", sortProcessor); public static Processor Split(Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor splitProcessor) => new Processor("split", splitProcessor); + public static Processor Terminate(Elastic.Clients.Elasticsearch.Serverless.Ingest.TerminateProcessor terminateProcessor) => new Processor("terminate", terminateProcessor); 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); @@ -152,6 +157,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "community_id") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "convert") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -215,6 +227,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "fingerprint") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "foreach") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -292,6 +311,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "network_direction") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "pipeline") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -306,6 +332,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "registered_domain") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "remove") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -362,6 +395,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "terminate") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "trim") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -424,6 +464,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "circle": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.CircleProcessor)value.Variant, options); break; + case "community_id": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.CommunityIDProcessor)value.Variant, options); + break; case "convert": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertProcessor)value.Variant, options); break; @@ -451,6 +494,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "fail": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.FailProcessor)value.Variant, options); break; + case "fingerprint": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintProcessor)value.Variant, options); + break; case "foreach": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.ForeachProcessor)value.Variant, options); break; @@ -484,12 +530,18 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "lowercase": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.LowercaseProcessor)value.Variant, options); break; + case "network_direction": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.NetworkDirectionProcessor)value.Variant, options); + break; case "pipeline": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineProcessor)value.Variant, options); break; case "redact": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.RedactProcessor)value.Variant, options); break; + case "registered_domain": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.RegisteredDomainProcessor)value.Variant, options); + break; case "remove": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.RemoveProcessor)value.Variant, options); break; @@ -514,6 +566,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "split": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor)value.Variant, options); break; + case "terminate": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.TerminateProcessor)value.Variant, options); + break; case "trim": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.TrimProcessor)value.Variant, options); break; @@ -575,6 +630,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Bytes(Action> configure) => Set(configure, "bytes"); public ProcessorDescriptor Circle(Elastic.Clients.Elasticsearch.Serverless.Ingest.CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); public ProcessorDescriptor Circle(Action> configure) => Set(configure, "circle"); + public ProcessorDescriptor CommunityId(Elastic.Clients.Elasticsearch.Serverless.Ingest.CommunityIDProcessor communityIDProcessor) => Set(communityIDProcessor, "community_id"); + public ProcessorDescriptor CommunityId(Action> configure) => Set(configure, "community_id"); public ProcessorDescriptor Convert(Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); public ProcessorDescriptor Convert(Action> configure) => Set(configure, "convert"); public ProcessorDescriptor Csv(Elastic.Clients.Elasticsearch.Serverless.Ingest.CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); @@ -593,6 +650,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Enrich(Action> configure) => Set(configure, "enrich"); public ProcessorDescriptor Fail(Elastic.Clients.Elasticsearch.Serverless.Ingest.FailProcessor failProcessor) => Set(failProcessor, "fail"); public ProcessorDescriptor Fail(Action> configure) => Set(configure, "fail"); + public ProcessorDescriptor Fingerprint(Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintProcessor fingerprintProcessor) => Set(fingerprintProcessor, "fingerprint"); + public ProcessorDescriptor Fingerprint(Action> configure) => Set(configure, "fingerprint"); public ProcessorDescriptor Foreach(Elastic.Clients.Elasticsearch.Serverless.Ingest.ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); public ProcessorDescriptor Foreach(Action> configure) => Set(configure, "foreach"); public ProcessorDescriptor GeoGrid(Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoGridProcessor geoGridProcessor) => Set(geoGridProcessor, "geo_grid"); @@ -615,10 +674,14 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Kv(Action> configure) => Set(configure, "kv"); public ProcessorDescriptor Lowercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); public ProcessorDescriptor Lowercase(Action> configure) => Set(configure, "lowercase"); + public ProcessorDescriptor NetworkDirection(Elastic.Clients.Elasticsearch.Serverless.Ingest.NetworkDirectionProcessor networkDirectionProcessor) => Set(networkDirectionProcessor, "network_direction"); + public ProcessorDescriptor NetworkDirection(Action> configure) => Set(configure, "network_direction"); public ProcessorDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); public ProcessorDescriptor Pipeline(Action> configure) => Set(configure, "pipeline"); public ProcessorDescriptor Redact(Elastic.Clients.Elasticsearch.Serverless.Ingest.RedactProcessor redactProcessor) => Set(redactProcessor, "redact"); public ProcessorDescriptor Redact(Action> configure) => Set(configure, "redact"); + public ProcessorDescriptor RegisteredDomain(Elastic.Clients.Elasticsearch.Serverless.Ingest.RegisteredDomainProcessor registeredDomainProcessor) => Set(registeredDomainProcessor, "registered_domain"); + public ProcessorDescriptor RegisteredDomain(Action> configure) => Set(configure, "registered_domain"); public ProcessorDescriptor Remove(Elastic.Clients.Elasticsearch.Serverless.Ingest.RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); public ProcessorDescriptor Remove(Action> configure) => Set(configure, "remove"); public ProcessorDescriptor Rename(Elastic.Clients.Elasticsearch.Serverless.Ingest.RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); @@ -635,6 +698,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Sort(Action> configure) => Set(configure, "sort"); public ProcessorDescriptor Split(Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor splitProcessor) => Set(splitProcessor, "split"); public ProcessorDescriptor Split(Action> configure) => Set(configure, "split"); + public ProcessorDescriptor Terminate(Elastic.Clients.Elasticsearch.Serverless.Ingest.TerminateProcessor terminateProcessor) => Set(terminateProcessor, "terminate"); + public ProcessorDescriptor Terminate(Action> configure) => Set(configure, "terminate"); public ProcessorDescriptor Trim(Elastic.Clients.Elasticsearch.Serverless.Ingest.TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); public ProcessorDescriptor Trim(Action> configure) => Set(configure, "trim"); public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); @@ -705,6 +770,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Bytes(Action configure) => Set(configure, "bytes"); public ProcessorDescriptor Circle(Elastic.Clients.Elasticsearch.Serverless.Ingest.CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); public ProcessorDescriptor Circle(Action configure) => Set(configure, "circle"); + public ProcessorDescriptor CommunityId(Elastic.Clients.Elasticsearch.Serverless.Ingest.CommunityIDProcessor communityIDProcessor) => Set(communityIDProcessor, "community_id"); + public ProcessorDescriptor CommunityId(Action configure) => Set(configure, "community_id"); public ProcessorDescriptor Convert(Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); public ProcessorDescriptor Convert(Action configure) => Set(configure, "convert"); public ProcessorDescriptor Csv(Elastic.Clients.Elasticsearch.Serverless.Ingest.CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); @@ -723,6 +790,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Enrich(Action configure) => Set(configure, "enrich"); public ProcessorDescriptor Fail(Elastic.Clients.Elasticsearch.Serverless.Ingest.FailProcessor failProcessor) => Set(failProcessor, "fail"); public ProcessorDescriptor Fail(Action configure) => Set(configure, "fail"); + public ProcessorDescriptor Fingerprint(Elastic.Clients.Elasticsearch.Serverless.Ingest.FingerprintProcessor fingerprintProcessor) => Set(fingerprintProcessor, "fingerprint"); + public ProcessorDescriptor Fingerprint(Action configure) => Set(configure, "fingerprint"); public ProcessorDescriptor Foreach(Elastic.Clients.Elasticsearch.Serverless.Ingest.ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); public ProcessorDescriptor Foreach(Action configure) => Set(configure, "foreach"); public ProcessorDescriptor GeoGrid(Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoGridProcessor geoGridProcessor) => Set(geoGridProcessor, "geo_grid"); @@ -745,10 +814,14 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Kv(Action configure) => Set(configure, "kv"); public ProcessorDescriptor Lowercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); public ProcessorDescriptor Lowercase(Action configure) => Set(configure, "lowercase"); + public ProcessorDescriptor NetworkDirection(Elastic.Clients.Elasticsearch.Serverless.Ingest.NetworkDirectionProcessor networkDirectionProcessor) => Set(networkDirectionProcessor, "network_direction"); + public ProcessorDescriptor NetworkDirection(Action configure) => Set(configure, "network_direction"); public ProcessorDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); public ProcessorDescriptor Pipeline(Action configure) => Set(configure, "pipeline"); public ProcessorDescriptor Redact(Elastic.Clients.Elasticsearch.Serverless.Ingest.RedactProcessor redactProcessor) => Set(redactProcessor, "redact"); public ProcessorDescriptor Redact(Action configure) => Set(configure, "redact"); + public ProcessorDescriptor RegisteredDomain(Elastic.Clients.Elasticsearch.Serverless.Ingest.RegisteredDomainProcessor registeredDomainProcessor) => Set(registeredDomainProcessor, "registered_domain"); + public ProcessorDescriptor RegisteredDomain(Action configure) => Set(configure, "registered_domain"); public ProcessorDescriptor Remove(Elastic.Clients.Elasticsearch.Serverless.Ingest.RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); public ProcessorDescriptor Remove(Action configure) => Set(configure, "remove"); public ProcessorDescriptor Rename(Elastic.Clients.Elasticsearch.Serverless.Ingest.RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); @@ -765,6 +838,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Sort(Action configure) => Set(configure, "sort"); public ProcessorDescriptor Split(Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor splitProcessor) => Set(splitProcessor, "split"); public ProcessorDescriptor Split(Action configure) => Set(configure, "split"); + public ProcessorDescriptor Terminate(Elastic.Clients.Elasticsearch.Serverless.Ingest.TerminateProcessor terminateProcessor) => Set(terminateProcessor, "terminate"); + public ProcessorDescriptor Terminate(Action configure) => Set(configure, "terminate"); public ProcessorDescriptor Trim(Elastic.Clients.Elasticsearch.Serverless.Ingest.TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); public ProcessorDescriptor Trim(Action configure) => Set(configure, "trim"); public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Redact.g.cs similarity index 78% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Redact.g.cs index 569d178560f..ab6867a45e6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Redact.g.cs @@ -19,20 +19,21 @@ 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.Linq.Expressions; +using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; +namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; -public sealed partial class PutTemplateResponse : ElasticsearchResponse +public sealed partial class Redact { /// /// - /// For a successful response, this value is always true. On failure, an exception is returned instead. + /// indicates if document has been redacted /// /// - [JsonInclude, JsonPropertyName("acknowledged")] - public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("_is_redacted")] + public bool IsRedacted { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RedactProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RedactProcessor.g.cs index 34389a4e009..3fd46a7ab96 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RedactProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RedactProcessor.g.cs @@ -121,6 +121,14 @@ public sealed partial class RedactProcessor [JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } + /// + /// + /// If true then ingest metadata _ingest._redact._is_redacted is set to true if the document has been redacted + /// + /// + [JsonInclude, JsonPropertyName("trace_redact")] + public bool? TraceRedact { get; set; } + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(RedactProcessor redactProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Redact(redactProcessor); } @@ -147,6 +155,7 @@ public RedactProcessorDescriptor() : base() private bool? SkipIfUnlicensedValue { get; set; } private string? SuffixValue { get; set; } private string? TagValue { get; set; } + private bool? TraceRedactValue { get; set; } /// /// @@ -329,6 +338,17 @@ public RedactProcessorDescriptor Tag(string? tag) return Self; } + /// + /// + /// If true then ingest metadata _ingest._redact._is_redacted is set to true if the document has been redacted + /// + /// + public RedactProcessorDescriptor TraceRedact(bool? traceRedact = true) + { + TraceRedactValue = traceRedact; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -421,6 +441,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(TagValue); } + if (TraceRedactValue.HasValue) + { + writer.WritePropertyName("trace_redact"); + writer.WriteBooleanValue(TraceRedactValue.Value); + } + writer.WriteEndObject(); } } @@ -448,6 +474,7 @@ public RedactProcessorDescriptor() : base() private bool? SkipIfUnlicensedValue { get; set; } private string? SuffixValue { get; set; } private string? TagValue { get; set; } + private bool? TraceRedactValue { get; set; } /// /// @@ -630,6 +657,17 @@ public RedactProcessorDescriptor Tag(string? tag) return Self; } + /// + /// + /// If true then ingest metadata _ingest._redact._is_redacted is set to true if the document has been redacted + /// + /// + public RedactProcessorDescriptor TraceRedact(bool? traceRedact = true) + { + TraceRedactValue = traceRedact; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -722,6 +760,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(TagValue); } + if (TraceRedactValue.HasValue) + { + writer.WritePropertyName("trace_redact"); + writer.WriteBooleanValue(TraceRedactValue.Value); + } + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs new file mode 100644 index 00000000000..5edced6ebd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs @@ -0,0 +1,629 @@ +// 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 RegisteredDomainProcessor +{ + /// + /// + /// 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 source FQDN. + /// + /// + [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 any required fields are missing, 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; } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(RegisteredDomainProcessor registeredDomainProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.RegisteredDomain(registeredDomainProcessor); +} + +public sealed partial class RegisteredDomainProcessorDescriptor : SerializableDescriptor> +{ + internal RegisteredDomainProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public RegisteredDomainProcessorDescriptor() : 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 RegisteredDomainProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public RegisteredDomainProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public RegisteredDomainProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public RegisteredDomainProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public RegisteredDomainProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public RegisteredDomainProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor 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 RegisteredDomainProcessorDescriptor : SerializableDescriptor +{ + internal RegisteredDomainProcessorDescriptor(Action configure) => configure.Invoke(this); + + public RegisteredDomainProcessorDescriptor() : 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 RegisteredDomainProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public RegisteredDomainProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public RegisteredDomainProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public RegisteredDomainProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public RegisteredDomainProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public RegisteredDomainProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Serverless.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor 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/TerminateProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TerminateProcessor.g.cs new file mode 100644 index 00000000000..70b2df4e941 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TerminateProcessor.g.cs @@ -0,0 +1,407 @@ +// 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 TerminateProcessor +{ + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { 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; } + + /// + /// + /// 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; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(TerminateProcessor terminateProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Terminate(terminateProcessor); +} + +public sealed partial class TerminateProcessorDescriptor : SerializableDescriptor> +{ + internal TerminateProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public TerminateProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { 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; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public TerminateProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public TerminateProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public TerminateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public TerminateProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public TerminateProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.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); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TerminateProcessorDescriptor : SerializableDescriptor +{ + internal TerminateProcessorDescriptor(Action configure) => configure.Invoke(this); + + public TerminateProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { 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; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public TerminateProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public TerminateProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public TerminateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public TerminateProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public TerminateProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.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); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs index 4e08844157d..46d3cd22aa6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs @@ -29,14 +29,56 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; public sealed partial class DenseVectorIndexOptions { + /// + /// + /// The confidence interval to use when quantizing the vectors. Can be any value between and including 0.90 and + /// 1.0 or exactly 0. When the value is 0, this indicates that dynamic quantiles should be calculated for + /// optimized quantization. When between 0.90 and 1.0, this value restricts the values used when calculating + /// the quantization thresholds. + /// + /// + /// For example, a value of 0.95 will only use the middle 95% of the values when calculating the quantization + /// thresholds (e.g. the highest and lowest 2.5% of values will be ignored). + /// + /// + /// Defaults to 1/(dims + 1) for int8 quantized vectors and 0 for int4 for dynamic quantile calculation. + /// + /// + /// Only applicable to int8_hnsw, int4_hnsw, int8_flat, and int4_flat index types. + /// + /// [JsonInclude, JsonPropertyName("confidence_interval")] public float? ConfidenceInterval { get; set; } + + /// + /// + /// The number of candidates to track while assembling the list of nearest neighbors for each new node. + /// + /// + /// Only applicable to hnsw, int8_hnsw, and int4_hnsw index types. + /// + /// [JsonInclude, JsonPropertyName("ef_construction")] public int? EfConstruction { get; set; } + + /// + /// + /// The number of neighbors each node will be connected to in the HNSW graph. + /// + /// + /// Only applicable to hnsw, int8_hnsw, and int4_hnsw index types. + /// + /// [JsonInclude, JsonPropertyName("m")] public int? m { get; set; } + + /// + /// + /// The type of kNN algorithm to use. + /// + /// [JsonInclude, JsonPropertyName("type")] - public string Type { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsType Type { get; set; } } public sealed partial class DenseVectorIndexOptionsDescriptor : SerializableDescriptor @@ -50,27 +92,66 @@ public DenseVectorIndexOptionsDescriptor() : base() private float? ConfidenceIntervalValue { get; set; } private int? EfConstructionValue { get; set; } private int? mValue { get; set; } - private string TypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsType TypeValue { get; set; } + /// + /// + /// The confidence interval to use when quantizing the vectors. Can be any value between and including 0.90 and + /// 1.0 or exactly 0. When the value is 0, this indicates that dynamic quantiles should be calculated for + /// optimized quantization. When between 0.90 and 1.0, this value restricts the values used when calculating + /// the quantization thresholds. + /// + /// + /// For example, a value of 0.95 will only use the middle 95% of the values when calculating the quantization + /// thresholds (e.g. the highest and lowest 2.5% of values will be ignored). + /// + /// + /// Defaults to 1/(dims + 1) for int8 quantized vectors and 0 for int4 for dynamic quantile calculation. + /// + /// + /// Only applicable to int8_hnsw, int4_hnsw, int8_flat, and int4_flat index types. + /// + /// public DenseVectorIndexOptionsDescriptor ConfidenceInterval(float? confidenceInterval) { ConfidenceIntervalValue = confidenceInterval; return Self; } + /// + /// + /// The number of candidates to track while assembling the list of nearest neighbors for each new node. + /// + /// + /// Only applicable to hnsw, int8_hnsw, and int4_hnsw index types. + /// + /// public DenseVectorIndexOptionsDescriptor EfConstruction(int? efConstruction) { EfConstructionValue = efConstruction; return Self; } + /// + /// + /// The number of neighbors each node will be connected to in the HNSW graph. + /// + /// + /// Only applicable to hnsw, int8_hnsw, and int4_hnsw index types. + /// + /// public DenseVectorIndexOptionsDescriptor m(int? m) { mValue = m; return Self; } - public DenseVectorIndexOptionsDescriptor Type(string type) + /// + /// + /// The type of kNN algorithm to use. + /// + /// + public DenseVectorIndexOptionsDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsType type) { TypeValue = type; return Self; @@ -98,7 +179,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("type"); - writer.WriteStringValue(TypeValue); + JsonSerializer.Serialize(writer, TypeValue, options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs index 489ed9e9c6e..dbf11217d64 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs @@ -29,18 +29,47 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; public sealed partial class DenseVectorProperty : IProperty { + /// + /// + /// Number of vector dimensions. Can't exceed 4096. If dims is not specified, it will be set to the length of + /// the first vector added to the field. + /// + /// [JsonInclude, JsonPropertyName("dims")] public int? Dims { get; set; } [JsonInclude, JsonPropertyName("dynamic")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } + + /// + /// + /// The data type used to encode vectors. The supported data types are float (default), byte, and bit. + /// + /// [JsonInclude, JsonPropertyName("element_type")] - public string? ElementType { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorElementType? ElementType { get; set; } [JsonInclude, JsonPropertyName("fields")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// + /// If true, you can search this field using the kNN search API. + /// + /// [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// + /// An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters + /// that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the + /// expense of slower indexing speed. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// [JsonInclude, JsonPropertyName("index_options")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? IndexOptions { get; set; } @@ -53,8 +82,28 @@ public sealed partial class DenseVectorProperty : IProperty public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Properties { get; set; } + + /// + /// + /// The vector similarity metric to use in kNN search. + /// + /// + /// Documents are ranked by their vector field's similarity to the query vector. The _score of each document will + /// be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds + /// to a higher ranking. + /// + /// + /// Defaults to l2_norm when element_type is bit otherwise defaults to cosine. + /// + /// + /// bit vectors only support l2_norm as their similarity metric. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// [JsonInclude, JsonPropertyName("similarity")] - public string? Similarity { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorSimilarity? Similarity { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "dense_vector"; @@ -70,7 +119,7 @@ public DenseVectorPropertyDescriptor() : base() private int? DimsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } - private string? ElementTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorElementType? ElementTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } @@ -79,8 +128,14 @@ public DenseVectorPropertyDescriptor() : base() private Action IndexOptionsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } - private string? SimilarityValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorSimilarity? SimilarityValue { get; set; } + /// + /// + /// Number of vector dimensions. Can't exceed 4096. If dims is not specified, it will be set to the length of + /// the first vector added to the field. + /// + /// public DenseVectorPropertyDescriptor Dims(int? dims) { DimsValue = dims; @@ -93,7 +148,12 @@ public DenseVectorPropertyDescriptor Dynamic(Elastic.Clients.Elastics return Self; } - public DenseVectorPropertyDescriptor ElementType(string? elementType) + /// + /// + /// The data type used to encode vectors. The supported data types are float (default), byte, and bit. + /// + /// + public DenseVectorPropertyDescriptor ElementType(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorElementType? elementType) { ElementTypeValue = elementType; return Self; @@ -125,12 +185,27 @@ public DenseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// + /// If true, you can search this field using the kNN search API. + /// + /// public DenseVectorPropertyDescriptor Index(bool? index = true) { IndexValue = index; return Self; } + /// + /// + /// An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters + /// that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the + /// expense of slower indexing speed. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? indexOptions) { IndexOptionsDescriptor = null; @@ -186,7 +261,26 @@ public DenseVectorPropertyDescriptor Properties(Action Similarity(string? similarity) + /// + /// + /// The vector similarity metric to use in kNN search. + /// + /// + /// Documents are ranked by their vector field's similarity to the query vector. The _score of each document will + /// be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds + /// to a higher ranking. + /// + /// + /// Defaults to l2_norm when element_type is bit otherwise defaults to cosine. + /// + /// + /// bit vectors only support l2_norm as their similarity metric. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// + public DenseVectorPropertyDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorSimilarity? similarity) { SimilarityValue = similarity; return Self; @@ -207,10 +301,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, DynamicValue, options); } - if (!string.IsNullOrEmpty(ElementTypeValue)) + if (ElementTypeValue is not null) { writer.WritePropertyName("element_type"); - writer.WriteStringValue(ElementTypeValue); + JsonSerializer.Serialize(writer, ElementTypeValue, options); } if (FieldsValue is not null) @@ -259,10 +353,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } - if (!string.IsNullOrEmpty(SimilarityValue)) + if (SimilarityValue is not null) { writer.WritePropertyName("similarity"); - writer.WriteStringValue(SimilarityValue); + JsonSerializer.Serialize(writer, SimilarityValue, options); } writer.WritePropertyName("type"); @@ -319,7 +413,7 @@ public DenseVectorPropertyDescriptor() : base() private int? DimsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? DynamicValue { get; set; } - private string? ElementTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorElementType? ElementTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } @@ -328,8 +422,14 @@ public DenseVectorPropertyDescriptor() : base() private Action IndexOptionsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } - private string? SimilarityValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorSimilarity? SimilarityValue { get; set; } + /// + /// + /// Number of vector dimensions. Can't exceed 4096. If dims is not specified, it will be set to the length of + /// the first vector added to the field. + /// + /// public DenseVectorPropertyDescriptor Dims(int? dims) { DimsValue = dims; @@ -342,7 +442,12 @@ public DenseVectorPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serve return Self; } - public DenseVectorPropertyDescriptor ElementType(string? elementType) + /// + /// + /// The data type used to encode vectors. The supported data types are float (default), byte, and bit. + /// + /// + public DenseVectorPropertyDescriptor ElementType(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorElementType? elementType) { ElementTypeValue = elementType; return Self; @@ -374,12 +479,27 @@ public DenseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// + /// If true, you can search this field using the kNN search API. + /// + /// public DenseVectorPropertyDescriptor Index(bool? index = true) { IndexValue = index; return Self; } + /// + /// + /// An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters + /// that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the + /// expense of slower indexing speed. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? indexOptions) { IndexOptionsDescriptor = null; @@ -435,7 +555,26 @@ public DenseVectorPropertyDescriptor Properties(Action + /// + /// The vector similarity metric to use in kNN search. + /// + /// + /// Documents are ranked by their vector field's similarity to the query vector. The _score of each document will + /// be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds + /// to a higher ranking. + /// + /// + /// Defaults to l2_norm when element_type is bit otherwise defaults to cosine. + /// + /// + /// bit vectors only support l2_norm as their similarity metric. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// + public DenseVectorPropertyDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorSimilarity? similarity) { SimilarityValue = similarity; return Self; @@ -456,10 +595,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, DynamicValue, options); } - if (!string.IsNullOrEmpty(ElementTypeValue)) + if (ElementTypeValue is not null) { writer.WritePropertyName("element_type"); - writer.WriteStringValue(ElementTypeValue); + JsonSerializer.Serialize(writer, ElementTypeValue, options); } if (FieldsValue is not null) @@ -508,10 +647,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } - if (!string.IsNullOrEmpty(SimilarityValue)) + if (SimilarityValue is not null) { writer.WritePropertyName("similarity"); - writer.WriteStringValue(SimilarityValue); + JsonSerializer.Serialize(writer, SimilarityValue, options); } writer.WritePropertyName("type"); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs index 842fbf686d3..f845950e3bb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs @@ -30,5 +30,6 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Nodes; public sealed partial class NodeInfoSettingsNetwork { [JsonInclude, JsonPropertyName("host")] - public string? Host { get; init; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? Host { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpack.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpack.g.cs index d987cbd663c..5e6d49c491c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpack.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpack.g.cs @@ -31,6 +31,8 @@ public sealed partial class NodeInfoXpack { [JsonInclude, JsonPropertyName("license")] public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackLicense? License { get; init; } + [JsonInclude, JsonPropertyName("ml")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackMl? Ml { get; init; } [JsonInclude, JsonPropertyName("notification")] public IReadOnlyDictionary? Notification { get; init; } [JsonInclude, JsonPropertyName("security")] diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs new file mode 100644 index 00000000000..0d47e32199a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs @@ -0,0 +1,34 @@ +// 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.Nodes; + +public sealed partial class NodeInfoXpackMl +{ + [JsonInclude, JsonPropertyName("use_auto_machine_memory_percent")] + public bool? UseAutoMachineMemoryPercent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs index e704f5da446..52f87efcbca 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs @@ -34,7 +34,7 @@ public sealed partial class NodeInfoXpackSecurity [JsonInclude, JsonPropertyName("enabled")] public string Enabled { get; init; } [JsonInclude, JsonPropertyName("http")] - public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecuritySsl Http { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecuritySsl? Http { get; init; } [JsonInclude, JsonPropertyName("transport")] public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecuritySsl? Transport { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs index 400a86e016a..4926312fafa 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Nodes; public sealed partial class NodeInfoXpackSecurityAuthc { [JsonInclude, JsonPropertyName("realms")] - public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecurityAuthcRealms Realms { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecurityAuthcRealms? Realms { get; init; } [JsonInclude, JsonPropertyName("token")] - public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecurityAuthcToken Token { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecurityAuthcToken? Token { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Security/IndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Security/IndicesPrivileges.g.cs index 7b33b54b2a3..8bf956852fc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Security/IndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Security/IndicesPrivileges.g.cs @@ -43,7 +43,7 @@ public sealed partial class IndicesPrivileges /// /// [JsonInclude, JsonPropertyName("names")] - public Elastic.Clients.Elasticsearch.Serverless.Indices Names { get; set; } + public ICollection Names { get; set; } /// /// @@ -73,7 +73,7 @@ public IndicesPrivilegesDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Security.FieldSecurity? FieldSecurityValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Security.FieldSecurityDescriptor FieldSecurityDescriptor { get; set; } private Action> FieldSecurityDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Indices NamesValue { get; set; } + private ICollection NamesValue { get; set; } private ICollection PrivilegesValue { get; set; } private object? QueryValue { get; set; } @@ -111,7 +111,7 @@ public IndicesPrivilegesDescriptor FieldSecurity(Action /// - public IndicesPrivilegesDescriptor Names(Elastic.Clients.Elasticsearch.Serverless.Indices names) + public IndicesPrivilegesDescriptor Names(ICollection names) { NamesValue = names; return Self; @@ -183,7 +183,7 @@ public IndicesPrivilegesDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Security.FieldSecurity? FieldSecurityValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Security.FieldSecurityDescriptor FieldSecurityDescriptor { get; set; } private Action FieldSecurityDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Indices NamesValue { get; set; } + private ICollection NamesValue { get; set; } private ICollection PrivilegesValue { get; set; } private object? QueryValue { get; set; } @@ -221,7 +221,7 @@ public IndicesPrivilegesDescriptor FieldSecurity(Action /// - public IndicesPrivilegesDescriptor Names(Elastic.Clients.Elasticsearch.Serverless.Indices names) + public IndicesPrivilegesDescriptor Names(ICollection names) { NamesValue = names; return Self; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Security/UserIndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Security/UserIndicesPrivileges.g.cs index 3693ef101e1..10deebc1689 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Security/UserIndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Security/UserIndicesPrivileges.g.cs @@ -51,7 +51,6 @@ public sealed partial class UserIndicesPrivileges /// /// [JsonInclude, JsonPropertyName("names")] - [SingleOrManyCollectionConverter(typeof(string))] public IReadOnlyCollection Names { get; init; } /// diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Features.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Features.g.cs index 3fc5b6e9a01..8fced1722fa 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Features.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Features.g.cs @@ -33,14 +33,8 @@ public sealed partial class Features public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature AggregateMetric { get; init; } [JsonInclude, JsonPropertyName("analytics")] public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Analytics { get; init; } - [JsonInclude, JsonPropertyName("archive")] - public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Archive { get; init; } [JsonInclude, JsonPropertyName("ccr")] public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Ccr { get; init; } - [JsonInclude, JsonPropertyName("data_frame")] - public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? DataFrame { get; init; } - [JsonInclude, JsonPropertyName("data_science")] - public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? DataScience { get; init; } [JsonInclude, JsonPropertyName("data_streams")] public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature DataStreams { get; init; } [JsonInclude, JsonPropertyName("data_tiers")] @@ -49,8 +43,6 @@ public sealed partial class Features public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Enrich { get; init; } [JsonInclude, JsonPropertyName("eql")] public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Eql { get; init; } - [JsonInclude, JsonPropertyName("flattened")] - public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? Flattened { get; init; } [JsonInclude, JsonPropertyName("frozen_indices")] public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature FrozenIndices { get; init; } [JsonInclude, JsonPropertyName("graph")] @@ -79,8 +71,6 @@ public sealed partial class Features public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Sql { get; init; } [JsonInclude, JsonPropertyName("transform")] public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Transform { get; init; } - [JsonInclude, JsonPropertyName("vectors")] - public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? Vectors { get; init; } [JsonInclude, JsonPropertyName("voting_only")] public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature VotingOnly { get; init; } [JsonInclude, JsonPropertyName("watcher")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs index 848f867049c..b35f97dfb6a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs @@ -33,10 +33,10 @@ public sealed partial class ClusterStatsRequestParameters : RequestParameters { /// /// - /// If true, returns settings in flat format. + /// Include remote cluster data into the response /// /// - public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + public bool? IncludeRemotes { get => Q("include_remotes"); set => Q("include_remotes", value); } /// /// @@ -74,11 +74,11 @@ public ClusterStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base /// /// - /// If true, returns settings in flat format. + /// Include remote cluster data into the response /// /// [JsonIgnore] - public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + public bool? IncludeRemotes { get => Q("include_remotes"); set => Q("include_remotes", value); } /// /// @@ -117,7 +117,7 @@ public ClusterStatsRequestDescriptor() internal override string OperationName => "cluster.stats"; - public ClusterStatsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public ClusterStatsRequestDescriptor IncludeRemotes(bool? includeRemotes = true) => Qs("include_remotes", includeRemotes); public ClusterStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); public ClusterStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs index dc57d3e8346..164f288e316 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs @@ -53,9 +53,9 @@ public MoveToStepRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r internal override string OperationName => "ilm.move_to_step"; [JsonInclude, JsonPropertyName("current_step")] - public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? CurrentStep { get; set; } + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey CurrentStep { get; set; } [JsonInclude, JsonPropertyName("next_step")] - public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? NextStep { get; set; } + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey NextStep { get; set; } } /// @@ -89,14 +89,14 @@ public MoveToStepRequestDescriptor Index(Elastic.Clients.Elasticsearc return Self; } - private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? CurrentStepValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey CurrentStepValue { get; set; } private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor CurrentStepDescriptor { get; set; } private Action CurrentStepDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? NextStepValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey NextStepValue { get; set; } private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor NextStepDescriptor { get; set; } private Action NextStepDescriptorAction { get; set; } - public MoveToStepRequestDescriptor CurrentStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? currentStep) + public MoveToStepRequestDescriptor CurrentStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey currentStep) { CurrentStepDescriptor = null; CurrentStepDescriptorAction = null; @@ -120,7 +120,7 @@ public MoveToStepRequestDescriptor CurrentStep(Action NextStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? nextStep) + public MoveToStepRequestDescriptor NextStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey nextStep) { NextStepDescriptor = null; NextStepDescriptorAction = null; @@ -157,7 +157,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("current_step"); JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor(CurrentStepDescriptorAction), options); } - else if (CurrentStepValue is not null) + else { writer.WritePropertyName("current_step"); JsonSerializer.Serialize(writer, CurrentStepValue, options); @@ -173,7 +173,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("next_step"); JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor(NextStepDescriptorAction), options); } - else if (NextStepValue is not null) + else { writer.WritePropertyName("next_step"); JsonSerializer.Serialize(writer, NextStepValue, options); @@ -210,14 +210,14 @@ public MoveToStepRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName return Self; } - private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? CurrentStepValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey CurrentStepValue { get; set; } private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor CurrentStepDescriptor { get; set; } private Action CurrentStepDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? NextStepValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey NextStepValue { get; set; } private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor NextStepDescriptor { get; set; } private Action NextStepDescriptorAction { get; set; } - public MoveToStepRequestDescriptor CurrentStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? currentStep) + public MoveToStepRequestDescriptor CurrentStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey currentStep) { CurrentStepDescriptor = null; CurrentStepDescriptorAction = null; @@ -241,7 +241,7 @@ public MoveToStepRequestDescriptor CurrentStep(Action /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs index 62e229a3ed0..173d7f57182 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs @@ -29,5 +29,5 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class RefreshResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("_shards")] - public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } + public Elastic.Clients.Elasticsearch.ShardStatistics? Shards { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs index f4c2535f6da..dca82330fc2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs @@ -58,7 +58,7 @@ public sealed partial class PutInferenceResponse : ElasticsearchResponse /// /// [JsonInclude, JsonPropertyName("task_settings")] - public object TaskSettings { get; init; } + public object? TaskSettings { get; init; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs index 5b7b58c3030..0f19d1b9a0e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs @@ -31,6 +31,5 @@ public sealed partial class GetBuiltinPrivilegesResponse : ElasticsearchResponse [JsonInclude, JsonPropertyName("cluster")] public IReadOnlyCollection Cluster { get; init; } [JsonInclude, JsonPropertyName("index")] - [SingleOrManyCollectionConverter(typeof(string))] - public IReadOnlyCollection Indices { get; init; } + public IReadOnlyCollection Index { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs index 6e81b6daa73..1bf5db7079d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs @@ -28,6 +28,8 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; public sealed partial class RestoreResponse : ElasticsearchResponse { + [JsonInclude, JsonPropertyName("accepted")] + public bool? Accepted { get; init; } [JsonInclude, JsonPropertyName("snapshot")] - public Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore Snapshot { get; init; } + public Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore? Snapshot { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs index 110960e049d..64fa62a915a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs @@ -32,9 +32,9 @@ public sealed partial class EdgeNGramTokenizer : ITokenizer [JsonInclude, JsonPropertyName("custom_token_chars")] public string? CustomTokenChars { get; set; } [JsonInclude, JsonPropertyName("max_gram")] - public int MaxGram { get; set; } + public int? MaxGram { get; set; } [JsonInclude, JsonPropertyName("min_gram")] - public int MinGram { get; set; } + public int? MinGram { get; set; } [JsonInclude, JsonPropertyName("token_chars")] public ICollection? TokenChars { get; set; } @@ -54,8 +54,8 @@ public EdgeNGramTokenizerDescriptor() : base() } private string? CustomTokenCharsValue { get; set; } - private int MaxGramValue { get; set; } - private int MinGramValue { get; set; } + private int? MaxGramValue { get; set; } + private int? MinGramValue { get; set; } private ICollection? TokenCharsValue { get; set; } private string? VersionValue { get; set; } @@ -65,13 +65,13 @@ public EdgeNGramTokenizerDescriptor CustomTokenChars(string? customTokenChars) return Self; } - public EdgeNGramTokenizerDescriptor MaxGram(int maxGram) + public EdgeNGramTokenizerDescriptor MaxGram(int? maxGram) { MaxGramValue = maxGram; return Self; } - public EdgeNGramTokenizerDescriptor MinGram(int minGram) + public EdgeNGramTokenizerDescriptor MinGram(int? minGram) { MinGramValue = minGram; return Self; @@ -98,10 +98,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(CustomTokenCharsValue); } - writer.WritePropertyName("max_gram"); - writer.WriteNumberValue(MaxGramValue); - writer.WritePropertyName("min_gram"); - writer.WriteNumberValue(MinGramValue); + if (MaxGramValue.HasValue) + { + writer.WritePropertyName("max_gram"); + writer.WriteNumberValue(MaxGramValue.Value); + } + + if (MinGramValue.HasValue) + { + writer.WritePropertyName("min_gram"); + writer.WriteNumberValue(MinGramValue.Value); + } + if (TokenCharsValue is not null) { writer.WritePropertyName("token_chars"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs index a68be22a2cb..c4cfb90b1fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs @@ -32,9 +32,9 @@ public sealed partial class NGramTokenizer : ITokenizer [JsonInclude, JsonPropertyName("custom_token_chars")] public string? CustomTokenChars { get; set; } [JsonInclude, JsonPropertyName("max_gram")] - public int MaxGram { get; set; } + public int? MaxGram { get; set; } [JsonInclude, JsonPropertyName("min_gram")] - public int MinGram { get; set; } + public int? MinGram { get; set; } [JsonInclude, JsonPropertyName("token_chars")] public ICollection? TokenChars { get; set; } @@ -54,8 +54,8 @@ public NGramTokenizerDescriptor() : base() } private string? CustomTokenCharsValue { get; set; } - private int MaxGramValue { get; set; } - private int MinGramValue { get; set; } + private int? MaxGramValue { get; set; } + private int? MinGramValue { get; set; } private ICollection? TokenCharsValue { get; set; } private string? VersionValue { get; set; } @@ -65,13 +65,13 @@ public NGramTokenizerDescriptor CustomTokenChars(string? customTokenChars) return Self; } - public NGramTokenizerDescriptor MaxGram(int maxGram) + public NGramTokenizerDescriptor MaxGram(int? maxGram) { MaxGramValue = maxGram; return Self; } - public NGramTokenizerDescriptor MinGram(int minGram) + public NGramTokenizerDescriptor MinGram(int? minGram) { MinGramValue = minGram; return Self; @@ -98,10 +98,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(CustomTokenCharsValue); } - writer.WritePropertyName("max_gram"); - writer.WriteNumberValue(MaxGramValue); - writer.WritePropertyName("min_gram"); - writer.WriteNumberValue(MinGramValue); + if (MaxGramValue.HasValue) + { + writer.WritePropertyName("max_gram"); + writer.WriteNumberValue(MaxGramValue.Value); + } + + if (MinGramValue.HasValue) + { + writer.WritePropertyName("min_gram"); + writer.WriteNumberValue(MinGramValue.Value); + } + if (TokenCharsValue is not null) { writer.WritePropertyName("token_chars"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs index c930a3155e2..6e2a0890436 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs @@ -35,6 +35,8 @@ public enum ConvertType String, [EnumMember(Value = "long")] Long, + [EnumMember(Value = "ip")] + Ip, [EnumMember(Value = "integer")] Integer, [EnumMember(Value = "float")] @@ -58,6 +60,8 @@ public override ConvertType Read(ref Utf8JsonReader reader, Type typeToConvert, return ConvertType.String; case "long": return ConvertType.Long; + case "ip": + return ConvertType.Ip; case "integer": return ConvertType.Integer; case "float": @@ -84,6 +88,9 @@ public override void Write(Utf8JsonWriter writer, ConvertType value, JsonSeriali case ConvertType.Long: writer.WriteStringValue("long"); return; + case ConvertType.Ip: + writer.WriteStringValue("ip"); + return; case ConvertType.Integer: writer.WriteStringValue("integer"); return; @@ -105,6 +112,69 @@ public override void Write(Utf8JsonWriter writer, ConvertType value, JsonSeriali } } +[JsonConverter(typeof(FingerprintDigestConverter))] +public enum FingerprintDigest +{ + [EnumMember(Value = "SHA-512")] + Sha512, + [EnumMember(Value = "SHA-256")] + Sha256, + [EnumMember(Value = "SHA-1")] + Sha1, + [EnumMember(Value = "MurmurHash3")] + Murmurhash3, + [EnumMember(Value = "MD5")] + Md5 +} + +internal sealed class FingerprintDigestConverter : JsonConverter +{ + public override FingerprintDigest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "SHA-512": + return FingerprintDigest.Sha512; + case "SHA-256": + return FingerprintDigest.Sha256; + case "SHA-1": + return FingerprintDigest.Sha1; + case "MurmurHash3": + return FingerprintDigest.Murmurhash3; + case "MD5": + return FingerprintDigest.Md5; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, FingerprintDigest value, JsonSerializerOptions options) + { + switch (value) + { + case FingerprintDigest.Sha512: + writer.WriteStringValue("SHA-512"); + return; + case FingerprintDigest.Sha256: + writer.WriteStringValue("SHA-256"); + return; + case FingerprintDigest.Sha1: + writer.WriteStringValue("SHA-1"); + return; + case FingerprintDigest.Murmurhash3: + writer.WriteStringValue("MurmurHash3"); + return; + case FingerprintDigest.Md5: + writer.WriteStringValue("MD5"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(GeoGridTargetFormatConverter))] public enum GeoGridTargetFormat { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs index cfbbedf34a4..b9936319efd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs @@ -28,6 +28,298 @@ namespace Elastic.Clients.Elasticsearch.Mapping; +[JsonConverter(typeof(DenseVectorElementTypeConverter))] +public enum DenseVectorElementType +{ + /// + /// + /// Indexes a 4-byte floating-point value per dimension. + /// + /// + [EnumMember(Value = "float")] + Float, + /// + /// + /// Indexes a 1-byte integer value per dimension. + /// + /// + [EnumMember(Value = "byte")] + Byte, + /// + /// + /// Indexes a single bit per dimension. Useful for very high-dimensional vectors or models that specifically support + /// bit vectors. + /// + /// + /// NOTE: when using bit, the number of dimensions must be a multiple of 8 and must represent the number of bits. + /// + /// + [EnumMember(Value = "bit")] + Bit +} + +internal sealed class DenseVectorElementTypeConverter : JsonConverter +{ + public override DenseVectorElementType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "float": + return DenseVectorElementType.Float; + case "byte": + return DenseVectorElementType.Byte; + case "bit": + return DenseVectorElementType.Bit; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DenseVectorElementType value, JsonSerializerOptions options) + { + switch (value) + { + case DenseVectorElementType.Float: + writer.WriteStringValue("float"); + return; + case DenseVectorElementType.Byte: + writer.WriteStringValue("byte"); + return; + case DenseVectorElementType.Bit: + writer.WriteStringValue("bit"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DenseVectorIndexOptionsTypeConverter))] +public enum DenseVectorIndexOptionsType +{ + /// + /// + /// The default index type for float vectors. This utilizes the HNSW algorithm in addition to automatically scalar + /// quantization for scalable approximate kNN search with element_type of float. + /// + /// + /// This can reduce the memory footprint by 4x at the cost of some accuracy. + /// + /// + [EnumMember(Value = "int8_hnsw")] + Int8Hnsw, + /// + /// + /// This utilizes a brute-force search algorithm in addition to automatically scalar quantization. Only supports + /// element_type of float. + /// + /// + [EnumMember(Value = "int8_flat")] + Int8Flat, + /// + /// + /// This utilizes the HNSW algorithm in addition to automatically scalar quantization for scalable approximate kNN + /// search with element_type of float. + /// + /// + /// This can reduce the memory footprint by 8x at the cost of some accuracy. + /// + /// + [EnumMember(Value = "int4_hnsw")] + Int4Hnsw, + /// + /// + /// This utilizes a brute-force search algorithm in addition to automatically half-byte scalar quantization. + /// Only supports element_type of float. + /// + /// + [EnumMember(Value = "int4_flat")] + Int4Flat, + /// + /// + /// This utilizes the HNSW algorithm for scalable approximate kNN search. This supports all element_type values. + /// + /// + [EnumMember(Value = "hnsw")] + Hnsw, + /// + /// + /// This utilizes a brute-force search algorithm for exact kNN search. This supports all element_type values. + /// + /// + [EnumMember(Value = "flat")] + Flat +} + +internal sealed class DenseVectorIndexOptionsTypeConverter : JsonConverter +{ + public override DenseVectorIndexOptionsType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "int8_hnsw": + return DenseVectorIndexOptionsType.Int8Hnsw; + case "int8_flat": + return DenseVectorIndexOptionsType.Int8Flat; + case "int4_hnsw": + return DenseVectorIndexOptionsType.Int4Hnsw; + case "int4_flat": + return DenseVectorIndexOptionsType.Int4Flat; + case "hnsw": + return DenseVectorIndexOptionsType.Hnsw; + case "flat": + return DenseVectorIndexOptionsType.Flat; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DenseVectorIndexOptionsType value, JsonSerializerOptions options) + { + switch (value) + { + case DenseVectorIndexOptionsType.Int8Hnsw: + writer.WriteStringValue("int8_hnsw"); + return; + case DenseVectorIndexOptionsType.Int8Flat: + writer.WriteStringValue("int8_flat"); + return; + case DenseVectorIndexOptionsType.Int4Hnsw: + writer.WriteStringValue("int4_hnsw"); + return; + case DenseVectorIndexOptionsType.Int4Flat: + writer.WriteStringValue("int4_flat"); + return; + case DenseVectorIndexOptionsType.Hnsw: + writer.WriteStringValue("hnsw"); + return; + case DenseVectorIndexOptionsType.Flat: + writer.WriteStringValue("flat"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DenseVectorSimilarityConverter))] +public enum DenseVectorSimilarity +{ + /// + /// + /// Computes the maximum inner product of two vectors. This is similar to dot_product, but doesn't require vectors + /// to be normalized. This means that each vector’s magnitude can significantly effect the score. + /// + /// + /// The document _score is adjusted to prevent negative values. For max_inner_product values < 0, the _score + /// is 1 / (1 + -1 * max_inner_product(query, vector)). For non-negative max_inner_product results the _score + /// is calculated max_inner_product(query, vector) + 1. + /// + /// + [EnumMember(Value = "max_inner_product")] + MaxInnerProduct, + /// + /// + /// Computes similarity based on the L2 distance (also known as Euclidean distance) between the vectors. + /// + /// + /// The document _score is computed as 1 / (1 + l2_norm(query, vector)^2). + /// + /// + /// For bit vectors, instead of using l2_norm, the hamming distance between the vectors is used. + /// + /// + /// The _score transformation is (numBits - hamming(a, b)) / numBits. + /// + /// + [EnumMember(Value = "l2_norm")] + L2Norm, + /// + /// + /// Computes the dot product of two unit vectors. This option provides an optimized way to perform cosine similarity. + /// The constraints and computed score are defined by element_type. + /// + /// + /// When element_type is float, all vectors must be unit length, including both document and query vectors. + /// + /// + /// The document _score is computed as (1 + dot_product(query, vector)) / 2. + /// + /// + /// When element_type is byte, all vectors must have the same length including both document and query vectors or + /// results will be inaccurate. + /// + /// + /// The document _score is computed as 0.5 + (dot_product(query, vector) / (32768 * dims)) where dims is the + /// number of dimensions per vector. + /// + /// + [EnumMember(Value = "dot_product")] + DotProduct, + /// + /// + /// Computes the cosine similarity. During indexing Elasticsearch automatically normalizes vectors with cosine + /// similarity to unit length. This allows to internally use dot_product for computing similarity, which is more + /// efficient. Original un-normalized vectors can be still accessed through scripts. + /// + /// + /// The document _score is computed as (1 + cosine(query, vector)) / 2. + /// + /// + /// The cosine similarity does not allow vectors with zero magnitude, since cosine is not defined in this case. + /// + /// + [EnumMember(Value = "cosine")] + Cosine +} + +internal sealed class DenseVectorSimilarityConverter : JsonConverter +{ + public override DenseVectorSimilarity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "max_inner_product": + return DenseVectorSimilarity.MaxInnerProduct; + case "l2_norm": + return DenseVectorSimilarity.L2Norm; + case "dot_product": + return DenseVectorSimilarity.DotProduct; + case "cosine": + return DenseVectorSimilarity.Cosine; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DenseVectorSimilarity value, JsonSerializerOptions options) + { + switch (value) + { + case DenseVectorSimilarity.MaxInnerProduct: + writer.WriteStringValue("max_inner_product"); + return; + case DenseVectorSimilarity.L2Norm: + writer.WriteStringValue("l2_norm"); + return; + case DenseVectorSimilarity.DotProduct: + writer.WriteStringValue("dot_product"); + return; + case DenseVectorSimilarity.Cosine: + writer.WriteStringValue("cosine"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(DynamicMappingConverter))] public enum DynamicMapping { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs index 8924b0ef17a..30fc8645cd8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs @@ -30,9 +30,9 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; public sealed partial class StepKey { [JsonInclude, JsonPropertyName("action")] - public string Action { get; set; } + public string? Action { get; set; } [JsonInclude, JsonPropertyName("name")] - public string Name { get; set; } + public string? Name { get; set; } [JsonInclude, JsonPropertyName("phase")] public string Phase { get; set; } } @@ -45,17 +45,17 @@ public StepKeyDescriptor() : base() { } - private string ActionValue { get; set; } - private string NameValue { get; set; } + private string? ActionValue { get; set; } + private string? NameValue { get; set; } private string PhaseValue { get; set; } - public StepKeyDescriptor Action(string action) + public StepKeyDescriptor Action(string? action) { ActionValue = action; return Self; } - public StepKeyDescriptor Name(string name) + public StepKeyDescriptor Name(string? name) { NameValue = name; return Self; @@ -70,10 +70,18 @@ public StepKeyDescriptor Phase(string phase) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("action"); - writer.WriteStringValue(ActionValue); - writer.WritePropertyName("name"); - writer.WriteStringValue(NameValue); + if (!string.IsNullOrEmpty(ActionValue)) + { + writer.WritePropertyName("action"); + writer.WriteStringValue(ActionValue); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + writer.WritePropertyName("phase"); writer.WriteStringValue(PhaseValue); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs index 2982f6b3c1f..3fd9f9b693d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs @@ -29,6 +29,8 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class DataStreamVisibility { + [JsonInclude, JsonPropertyName("allow_custom_routing")] + public bool? AllowCustomRouting { get; set; } [JsonInclude, JsonPropertyName("hidden")] public bool? Hidden { get; set; } } @@ -41,8 +43,15 @@ public DataStreamVisibilityDescriptor() : base() { } + private bool? AllowCustomRoutingValue { get; set; } private bool? HiddenValue { get; set; } + public DataStreamVisibilityDescriptor AllowCustomRouting(bool? allowCustomRouting = true) + { + AllowCustomRoutingValue = allowCustomRouting; + return Self; + } + public DataStreamVisibilityDescriptor Hidden(bool? hidden = true) { HiddenValue = hidden; @@ -52,6 +61,12 @@ public DataStreamVisibilityDescriptor Hidden(bool? hidden = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (AllowCustomRoutingValue.HasValue) + { + writer.WritePropertyName("allow_custom_routing"); + writer.WriteBooleanValue(AllowCustomRoutingValue.Value); + } + if (HiddenValue.HasValue) { writer.WritePropertyName("hidden"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs index a1e9cf57801..cd1fd616d31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs @@ -56,7 +56,7 @@ public sealed partial class InferenceEndpoint /// /// [JsonInclude, JsonPropertyName("task_settings")] - public object TaskSettings { get; set; } + public object? TaskSettings { get; set; } } /// @@ -74,7 +74,7 @@ public InferenceEndpointDescriptor() : base() private string ServiceValue { get; set; } private object ServiceSettingsValue { get; set; } - private object TaskSettingsValue { get; set; } + private object? TaskSettingsValue { get; set; } /// /// @@ -103,7 +103,7 @@ public InferenceEndpointDescriptor ServiceSettings(object serviceSettings) /// Task settings specific to the service and task type /// /// - public InferenceEndpointDescriptor TaskSettings(object taskSettings) + public InferenceEndpointDescriptor TaskSettings(object? taskSettings) { TaskSettingsValue = taskSettings; return Self; @@ -116,8 +116,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(ServiceValue); writer.WritePropertyName("service_settings"); JsonSerializer.Serialize(writer, ServiceSettingsValue, options); - writer.WritePropertyName("task_settings"); - JsonSerializer.Serialize(writer, TaskSettingsValue, options); + if (TaskSettingsValue is not null) + { + writer.WritePropertyName("task_settings"); + JsonSerializer.Serialize(writer, TaskSettingsValue, options); + } + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs index 2863e2dea74..d0324de75cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs @@ -64,7 +64,7 @@ public sealed partial class InferenceEndpointInfo /// /// [JsonInclude, JsonPropertyName("task_settings")] - public object TaskSettings { get; init; } + public object? TaskSettings { get; init; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.g.cs new file mode 100644 index 00000000000..5b12c5802f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.g.cs @@ -0,0 +1,1310 @@ +// 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 CommunityIDProcessor +{ + /// + /// + /// 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 destination IP address. + /// + /// + [JsonInclude, JsonPropertyName("destination_ip")] + public Elastic.Clients.Elasticsearch.Field? DestinationIp { get; set; } + + /// + /// + /// Field containing the destination port. + /// + /// + [JsonInclude, JsonPropertyName("destination_port")] + public Elastic.Clients.Elasticsearch.Field? DestinationPort { get; set; } + + /// + /// + /// Field containing the IANA number. + /// + /// + [JsonInclude, JsonPropertyName("iana_number")] + public Elastic.Clients.Elasticsearch.Field? IanaNumber { get; set; } + + /// + /// + /// Field containing the ICMP code. + /// + /// + [JsonInclude, JsonPropertyName("icmp_code")] + public Elastic.Clients.Elasticsearch.Field? IcmpCode { get; set; } + + /// + /// + /// Field containing the ICMP type. + /// + /// + [JsonInclude, JsonPropertyName("icmp_type")] + public Elastic.Clients.Elasticsearch.Field? IcmpType { 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 any required fields are missing, 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; } + + /// + /// + /// Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The + /// seed can prevent hash collisions between network domains, such as a staging + /// and production network that use the same addressing scheme. + /// + /// + [JsonInclude, JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// + /// Field containing the source IP address. + /// + /// + [JsonInclude, JsonPropertyName("source_ip")] + public Elastic.Clients.Elasticsearch.Field? SourceIp { get; set; } + + /// + /// + /// Field containing the source port. + /// + /// + [JsonInclude, JsonPropertyName("source_port")] + public Elastic.Clients.Elasticsearch.Field? SourcePort { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// Output field for the community ID. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Field? Transport { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(CommunityIDProcessor communityIDProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.CommunityId(communityIDProcessor); +} + +public sealed partial class CommunityIDProcessorDescriptor : SerializableDescriptor> +{ + internal CommunityIDProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public CommunityIDProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? DestinationIpValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? DestinationPortValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? IanaNumberValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? IcmpCodeValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? IcmpTypeValue { 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 int? SeedValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? SourceIpValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? SourcePortValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TransportValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public CommunityIDProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Elastic.Clients.Elasticsearch.Field? destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Elastic.Clients.Elasticsearch.Field? destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Expression> destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Expression> destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Elastic.Clients.Elasticsearch.Field? ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Expression> ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Expression> ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Elastic.Clients.Elasticsearch.Field? icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Expression> icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Expression> icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Elastic.Clients.Elasticsearch.Field? icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Expression> icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Expression> icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public CommunityIDProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public CommunityIDProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public CommunityIDProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public CommunityIDProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The + /// seed can prevent hash collisions between network domains, such as a staging + /// and production network that use the same addressing scheme. + /// + /// + public CommunityIDProcessorDescriptor Seed(int? seed) + { + SeedValue = seed; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Elastic.Clients.Elasticsearch.Field? sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Elastic.Clients.Elasticsearch.Field? sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Expression> sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Expression> sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public CommunityIDProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Elastic.Clients.Elasticsearch.Field? transport) + { + TransportValue = transport; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Expression> transport) + { + TransportValue = transport; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Expression> transport) + { + TransportValue = transport; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestinationIpValue is not null) + { + writer.WritePropertyName("destination_ip"); + JsonSerializer.Serialize(writer, DestinationIpValue, options); + } + + if (DestinationPortValue is not null) + { + writer.WritePropertyName("destination_port"); + JsonSerializer.Serialize(writer, DestinationPortValue, options); + } + + if (IanaNumberValue is not null) + { + writer.WritePropertyName("iana_number"); + JsonSerializer.Serialize(writer, IanaNumberValue, options); + } + + if (IcmpCodeValue is not null) + { + writer.WritePropertyName("icmp_code"); + JsonSerializer.Serialize(writer, IcmpCodeValue, options); + } + + if (IcmpTypeValue is not null) + { + writer.WritePropertyName("icmp_type"); + JsonSerializer.Serialize(writer, IcmpTypeValue, 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 (SeedValue.HasValue) + { + writer.WritePropertyName("seed"); + writer.WriteNumberValue(SeedValue.Value); + } + + if (SourceIpValue is not null) + { + writer.WritePropertyName("source_ip"); + JsonSerializer.Serialize(writer, SourceIpValue, options); + } + + if (SourcePortValue is not null) + { + writer.WritePropertyName("source_port"); + JsonSerializer.Serialize(writer, SourcePortValue, 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); + } + + if (TransportValue is not null) + { + writer.WritePropertyName("transport"); + JsonSerializer.Serialize(writer, TransportValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CommunityIDProcessorDescriptor : SerializableDescriptor +{ + internal CommunityIDProcessorDescriptor(Action configure) => configure.Invoke(this); + + public CommunityIDProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? DestinationIpValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? DestinationPortValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? IanaNumberValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? IcmpCodeValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? IcmpTypeValue { 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 int? SeedValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? SourceIpValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? SourcePortValue { get; set; } + private string? TagValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TransportValue { get; set; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public CommunityIDProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Elastic.Clients.Elasticsearch.Field? destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public CommunityIDProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Elastic.Clients.Elasticsearch.Field? destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Expression> destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the destination port. + /// + /// + public CommunityIDProcessorDescriptor DestinationPort(Expression> destinationPort) + { + DestinationPortValue = destinationPort; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Elastic.Clients.Elasticsearch.Field? ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Expression> ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the IANA number. + /// + /// + public CommunityIDProcessorDescriptor IanaNumber(Expression> ianaNumber) + { + IanaNumberValue = ianaNumber; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Elastic.Clients.Elasticsearch.Field? icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Expression> icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP code. + /// + /// + public CommunityIDProcessorDescriptor IcmpCode(Expression> icmpCode) + { + IcmpCodeValue = icmpCode; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Elastic.Clients.Elasticsearch.Field? icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Expression> icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Field containing the ICMP type. + /// + /// + public CommunityIDProcessorDescriptor IcmpType(Expression> icmpType) + { + IcmpTypeValue = icmpType; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public CommunityIDProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public CommunityIDProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public CommunityIDProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public CommunityIDProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public CommunityIDProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The + /// seed can prevent hash collisions between network domains, such as a staging + /// and production network that use the same addressing scheme. + /// + /// + public CommunityIDProcessorDescriptor Seed(int? seed) + { + SeedValue = seed; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Elastic.Clients.Elasticsearch.Field? sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public CommunityIDProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Elastic.Clients.Elasticsearch.Field? sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Expression> sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Field containing the source port. + /// + /// + public CommunityIDProcessorDescriptor SourcePort(Expression> sourcePort) + { + SourcePortValue = sourcePort; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public CommunityIDProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the community ID. + /// + /// + public CommunityIDProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Elastic.Clients.Elasticsearch.Field? transport) + { + TransportValue = transport; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Expression> transport) + { + TransportValue = transport; + return Self; + } + + /// + /// + /// Field containing the transport protocol name or number. Used only when the + /// iana_number field is not present. The following protocol names are currently + /// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp + /// + /// + public CommunityIDProcessorDescriptor Transport(Expression> transport) + { + TransportValue = transport; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestinationIpValue is not null) + { + writer.WritePropertyName("destination_ip"); + JsonSerializer.Serialize(writer, DestinationIpValue, options); + } + + if (DestinationPortValue is not null) + { + writer.WritePropertyName("destination_port"); + JsonSerializer.Serialize(writer, DestinationPortValue, options); + } + + if (IanaNumberValue is not null) + { + writer.WritePropertyName("iana_number"); + JsonSerializer.Serialize(writer, IanaNumberValue, options); + } + + if (IcmpCodeValue is not null) + { + writer.WritePropertyName("icmp_code"); + JsonSerializer.Serialize(writer, IcmpCodeValue, options); + } + + if (IcmpTypeValue is not null) + { + writer.WritePropertyName("icmp_type"); + JsonSerializer.Serialize(writer, IcmpTypeValue, 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 (SeedValue.HasValue) + { + writer.WritePropertyName("seed"); + writer.WriteNumberValue(SeedValue.Value); + } + + if (SourceIpValue is not null) + { + writer.WritePropertyName("source_ip"); + JsonSerializer.Serialize(writer, SourceIpValue, options); + } + + if (SourcePortValue is not null) + { + writer.WritePropertyName("source_port"); + JsonSerializer.Serialize(writer, SourcePortValue, 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); + } + + if (TransportValue is not null) + { + writer.WritePropertyName("transport"); + JsonSerializer.Serialize(writer, TransportValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs index cc093530e31..c74aa779235 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs @@ -88,6 +88,15 @@ public sealed partial class DateProcessor [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + /// + /// + /// The format to use when writing the date to target_field. Must be a valid + /// java time pattern. + /// + /// + [JsonInclude, JsonPropertyName("output_format")] + public string? OutputFormat { get; set; } + /// /// /// Identifier for the processor. @@ -135,6 +144,7 @@ public DateProcessorDescriptor() : base() private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } private Action> OnFailureDescriptorAction { get; set; } private Action>[] OnFailureDescriptorActions { get; set; } + private string? OutputFormatValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } private string? TimezoneValue { get; set; } @@ -271,6 +281,18 @@ public DateProcessorDescriptor OnFailure(params Action + /// + /// The format to use when writing the date to target_field. Must be a valid + /// java time pattern. + /// + /// + public DateProcessorDescriptor OutputFormat(string? outputFormat) + { + OutputFormatValue = outputFormat; + return Self; + } + /// /// /// Identifier for the processor. @@ -390,6 +412,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, OnFailureValue, options); } + if (!string.IsNullOrEmpty(OutputFormatValue)) + { + writer.WritePropertyName("output_format"); + writer.WriteStringValue(OutputFormatValue); + } + if (!string.IsNullOrEmpty(TagValue)) { writer.WritePropertyName("tag"); @@ -430,6 +458,7 @@ public DateProcessorDescriptor() : base() private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } private Action OnFailureDescriptorAction { get; set; } private Action[] OnFailureDescriptorActions { get; set; } + private string? OutputFormatValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } private string? TimezoneValue { get; set; } @@ -566,6 +595,18 @@ public DateProcessorDescriptor OnFailure(params Action + /// + /// The format to use when writing the date to target_field. Must be a valid + /// java time pattern. + /// + /// + public DateProcessorDescriptor OutputFormat(string? outputFormat) + { + OutputFormatValue = outputFormat; + return Self; + } + /// /// /// Identifier for the processor. @@ -685,6 +726,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, OnFailureValue, options); } + if (!string.IsNullOrEmpty(OutputFormatValue)) + { + writer.WritePropertyName("output_format"); + writer.WriteStringValue(OutputFormatValue); + } + if (!string.IsNullOrEmpty(TagValue)) { writer.WritePropertyName("tag"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.g.cs new file mode 100644 index 00000000000..1242f11c013 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.g.cs @@ -0,0 +1,676 @@ +// 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 FingerprintProcessor +{ + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// Array of fields to include in the fingerprint. For objects, the processor + /// hashes both the field key and value. For other fields, the processor hashes + /// only the field value. + /// + /// + [JsonInclude, JsonPropertyName("fields")] + [JsonConverter(typeof(SingleOrManyFieldsConverter))] + public Elastic.Clients.Elasticsearch.Fields Fields { 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, the processor ignores any missing fields. If all fields are + /// missing, the processor silently exits without modifying the document. + /// + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// + /// The hash method used to compute the fingerprint. Must be one of MD5, SHA-1, + /// SHA-256, SHA-512, or MurmurHash3. + /// + /// + [JsonInclude, JsonPropertyName("method")] + public Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? Method { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// + /// Salt value for the hash function. + /// + /// + [JsonInclude, JsonPropertyName("salt")] + public string? Salt { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// Output field for the fingerprint. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(FingerprintProcessor fingerprintProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Fingerprint(fingerprintProcessor); +} + +public sealed partial class FingerprintProcessorDescriptor : SerializableDescriptor> +{ + internal FingerprintProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public FingerprintProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields FieldsValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? MethodValue { 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? SaltValue { 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 FingerprintProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Array of fields to include in the fingerprint. For objects, the processor + /// hashes both the field key and value. For other fields, the processor hashes + /// only the field value. + /// + /// + public FingerprintProcessorDescriptor Fields(Elastic.Clients.Elasticsearch.Fields fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public FingerprintProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public FingerprintProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true, the processor ignores any missing fields. If all fields are + /// missing, the processor silently exits without modifying the document. + /// + /// + public FingerprintProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// The hash method used to compute the fingerprint. Must be one of MD5, SHA-1, + /// SHA-256, SHA-512, or MurmurHash3. + /// + /// + public FingerprintProcessorDescriptor Method(Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? method) + { + MethodValue = method; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public FingerprintProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Salt value for the hash function. + /// + /// + public FingerprintProcessorDescriptor Salt(string? salt) + { + SaltValue = salt; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public FingerprintProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor 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("fields"); + JsonSerializer.Serialize(writer, FieldsValue, 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 (MethodValue is not null) + { + writer.WritePropertyName("method"); + JsonSerializer.Serialize(writer, MethodValue, options); + } + + 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(SaltValue)) + { + writer.WritePropertyName("salt"); + writer.WriteStringValue(SaltValue); + } + + 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 FingerprintProcessorDescriptor : SerializableDescriptor +{ + internal FingerprintProcessorDescriptor(Action configure) => configure.Invoke(this); + + public FingerprintProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields FieldsValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? MethodValue { 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? SaltValue { 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 FingerprintProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Array of fields to include in the fingerprint. For objects, the processor + /// hashes both the field key and value. For other fields, the processor hashes + /// only the field value. + /// + /// + public FingerprintProcessorDescriptor Fields(Elastic.Clients.Elasticsearch.Fields fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public FingerprintProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public FingerprintProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true, the processor ignores any missing fields. If all fields are + /// missing, the processor silently exits without modifying the document. + /// + /// + public FingerprintProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// The hash method used to compute the fingerprint. Must be one of MD5, SHA-1, + /// SHA-256, SHA-512, or MurmurHash3. + /// + /// + public FingerprintProcessorDescriptor Method(Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? method) + { + MethodValue = method; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public FingerprintProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public FingerprintProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Salt value for the hash function. + /// + /// + public FingerprintProcessorDescriptor Salt(string? salt) + { + SaltValue = salt; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public FingerprintProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the fingerprint. + /// + /// + public FingerprintProcessorDescriptor 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("fields"); + JsonSerializer.Serialize(writer, FieldsValue, 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 (MethodValue is not null) + { + writer.WritePropertyName("method"); + JsonSerializer.Serialize(writer, MethodValue, options); + } + + 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(SaltValue)) + { + writer.WritePropertyName("salt"); + writer.WriteStringValue(SaltValue); + } + + 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/GrokProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs index 07e9afcca33..f7948688c86 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs @@ -38,6 +38,15 @@ public sealed partial class GrokProcessor [JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } + /// + /// + /// Must be disabled or v1. If v1, the processor uses patterns with Elastic + /// Common Schema (ECS) field names. + /// + /// + [JsonInclude, JsonPropertyName("ecs_compatibility")] + public string? EcsCompatibility { get; set; } + /// /// /// The field to use for grok expression parsing. @@ -125,6 +134,7 @@ public GrokProcessorDescriptor() : base() } private string? DescriptionValue { get; set; } + private string? EcsCompatibilityValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } @@ -150,6 +160,18 @@ public GrokProcessorDescriptor Description(string? description) return Self; } + /// + /// + /// Must be disabled or v1. If v1, the processor uses patterns with Elastic + /// Common Schema (ECS) field names. + /// + /// + public GrokProcessorDescriptor EcsCompatibility(string? ecsCompatibility) + { + EcsCompatibilityValue = ecsCompatibility; + return Self; + } + /// /// /// The field to use for grok expression parsing. @@ -313,6 +335,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(DescriptionValue); } + if (!string.IsNullOrEmpty(EcsCompatibilityValue)) + { + writer.WritePropertyName("ecs_compatibility"); + writer.WriteStringValue(EcsCompatibilityValue); + } + writer.WritePropertyName("field"); JsonSerializer.Serialize(writer, FieldValue, options); if (!string.IsNullOrEmpty(IfValue)) @@ -397,6 +425,7 @@ public GrokProcessorDescriptor() : base() } private string? DescriptionValue { get; set; } + private string? EcsCompatibilityValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } @@ -422,6 +451,18 @@ public GrokProcessorDescriptor Description(string? description) return Self; } + /// + /// + /// Must be disabled or v1. If v1, the processor uses patterns with Elastic + /// Common Schema (ECS) field names. + /// + /// + public GrokProcessorDescriptor EcsCompatibility(string? ecsCompatibility) + { + EcsCompatibilityValue = ecsCompatibility; + return Self; + } + /// /// /// The field to use for grok expression parsing. @@ -585,6 +626,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(DescriptionValue); } + if (!string.IsNullOrEmpty(EcsCompatibilityValue)) + { + writer.WritePropertyName("ecs_compatibility"); + writer.WriteStringValue(EcsCompatibilityValue); + } + writer.WritePropertyName("field"); JsonSerializer.Serialize(writer, FieldValue, options); if (!string.IsNullOrEmpty(IfValue)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs new file mode 100644 index 00000000000..22371363f48 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs @@ -0,0 +1,866 @@ +// 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 NetworkDirectionProcessor +{ + /// + /// + /// 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 destination IP address. + /// + /// + [JsonInclude, JsonPropertyName("destination_ip")] + public Elastic.Clients.Elasticsearch.Field? DestinationIp { 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 any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + [JsonInclude, JsonPropertyName("ignore_missing")] + public bool? IgnoreMissing { get; set; } + + /// + /// + /// List of internal networks. Supports IPv4 and IPv6 addresses and ranges in + /// CIDR notation. Also supports the named ranges listed below. These may be + /// constructed with template snippets. Must specify only one of + /// internal_networks or internal_networks_field. + /// + /// + [JsonInclude, JsonPropertyName("internal_networks")] + public ICollection? InternalNetworks { get; set; } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + [JsonInclude, JsonPropertyName("internal_networks_field")] + public Elastic.Clients.Elasticsearch.Field? InternalNetworksField { get; set; } + + /// + /// + /// Handle failures for the processor. + /// + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// + /// Field containing the source IP address. + /// + /// + [JsonInclude, JsonPropertyName("source_ip")] + public Elastic.Clients.Elasticsearch.Field? SourceIp { get; set; } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + /// + /// + /// Output field for the network direction. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(NetworkDirectionProcessor networkDirectionProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.NetworkDirection(networkDirectionProcessor); +} + +public sealed partial class NetworkDirectionProcessorDescriptor : SerializableDescriptor> +{ + internal NetworkDirectionProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public NetworkDirectionProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? DestinationIpValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? InternalNetworksValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? InternalNetworksFieldValue { 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 Elastic.Clients.Elasticsearch.Field? SourceIpValue { 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 NetworkDirectionProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Elastic.Clients.Elasticsearch.Field? destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public NetworkDirectionProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public NetworkDirectionProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public NetworkDirectionProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// List of internal networks. Supports IPv4 and IPv6 addresses and ranges in + /// CIDR notation. Also supports the named ranges listed below. These may be + /// constructed with template snippets. Must specify only one of + /// internal_networks or internal_networks_field. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworks(ICollection? internalNetworks) + { + InternalNetworksValue = internalNetworks; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Elastic.Clients.Elasticsearch.Field? internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Expression> internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Expression> internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public NetworkDirectionProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Elastic.Clients.Elasticsearch.Field? sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public NetworkDirectionProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor 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); + } + + if (DestinationIpValue is not null) + { + writer.WritePropertyName("destination_ip"); + JsonSerializer.Serialize(writer, DestinationIpValue, 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 (InternalNetworksValue is not null) + { + writer.WritePropertyName("internal_networks"); + JsonSerializer.Serialize(writer, InternalNetworksValue, options); + } + + if (InternalNetworksFieldValue is not null) + { + writer.WritePropertyName("internal_networks_field"); + JsonSerializer.Serialize(writer, InternalNetworksFieldValue, options); + } + + 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 (SourceIpValue is not null) + { + writer.WritePropertyName("source_ip"); + JsonSerializer.Serialize(writer, SourceIpValue, 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 NetworkDirectionProcessorDescriptor : SerializableDescriptor +{ + internal NetworkDirectionProcessorDescriptor(Action configure) => configure.Invoke(this); + + public NetworkDirectionProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? DestinationIpValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private bool? IgnoreMissingValue { get; set; } + private ICollection? InternalNetworksValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? InternalNetworksFieldValue { 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 Elastic.Clients.Elasticsearch.Field? SourceIpValue { 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 NetworkDirectionProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Elastic.Clients.Elasticsearch.Field? destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Field containing the destination IP address. + /// + /// + public NetworkDirectionProcessorDescriptor DestinationIp(Expression> destinationIp) + { + DestinationIpValue = destinationIp; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public NetworkDirectionProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public NetworkDirectionProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public NetworkDirectionProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// List of internal networks. Supports IPv4 and IPv6 addresses and ranges in + /// CIDR notation. Also supports the named ranges listed below. These may be + /// constructed with template snippets. Must specify only one of + /// internal_networks or internal_networks_field. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworks(ICollection? internalNetworks) + { + InternalNetworksValue = internalNetworks; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Elastic.Clients.Elasticsearch.Field? internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Expression> internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// A field on the given document to read the internal_networks configuration + /// from. + /// + /// + public NetworkDirectionProcessorDescriptor InternalNetworksField(Expression> internalNetworksField) + { + InternalNetworksFieldValue = internalNetworksField; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public NetworkDirectionProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public NetworkDirectionProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Elastic.Clients.Elasticsearch.Field? sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Field containing the source IP address. + /// + /// + public NetworkDirectionProcessorDescriptor SourceIp(Expression> sourceIp) + { + SourceIpValue = sourceIp; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public NetworkDirectionProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Output field for the network direction. + /// + /// + public NetworkDirectionProcessorDescriptor 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); + } + + if (DestinationIpValue is not null) + { + writer.WritePropertyName("destination_ip"); + JsonSerializer.Serialize(writer, DestinationIpValue, 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 (InternalNetworksValue is not null) + { + writer.WritePropertyName("internal_networks"); + JsonSerializer.Serialize(writer, InternalNetworksValue, options); + } + + if (InternalNetworksFieldValue is not null) + { + writer.WritePropertyName("internal_networks_field"); + JsonSerializer.Serialize(writer, InternalNetworksFieldValue, options); + } + + 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 (SourceIpValue is not null) + { + writer.WritePropertyName("source_ip"); + JsonSerializer.Serialize(writer, SourceIpValue, 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/Processor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs index 0df789b01d2..d8402c22813 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs @@ -50,6 +50,7 @@ internal Processor(string variantName, object variant) public static Processor Attachment(Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor attachmentProcessor) => new Processor("attachment", attachmentProcessor); public static Processor Bytes(Elastic.Clients.Elasticsearch.Ingest.BytesProcessor bytesProcessor) => new Processor("bytes", bytesProcessor); public static Processor Circle(Elastic.Clients.Elasticsearch.Ingest.CircleProcessor circleProcessor) => new Processor("circle", circleProcessor); + public static Processor CommunityId(Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor communityIDProcessor) => new Processor("community_id", communityIDProcessor); public static Processor Convert(Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor convertProcessor) => new Processor("convert", convertProcessor); public static Processor Csv(Elastic.Clients.Elasticsearch.Ingest.CsvProcessor csvProcessor) => new Processor("csv", csvProcessor); public static Processor Date(Elastic.Clients.Elasticsearch.Ingest.DateProcessor dateProcessor) => new Processor("date", dateProcessor); @@ -59,6 +60,7 @@ internal Processor(string variantName, object variant) public static Processor Drop(Elastic.Clients.Elasticsearch.Ingest.DropProcessor dropProcessor) => new Processor("drop", dropProcessor); public static Processor Enrich(Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor enrichProcessor) => new Processor("enrich", enrichProcessor); public static Processor Fail(Elastic.Clients.Elasticsearch.Ingest.FailProcessor failProcessor) => new Processor("fail", failProcessor); + public static Processor Fingerprint(Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor fingerprintProcessor) => new Processor("fingerprint", fingerprintProcessor); public static Processor Foreach(Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor foreachProcessor) => new Processor("foreach", foreachProcessor); public static Processor GeoGrid(Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor geoGridProcessor) => new Processor("geo_grid", geoGridProcessor); public static Processor Geoip(Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor geoIpProcessor) => new Processor("geoip", geoIpProcessor); @@ -70,8 +72,10 @@ internal Processor(string variantName, object variant) public static Processor Json(Elastic.Clients.Elasticsearch.Ingest.JsonProcessor jsonProcessor) => new Processor("json", jsonProcessor); public static Processor Kv(Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor keyValueProcessor) => new Processor("kv", keyValueProcessor); public static Processor Lowercase(Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor lowercaseProcessor) => new Processor("lowercase", lowercaseProcessor); + public static Processor NetworkDirection(Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor networkDirectionProcessor) => new Processor("network_direction", networkDirectionProcessor); public static Processor Pipeline(Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor pipelineProcessor) => new Processor("pipeline", pipelineProcessor); public static Processor Redact(Elastic.Clients.Elasticsearch.Ingest.RedactProcessor redactProcessor) => new Processor("redact", redactProcessor); + public static Processor RegisteredDomain(Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor registeredDomainProcessor) => new Processor("registered_domain", registeredDomainProcessor); public static Processor Remove(Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor removeProcessor) => new Processor("remove", removeProcessor); public static Processor Rename(Elastic.Clients.Elasticsearch.Ingest.RenameProcessor renameProcessor) => new Processor("rename", renameProcessor); public static Processor Reroute(Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor rerouteProcessor) => new Processor("reroute", rerouteProcessor); @@ -80,6 +84,7 @@ internal Processor(string variantName, object variant) public static Processor SetSecurityUser(Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor setSecurityUserProcessor) => new Processor("set_security_user", setSecurityUserProcessor); public static Processor Sort(Elastic.Clients.Elasticsearch.Ingest.SortProcessor sortProcessor) => new Processor("sort", sortProcessor); public static Processor Split(Elastic.Clients.Elasticsearch.Ingest.SplitProcessor splitProcessor) => new Processor("split", splitProcessor); + public static Processor Terminate(Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor terminateProcessor) => new Processor("terminate", terminateProcessor); 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); @@ -152,6 +157,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "community_id") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "convert") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -215,6 +227,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "fingerprint") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "foreach") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -292,6 +311,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "network_direction") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "pipeline") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -306,6 +332,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "registered_domain") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "remove") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -362,6 +395,13 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js continue; } + if (propertyName == "terminate") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + if (propertyName == "trim") { variantValue = JsonSerializer.Deserialize(ref reader, options); @@ -424,6 +464,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "circle": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.CircleProcessor)value.Variant, options); break; + case "community_id": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor)value.Variant, options); + break; case "convert": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor)value.Variant, options); break; @@ -451,6 +494,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "fail": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.FailProcessor)value.Variant, options); break; + case "fingerprint": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor)value.Variant, options); + break; case "foreach": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor)value.Variant, options); break; @@ -484,12 +530,18 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "lowercase": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor)value.Variant, options); break; + case "network_direction": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor)value.Variant, options); + break; case "pipeline": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor)value.Variant, options); break; case "redact": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.RedactProcessor)value.Variant, options); break; + case "registered_domain": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor)value.Variant, options); + break; case "remove": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor)value.Variant, options); break; @@ -514,6 +566,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "split": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.SplitProcessor)value.Variant, options); break; + case "terminate": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor)value.Variant, options); + break; case "trim": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.TrimProcessor)value.Variant, options); break; @@ -575,6 +630,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Bytes(Action> configure) => Set(configure, "bytes"); public ProcessorDescriptor Circle(Elastic.Clients.Elasticsearch.Ingest.CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); public ProcessorDescriptor Circle(Action> configure) => Set(configure, "circle"); + public ProcessorDescriptor CommunityId(Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor communityIDProcessor) => Set(communityIDProcessor, "community_id"); + public ProcessorDescriptor CommunityId(Action> configure) => Set(configure, "community_id"); public ProcessorDescriptor Convert(Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); public ProcessorDescriptor Convert(Action> configure) => Set(configure, "convert"); public ProcessorDescriptor Csv(Elastic.Clients.Elasticsearch.Ingest.CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); @@ -593,6 +650,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Enrich(Action> configure) => Set(configure, "enrich"); public ProcessorDescriptor Fail(Elastic.Clients.Elasticsearch.Ingest.FailProcessor failProcessor) => Set(failProcessor, "fail"); public ProcessorDescriptor Fail(Action> configure) => Set(configure, "fail"); + public ProcessorDescriptor Fingerprint(Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor fingerprintProcessor) => Set(fingerprintProcessor, "fingerprint"); + public ProcessorDescriptor Fingerprint(Action> configure) => Set(configure, "fingerprint"); public ProcessorDescriptor Foreach(Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); public ProcessorDescriptor Foreach(Action> configure) => Set(configure, "foreach"); public ProcessorDescriptor GeoGrid(Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor geoGridProcessor) => Set(geoGridProcessor, "geo_grid"); @@ -615,10 +674,14 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Kv(Action> configure) => Set(configure, "kv"); public ProcessorDescriptor Lowercase(Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); public ProcessorDescriptor Lowercase(Action> configure) => Set(configure, "lowercase"); + public ProcessorDescriptor NetworkDirection(Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor networkDirectionProcessor) => Set(networkDirectionProcessor, "network_direction"); + public ProcessorDescriptor NetworkDirection(Action> configure) => Set(configure, "network_direction"); public ProcessorDescriptor Pipeline(Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); public ProcessorDescriptor Pipeline(Action> configure) => Set(configure, "pipeline"); public ProcessorDescriptor Redact(Elastic.Clients.Elasticsearch.Ingest.RedactProcessor redactProcessor) => Set(redactProcessor, "redact"); public ProcessorDescriptor Redact(Action> configure) => Set(configure, "redact"); + public ProcessorDescriptor RegisteredDomain(Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor registeredDomainProcessor) => Set(registeredDomainProcessor, "registered_domain"); + public ProcessorDescriptor RegisteredDomain(Action> configure) => Set(configure, "registered_domain"); public ProcessorDescriptor Remove(Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); public ProcessorDescriptor Remove(Action> configure) => Set(configure, "remove"); public ProcessorDescriptor Rename(Elastic.Clients.Elasticsearch.Ingest.RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); @@ -635,6 +698,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Sort(Action> configure) => Set(configure, "sort"); public ProcessorDescriptor Split(Elastic.Clients.Elasticsearch.Ingest.SplitProcessor splitProcessor) => Set(splitProcessor, "split"); public ProcessorDescriptor Split(Action> configure) => Set(configure, "split"); + public ProcessorDescriptor Terminate(Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor terminateProcessor) => Set(terminateProcessor, "terminate"); + public ProcessorDescriptor Terminate(Action> configure) => Set(configure, "terminate"); public ProcessorDescriptor Trim(Elastic.Clients.Elasticsearch.Ingest.TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); public ProcessorDescriptor Trim(Action> configure) => Set(configure, "trim"); public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); @@ -705,6 +770,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Bytes(Action configure) => Set(configure, "bytes"); public ProcessorDescriptor Circle(Elastic.Clients.Elasticsearch.Ingest.CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); public ProcessorDescriptor Circle(Action configure) => Set(configure, "circle"); + public ProcessorDescriptor CommunityId(Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor communityIDProcessor) => Set(communityIDProcessor, "community_id"); + public ProcessorDescriptor CommunityId(Action configure) => Set(configure, "community_id"); public ProcessorDescriptor Convert(Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); public ProcessorDescriptor Convert(Action configure) => Set(configure, "convert"); public ProcessorDescriptor Csv(Elastic.Clients.Elasticsearch.Ingest.CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); @@ -723,6 +790,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Enrich(Action configure) => Set(configure, "enrich"); public ProcessorDescriptor Fail(Elastic.Clients.Elasticsearch.Ingest.FailProcessor failProcessor) => Set(failProcessor, "fail"); public ProcessorDescriptor Fail(Action configure) => Set(configure, "fail"); + public ProcessorDescriptor Fingerprint(Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor fingerprintProcessor) => Set(fingerprintProcessor, "fingerprint"); + public ProcessorDescriptor Fingerprint(Action configure) => Set(configure, "fingerprint"); public ProcessorDescriptor Foreach(Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); public ProcessorDescriptor Foreach(Action configure) => Set(configure, "foreach"); public ProcessorDescriptor GeoGrid(Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor geoGridProcessor) => Set(geoGridProcessor, "geo_grid"); @@ -745,10 +814,14 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Kv(Action configure) => Set(configure, "kv"); public ProcessorDescriptor Lowercase(Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); public ProcessorDescriptor Lowercase(Action configure) => Set(configure, "lowercase"); + public ProcessorDescriptor NetworkDirection(Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor networkDirectionProcessor) => Set(networkDirectionProcessor, "network_direction"); + public ProcessorDescriptor NetworkDirection(Action configure) => Set(configure, "network_direction"); public ProcessorDescriptor Pipeline(Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); public ProcessorDescriptor Pipeline(Action configure) => Set(configure, "pipeline"); public ProcessorDescriptor Redact(Elastic.Clients.Elasticsearch.Ingest.RedactProcessor redactProcessor) => Set(redactProcessor, "redact"); public ProcessorDescriptor Redact(Action configure) => Set(configure, "redact"); + public ProcessorDescriptor RegisteredDomain(Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor registeredDomainProcessor) => Set(registeredDomainProcessor, "registered_domain"); + public ProcessorDescriptor RegisteredDomain(Action configure) => Set(configure, "registered_domain"); public ProcessorDescriptor Remove(Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); public ProcessorDescriptor Remove(Action configure) => Set(configure, "remove"); public ProcessorDescriptor Rename(Elastic.Clients.Elasticsearch.Ingest.RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); @@ -765,6 +838,8 @@ private ProcessorDescriptor Set(object variant, string variantName) public ProcessorDescriptor Sort(Action configure) => Set(configure, "sort"); public ProcessorDescriptor Split(Elastic.Clients.Elasticsearch.Ingest.SplitProcessor splitProcessor) => Set(splitProcessor, "split"); public ProcessorDescriptor Split(Action configure) => Set(configure, "split"); + public ProcessorDescriptor Terminate(Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor terminateProcessor) => Set(terminateProcessor, "terminate"); + public ProcessorDescriptor Terminate(Action configure) => Set(configure, "terminate"); public ProcessorDescriptor Trim(Elastic.Clients.Elasticsearch.Ingest.TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); public ProcessorDescriptor Trim(Action configure) => Set(configure, "trim"); public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs new file mode 100644 index 00000000000..a8089013ea1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs @@ -0,0 +1,629 @@ +// 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 RegisteredDomainProcessor +{ + /// + /// + /// 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 source FQDN. + /// + /// + [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 any required fields are missing, 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; } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + [JsonInclude, JsonPropertyName("target_field")] + public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(RegisteredDomainProcessor registeredDomainProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.RegisteredDomain(registeredDomainProcessor); +} + +public sealed partial class RegisteredDomainProcessorDescriptor : SerializableDescriptor> +{ + internal RegisteredDomainProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public RegisteredDomainProcessorDescriptor() : 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 RegisteredDomainProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public RegisteredDomainProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public RegisteredDomainProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public RegisteredDomainProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public RegisteredDomainProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public RegisteredDomainProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor 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 RegisteredDomainProcessorDescriptor : SerializableDescriptor +{ + internal RegisteredDomainProcessorDescriptor(Action configure) => configure.Invoke(this); + + public RegisteredDomainProcessorDescriptor() : 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 RegisteredDomainProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Field containing the source FQDN. + /// + /// + public RegisteredDomainProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public RegisteredDomainProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public RegisteredDomainProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// If true and any required fields are missing, the processor quietly exits + /// without modifying the document. + /// + /// + public RegisteredDomainProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) + { + IgnoreMissingValue = ignoreMissing; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public RegisteredDomainProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public RegisteredDomainProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public RegisteredDomainProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor TargetField(Elastic.Clients.Elasticsearch.Field? targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + + /// + /// + /// Object field containing extracted domain components. If an empty string, + /// the processor adds components to the document’s root. + /// + /// + public RegisteredDomainProcessorDescriptor 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/TerminateProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.g.cs new file mode 100644 index 00000000000..16b80dd17d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.g.cs @@ -0,0 +1,407 @@ +// 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 TerminateProcessor +{ + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { 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; } + + /// + /// + /// 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; } + + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(TerminateProcessor terminateProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Terminate(terminateProcessor); +} + +public sealed partial class TerminateProcessorDescriptor : SerializableDescriptor> +{ + internal TerminateProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public TerminateProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { 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; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public TerminateProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public TerminateProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public TerminateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public TerminateProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public TerminateProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.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); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class TerminateProcessorDescriptor : SerializableDescriptor +{ + internal TerminateProcessorDescriptor(Action configure) => configure.Invoke(this); + + public TerminateProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { 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; } + + /// + /// + /// Description of the processor. + /// Useful for describing the purpose of the processor or its configuration. + /// + /// + public TerminateProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// + /// Conditionally execute the processor. + /// + /// + public TerminateProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// + /// Ignore failures for the processor. + /// + /// + public TerminateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// + /// Handle failures for the processor. + /// + /// + public TerminateProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public TerminateProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// + /// Identifier for the processor. + /// Useful for debugging and metrics. + /// + /// + public TerminateProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (!string.IsNullOrEmpty(IfValue)) + { + writer.WritePropertyName("if"); + writer.WriteStringValue(IfValue); + } + + if (IgnoreFailureValue.HasValue) + { + writer.WritePropertyName("ignore_failure"); + writer.WriteBooleanValue(IgnoreFailureValue.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); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs index 72b319a4a6e..b511d9b0955 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs @@ -29,14 +29,56 @@ namespace Elastic.Clients.Elasticsearch.Mapping; public sealed partial class DenseVectorIndexOptions { + /// + /// + /// The confidence interval to use when quantizing the vectors. Can be any value between and including 0.90 and + /// 1.0 or exactly 0. When the value is 0, this indicates that dynamic quantiles should be calculated for + /// optimized quantization. When between 0.90 and 1.0, this value restricts the values used when calculating + /// the quantization thresholds. + /// + /// + /// For example, a value of 0.95 will only use the middle 95% of the values when calculating the quantization + /// thresholds (e.g. the highest and lowest 2.5% of values will be ignored). + /// + /// + /// Defaults to 1/(dims + 1) for int8 quantized vectors and 0 for int4 for dynamic quantile calculation. + /// + /// + /// Only applicable to int8_hnsw, int4_hnsw, int8_flat, and int4_flat index types. + /// + /// [JsonInclude, JsonPropertyName("confidence_interval")] public float? ConfidenceInterval { get; set; } + + /// + /// + /// The number of candidates to track while assembling the list of nearest neighbors for each new node. + /// + /// + /// Only applicable to hnsw, int8_hnsw, and int4_hnsw index types. + /// + /// [JsonInclude, JsonPropertyName("ef_construction")] public int? EfConstruction { get; set; } + + /// + /// + /// The number of neighbors each node will be connected to in the HNSW graph. + /// + /// + /// Only applicable to hnsw, int8_hnsw, and int4_hnsw index types. + /// + /// [JsonInclude, JsonPropertyName("m")] public int? m { get; set; } + + /// + /// + /// The type of kNN algorithm to use. + /// + /// [JsonInclude, JsonPropertyName("type")] - public string Type { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType Type { get; set; } } public sealed partial class DenseVectorIndexOptionsDescriptor : SerializableDescriptor @@ -50,27 +92,66 @@ public DenseVectorIndexOptionsDescriptor() : base() private float? ConfidenceIntervalValue { get; set; } private int? EfConstructionValue { get; set; } private int? mValue { get; set; } - private string TypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType TypeValue { get; set; } + /// + /// + /// The confidence interval to use when quantizing the vectors. Can be any value between and including 0.90 and + /// 1.0 or exactly 0. When the value is 0, this indicates that dynamic quantiles should be calculated for + /// optimized quantization. When between 0.90 and 1.0, this value restricts the values used when calculating + /// the quantization thresholds. + /// + /// + /// For example, a value of 0.95 will only use the middle 95% of the values when calculating the quantization + /// thresholds (e.g. the highest and lowest 2.5% of values will be ignored). + /// + /// + /// Defaults to 1/(dims + 1) for int8 quantized vectors and 0 for int4 for dynamic quantile calculation. + /// + /// + /// Only applicable to int8_hnsw, int4_hnsw, int8_flat, and int4_flat index types. + /// + /// public DenseVectorIndexOptionsDescriptor ConfidenceInterval(float? confidenceInterval) { ConfidenceIntervalValue = confidenceInterval; return Self; } + /// + /// + /// The number of candidates to track while assembling the list of nearest neighbors for each new node. + /// + /// + /// Only applicable to hnsw, int8_hnsw, and int4_hnsw index types. + /// + /// public DenseVectorIndexOptionsDescriptor EfConstruction(int? efConstruction) { EfConstructionValue = efConstruction; return Self; } + /// + /// + /// The number of neighbors each node will be connected to in the HNSW graph. + /// + /// + /// Only applicable to hnsw, int8_hnsw, and int4_hnsw index types. + /// + /// public DenseVectorIndexOptionsDescriptor m(int? m) { mValue = m; return Self; } - public DenseVectorIndexOptionsDescriptor Type(string type) + /// + /// + /// The type of kNN algorithm to use. + /// + /// + public DenseVectorIndexOptionsDescriptor Type(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType type) { TypeValue = type; return Self; @@ -98,7 +179,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("type"); - writer.WriteStringValue(TypeValue); + JsonSerializer.Serialize(writer, TypeValue, options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs index 4484f144eef..945bd8cf841 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs @@ -29,18 +29,47 @@ namespace Elastic.Clients.Elasticsearch.Mapping; public sealed partial class DenseVectorProperty : IProperty { + /// + /// + /// Number of vector dimensions. Can't exceed 4096. If dims is not specified, it will be set to the length of + /// the first vector added to the field. + /// + /// [JsonInclude, JsonPropertyName("dims")] public int? Dims { get; set; } [JsonInclude, JsonPropertyName("dynamic")] public Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? Dynamic { get; set; } + + /// + /// + /// The data type used to encode vectors. The supported data types are float (default), byte, and bit. + /// + /// [JsonInclude, JsonPropertyName("element_type")] - public string? ElementType { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? ElementType { get; set; } [JsonInclude, JsonPropertyName("fields")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// + /// If true, you can search this field using the kNN search API. + /// + /// [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// + /// An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters + /// that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the + /// expense of slower indexing speed. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// [JsonInclude, JsonPropertyName("index_options")] public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions? IndexOptions { get; set; } @@ -53,8 +82,28 @@ public sealed partial class DenseVectorProperty : IProperty public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } + + /// + /// + /// The vector similarity metric to use in kNN search. + /// + /// + /// Documents are ranked by their vector field's similarity to the query vector. The _score of each document will + /// be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds + /// to a higher ranking. + /// + /// + /// Defaults to l2_norm when element_type is bit otherwise defaults to cosine. + /// + /// + /// bit vectors only support l2_norm as their similarity metric. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// [JsonInclude, JsonPropertyName("similarity")] - public string? Similarity { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? Similarity { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "dense_vector"; @@ -70,7 +119,7 @@ public DenseVectorPropertyDescriptor() : base() private int? DimsValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } - private string? ElementTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? ElementTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } @@ -79,8 +128,14 @@ public DenseVectorPropertyDescriptor() : base() private Action IndexOptionsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } - private string? SimilarityValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? SimilarityValue { get; set; } + /// + /// + /// Number of vector dimensions. Can't exceed 4096. If dims is not specified, it will be set to the length of + /// the first vector added to the field. + /// + /// public DenseVectorPropertyDescriptor Dims(int? dims) { DimsValue = dims; @@ -93,7 +148,12 @@ public DenseVectorPropertyDescriptor Dynamic(Elastic.Clients.Elastics return Self; } - public DenseVectorPropertyDescriptor ElementType(string? elementType) + /// + /// + /// The data type used to encode vectors. The supported data types are float (default), byte, and bit. + /// + /// + public DenseVectorPropertyDescriptor ElementType(Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? elementType) { ElementTypeValue = elementType; return Self; @@ -125,12 +185,27 @@ public DenseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// + /// If true, you can search this field using the kNN search API. + /// + /// public DenseVectorPropertyDescriptor Index(bool? index = true) { IndexValue = index; return Self; } + /// + /// + /// An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters + /// that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the + /// expense of slower indexing speed. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions? indexOptions) { IndexOptionsDescriptor = null; @@ -186,7 +261,26 @@ public DenseVectorPropertyDescriptor Properties(Action Similarity(string? similarity) + /// + /// + /// The vector similarity metric to use in kNN search. + /// + /// + /// Documents are ranked by their vector field's similarity to the query vector. The _score of each document will + /// be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds + /// to a higher ranking. + /// + /// + /// Defaults to l2_norm when element_type is bit otherwise defaults to cosine. + /// + /// + /// bit vectors only support l2_norm as their similarity metric. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// + public DenseVectorPropertyDescriptor Similarity(Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? similarity) { SimilarityValue = similarity; return Self; @@ -207,10 +301,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, DynamicValue, options); } - if (!string.IsNullOrEmpty(ElementTypeValue)) + if (ElementTypeValue is not null) { writer.WritePropertyName("element_type"); - writer.WriteStringValue(ElementTypeValue); + JsonSerializer.Serialize(writer, ElementTypeValue, options); } if (FieldsValue is not null) @@ -259,10 +353,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } - if (!string.IsNullOrEmpty(SimilarityValue)) + if (SimilarityValue is not null) { writer.WritePropertyName("similarity"); - writer.WriteStringValue(SimilarityValue); + JsonSerializer.Serialize(writer, SimilarityValue, options); } writer.WritePropertyName("type"); @@ -319,7 +413,7 @@ public DenseVectorPropertyDescriptor() : base() private int? DimsValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } - private string? ElementTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? ElementTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } @@ -328,8 +422,14 @@ public DenseVectorPropertyDescriptor() : base() private Action IndexOptionsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } - private string? SimilarityValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? SimilarityValue { get; set; } + /// + /// + /// Number of vector dimensions. Can't exceed 4096. If dims is not specified, it will be set to the length of + /// the first vector added to the field. + /// + /// public DenseVectorPropertyDescriptor Dims(int? dims) { DimsValue = dims; @@ -342,7 +442,12 @@ public DenseVectorPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mappi return Self; } - public DenseVectorPropertyDescriptor ElementType(string? elementType) + /// + /// + /// The data type used to encode vectors. The supported data types are float (default), byte, and bit. + /// + /// + public DenseVectorPropertyDescriptor ElementType(Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? elementType) { ElementTypeValue = elementType; return Self; @@ -374,12 +479,27 @@ public DenseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// + /// If true, you can search this field using the kNN search API. + /// + /// public DenseVectorPropertyDescriptor Index(bool? index = true) { IndexValue = index; return Self; } + /// + /// + /// An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters + /// that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the + /// expense of slower indexing speed. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions? indexOptions) { IndexOptionsDescriptor = null; @@ -435,7 +555,26 @@ public DenseVectorPropertyDescriptor Properties(Action + /// + /// The vector similarity metric to use in kNN search. + /// + /// + /// Documents are ranked by their vector field's similarity to the query vector. The _score of each document will + /// be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds + /// to a higher ranking. + /// + /// + /// Defaults to l2_norm when element_type is bit otherwise defaults to cosine. + /// + /// + /// bit vectors only support l2_norm as their similarity metric. + /// + /// + /// This parameter can only be specified when index is true. + /// + /// + public DenseVectorPropertyDescriptor Similarity(Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? similarity) { SimilarityValue = similarity; return Self; @@ -456,10 +595,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, DynamicValue, options); } - if (!string.IsNullOrEmpty(ElementTypeValue)) + if (ElementTypeValue is not null) { writer.WritePropertyName("element_type"); - writer.WriteStringValue(ElementTypeValue); + JsonSerializer.Serialize(writer, ElementTypeValue, options); } if (FieldsValue is not null) @@ -508,10 +647,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } - if (!string.IsNullOrEmpty(SimilarityValue)) + if (SimilarityValue is not null) { writer.WritePropertyName("similarity"); - writer.WriteStringValue(SimilarityValue); + JsonSerializer.Serialize(writer, SimilarityValue, options); } writer.WritePropertyName("type"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs index 094f4f133f1..34db00f7452 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs @@ -30,5 +30,6 @@ namespace Elastic.Clients.Elasticsearch.Nodes; public sealed partial class NodeInfoSettingsNetwork { [JsonInclude, JsonPropertyName("host")] - public string? Host { get; init; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? Host { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs index ecbfc902214..eaefaf620c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs @@ -31,6 +31,8 @@ public sealed partial class NodeInfoXpack { [JsonInclude, JsonPropertyName("license")] public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicense? License { get; init; } + [JsonInclude, JsonPropertyName("ml")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackMl? Ml { get; init; } [JsonInclude, JsonPropertyName("notification")] public IReadOnlyDictionary? Notification { get; init; } [JsonInclude, JsonPropertyName("security")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs new file mode 100644 index 00000000000..e33170cb330 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs @@ -0,0 +1,34 @@ +// 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.Nodes; + +public sealed partial class NodeInfoXpackMl +{ + [JsonInclude, JsonPropertyName("use_auto_machine_memory_percent")] + public bool? UseAutoMachineMemoryPercent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs index 9302ad2254f..ca42856289e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs @@ -34,7 +34,7 @@ public sealed partial class NodeInfoXpackSecurity [JsonInclude, JsonPropertyName("enabled")] public string Enabled { get; init; } [JsonInclude, JsonPropertyName("http")] - public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl Http { get; init; } + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl? Http { get; init; } [JsonInclude, JsonPropertyName("transport")] public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl? Transport { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs index f7adc9f5d06..1d408079467 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; public sealed partial class NodeInfoXpackSecurityAuthc { [JsonInclude, JsonPropertyName("realms")] - public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms Realms { get; init; } + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms? Realms { get; init; } [JsonInclude, JsonPropertyName("token")] - public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken Token { get; init; } + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken? Token { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.g.cs index 1d94b492440..3f6062507e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.g.cs @@ -51,7 +51,7 @@ public sealed partial class IndicesPrivileges /// /// [JsonInclude, JsonPropertyName("names")] - public Elastic.Clients.Elasticsearch.Indices Names { get; set; } + public ICollection Names { get; set; } /// /// @@ -82,7 +82,7 @@ public IndicesPrivilegesDescriptor() : base() private Elastic.Clients.Elasticsearch.Security.FieldSecurity? FieldSecurityValue { get; set; } private Elastic.Clients.Elasticsearch.Security.FieldSecurityDescriptor FieldSecurityDescriptor { get; set; } private Action> FieldSecurityDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.Indices NamesValue { get; set; } + private ICollection NamesValue { get; set; } private ICollection PrivilegesValue { get; set; } private object? QueryValue { get; set; } @@ -131,7 +131,7 @@ public IndicesPrivilegesDescriptor FieldSecurity(Action /// - public IndicesPrivilegesDescriptor Names(Elastic.Clients.Elasticsearch.Indices names) + public IndicesPrivilegesDescriptor Names(ICollection names) { NamesValue = names; return Self; @@ -210,7 +210,7 @@ public IndicesPrivilegesDescriptor() : base() private Elastic.Clients.Elasticsearch.Security.FieldSecurity? FieldSecurityValue { get; set; } private Elastic.Clients.Elasticsearch.Security.FieldSecurityDescriptor FieldSecurityDescriptor { get; set; } private Action FieldSecurityDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.Indices NamesValue { get; set; } + private ICollection NamesValue { get; set; } private ICollection PrivilegesValue { get; set; } private object? QueryValue { get; set; } @@ -259,7 +259,7 @@ public IndicesPrivilegesDescriptor FieldSecurity(Action /// - public IndicesPrivilegesDescriptor Names(Elastic.Clients.Elasticsearch.Indices names) + public IndicesPrivilegesDescriptor Names(ICollection names) { NamesValue = names; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.g.cs index 76e91fab6de..068928f43c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.g.cs @@ -59,7 +59,7 @@ public sealed partial class RemoteIndicesPrivileges /// /// [JsonInclude, JsonPropertyName("names")] - public Elastic.Clients.Elasticsearch.Indices Names { get; set; } + public ICollection Names { get; set; } /// /// @@ -91,7 +91,7 @@ public RemoteIndicesPrivilegesDescriptor() : base() private Elastic.Clients.Elasticsearch.Security.FieldSecurity? FieldSecurityValue { get; set; } private Elastic.Clients.Elasticsearch.Security.FieldSecurityDescriptor FieldSecurityDescriptor { get; set; } private Action> FieldSecurityDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.Indices NamesValue { get; set; } + private ICollection NamesValue { get; set; } private ICollection PrivilegesValue { get; set; } private object? QueryValue { get; set; } @@ -151,7 +151,7 @@ public RemoteIndicesPrivilegesDescriptor FieldSecurity(Action /// - public RemoteIndicesPrivilegesDescriptor Names(Elastic.Clients.Elasticsearch.Indices names) + public RemoteIndicesPrivilegesDescriptor Names(ICollection names) { NamesValue = names; return Self; @@ -233,7 +233,7 @@ public RemoteIndicesPrivilegesDescriptor() : base() private Elastic.Clients.Elasticsearch.Security.FieldSecurity? FieldSecurityValue { get; set; } private Elastic.Clients.Elasticsearch.Security.FieldSecurityDescriptor FieldSecurityDescriptor { get; set; } private Action FieldSecurityDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.Indices NamesValue { get; set; } + private ICollection NamesValue { get; set; } private ICollection PrivilegesValue { get; set; } private object? QueryValue { get; set; } @@ -293,7 +293,7 @@ public RemoteIndicesPrivilegesDescriptor FieldSecurity(Action /// - public RemoteIndicesPrivilegesDescriptor Names(Elastic.Clients.Elasticsearch.Indices names) + public RemoteIndicesPrivilegesDescriptor Names(ICollection names) { NamesValue = names; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs index 5bacdaccaa6..00564aac314 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs @@ -51,7 +51,6 @@ public sealed partial class UserIndicesPrivileges /// /// [JsonInclude, JsonPropertyName("names")] - [SingleOrManyCollectionConverter(typeof(string))] public IReadOnlyCollection Names { get; init; } /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs index 4f64a20937c..ce73c0c79b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs @@ -37,20 +37,18 @@ public sealed partial class Features public Elastic.Clients.Elasticsearch.Xpack.Feature Archive { get; init; } [JsonInclude, JsonPropertyName("ccr")] public Elastic.Clients.Elasticsearch.Xpack.Feature Ccr { get; init; } - [JsonInclude, JsonPropertyName("data_frame")] - public Elastic.Clients.Elasticsearch.Xpack.Feature? DataFrame { get; init; } - [JsonInclude, JsonPropertyName("data_science")] - public Elastic.Clients.Elasticsearch.Xpack.Feature? DataScience { get; init; } [JsonInclude, JsonPropertyName("data_streams")] public Elastic.Clients.Elasticsearch.Xpack.Feature DataStreams { get; init; } [JsonInclude, JsonPropertyName("data_tiers")] public Elastic.Clients.Elasticsearch.Xpack.Feature DataTiers { get; init; } [JsonInclude, JsonPropertyName("enrich")] public Elastic.Clients.Elasticsearch.Xpack.Feature Enrich { get; init; } + [JsonInclude, JsonPropertyName("enterprise_search")] + public Elastic.Clients.Elasticsearch.Xpack.Feature EnterpriseSearch { get; init; } [JsonInclude, JsonPropertyName("eql")] public Elastic.Clients.Elasticsearch.Xpack.Feature Eql { get; init; } - [JsonInclude, JsonPropertyName("flattened")] - public Elastic.Clients.Elasticsearch.Xpack.Feature? Flattened { get; init; } + [JsonInclude, JsonPropertyName("esql")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Esql { get; init; } [JsonInclude, JsonPropertyName("frozen_indices")] public Elastic.Clients.Elasticsearch.Xpack.Feature FrozenIndices { get; init; } [JsonInclude, JsonPropertyName("graph")] @@ -79,8 +77,8 @@ public sealed partial class Features public Elastic.Clients.Elasticsearch.Xpack.Feature Sql { get; init; } [JsonInclude, JsonPropertyName("transform")] public Elastic.Clients.Elasticsearch.Xpack.Feature Transform { get; init; } - [JsonInclude, JsonPropertyName("vectors")] - public Elastic.Clients.Elasticsearch.Xpack.Feature? Vectors { get; init; } + [JsonInclude, JsonPropertyName("universal_profiling")] + public Elastic.Clients.Elasticsearch.Xpack.Feature UniversalProfiling { get; init; } [JsonInclude, JsonPropertyName("voting_only")] public Elastic.Clients.Elasticsearch.Xpack.Feature VotingOnly { get; init; } [JsonInclude, JsonPropertyName("watcher")]