diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs index ad0139f367..599288109c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs @@ -164,7 +164,7 @@ public BulkRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? { } - public BulkRequestDescriptor() + public BulkRequestDescriptor() : this(typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs index bc8ed7b61c..ca723c7de0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs @@ -121,7 +121,7 @@ public AnalyzeIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.In { } - public AnalyzeIndexRequestDescriptor() + public AnalyzeIndexRequestDescriptor() : this(typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs index 960589dd80..aa58f533c6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs @@ -112,6 +112,10 @@ public CreateIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } + public CreateIndexRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs index 437a144fd8..2f585dcd6c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs @@ -133,7 +133,7 @@ public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexA { } - public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias) : base(r => r.Required("alias", alias)) + public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias) : this(alias, typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs index 93e1bdd7cf..ee955d35e9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs @@ -165,7 +165,7 @@ public MultiGetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexN { } - public MultiGetRequestDescriptor() + public MultiGetRequestDescriptor() : this(typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs index 3452519e2f..bedde8b16f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs @@ -198,7 +198,7 @@ public MultiTermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverles { } - public MultiTermVectorsRequestDescriptor() + public MultiTermVectorsRequestDescriptor() : this(typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs index daf1622397..95e39f9cd8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs @@ -100,6 +100,10 @@ public TermsEnumRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Index { } + public TermsEnumRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; 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 6a216ccd2b..2da23396af 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 @@ -423,6 +423,29 @@ public virtual Task CreateAsync(Elastic.Clients. return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); } + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + } + /// /// Creates an index with optional settings and mappings. /// Learn more about this API in the Elasticsearch documentation. diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs index 758ce5d713..4c44d1f196 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs @@ -3311,6 +3311,29 @@ public virtual Task TermsEnumAsync(Elastic.Clients return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); } + /// + /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + } + + /// + /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + } + /// /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. /// Learn more about this API in the Elasticsearch documentation. diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs index cae957ce4b..681f757ff1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs @@ -33,8 +33,7 @@ public sealed partial class TopHitsAggregation /// Fields for which to return doc values. /// [JsonInclude, JsonPropertyName("docvalue_fields")] - [JsonConverter(typeof(SingleOrManyFieldsConverter))] - public Elastic.Clients.Elasticsearch.Serverless.Fields? DocvalueFields { get; set; } + public ICollection? DocvalueFields { get; set; } /// /// If `true`, returns detailed information about score computation as part of a hit. @@ -48,6 +47,12 @@ public sealed partial class TopHitsAggregation [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + /// + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public ICollection? Fields { get; set; } + /// /// Starting document offset. /// @@ -129,9 +134,16 @@ public TopHitsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Serverless.Fields? DocvalueFieldsValue { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private ICollection? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } @@ -153,12 +165,42 @@ public TopHitsAggregationDescriptor() : base() /// /// Fields for which to return doc values. /// - public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.Fields? docvalueFields) + public TopHitsAggregationDescriptor DocvalueFields(ICollection? docvalueFields) { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; DocvalueFieldsValue = docvalueFields; return Self; } + public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor DocvalueFields(Action> configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor DocvalueFields(params Action>[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + /// /// If `true`, returns detailed information about score computation as part of a hit. /// @@ -195,6 +237,45 @@ public TopHitsAggregationDescriptor Field(Expression + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public TopHitsAggregationDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public TopHitsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor Fields(Action> configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor Fields(params Action>[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + /// /// Starting document offset. /// @@ -351,7 +432,32 @@ public TopHitsAggregationDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (DocvalueFieldsValue is not null) + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) { writer.WritePropertyName("docvalue_fields"); JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); @@ -369,6 +475,37 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + if (FromValue.HasValue) { writer.WritePropertyName("from"); @@ -486,9 +623,16 @@ public TopHitsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Serverless.Fields? DocvalueFieldsValue { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private ICollection? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } @@ -510,12 +654,42 @@ public TopHitsAggregationDescriptor() : base() /// /// Fields for which to return doc values. /// - public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.Fields? docvalueFields) + public TopHitsAggregationDescriptor DocvalueFields(ICollection? docvalueFields) { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; DocvalueFieldsValue = docvalueFields; return Self; } + public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor DocvalueFields(Action configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor DocvalueFields(params Action[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + /// /// If `true`, returns detailed information about score computation as part of a hit. /// @@ -552,6 +726,45 @@ public TopHitsAggregationDescriptor Field(Expression + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public TopHitsAggregationDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public TopHitsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor Fields(Action configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor Fields(params Action[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + /// /// Starting document offset. /// @@ -708,7 +921,32 @@ public TopHitsAggregationDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (DocvalueFieldsValue is not null) + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) { writer.WritePropertyName("docvalue_fields"); JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); @@ -726,6 +964,37 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + if (FromValue.HasValue) { writer.WritePropertyName("from"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs index c5dd76e426..5241411bc4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs @@ -132,7 +132,7 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementUpdateAliases = new ApiUrls(new[] { "_aliases" }); internal static ApiUrls IndexManagementValidateQuery = new ApiUrls(new[] { "_validate/query", "{index}/_validate/query" }); internal static ApiUrls InferenceDeleteModel = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); - internal static ApiUrls InferenceGetModel = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); + internal static ApiUrls InferenceGetModel = new ApiUrls(new[] { "_inference", "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); internal static ApiUrls InferenceInference = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); internal static ApiUrls InferencePutModel = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); internal static ApiUrls IngestDeletePipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs index f53365af25..48d15b96fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs @@ -164,7 +164,7 @@ public BulkRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : b { } - public BulkRequestDescriptor() + public BulkRequestDescriptor() : this(typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs index b57796abd8..a3ec6541f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs @@ -96,6 +96,10 @@ public FollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : { } + public FollowRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollow; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs index af93494689..9ca54b8504 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs @@ -71,6 +71,10 @@ public ForgetFollowerRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName i { } + public ForgetFollowerRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationForgetFollower; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs index 216fb5e843..e1c02d6876 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs @@ -62,6 +62,10 @@ public PauseFollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName inde { } + public PauseFollowRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationPauseFollow; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs index 1ebeedbf17..7c972aecf2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs @@ -83,6 +83,10 @@ public ResumeFollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName ind { } + public ResumeFollowRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationResumeFollow; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs index 5893118b84..52fa7cc543 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs @@ -62,6 +62,10 @@ public UnfollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) { } + public UnfollowRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationUnfollow; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs index 8f76d33289..e6b6c6918a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs @@ -92,6 +92,12 @@ public sealed partial class EsqlQueryRequest : PlainRequest [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + + /// + /// The version of the ES|QL language in which the "query" field was written. + /// + [JsonInclude, JsonPropertyName("version")] + public Elastic.Clients.Elasticsearch.Esql.Version Version { get; set; } } /// @@ -123,6 +129,7 @@ public EsqlQueryRequestDescriptor() private string? LocaleValue { get; set; } private ICollection? ParamsValue { get; set; } private string QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Esql.Version VersionValue { get; set; } /// /// By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results. @@ -184,6 +191,15 @@ public EsqlQueryRequestDescriptor Query(string query) return Self; } + /// + /// The version of the ES|QL language in which the "query" field was written. + /// + public EsqlQueryRequestDescriptor Version(Elastic.Clients.Elasticsearch.Esql.Version version) + { + VersionValue = version; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -223,6 +239,8 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("query"); writer.WriteStringValue(QueryValue); + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); writer.WriteEndObject(); } } @@ -256,6 +274,7 @@ public EsqlQueryRequestDescriptor() private string? LocaleValue { get; set; } private ICollection? ParamsValue { get; set; } private string QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Esql.Version VersionValue { get; set; } /// /// By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results. @@ -317,6 +336,15 @@ public EsqlQueryRequestDescriptor Query(string query) return Self; } + /// + /// The version of the ES|QL language in which the "query" field was written. + /// + public EsqlQueryRequestDescriptor Version(Elastic.Clients.Elasticsearch.Esql.Version version) + { + VersionValue = version; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -356,6 +384,8 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("query"); writer.WriteStringValue(QueryValue); + writer.WritePropertyName("version"); + JsonSerializer.Serialize(writer, VersionValue, options); writer.WriteEndObject(); } } \ No newline at end of file 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 a68f1be678..a2445fa0ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs @@ -67,6 +67,10 @@ public MoveToStepRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index { } + public MoveToStepRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementMoveToStep; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs index 3ce2c05b20..ee6949c36f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs @@ -62,6 +62,10 @@ public RemovePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName ind { } + public RemovePolicyRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementRemovePolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs index bc0e2e5a0d..97adb377e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs @@ -62,6 +62,10 @@ public RetryRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : b { } + public RetryRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementRetry; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs index 3d48c5b90e..013c2c7682 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs @@ -121,7 +121,7 @@ public AnalyzeIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? in { } - public AnalyzeIndexRequestDescriptor() + public AnalyzeIndexRequestDescriptor() : this(typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs index 2b31d2f13c..4245b37a08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs @@ -106,6 +106,10 @@ public CloneIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index { } + public CloneIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Name target) : this(typeof(TDocument), target) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClone; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs index c6f6af6043..9760301010 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs @@ -112,6 +112,10 @@ public CreateIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName inde { } + public CreateIndexRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs index e11b0c0475..266b63debb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs @@ -133,7 +133,7 @@ public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.IndexAlias alias, { } - public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.IndexAlias alias) : base(r => r.Required("alias", alias)) + public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.IndexAlias alias) : this(alias, typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelRequest.g.cs index 12e0b52495..e0b4750a61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelRequest.g.cs @@ -38,11 +38,15 @@ public sealed partial class GetModelRequestParameters : RequestParameters /// public sealed partial class GetModelRequest : PlainRequest { - public GetModelRequest(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + public GetModelRequest() { } - public GetModelRequest(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + public GetModelRequest(Elastic.Clients.Elasticsearch.Id? inferenceId) : base(r => r.Optional("inference_id", inferenceId)) + { + } + + public GetModelRequest(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id? inferenceId) : base(r => r.Optional("task_type", taskType).Optional("inference_id", inferenceId)) { } @@ -62,11 +66,11 @@ public sealed partial class GetModelRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public GetModelRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + public GetModelRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id? inferenceId) : base(r => r.Optional("task_type", taskType).Optional("inference_id", inferenceId)) { } - public GetModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + public GetModelRequestDescriptor() { } @@ -78,9 +82,9 @@ public GetModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id inferenceId) : internal override string OperationName => "inference.get_model"; - public GetModelRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id inferenceId) + public GetModelRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id? inferenceId) { - RouteValues.Required("inference_id", inferenceId); + RouteValues.Optional("inference_id", inferenceId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs index 3fefe849a0..0529e06c25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs @@ -176,7 +176,7 @@ public MultiGetRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) { } - public MultiGetRequestDescriptor() + public MultiGetRequestDescriptor() : this(typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs index 5222ce4935..8953c5d503 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs @@ -198,7 +198,7 @@ public MultiTermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName { } - public MultiTermVectorsRequestDescriptor() + public MultiTermVectorsRequestDescriptor() : this(typeof(TDocument)) { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs index 0520223c0d..a496a09356 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs @@ -100,6 +100,10 @@ public TermsEnumRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) { } + public TermsEnumRequestDescriptor() : this(typeof(TDocument)) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ccr.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ccr.g.cs index 2dd5c2bf66..5d45759634 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ccr.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ccr.g.cs @@ -184,6 +184,31 @@ public virtual FollowResponse Follow(Elastic.Clients.Elasticsearch.In return DoRequest, FollowResponse, FollowRequestParameters>(descriptor); } + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowResponse Follow() + { + var descriptor = new FollowRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, FollowResponse, FollowRequestParameters>(descriptor); + } + + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowResponse Follow(Action> configureRequest) + { + var descriptor = new FollowRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, FollowResponse, FollowRequestParameters>(descriptor); + } + /// /// Creates a new follower index configured to follow the referenced leader index. /// Learn more about this API in the Elasticsearch documentation. @@ -253,6 +278,29 @@ public virtual Task FollowAsync(Elastic.Clients.Elast return DoRequestAsync, FollowResponse, FollowRequestParameters>(descriptor, cancellationToken); } + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowAsync(CancellationToken cancellationToken = default) + { + var descriptor = new FollowRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, FollowResponse, FollowRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FollowRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, FollowResponse, FollowRequestParameters>(descriptor, cancellationToken); + } + /// /// Creates a new follower index configured to follow the referenced leader index. /// Learn more about this API in the Elasticsearch documentation. @@ -757,6 +805,31 @@ public virtual ForgetFollowerResponse ForgetFollower(Elastic.Clients. return DoRequest, ForgetFollowerResponse, ForgetFollowerRequestParameters>(descriptor); } + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForgetFollowerResponse ForgetFollower() + { + var descriptor = new ForgetFollowerRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, ForgetFollowerResponse, ForgetFollowerRequestParameters>(descriptor); + } + + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForgetFollowerResponse ForgetFollower(Action> configureRequest) + { + var descriptor = new ForgetFollowerRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ForgetFollowerResponse, ForgetFollowerRequestParameters>(descriptor); + } + /// /// Removes the follower retention leases from the leader. /// Learn more about this API in the Elasticsearch documentation. @@ -826,6 +899,29 @@ public virtual Task ForgetFollowerAsync(Elast return DoRequestAsync, ForgetFollowerResponse, ForgetFollowerRequestParameters>(descriptor, cancellationToken); } + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForgetFollowerAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ForgetFollowerRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, ForgetFollowerResponse, ForgetFollowerRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForgetFollowerAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ForgetFollowerRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ForgetFollowerResponse, ForgetFollowerRequestParameters>(descriptor, cancellationToken); + } + /// /// Removes the follower retention leases from the leader. /// Learn more about this API in the Elasticsearch documentation. @@ -1144,6 +1240,31 @@ public virtual PauseFollowResponse PauseFollow(Elastic.Clients.Elasti return DoRequest, PauseFollowResponse, PauseFollowRequestParameters>(descriptor); } + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PauseFollowResponse PauseFollow() + { + var descriptor = new PauseFollowRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, PauseFollowResponse, PauseFollowRequestParameters>(descriptor); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PauseFollowResponse PauseFollow(Action> configureRequest) + { + var descriptor = new PauseFollowRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PauseFollowResponse, PauseFollowRequestParameters>(descriptor); + } + /// /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. /// Learn more about this API in the Elasticsearch documentation. @@ -1213,6 +1334,29 @@ public virtual Task PauseFollowAsync(Elastic.Cli return DoRequestAsync, PauseFollowResponse, PauseFollowRequestParameters>(descriptor, cancellationToken); } + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseFollowAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PauseFollowRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, PauseFollowResponse, PauseFollowRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseFollowAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PauseFollowRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PauseFollowResponse, PauseFollowRequestParameters>(descriptor, cancellationToken); + } + /// /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. /// Learn more about this API in the Elasticsearch documentation. @@ -1483,6 +1627,31 @@ public virtual ResumeFollowResponse ResumeFollow(Elastic.Clients.Elas return DoRequest, ResumeFollowResponse, ResumeFollowRequestParameters>(descriptor); } + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResumeFollowResponse ResumeFollow() + { + var descriptor = new ResumeFollowRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, ResumeFollowResponse, ResumeFollowRequestParameters>(descriptor); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResumeFollowResponse ResumeFollow(Action> configureRequest) + { + var descriptor = new ResumeFollowRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ResumeFollowResponse, ResumeFollowRequestParameters>(descriptor); + } + /// /// Resumes a follower index that has been paused /// Learn more about this API in the Elasticsearch documentation. @@ -1552,6 +1721,29 @@ public virtual Task ResumeFollowAsync(Elastic.C return DoRequestAsync, ResumeFollowResponse, ResumeFollowRequestParameters>(descriptor, cancellationToken); } + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeFollowAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ResumeFollowRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, ResumeFollowResponse, ResumeFollowRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeFollowAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ResumeFollowRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ResumeFollowResponse, ResumeFollowRequestParameters>(descriptor, cancellationToken); + } + /// /// Resumes a follower index that has been paused /// Learn more about this API in the Elasticsearch documentation. @@ -1732,6 +1924,31 @@ public virtual UnfollowResponse Unfollow(Elastic.Clients.Elasticsearc return DoRequest, UnfollowResponse, UnfollowRequestParameters>(descriptor); } + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UnfollowResponse Unfollow() + { + var descriptor = new UnfollowRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, UnfollowResponse, UnfollowRequestParameters>(descriptor); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UnfollowResponse Unfollow(Action> configureRequest) + { + var descriptor = new UnfollowRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UnfollowResponse, UnfollowRequestParameters>(descriptor); + } + /// /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. /// Learn more about this API in the Elasticsearch documentation. @@ -1801,6 +2018,29 @@ public virtual Task UnfollowAsync(Elastic.Clients.E return DoRequestAsync, UnfollowResponse, UnfollowRequestParameters>(descriptor, cancellationToken); } + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UnfollowAsync(CancellationToken cancellationToken = default) + { + var descriptor = new UnfollowRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, UnfollowResponse, UnfollowRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UnfollowAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UnfollowRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UnfollowResponse, UnfollowRequestParameters>(descriptor, cancellationToken); + } + /// /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. /// Learn more about this API in the Elasticsearch documentation. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ilm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ilm.g.cs index 5a7277575a..d4677251eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ilm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ilm.g.cs @@ -502,6 +502,31 @@ public virtual MoveToStepResponse MoveToStep(Elastic.Clients.Elastics return DoRequest, MoveToStepResponse, MoveToStepRequestParameters>(descriptor); } + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MoveToStepResponse MoveToStep() + { + var descriptor = new MoveToStepRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, MoveToStepResponse, MoveToStepRequestParameters>(descriptor); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MoveToStepResponse MoveToStep(Action> configureRequest) + { + var descriptor = new MoveToStepRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, MoveToStepResponse, MoveToStepRequestParameters>(descriptor); + } + /// /// Manually moves an index into the specified step and executes that step. /// Learn more about this API in the Elasticsearch documentation. @@ -571,6 +596,29 @@ public virtual Task MoveToStepAsync(Elastic.Clien return DoRequestAsync, MoveToStepResponse, MoveToStepRequestParameters>(descriptor, cancellationToken); } + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MoveToStepAsync(CancellationToken cancellationToken = default) + { + var descriptor = new MoveToStepRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, MoveToStepResponse, MoveToStepRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MoveToStepAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MoveToStepRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, MoveToStepResponse, MoveToStepRequestParameters>(descriptor, cancellationToken); + } + /// /// Manually moves an index into the specified step and executes that step. /// Learn more about this API in the Elasticsearch documentation. @@ -751,6 +799,31 @@ public virtual RemovePolicyResponse RemovePolicy(Elastic.Clients.Elas return DoRequest, RemovePolicyResponse, RemovePolicyRequestParameters>(descriptor); } + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RemovePolicyResponse RemovePolicy() + { + var descriptor = new RemovePolicyRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, RemovePolicyResponse, RemovePolicyRequestParameters>(descriptor); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RemovePolicyResponse RemovePolicy(Action> configureRequest) + { + var descriptor = new RemovePolicyRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, RemovePolicyResponse, RemovePolicyRequestParameters>(descriptor); + } + /// /// Removes the assigned lifecycle policy and stops managing the specified index /// Learn more about this API in the Elasticsearch documentation. @@ -820,6 +893,29 @@ public virtual Task RemovePolicyAsync(Elastic.C return DoRequestAsync, RemovePolicyResponse, RemovePolicyRequestParameters>(descriptor, cancellationToken); } + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RemovePolicyAsync(CancellationToken cancellationToken = default) + { + var descriptor = new RemovePolicyRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, RemovePolicyResponse, RemovePolicyRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RemovePolicyAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RemovePolicyRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, RemovePolicyResponse, RemovePolicyRequestParameters>(descriptor, cancellationToken); + } + /// /// Removes the assigned lifecycle policy and stops managing the specified index /// Learn more about this API in the Elasticsearch documentation. @@ -910,6 +1006,31 @@ public virtual RetryResponse Retry(Elastic.Clients.Elasticsearch.Inde return DoRequest, RetryResponse, RetryRequestParameters>(descriptor); } + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RetryResponse Retry() + { + var descriptor = new RetryRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, RetryResponse, RetryRequestParameters>(descriptor); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RetryResponse Retry(Action> configureRequest) + { + var descriptor = new RetryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, RetryResponse, RetryRequestParameters>(descriptor); + } + /// /// Retries executing the policy for an index that is in the ERROR step. /// Learn more about this API in the Elasticsearch documentation. @@ -979,6 +1100,29 @@ public virtual Task RetryAsync(Elastic.Clients.Elastic return DoRequestAsync, RetryResponse, RetryRequestParameters>(descriptor, cancellationToken); } + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RetryAsync(CancellationToken cancellationToken = default) + { + var descriptor = new RetryRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, RetryResponse, RetryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RetryAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RetryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, RetryResponse, RetryRequestParameters>(descriptor, cancellationToken); + } + /// /// Retries executing the policy for an index that is in the ERROR step. /// Learn more about this API in the Elasticsearch documentation. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs index a65ec0141b..c9a9a50928 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -604,6 +604,31 @@ public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); } + /// + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.Name target) + { + var descriptor = new CloneIndexRequestDescriptor(target); + descriptor.BeforeRequest(); + return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); + } + + /// + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.Name target, Action> configureRequest) + { + var descriptor = new CloneIndexRequestDescriptor(target); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); + } + /// /// Clones an index /// Learn more about this API in the Elasticsearch documentation. @@ -673,6 +698,29 @@ public virtual Task CloneAsync(Elastic.Clients.El return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); } + /// + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.Name target, CancellationToken cancellationToken = default) + { + var descriptor = new CloneIndexRequestDescriptor(target); + descriptor.BeforeRequest(); + return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.Name target, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CloneIndexRequestDescriptor(target); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); + } + /// /// Clones an index /// Learn more about this API in the Elasticsearch documentation. @@ -970,6 +1018,31 @@ public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsear return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); } + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateIndexResponse Create() + { + var descriptor = new CreateIndexRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateIndexResponse Create(Action> configureRequest) + { + var descriptor = new CreateIndexRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + } + /// /// Creates an index with optional settings and mappings. /// Learn more about this API in the Elasticsearch documentation. @@ -1039,6 +1112,29 @@ public virtual Task CreateAsync(Elastic.Clients. return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); } + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateIndexRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + } + /// /// Creates an index with optional settings and mappings. /// Learn more about this API in the Elasticsearch documentation. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs index c1bc7e2d02..2778a38abe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs @@ -212,7 +212,7 @@ public virtual GetModelResponse GetModel(GetModelRequestDescriptor descriptor) /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) + public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id? inferenceId) { var descriptor = new GetModelRequestDescriptor(taskType, inferenceId); descriptor.BeforeRequest(); @@ -224,7 +224,7 @@ public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Inference /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest) + public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id? inferenceId, Action configureRequest) { var descriptor = new GetModelRequestDescriptor(taskType, inferenceId); configureRequest?.Invoke(descriptor); @@ -237,9 +237,9 @@ public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Inference /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Id inferenceId) + public virtual GetModelResponse GetModel() { - var descriptor = new GetModelRequestDescriptor(inferenceId); + var descriptor = new GetModelRequestDescriptor(); descriptor.BeforeRequest(); return DoRequest(descriptor); } @@ -249,9 +249,9 @@ public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Id infere /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest) + public virtual GetModelResponse GetModel(Action configureRequest) { - var descriptor = new GetModelRequestDescriptor(inferenceId); + var descriptor = new GetModelRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequest(descriptor); @@ -271,7 +271,7 @@ public virtual Task GetModelAsync(GetModelRequestDescriptor de /// Get a model in the Inference API /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetModelAsync(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId, CancellationToken cancellationToken = default) + public virtual Task GetModelAsync(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id? inferenceId, CancellationToken cancellationToken = default) { var descriptor = new GetModelRequestDescriptor(taskType, inferenceId); descriptor.BeforeRequest(); @@ -282,7 +282,7 @@ public virtual Task GetModelAsync(Elastic.Clients.Elasticsearc /// Get a model in the Inference API /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetModelAsync(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetModelAsync(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id? inferenceId, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new GetModelRequestDescriptor(taskType, inferenceId); configureRequest?.Invoke(descriptor); @@ -294,9 +294,9 @@ public virtual Task GetModelAsync(Elastic.Clients.Elasticsearc /// Get a model in the Inference API /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetModelAsync(Elastic.Clients.Elasticsearch.Id inferenceId, CancellationToken cancellationToken = default) + public virtual Task GetModelAsync(CancellationToken cancellationToken = default) { - var descriptor = new GetModelRequestDescriptor(inferenceId); + var descriptor = new GetModelRequestDescriptor(); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } @@ -305,9 +305,9 @@ public virtual Task GetModelAsync(Elastic.Clients.Elasticsearc /// Get a model in the Inference API /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetModelAsync(Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetModelAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetModelRequestDescriptor(inferenceId); + var descriptor = new GetModelRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index 461fb31426..183b5bf63e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -7356,6 +7356,31 @@ public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsea return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); } + /// + /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermsEnumResponse TermsEnum() + { + var descriptor = new TermsEnumRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + } + + /// + /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermsEnumResponse TermsEnum(Action> configureRequest) + { + var descriptor = new TermsEnumRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + } + /// /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. /// Learn more about this API in the Elasticsearch documentation. @@ -7425,6 +7450,29 @@ public virtual Task TermsEnumAsync(Elastic.Clients return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); } + /// + /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + } + + /// + /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermsEnumAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + } + /// /// The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. /// Learn more about this API in the Elasticsearch documentation. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs index ae09212661..b6b91dd72c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs @@ -33,8 +33,7 @@ public sealed partial class TopHitsAggregation /// Fields for which to return doc values. /// [JsonInclude, JsonPropertyName("docvalue_fields")] - [JsonConverter(typeof(SingleOrManyFieldsConverter))] - public Elastic.Clients.Elasticsearch.Fields? DocvalueFields { get; set; } + public ICollection? DocvalueFields { get; set; } /// /// If `true`, returns detailed information about score computation as part of a hit. @@ -48,6 +47,12 @@ public sealed partial class TopHitsAggregation [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + /// + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public ICollection? Fields { get; set; } + /// /// Starting document offset. /// @@ -129,9 +134,16 @@ public TopHitsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Fields? DocvalueFieldsValue { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private ICollection? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } @@ -153,12 +165,42 @@ public TopHitsAggregationDescriptor() : base() /// /// Fields for which to return doc values. /// - public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Fields? docvalueFields) + public TopHitsAggregationDescriptor DocvalueFields(ICollection? docvalueFields) { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; DocvalueFieldsValue = docvalueFields; return Self; } + public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor DocvalueFields(Action> configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor DocvalueFields(params Action>[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + /// /// If `true`, returns detailed information about score computation as part of a hit. /// @@ -195,6 +237,45 @@ public TopHitsAggregationDescriptor Field(Expression + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public TopHitsAggregationDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public TopHitsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor Fields(Action> configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor Fields(params Action>[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + /// /// Starting document offset. /// @@ -351,7 +432,32 @@ public TopHitsAggregationDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (DocvalueFieldsValue is not null) + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) { writer.WritePropertyName("docvalue_fields"); JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); @@ -369,6 +475,37 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + if (FromValue.HasValue) { writer.WritePropertyName("from"); @@ -486,9 +623,16 @@ public TopHitsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Fields? DocvalueFieldsValue { get; set; } + private ICollection? DocvalueFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private ICollection? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } @@ -510,12 +654,42 @@ public TopHitsAggregationDescriptor() : base() /// /// Fields for which to return doc values. /// - public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Fields? docvalueFields) + public TopHitsAggregationDescriptor DocvalueFields(ICollection? docvalueFields) { + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; DocvalueFieldsValue = docvalueFields; return Self; } + public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor DocvalueFields(Action configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorActions = null; + DocvalueFieldsDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor DocvalueFields(params Action[] configure) + { + DocvalueFieldsValue = null; + DocvalueFieldsDescriptor = null; + DocvalueFieldsDescriptorAction = null; + DocvalueFieldsDescriptorActions = configure; + return Self; + } + /// /// If `true`, returns detailed information about score computation as part of a hit. /// @@ -552,6 +726,45 @@ public TopHitsAggregationDescriptor Field(Expression + /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ public TopHitsAggregationDescriptor Fields(ICollection? fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public TopHitsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public TopHitsAggregationDescriptor Fields(Action configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public TopHitsAggregationDescriptor Fields(params Action[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + /// /// Starting document offset. /// @@ -708,7 +921,32 @@ public TopHitsAggregationDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (DocvalueFieldsValue is not null) + if (DocvalueFieldsDescriptor is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DocvalueFieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorAction is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocvalueFieldsDescriptorActions is not null) + { + writer.WritePropertyName("docvalue_fields"); + writer.WriteStartArray(); + foreach (var action in DocvalueFieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DocvalueFieldsValue is not null) { writer.WritePropertyName("docvalue_fields"); JsonSerializer.Serialize(writer, DocvalueFieldsValue, options); @@ -726,6 +964,37 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (FieldsDescriptor is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FieldsDescriptor, options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorAction is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + if (FromValue.HasValue) { writer.WritePropertyName("from"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Esql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Esql.g.cs new file mode 100644 index 0000000000..ad611e00f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Esql.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql; + +[JsonConverter(typeof(VersionConverter))] +public enum Version +{ + /// + /// Run against the first version of ES|QL. + /// + [EnumMember(Value = "2024.04.01")] + V20240401 +} + +internal sealed class VersionConverter : JsonConverter +{ + public override Version Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "2024.04.01": + return Version.V20240401; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, Version value, JsonSerializerOptions options) + { + switch (value) + { + case Version.V20240401: + writer.WriteStringValue("2024.04.01"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file