Skip to content

enrich was forward ported but needed a regen as well #4283

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 2 commits into from
Dec 18, 2019
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ namespace Elasticsearch.Net.Specification.EnrichApi
public class DeleteEnrichPolicyRequestParameters : RequestParameters<DeleteEnrichPolicyRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.DELETE;
public override bool SupportsBody => false;
}

///<summary>Request options for ExecutePolicy <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-execute-policy.html</para></summary>
public class ExecuteEnrichPolicyRequestParameters : RequestParameters<ExecuteEnrichPolicyRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
public override bool SupportsBody => false;
///<summary>Should the request should block until the execution is complete.</summary>
public bool? WaitForCompletion
{
Expand All @@ -46,17 +48,20 @@ public bool? WaitForCompletion
public class GetEnrichPolicyRequestParameters : RequestParameters<GetEnrichPolicyRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
public override bool SupportsBody => false;
}

///<summary>Request options for PutPolicy <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-put-policy.html</para></summary>
public class PutEnrichPolicyRequestParameters : RequestParameters<PutEnrichPolicyRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
public override bool SupportsBody => true;
}

///<summary>Request options for Stats <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats.html</para></summary>
public class EnrichStatsRequestParameters : RequestParameters<EnrichStatsRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
public override bool SupportsBody => false;
}
}
8 changes: 4 additions & 4 deletions src/Elasticsearch.Net/ElasticLowLevelClient.Enrich.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ public TResponse GetPolicy<TResponse>(string name, GetEnrichPolicyRequestParamet
[MapsApi("enrich.get_policy", "name")]
public Task<TResponse> GetPolicyAsync<TResponse>(string name, GetEnrichPolicyRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_enrich/policy/{name:name}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_enrich/policy/ <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-get-policy.html</para></summary>
///<summary>GET on /_enrich/policy <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-get-policy.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse GetPolicy<TResponse>(GetEnrichPolicyRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_enrich/policy/", null, RequestParams(requestParameters));
///<summary>GET on /_enrich/policy/ <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-get-policy.html</para></summary>
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_enrich/policy", null, RequestParams(requestParameters));
///<summary>GET on /_enrich/policy <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-get-policy.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
[MapsApi("enrich.get_policy", "")]
public Task<TResponse> GetPolicyAsync<TResponse>(GetEnrichPolicyRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_enrich/policy/", ctx, null, RequestParams(requestParameters));
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_enrich/policy", ctx, null, RequestParams(requestParameters));
///<summary>PUT on /_enrich/policy/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-put-policy.html</para></summary>
///<param name = "name">The name of the enrich policy</param>
///<param name = "body">The enrich policy to register</param>
Expand Down
2 changes: 1 addition & 1 deletion src/Nest/Descriptors.Enrich.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public GetEnrichPolicyDescriptor(Names name): base(r => r.Optional("name", name)
{
}

///<summary>/_enrich/policy/</summary>
///<summary>/_enrich/policy</summary>
public GetEnrichPolicyDescriptor(): base()
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/Nest/Requests.Enrich.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public GetEnrichPolicyRequest(Names name): base(r => r.Optional("name", name))
{
}

///<summary>/_enrich/policy/</summary>
///<summary>/_enrich/policy</summary>
public GetEnrichPolicyRequest(): base()
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/Nest/_Generated/ApiUrlsLookup.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal static class ApiUrlsLookups
internal static ApiUrls NoNamespaceDeleteScript = new ApiUrls(new[]{"_scripts/{id}"});
internal static ApiUrls EnrichDeletePolicy = new ApiUrls(new[]{"_enrich/policy/{name}"});
internal static ApiUrls EnrichExecutePolicy = new ApiUrls(new[]{"_enrich/policy/{name}/_execute"});
internal static ApiUrls EnrichGetPolicy = new ApiUrls(new[]{"_enrich/policy/{name}", "_enrich/policy/"});
internal static ApiUrls EnrichGetPolicy = new ApiUrls(new[]{"_enrich/policy/{name}", "_enrich/policy"});
internal static ApiUrls EnrichPutPolicy = new ApiUrls(new[]{"_enrich/policy/{name}"});
internal static ApiUrls EnrichStats = new ApiUrls(new[]{"_enrich/_stats"});
internal static ApiUrls NoNamespaceDocumentExists = new ApiUrls(new[]{"{index}/_doc/{id}"});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ await GET("/_enrich/policy/policy_name_1%2Cpolicy_name_2")
.FluentAsync(c => c.Enrich.GetPolicyAsync(new [] { "policy_name_1", "policy_name_2" }))
.RequestAsync(c => c.Enrich.GetPolicyAsync(new GetEnrichPolicyRequest(new [] { "policy_name_1", "policy_name_2" })));

await GET("/_enrich/policy/")
await GET("/_enrich/policy")
.Fluent(c => c.Enrich.GetPolicy())
.Request(c => c.Enrich.GetPolicy(new GetEnrichPolicyRequest()))
.FluentAsync(c => c.Enrich.GetPolicyAsync())
Expand Down