Skip to content

[codegen] 7.x synchronization #5485

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 31, 2021
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 @@ -14,16 +14,28 @@
{
"path":"/_ml/datafeeds/{datafeed_id}/_preview",
"methods":[
"GET"
"GET",
"POST"
],
"parts":{
"datafeed_id":{
"type":"string",
"description":"The ID of the datafeed to preview"
}
}
},
{
"path":"/_ml/datafeeds/_preview",
"methods":[
"GET",
"POST"
]
}
]
},
"body":{
"description":"The datafeed config and job config with which to execute the preview",
"required":false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ public class PreviewDataFrameAnalyticsRequestParameters : RequestParameters<Prev
///<summary>Request options for PreviewDatafeed <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
public class PreviewDatafeedRequestParameters : RequestParameters<PreviewDatafeedRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
public override bool SupportsBody => false;
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
public override bool SupportsBody => true;
}

///<summary>Request options for PutCalendar <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html</para></summary>
Expand Down
29 changes: 21 additions & 8 deletions src/Elasticsearch.Net/ElasticLowLevelClient.MachineLearning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -721,17 +721,30 @@ public TResponse PreviewDataFrameAnalytics<TResponse>(string id, PostData body,
[MapsApi("ml.preview_data_frame_analytics", "id, body")]
public Task<TResponse> PreviewDataFrameAnalyticsAsync<TResponse>(string id, PostData body, PreviewDataFrameAnalyticsRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/data_frame/analytics/{id:id}/_preview"), ctx, body, RequestParams(requestParameters));
///<summary>GET on /_ml/datafeeds/{datafeed_id}/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
///<summary>POST on /_ml/datafeeds/{datafeed_id}/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
///<param name = "datafeedId">The ID of the datafeed to preview</param>
///<param name = "body">The datafeed config and job config with which to execute the preview</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse PreviewDatafeed<TResponse>(string datafeedId, PreviewDatafeedRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_ml/datafeeds/{datafeedId:datafeedId}/_preview"), null, RequestParams(requestParameters));
///<summary>GET on /_ml/datafeeds/{datafeed_id}/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
public TResponse PreviewDatafeed<TResponse>(string datafeedId, PostData body, PreviewDatafeedRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/datafeeds/{datafeedId:datafeedId}/_preview"), body, RequestParams(requestParameters));
///<summary>POST on /_ml/datafeeds/{datafeed_id}/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
///<param name = "datafeedId">The ID of the datafeed to preview</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
[MapsApi("ml.preview_datafeed", "datafeed_id")]
public Task<TResponse> PreviewDatafeedAsync<TResponse>(string datafeedId, PreviewDatafeedRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_ml/datafeeds/{datafeedId:datafeedId}/_preview"), ctx, null, RequestParams(requestParameters));
///<param name = "body">The datafeed config and job config with which to execute the preview</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
[MapsApi("ml.preview_datafeed", "datafeed_id, body")]
public Task<TResponse> PreviewDatafeedAsync<TResponse>(string datafeedId, PostData body, PreviewDatafeedRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/datafeeds/{datafeedId:datafeedId}/_preview"), ctx, body, RequestParams(requestParameters));
///<summary>POST on /_ml/datafeeds/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
///<param name = "body">The datafeed config and job config with which to execute the preview</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse PreviewDatafeed<TResponse>(PostData body, PreviewDatafeedRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, "_ml/datafeeds/_preview", body, RequestParams(requestParameters));
///<summary>POST on /_ml/datafeeds/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
///<param name = "body">The datafeed config and job config with which to execute the preview</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
[MapsApi("ml.preview_datafeed", "body")]
public Task<TResponse> PreviewDatafeedAsync<TResponse>(PostData body, PreviewDatafeedRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, "_ml/datafeeds/_preview", ctx, body, RequestParams(requestParameters));
///<summary>PUT on /_ml/calendars/{calendar_id} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html</para></summary>
///<param name = "calendarId">The ID of the calendar to create</param>
///<param name = "body">The calendar details</param>
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 @@ -197,7 +197,7 @@ internal static class ApiUrlsLookups
internal static ApiUrls MachineLearningOpenJob = new ApiUrls(new[]{"_ml/anomaly_detectors/{job_id}/_open"});
internal static ApiUrls MachineLearningPostCalendarEvents = new ApiUrls(new[]{"_ml/calendars/{calendar_id}/events"});
internal static ApiUrls MachineLearningPostJobData = new ApiUrls(new[]{"_ml/anomaly_detectors/{job_id}/_data"});
internal static ApiUrls MachineLearningPreviewDatafeed = new ApiUrls(new[]{"_ml/datafeeds/{datafeed_id}/_preview"});
internal static ApiUrls MachineLearningPreviewDatafeed = new ApiUrls(new[]{"_ml/datafeeds/{datafeed_id}/_preview", "_ml/datafeeds/_preview"});
internal static ApiUrls MachineLearningPutCalendar = new ApiUrls(new[]{"_ml/calendars/{calendar_id}"});
internal static ApiUrls MachineLearningPutCalendarJob = new ApiUrls(new[]{"_ml/calendars/{calendar_id}/jobs/{job_id}"});
internal static ApiUrls MachineLearningPutDatafeed = new ApiUrls(new[]{"_ml/datafeeds/{datafeed_id}"});
Expand Down