Skip to content

[Backport 8.2] Code generate XML doc comments. #7414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
//
// ------------------------------------------------

#nullable restore

namespace Elastic.Clients.Elasticsearch.Requests;
internal static class ApiUrlsLookups

internal static class ApiUrlLookup
{
internal static ApiUrls AsyncSearchStatus = new ApiUrls(new[] { "/_async_search/status/{id}" });
internal static ApiUrls AsyncSearchDelete = new ApiUrls(new[] { "/_async_search/{id}" });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
Expand All @@ -25,26 +27,35 @@
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.AsyncSearch;

public sealed class AsyncSearchStatusRequestParameters : RequestParameters
{
}

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// </summary>
public sealed partial class AsyncSearchStatusRequest : PlainRequest<AsyncSearchStatusRequestParameters>
{
public AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchStatus;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;

protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

internal override bool SupportsBody => false;
}

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// </summary>
public sealed partial class AsyncSearchStatusRequestDescriptor<TDocument> : RequestDescriptor<AsyncSearchStatusRequestDescriptor<TDocument>, AsyncSearchStatusRequestParameters>
{
internal AsyncSearchStatusRequestDescriptor(Action<AsyncSearchStatusRequestDescriptor<TDocument>> configure) => configure.Invoke(this);

public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
Expand All @@ -53,9 +64,12 @@ internal AsyncSearchStatusRequestDescriptor()
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchStatus;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;

protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

internal override bool SupportsBody => false;

public AsyncSearchStatusRequestDescriptor<TDocument> Id(Elastic.Clients.Elasticsearch.Id id)
{
RouteValues.Required("id", id);
Expand All @@ -67,9 +81,13 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}
}

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// </summary>
public sealed partial class AsyncSearchStatusRequestDescriptor : RequestDescriptor<AsyncSearchStatusRequestDescriptor, AsyncSearchStatusRequestParameters>
{
internal AsyncSearchStatusRequestDescriptor(Action<AsyncSearchStatusRequestDescriptor> configure) => configure.Invoke(this);

public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
Expand All @@ -78,9 +96,12 @@ internal AsyncSearchStatusRequestDescriptor()
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchStatus;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;

protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

internal override bool SupportsBody => false;

public AsyncSearchStatusRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
{
RouteValues.Required("id", id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,35 @@
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.AsyncSearch;

public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
{
[JsonInclude, JsonPropertyName("completion_status")]
public int? CompletionStatus { get; init; }

[JsonInclude, JsonPropertyName("expiration_time")]
public DateTimeOffset? ExpirationTime { get; init; }

[JsonInclude, JsonPropertyName("expiration_time_in_millis")]
public long ExpirationTimeInMillis { get; init; }

[JsonInclude, JsonPropertyName("id")]
public string? Id { get; init; }

[JsonInclude, JsonPropertyName("is_partial")]
public bool IsPartial { get; init; }

[JsonInclude, JsonPropertyName("is_running")]
public bool IsRunning { get; init; }

[JsonInclude, JsonPropertyName("_shards")]
public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; }

[JsonInclude, JsonPropertyName("start_time")]
public DateTimeOffset? StartTime { get; init; }

[JsonInclude, JsonPropertyName("start_time_in_millis")]
public long StartTimeInMillis { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
Expand All @@ -25,26 +27,35 @@
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.AsyncSearch;

public sealed class DeleteAsyncSearchRequestParameters : RequestParameters
{
}

/// <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>
/// </summary>
public sealed partial class DeleteAsyncSearchRequest : PlainRequest<DeleteAsyncSearchRequestParameters>
{
public DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchDelete;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;

protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;

internal override bool SupportsBody => false;
}

/// <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>
/// </summary>
public sealed partial class DeleteAsyncSearchRequestDescriptor<TDocument> : RequestDescriptor<DeleteAsyncSearchRequestDescriptor<TDocument>, DeleteAsyncSearchRequestParameters>
{
internal DeleteAsyncSearchRequestDescriptor(Action<DeleteAsyncSearchRequestDescriptor<TDocument>> configure) => configure.Invoke(this);

public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
Expand All @@ -53,9 +64,12 @@ internal DeleteAsyncSearchRequestDescriptor()
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchDelete;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;

protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;

internal override bool SupportsBody => false;

public DeleteAsyncSearchRequestDescriptor<TDocument> Id(Elastic.Clients.Elasticsearch.Id id)
{
RouteValues.Required("id", id);
Expand All @@ -67,9 +81,13 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}
}

/// <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>
/// </summary>
public sealed partial class DeleteAsyncSearchRequestDescriptor : RequestDescriptor<DeleteAsyncSearchRequestDescriptor, DeleteAsyncSearchRequestParameters>
{
internal DeleteAsyncSearchRequestDescriptor(Action<DeleteAsyncSearchRequestDescriptor> configure) => configure.Invoke(this);

public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
Expand All @@ -78,9 +96,12 @@ internal DeleteAsyncSearchRequestDescriptor()
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchDelete;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;

protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;

internal override bool SupportsBody => false;

public DeleteAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
{
RouteValues.Required("id", id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System.Collections.Generic;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.AsyncSearch;

public sealed partial class DeleteAsyncSearchResponse : ElasticsearchResponse
{
/// <summary>
/// <para>For a successful response, this value is always true. On failure, an exception is returned instead.</para>
/// </summary>
[JsonInclude, JsonPropertyName("acknowledged")]
public bool Acknowledged { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
Expand All @@ -25,42 +27,67 @@
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.AsyncSearch;

public sealed class GetAsyncSearchRequestParameters : RequestParameters
{
[JsonIgnore]
/// <summary>
/// <para>Specify the time interval in which the results (partial or final) for this search will be available</para>
/// </summary>
public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q<Elastic.Clients.Elasticsearch.Duration?>("keep_alive"); set => Q("keep_alive", value); }

[JsonIgnore]
/// <summary>
/// <para>Specify whether aggregation and suggester names should be prefixed by their respective types in the response</para>
/// </summary>
public bool? TypedKeys { get => Q<bool?>("typed_keys"); set => Q("typed_keys", value); }

[JsonIgnore]
/// <summary>
/// <para>Specify the time that the request should block waiting for the final response</para>
/// </summary>
public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
}

/// <summary>
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
/// </summary>
public sealed partial class GetAsyncSearchRequest : PlainRequest<GetAsyncSearchRequestParameters>
{
public GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchGet;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;

protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

internal override bool SupportsBody => false;

/// <summary>
/// <para>Specify the time interval in which the results (partial or final) for this search will be available</para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q<Elastic.Clients.Elasticsearch.Duration?>("keep_alive"); set => Q("keep_alive", value); }

/// <summary>
/// <para>Specify whether aggregation and suggester names should be prefixed by their respective types in the response</para>
/// </summary>
[JsonIgnore]
public bool? TypedKeys { get => Q<bool?>("typed_keys"); set => Q("typed_keys", value); }

/// <summary>
/// <para>Specify the time that the request should block waiting for the final response</para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
}

/// <summary>
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
/// </summary>
public sealed partial class GetAsyncSearchRequestDescriptor<TDocument> : RequestDescriptor<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchRequestParameters>
{
internal GetAsyncSearchRequestDescriptor(Action<GetAsyncSearchRequestDescriptor<TDocument>> configure) => configure.Invoke(this);

public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
Expand All @@ -69,12 +96,16 @@ internal GetAsyncSearchRequestDescriptor()
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchGet;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;

protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

internal override bool SupportsBody => false;

public GetAsyncSearchRequestDescriptor<TDocument> KeepAlive(Elastic.Clients.Elasticsearch.Duration? keepAlive) => Qs("keep_alive", keepAlive);
public GetAsyncSearchRequestDescriptor<TDocument> TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
public GetAsyncSearchRequestDescriptor<TDocument> WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout);

public GetAsyncSearchRequestDescriptor<TDocument> Id(Elastic.Clients.Elasticsearch.Id id)
{
RouteValues.Required("id", id);
Expand All @@ -86,9 +117,13 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
}
}

/// <summary>
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
/// </summary>
public sealed partial class GetAsyncSearchRequestDescriptor : RequestDescriptor<GetAsyncSearchRequestDescriptor, GetAsyncSearchRequestParameters>
{
internal GetAsyncSearchRequestDescriptor(Action<GetAsyncSearchRequestDescriptor> configure) => configure.Invoke(this);

public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
Expand All @@ -97,12 +132,16 @@ internal GetAsyncSearchRequestDescriptor()
{
}

internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchGet;
internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;

protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

internal override bool SupportsBody => false;

public GetAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Duration? keepAlive) => Qs("keep_alive", keepAlive);
public GetAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
public GetAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout);

public GetAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
{
RouteValues.Required("id", id);
Expand Down
Loading