From 6b8aaa47a6d5b1a9be3fa8357ecee745153fa30e Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 22 Apr 2024 13:02:51 +0200 Subject: [PATCH] Generate inference constructor overloads --- .../_Generated/Api/DeleteRequest.g.cs | 16 + .../_Generated/Api/ExistsRequest.g.cs | 16 + .../_Generated/Api/ExistsSourceRequest.g.cs | 16 + .../_Generated/Api/ExplainRequest.g.cs | 16 + .../_Generated/Api/GetRequest.g.cs | 16 + .../_Generated/Api/GetSourceRequest.g.cs | 16 + .../_Generated/Api/TermVectorsRequest.g.cs | 16 + .../_Generated/Api/UpdateRequest.g.cs | 16 + .../Client/ElasticsearchClient.g.cs | 786 ++++++- .../_Generated/Api/DeleteRequest.g.cs | 16 + .../_Generated/Api/ExistsRequest.g.cs | 16 + .../_Generated/Api/ExistsSourceRequest.g.cs | 16 + .../_Generated/Api/ExplainRequest.g.cs | 16 + .../_Generated/Api/GetRequest.g.cs | 16 + .../_Generated/Api/GetSourceRequest.g.cs | 16 + .../_Generated/Api/TermVectorsRequest.g.cs | 16 + .../_Generated/Api/UpdateRequest.g.cs | 16 + .../Client/ElasticsearchClient.g.cs | 2076 ++++++++++++++--- 18 files changed, 2823 insertions(+), 295 deletions(-) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs index 48085c5eb92..2e3c99dbf0a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs @@ -149,6 +149,22 @@ public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNam { } + public DeleteRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public DeleteRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public DeleteRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + + public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs index af089f46235..2a9479251df 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs @@ -171,6 +171,22 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNam { } + public ExistsRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public ExistsRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public ExistsRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + + public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExists; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs index 9f69b5c1f58..513485ab900 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs @@ -160,6 +160,22 @@ public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.In { } + public ExistsSourceRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public ExistsSourceRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public ExistsSourceRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + + public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExistsSource; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainRequest.g.cs index e70bf6c1215..2b67dee6913 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainRequest.g.cs @@ -199,6 +199,22 @@ public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNa { } + public ExplainRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public ExplainRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public ExplainRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + + public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExplain; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs index f4d5e4680dd..230b7e3a22f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs @@ -171,6 +171,22 @@ public GetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName i { } + public GetRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public GetRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public GetRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + + public GetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs index c502d2e5918..7b3d473879a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs @@ -163,6 +163,22 @@ public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Index { } + public GetSourceRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public GetSourceRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public GetSourceRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + + public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetSource; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs index 8710f9a0974..77f8ad1e034 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs @@ -209,6 +209,22 @@ public TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } + public TermVectorsRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public TermVectorsRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public TermVectorsRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id? id) : this(typeof(TDocument), id) + { + } + + public TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermvectors; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs index e514bb0c2c1..3c296d552c8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs @@ -226,6 +226,22 @@ public UpdateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNam { } + public UpdateRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public UpdateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) + { + } + + public UpdateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + + public UpdateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; 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 4d959a2befe..74254e01b26 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs @@ -548,10 +548,10 @@ public virtual Task DeleteAsync(DeleteRequest request, Cancellat /// Removes a document from the index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); } /// @@ -560,21 +560,113 @@ public virtual Task DeleteAsync(DeleteRequestDescript /// public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(index, id); + var descriptor = new DeleteRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); } /// /// Removes a document from the index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(index, id); + var descriptor = new DeleteRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); } /// @@ -848,6 +940,98 @@ public virtual Task ExistsAsync(Elastic.Clients.Elast return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); } + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + /// /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. @@ -924,6 +1108,98 @@ public virtual Task ExistsSourceAsync(Elastic.C return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); } + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + /// /// Returns information about whether a document source exists in an index. /// Learn more about this API in the Elasticsearch documentation. @@ -1000,6 +1276,98 @@ public virtual Task> ExplainAsync(Elastic. return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); + } + /// /// Returns the information about the capabilities of fields among multiple indices. /// Learn more about this API in the Elasticsearch documentation. @@ -1100,44 +1468,136 @@ public virtual Task FieldCapsAsync(Elastic.Clients.Elasticsea } /// - /// Returns the information about the capabilities of fields among multiple indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(GetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, GetRequestParameters>(request, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(GetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new GetRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FieldCapsAsync(CancellationToken cancellationToken = default) + public virtual Task> GetAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) { - var descriptor = new FieldCapsRequestDescriptor(); + var descriptor = new GetRequestDescriptor(document, index); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// - /// Returns the information about the capabilities of fields among multiple indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FieldCapsAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new FieldCapsRequestDescriptor(); + var descriptor = new GetRequestDescriptor(document, index); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(GetRequest request, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync, GetRequestParameters>(request, cancellationToken); + var descriptor = new GetRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(GetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new GetRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } @@ -1146,9 +1606,9 @@ public virtual Task> GetAsync(GetRequestDescri /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(index, id); + var descriptor = new GetRequestDescriptor(id); descriptor.BeforeRequest(); return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } @@ -1157,9 +1617,9 @@ public virtual Task> GetAsync(Elastic.Clients. /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(index, id); + var descriptor = new GetRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); @@ -1284,6 +1744,98 @@ public virtual Task> GetSourceAsync(Elas return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSourceRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + } + /// /// Returns the health of the cluster. /// Learn more about this API in the Elasticsearch documentation. @@ -2789,6 +3341,98 @@ public virtual Task TermvectorsAsync(Elastic.Cli return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id? id, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id? id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.Serverless.Id? id, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.Serverless.Id? id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermVectorsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + } + /// /// Updates a document with a script or partial document. /// Learn more about this API in the Elasticsearch documentation. @@ -2832,6 +3476,98 @@ public virtual Task> UpdateAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); } + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + /// /// Updates documents that match the specified query. If no query is specified,
performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
/// Learn more about this API in the Elasticsearch documentation. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs index 22f7c05315c..d9ae2d87e87 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs @@ -149,6 +149,22 @@ public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El { } + public DeleteRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public DeleteRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public DeleteRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + + public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs index ca1b7ecda2d..63141f63a5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs @@ -171,6 +171,22 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El { } + public ExistsRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public ExistsRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public ExistsRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + + public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExists; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs index f899080d652..277d9aeef81 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs @@ -160,6 +160,22 @@ public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName ind { } + public ExistsSourceRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public ExistsSourceRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public ExistsSourceRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + + public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExistsSource; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs index 1e143403c3d..59c2de60ead 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs @@ -199,6 +199,22 @@ public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, E { } + public ExplainRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public ExplainRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public ExplainRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + + public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExplain; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs index bc547ad4e17..fa1c1a639b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs @@ -182,6 +182,22 @@ public GetRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, Elast { } + public GetRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public GetRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public GetRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + + public GetRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs index 06e5dbdcbf1..876f9f312b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs @@ -163,6 +163,22 @@ public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, { } + public GetSourceRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public GetSourceRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public GetSourceRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + + public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetSource; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs index 7fb40edfa5f..d35dcf2a468 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs @@ -209,6 +209,22 @@ public TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName inde { } + public TermVectorsRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public TermVectorsRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public TermVectorsRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id? id) : this(typeof(TDocument), id) + { + } + + public TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermvectors; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs index afbe6d246fd..b36ed5ff57e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs @@ -226,6 +226,22 @@ public UpdateRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El { } + public UpdateRequestDescriptor(TDocument document) : this(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public UpdateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(index, Elastic.Clients.Elasticsearch.Id.From(document)) + { + } + + public UpdateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + + public UpdateRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : this(typeof(TDocument), id) + { + } + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index b5660060b93..ca31e3867c2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -1085,10 +1085,10 @@ public virtual Task DeleteAsync(DeleteRequest request, Cancellat /// Learn more about this API in the Elasticsearch documentation. ///
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual DeleteResponse Delete(DeleteRequestDescriptor descriptor) + public virtual DeleteResponse Delete(DeleteRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); } /// @@ -1098,9 +1098,9 @@ public virtual DeleteResponse Delete(DeleteRequestDescriptor descript [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) { - var descriptor = new DeleteRequestDescriptor(index, id); + var descriptor = new DeleteRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); } /// @@ -1108,12 +1108,112 @@ public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.In /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { - var descriptor = new DeleteRequestDescriptor(index, id); + var descriptor = new DeleteRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(TDocument document) + { + var descriptor = new DeleteRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(TDocument document, Action> configureRequest) + { + var descriptor = new DeleteRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new DeleteRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + { + var descriptor = new DeleteRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(TDocument document, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new DeleteRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new DeleteRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new DeleteRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new DeleteRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); } /// @@ -1156,10 +1256,10 @@ public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.IndexName ind /// Removes a document from the index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); } /// @@ -1168,21 +1268,113 @@ public virtual Task DeleteAsync(DeleteRequestDescript /// public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(index, id); + var descriptor = new DeleteRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); } /// /// Removes a document from the index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(index, id); + var descriptor = new DeleteRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); } /// @@ -1688,10 +1880,11 @@ public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.In /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) + public virtual ExistsResponse Exists(TDocument document) { + var descriptor = new ExistsRequestDescriptor(document); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); } /// @@ -1699,11 +1892,12 @@ public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + public virtual ExistsResponse Exists(TDocument document, Action> configureRequest) { - var descriptor = new ExistsRequestDescriptor(index, id); + var descriptor = new ExistsRequestDescriptor(document); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); } /// @@ -1711,156 +1905,446 @@ public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName ind /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + public virtual ExistsResponse Exists(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) { - var descriptor = new ExistsRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new ExistsRequestDescriptor(document, index); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); } /// /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsResponse Exists(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) { + var descriptor = new ExistsRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); } /// /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsResponse Exists(TDocument document, Elastic.Clients.Elasticsearch.Id id) { - var descriptor = new ExistsRequestDescriptor(index, id); + var descriptor = new ExistsRequestDescriptor(document, id); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); } /// /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsResponse Exists(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { - var descriptor = new ExistsRequestDescriptor(index, id); + var descriptor = new ExistsRequestDescriptor(document, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); } /// /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Id id) { + var descriptor = new ExistsRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); } /// /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { - var descriptor = new ExistsRequestDescriptor(index, id); + var descriptor = new ExistsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); } /// /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) { - var descriptor = new ExistsRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns information about whether a document source exists in an index. + /// Returns information about whether a document exists in 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 ExistsSourceResponse ExistsSource(ExistsSourceRequest request) + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new ExistsRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Returns information about whether a document source exists in an index. + /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(ExistsSourceRequest request, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new ExistsRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Returns information about whether a document source exists in an index. + /// Returns information about whether a document exists in 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 ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. + /// Returns information about whether a document exists in 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 ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new ExistsRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. + /// Returns information about whether a document exists in 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 ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new ExistsRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. + /// Returns information about whether a document exists in 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 ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) + public virtual Task ExistsAsync(TDocument document, CancellationToken cancellationToken = default) { + var descriptor = new ExistsRequestDescriptor(document); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. + /// Returns information about whether a document exists in 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 ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + public virtual Task ExistsAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new ExistsRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(ExistsSourceRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(ExistsSourceRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(TDocument document) + { + var descriptor = new ExistsSourceRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(TDocument document, Action> configureRequest) + { + var descriptor = new ExistsSourceRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new ExistsSourceRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + { + var descriptor = new ExistsSourceRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(TDocument document, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new ExistsSourceRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new ExistsSourceRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new ExistsSourceRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new ExistsSourceRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a document source exists in 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 ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); descriptor.BeforeRequest(); return DoRequest(descriptor); } @@ -1889,124 +2373,408 @@ public virtual Task ExistsSourceAsync(ExistsSou } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(ExistsSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(ExplainRequest request) + { + request.BeforeRequest(); + return DoRequest, ExplainRequestParameters>(request); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ExplainAsync(ExplainRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, ExplainRequestParameters>(request, cancellationToken); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(ExplainRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new ExplainRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new ExplainRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(TDocument document) + { + var descriptor = new ExplainRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(TDocument document, Action> configureRequest) + { + var descriptor = new ExplainRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new ExplainRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + { + var descriptor = new ExplainRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(TDocument document, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new ExplainRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new ExplainRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + } + + /// + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.Id id) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new ExplainRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new ExplainRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(ExistsSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(ExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new ExplainRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new ExplainRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ExplainResponse Explain(ExplainRequest request) + public virtual Task> ExplainAsync(TDocument document, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest, ExplainRequestParameters>(request); + var descriptor = new ExplainRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> ExplainAsync(ExplainRequest request, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync, ExplainRequestParameters>(request, cancellationToken); + var descriptor = new ExplainRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ExplainResponse Explain(ExplainRequestDescriptor descriptor) + public virtual Task> ExplainAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) { + var descriptor = new ExplainRequestDescriptor(document, index); descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + public virtual Task> ExplainAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(index, id); + var descriptor = new ExplainRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + public virtual Task> ExplainAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new ExplainRequestDescriptor(document, id); descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> ExplainAsync(ExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new ExplainRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } @@ -2015,9 +2783,9 @@ public virtual Task> ExplainAsync(ExplainR /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(index, id); + var descriptor = new ExplainRequestDescriptor(id); descriptor.BeforeRequest(); return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } @@ -2026,9 +2794,9 @@ public virtual Task> ExplainAsync(Elastic. /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(index, id); + var descriptor = new ExplainRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); @@ -2237,121 +3005,313 @@ public virtual Task FieldCapsAsync(ActionReturns the information about the capabilities of fields among multiple indices. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task FieldCapsAsync(FieldCapsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task FieldCapsAsync(FieldCapsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(Elastic.Clients.Elasticsearch.Indices? indices, CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(Elastic.Clients.Elasticsearch.Indices? indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldCapsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FieldCapsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(GetRequest request) + { + request.BeforeRequest(); + return DoRequest, GetRequestParameters>(request); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetAsync(GetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, GetRequestParameters>(request, cancellationToken); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(GetRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new GetRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new GetRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(TDocument document) + { + var descriptor = new GetRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(TDocument document, Action> configureRequest) + { + var descriptor = new GetRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new GetRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + { + var descriptor = new GetRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(TDocument document, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new GetRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new GetRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); + } + + /// + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(Elastic.Clients.Elasticsearch.Id id) { + var descriptor = new GetRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); } /// - /// Returns the information about the capabilities of fields among multiple indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FieldCapsAsync(Elastic.Clients.Elasticsearch.Indices? indices, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetResponse Get(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { - var descriptor = new FieldCapsRequestDescriptor(indices); + var descriptor = new GetRequestDescriptor(id); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, GetResponse, GetRequestParameters>(descriptor); } /// - /// Returns the information about the capabilities of fields among multiple indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FieldCapsAsync(Elastic.Clients.Elasticsearch.Indices? indices, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(GetRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new FieldCapsRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// - /// Returns the information about the capabilities of fields among multiple indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FieldCapsAsync(CancellationToken cancellationToken = default) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new FieldCapsRequestDescriptor(); + var descriptor = new GetRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// - /// Returns the information about the capabilities of fields among multiple indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FieldCapsAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new FieldCapsRequestDescriptor(); + var descriptor = new GetRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetResponse Get(GetRequest request) + public virtual Task> GetAsync(TDocument document, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest, GetRequestParameters>(request); + var descriptor = new GetRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(GetRequest request, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync, GetRequestParameters>(request, cancellationToken); + var descriptor = new GetRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetResponse Get(GetRequestDescriptor descriptor) + public virtual Task> GetAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) { + var descriptor = new GetRequestDescriptor(document, index); descriptor.BeforeRequest(); - return DoRequest, GetResponse, GetRequestParameters>(descriptor); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetResponse Get(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + public virtual Task> GetAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(index, id); + var descriptor = new GetRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetResponse, GetRequestParameters>(descriptor); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetResponse Get(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + public virtual Task> GetAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new GetRequestDescriptor(document, id); descriptor.BeforeRequest(); - return DoRequest, GetResponse, GetRequestParameters>(descriptor); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(GetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new GetRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } @@ -2360,9 +3320,9 @@ public virtual Task> GetAsync(GetRequestDescri /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(index, id); + var descriptor = new GetRequestDescriptor(id); descriptor.BeforeRequest(); return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } @@ -2371,9 +3331,9 @@ public virtual Task> GetAsync(Elastic.Clients. /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(index, id); + var descriptor = new GetRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); @@ -2661,126 +3621,318 @@ public virtual GetScriptLanguagesResponse GetScriptLanguages(GetScriptLanguagesR } /// - /// Returns available script types, languages and contexts - /// Learn more about this API in the Elasticsearch documentation. + /// Returns available script types, languages and contexts + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetScriptLanguagesResponse GetScriptLanguages() + { + var descriptor = new GetScriptLanguagesRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns available script types, languages and contexts + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetScriptLanguagesResponse GetScriptLanguages(Action configureRequest) + { + var descriptor = new GetScriptLanguagesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns available script types, languages and contexts + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptLanguagesAsync(GetScriptLanguagesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns available script types, languages and contexts + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptLanguagesAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetScriptLanguagesRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns available script types, languages and contexts + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetScriptLanguagesAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetScriptLanguagesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(GetSourceRequest request) + { + request.BeforeRequest(); + return DoRequest, GetSourceRequestParameters>(request); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> GetSourceAsync(GetSourceRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, GetSourceRequestParameters>(request, cancellationToken); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(GetSourceRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new GetSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new GetSourceRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(TDocument document) + { + var descriptor = new GetSourceRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(TDocument document, Action> configureRequest) + { + var descriptor = new GetSourceRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new GetSourceRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + { + var descriptor = new GetSourceRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(TDocument document, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new GetSourceRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSourceResponse GetSource(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new GetSourceRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + } + + /// + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetScriptLanguagesResponse GetScriptLanguages() + public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.Id id) { - var descriptor = new GetScriptLanguagesRequestDescriptor(); + var descriptor = new GetSourceRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); } /// - /// Returns available script types, languages and contexts - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetScriptLanguagesResponse GetScriptLanguages(Action configureRequest) + public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { - var descriptor = new GetScriptLanguagesRequestDescriptor(); + var descriptor = new GetSourceRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); } /// - /// Returns available script types, languages and contexts - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetScriptLanguagesAsync(GetScriptLanguagesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(GetSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// - /// Returns available script types, languages and contexts - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetScriptLanguagesAsync(CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetScriptLanguagesRequestDescriptor(); + var descriptor = new GetSourceRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// - /// Returns available script types, languages and contexts - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the source of a document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetScriptLanguagesAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetScriptLanguagesRequestDescriptor(); + var descriptor = new GetSourceRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetSourceResponse GetSource(GetSourceRequest request) + public virtual Task> GetSourceAsync(TDocument document, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest, GetSourceRequestParameters>(request); + var descriptor = new GetSourceRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetSourceAsync(GetSourceRequest request, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync, GetSourceRequestParameters>(request, cancellationToken); + var descriptor = new GetSourceRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetSourceResponse GetSource(GetSourceRequestDescriptor descriptor) + public virtual Task> GetSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) { + var descriptor = new GetSourceRequestDescriptor(document, index); descriptor.BeforeRequest(); - return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) + public virtual Task> GetSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetSourceRequestDescriptor(index, id); + var descriptor = new GetSourceRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + public virtual Task> GetSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetSourceRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new GetSourceRequestDescriptor(document, id); descriptor.BeforeRequest(); - return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetSourceAsync(GetSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new GetSourceRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } @@ -2789,9 +3941,9 @@ public virtual Task> GetSourceAsync(GetS /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetSourceRequestDescriptor(index, id); + var descriptor = new GetSourceRequestDescriptor(id); descriptor.BeforeRequest(); return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } @@ -2800,9 +3952,9 @@ public virtual Task> GetSourceAsync(Elas /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetSourceRequestDescriptor(index, id); + var descriptor = new GetSourceRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); @@ -6118,138 +7270,330 @@ public virtual Task TermsEnumAsync(Elastic.Clients } /// - /// 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. + /// 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(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(index); + 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. + /// + public virtual Task TermsEnumAsync(TermsEnumRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(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(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(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(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TermsEnumRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TermVectorsRequest request) + { + request.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(request); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TermvectorsAsync(TermVectorsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(request, cancellationToken); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TermVectorsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id) + { + var descriptor = new TermVectorsRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id, Action> configureRequest) + { + var descriptor = new TermVectorsRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new TermVectorsRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + { + var descriptor = new TermVectorsRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TDocument document) + { + var descriptor = new TermVectorsRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TDocument document, Action> configureRequest) + { + var descriptor = new TermVectorsRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new TermVectorsRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + { + var descriptor = new TermVectorsRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TDocument document, Elastic.Clients.Elasticsearch.Id? id) + { + var descriptor = new TermVectorsRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TDocument document, Elastic.Clients.Elasticsearch.Id? id, Action> configureRequest) { - var descriptor = new TermsEnumRequestDescriptor(index); + var descriptor = new TermVectorsRequestDescriptor(document, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(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. + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(TermsEnumRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.Id? id) { + var descriptor = new TermVectorsRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(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. + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.Id? id, Action> configureRequest) { - var descriptor = new TermsEnumRequestDescriptor(index); + var descriptor = new TermVectorsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(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. + /// Returns information and statistics about terms in the fields of a particular document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(TermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new TermsEnumRequestDescriptor(index); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } /// /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual TermVectorsResponse Termvectors(TermVectorsRequest request) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(request); + var descriptor = new TermVectorsRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } /// /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermvectorsAsync(TermVectorsRequest request, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id, Action> configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(request, cancellationToken); + var descriptor = new TermVectorsRequestDescriptor(index, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } /// /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual TermVectorsResponse Termvectors(TermVectorsRequestDescriptor descriptor) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) { + var descriptor = new TermVectorsRequestDescriptor(index); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } /// /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(index, id); + var descriptor = new TermVectorsRequestDescriptor(index); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } /// /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id, Action> configureRequest) + public virtual Task TermvectorsAsync(TDocument document, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new TermVectorsRequestDescriptor(document); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } /// /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index) + public virtual Task TermvectorsAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(index); + var descriptor = new TermVectorsRequestDescriptor(document); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } /// /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + public virtual Task TermvectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(index); - configureRequest?.Invoke(descriptor); + var descriptor = new TermVectorsRequestDescriptor(document, index); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } /// /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermvectorsAsync(TermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new TermVectorsRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } @@ -6258,9 +7602,9 @@ public virtual Task TermvectorsAsync(TermVectors /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Id? id, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(index, id); + var descriptor = new TermVectorsRequestDescriptor(document, id); descriptor.BeforeRequest(); return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } @@ -6269,9 +7613,9 @@ public virtual Task TermvectorsAsync(Elastic.Cli /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Id? id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(index, id); + var descriptor = new TermVectorsRequestDescriptor(document, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); @@ -6281,9 +7625,9 @@ public virtual Task TermvectorsAsync(Elastic.Cli /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.Id? id, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(index); + var descriptor = new TermVectorsRequestDescriptor(id); descriptor.BeforeRequest(); return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } @@ -6292,9 +7636,9 @@ public virtual Task TermvectorsAsync(Elastic.Cli /// Returns information and statistics about terms in the fields of a particular document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.Id? id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(index); + var descriptor = new TermVectorsRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); @@ -6357,6 +7701,106 @@ public virtual UpdateResponse Update(Ela return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); } + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(TDocument document) + { + var descriptor = new UpdateRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(TDocument document, Action> configureRequest) + { + var descriptor = new UpdateRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new UpdateRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) + { + var descriptor = new UpdateRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(TDocument document, Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new UpdateRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new UpdateRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new UpdateRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new UpdateRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); + } + /// /// Updates a document with a script or partial document. /// Learn more about this API in the Elasticsearch documentation. @@ -6390,6 +7834,98 @@ public virtual Task> UpdateAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); } + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, index); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, id); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(TDocument document, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(document, id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> UpdateAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); + } + /// /// Updates documents that match the specified query. If no query is specified,
performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
/// Learn more about this API in the Elasticsearch documentation.