Skip to content

Commit

Permalink
Generate exhaustive overloads for all request methods
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Apr 16, 2024
1 parent 00c8b42 commit 8195693
Show file tree
Hide file tree
Showing 49 changed files with 23,556 additions and 5,700 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,31 @@ public virtual Task<DeleteAsyncSearchResponse> DeleteAsync(DeleteAsyncSearchRequ
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<DeleteAsyncSearchResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
public virtual Task<DeleteAsyncSearchResponse> DeleteAsync<TDocument>(DeleteAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default)
{
descriptor.BeforeRequest();
return DoRequestAsync<DeleteAsyncSearchRequestDescriptor, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<DeleteAsyncSearchResponse> DeleteAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
{
var descriptor = new DeleteAsyncSearchRequestDescriptor(id);
descriptor.BeforeRequest();
return DoRequestAsync<DeleteAsyncSearchRequestDescriptor, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<DeleteAsyncSearchResponse> DeleteAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id id, Action<DeleteAsyncSearchRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
{
var descriptor = new DeleteAsyncSearchRequestDescriptor(id);
configureRequest?.Invoke(descriptor);
descriptor.BeforeRequest();
return DoRequestAsync<DeleteAsyncSearchRequestDescriptor, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor, cancellationToken);
}
Expand All @@ -78,6 +100,17 @@ public virtual Task<DeleteAsyncSearchResponse> DeleteAsync(DeleteAsyncSearchRequ
return DoRequestAsync<DeleteAsyncSearchRequestDescriptor, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<DeleteAsyncSearchResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
{
var descriptor = new DeleteAsyncSearchRequestDescriptor(id);
descriptor.BeforeRequest();
return DoRequestAsync<DeleteAsyncSearchRequestDescriptor, DeleteAsyncSearchResponse, DeleteAsyncSearchRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
Expand Down Expand Up @@ -114,9 +147,8 @@ public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(GetAs
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(GetAsyncSearchRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
{
var descriptor = new GetAsyncSearchRequestDescriptor<TDocument>(id);
descriptor.BeforeRequest();
return DoRequestAsync<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor, cancellationToken);
}
Expand All @@ -125,8 +157,9 @@ public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elast
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(GetAsyncSearchRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
{
var descriptor = new GetAsyncSearchRequestDescriptor<TDocument>(id);
descriptor.BeforeRequest();
return DoRequestAsync<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor, cancellationToken);
}
Expand Down Expand Up @@ -167,13 +200,35 @@ public virtual Task<AsyncSearchStatusResponse> StatusAsync(AsyncSearchStatusRequ
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<AsyncSearchStatusResponse> StatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
public virtual Task<AsyncSearchStatusResponse> StatusAsync<TDocument>(AsyncSearchStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default)
{
descriptor.BeforeRequest();
return DoRequestAsync<AsyncSearchStatusRequestDescriptor, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<AsyncSearchStatusResponse> StatusAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
{
var descriptor = new AsyncSearchStatusRequestDescriptor(id);
descriptor.BeforeRequest();
return DoRequestAsync<AsyncSearchStatusRequestDescriptor, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<AsyncSearchStatusResponse> StatusAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id id, Action<AsyncSearchStatusRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
{
var descriptor = new AsyncSearchStatusRequestDescriptor(id);
configureRequest?.Invoke(descriptor);
descriptor.BeforeRequest();
return DoRequestAsync<AsyncSearchStatusRequestDescriptor, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
Expand All @@ -184,6 +239,17 @@ public virtual Task<AsyncSearchStatusResponse> StatusAsync(AsyncSearchStatusRequ
return DoRequestAsync<AsyncSearchStatusRequestDescriptor, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<AsyncSearchStatusResponse> StatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
{
var descriptor = new AsyncSearchStatusRequestDescriptor(id);
descriptor.BeforeRequest();
return DoRequestAsync<AsyncSearchStatusRequestDescriptor, AsyncSearchStatusResponse, AsyncSearchStatusRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
Expand Down Expand Up @@ -220,9 +286,8 @@ public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>
/// <para>Executes a search request asynchronously.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(CancellationToken cancellationToken = default)
public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(SubmitAsyncSearchRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
{
var descriptor = new SubmitAsyncSearchRequestDescriptor<TDocument>();
descriptor.BeforeRequest();
return DoRequestAsync<SubmitAsyncSearchRequestDescriptor<TDocument>, SubmitAsyncSearchResponse<TDocument>, SubmitAsyncSearchRequestParameters>(descriptor, cancellationToken);
}
Expand All @@ -231,8 +296,32 @@ public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>
/// <para>Executes a search request asynchronously.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(SubmitAsyncSearchRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, CancellationToken cancellationToken = default)
{
var descriptor = new SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
descriptor.BeforeRequest();
return DoRequestAsync<SubmitAsyncSearchRequestDescriptor<TDocument>, SubmitAsyncSearchResponse<TDocument>, SubmitAsyncSearchRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Executes a search request asynchronously.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Action<SubmitAsyncSearchRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
{
var descriptor = new SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
configureRequest?.Invoke(descriptor);
descriptor.BeforeRequest();
return DoRequestAsync<SubmitAsyncSearchRequestDescriptor<TDocument>, SubmitAsyncSearchResponse<TDocument>, SubmitAsyncSearchRequestParameters>(descriptor, cancellationToken);
}

/// <summary>
/// <para>Executes a search request asynchronously.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(CancellationToken cancellationToken = default)
{
var descriptor = new SubmitAsyncSearchRequestDescriptor<TDocument>();
descriptor.BeforeRequest();
return DoRequestAsync<SubmitAsyncSearchRequestDescriptor<TDocument>, SubmitAsyncSearchResponse<TDocument>, SubmitAsyncSearchRequestParameters>(descriptor, cancellationToken);
}
Expand Down
Loading

0 comments on commit 8195693

Please sign in to comment.