Skip to content

Commit

Permalink
[codegen] 7.x synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
nknize authored Aug 5, 2021
1 parent 0eddd8d commit 84030a1
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
},
"body":{
"description":"The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'"
"description":"The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard'"
}
}
}
6 changes: 4 additions & 2 deletions src/ApiGenerator/RestSpecification/Core/nodes.stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
"segments",
"store",
"warmer",
"suggest"
"suggest",
"shards"
],
"description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified."
}
Expand Down Expand Up @@ -175,7 +176,8 @@
"segments",
"store",
"warmer",
"suggest"
"suggest",
"shards"
],
"description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified."
},
Expand Down
86 changes: 86 additions & 0 deletions src/ApiGenerator/RestSpecification/Core/search_mvt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"search_mvt": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html",
"description": "Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile."
},
"stability": "experimental",
"visibility": "public",
"headers": {
"accept": [
"application/json"
],
"content_type": [
"application/vnd.mapbox-vector-tile"
]
},
"url": {
"paths": [
{
"path": "/{index}/_mvt/{field}/{zoom}/{x}/{y}",
"methods": [
"GET",
"POST"
],
"parts": {
"index": {
"type": "list",
"description": "Comma-separated list of data streams, indices, or aliases to search"
},
"field": {
"type": "string",
"description": "Field containing geospatial data to return"
},
"zoom": {
"type": "integer",
"description": "Zoom level for the vector tile to search"
},
"x": {
"type": "integer",
"description": "X coordinate for the vector tile to search"
},
"y": {
"type": "integer",
"description": "Y coordinate for the vector tile to search"
}
}
}
]
},
"params":{
"exact_bounds":{
"type":"boolean",
"description":"If false, the meta layer's feature is the bounding box of the tile. If true, the meta layer's feature is a bounding box resulting from a `geo_bounds` aggregation.",
"default":false
},
"extent":{
"type":"number",
"description":"Size, in pixels, of a side of the vector tile.",
"default":4096
},
"grid_precision":{
"type":"number",
"description":"Additional zoom levels available through the aggs layer. Accepts 0-8.",
"default":8
},
"grid_type":{
"type":"enum",
"options":[
"grid",
"point"
],
"description":"Determines the geometry type for features in the aggs layer.",
"default":"grid"
},
"size":{
"type":"number",
"description":"Maximum number of features to return in the hits layer. Accepts 0-10000.",
"default":10000
}
},
"body":{
"description":"Search request body.",
"required":false
}
}
}
23 changes: 23 additions & 0 deletions src/Elasticsearch.Net/Api/Enums.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,15 @@ public enum ThreadType
Block
}

[StringEnum]
public enum GridType
{
[EnumMember(Value = "grid")]
Grid,
[EnumMember(Value = "point")]
Point
}

[StringEnum]
public enum GroupBy
{
Expand Down Expand Up @@ -478,6 +487,7 @@ static KnownEnums()
EnumStringResolvers.TryAdd(typeof(OpType), (e) => GetStringValue((OpType)e));
EnumStringResolvers.TryAdd(typeof(IndicesShardStoresStatus), (e) => GetStringValue((IndicesShardStoresStatus)e));
EnumStringResolvers.TryAdd(typeof(ThreadType), (e) => GetStringValue((ThreadType)e));
EnumStringResolvers.TryAdd(typeof(GridType), (e) => GetStringValue((GridType)e));
EnumStringResolvers.TryAdd(typeof(GroupBy), (e) => GetStringValue((GroupBy)e));
EnumStringResolvers.TryAdd(typeof(TextStructureFindStructureFormat), (e) => GetStringValue((TextStructureFindStructureFormat)e));
}
Expand Down Expand Up @@ -965,6 +975,19 @@ public static string GetStringValue(this ThreadType enumValue)
throw new ArgumentException($"'{enumValue.ToString()}' is not a valid value for enum 'ThreadType'");
}

public static string GetStringValue(this GridType enumValue)
{
switch (enumValue)
{
case GridType.Grid:
return "grid";
case GridType.Point:
return "point";
}

throw new ArgumentException($"'{enumValue.ToString()}' is not a valid value for enum 'GridType'");
}

public static string GetStringValue(this GroupBy enumValue)
{
switch (enumValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,50 @@ public bool? TypedKeys
}
}

///<summary>Request options for SearchMvt <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html</para></summary>
public class SearchMvtRequestParameters : RequestParameters<SearchMvtRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
public override bool SupportsBody => true;
///<summary>
/// If false, the meta layer's feature is the bounding box of the tile. If true, the meta layer's feature is a bounding box resulting from a
/// `geo_bounds` aggregation.
///</summary>
public bool? ExactBounds
{
get => Q<bool? >("exact_bounds");
set => Q("exact_bounds", value);
}

///<summary>Size, in pixels, of a side of the vector tile.</summary>
public long? Extent
{
get => Q<long? >("extent");
set => Q("extent", value);
}

///<summary>Additional zoom levels available through the aggs layer. Accepts 0-8.</summary>
public long? GridPrecision
{
get => Q<long? >("grid_precision");
set => Q("grid_precision", value);
}

///<summary>Determines the geometry type for features in the aggs layer.</summary>
public GridType? GridType
{
get => Q<GridType? >("grid_type");
set => Q("grid_type", value);
}

///<summary>Maximum number of features to return in the hits layer. Accepts 0-10000.</summary>
public long? Size
{
get => Q<long? >("size");
set => Q("size", value);
}
}

///<summary>Request options for SearchShards <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html</para></summary>
public class SearchShardsRequestParameters : RequestParameters<SearchShardsRequestParameters>
{
Expand Down
4 changes: 2 additions & 2 deletions src/Elasticsearch.Net/ElasticLowLevelClient.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ internal LowLevelClusterNamespace(ElasticLowLevelClient client): base(client)
}

///<summary>POST on /_cluster/allocation/explain <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html</para></summary>
///<param name = "body">The index, shard, and primary flag to explain. Empty means &#x27;explain the first unassigned shard&#x27;</param>
///<param name = "body">The index, shard, and primary flag to explain. Empty means &#x27;explain a randomly-chosen unassigned shard&#x27;</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse AllocationExplain<TResponse>(PostData body, ClusterAllocationExplainRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, "_cluster/allocation/explain", body, RequestParams(requestParameters));
///<summary>POST on /_cluster/allocation/explain <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html</para></summary>
///<param name = "body">The index, shard, and primary flag to explain. Empty means &#x27;explain the first unassigned shard&#x27;</param>
///<param name = "body">The index, shard, and primary flag to explain. Empty means &#x27;explain a randomly-chosen unassigned shard&#x27;</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
[MapsApi("cluster.allocation_explain", "body")]
public Task<TResponse> AllocationExplainAsync<TResponse>(PostData body, ClusterAllocationExplainRequestParameters requestParameters = null, CancellationToken ctx = default)
Expand Down
23 changes: 23 additions & 0 deletions src/Elasticsearch.Net/ElasticLowLevelClient.NoNamespace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,29 @@ public TResponse SearchUsingType<TResponse>(string index, string type, PostData
[MapsApi("search", "index, type, body")]
public Task<TResponse> SearchUsingTypeAsync<TResponse>(string index, string type, PostData body, SearchRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/{type:type}/_search"), ctx, body, RequestParams(requestParameters));
///<summary>POST on /{index}/_mvt/{field}/{zoom}/{x}/{y} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html</para></summary>
///<param name = "index">Comma-separated list of data streams, indices, or aliases to search</param>
///<param name = "field">Field containing geospatial data to return</param>
///<param name = "zoom">Zoom level for the vector tile to search</param>
///<param name = "X">X coordinate for the vector tile to search</param>
///<param name = "Y">Y coordinate for the vector tile to search</param>
///<param name = "body">Search request body.</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
///<remarks>Note: Experimental within the Elasticsearch server, this functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded.</remarks>
public TResponse SearchMvt<TResponse>(string index, string field, integer zoom, integer X, integer Y, PostData body, SearchMvtRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"{index:index}/_mvt/{field:field}/{zoom:zoom}/{X:X}/{Y:Y}"), body, RequestParams(requestParameters));
///<summary>POST on /{index}/_mvt/{field}/{zoom}/{x}/{y} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html</para></summary>
///<param name = "index">Comma-separated list of data streams, indices, or aliases to search</param>
///<param name = "field">Field containing geospatial data to return</param>
///<param name = "zoom">Zoom level for the vector tile to search</param>
///<param name = "X">X coordinate for the vector tile to search</param>
///<param name = "Y">Y coordinate for the vector tile to search</param>
///<param name = "body">Search request body.</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
///<remarks>Note: Experimental within the Elasticsearch server, this functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded.</remarks>
[MapsApi("search_mvt", "index, field, zoom, x, y, body")]
public Task<TResponse> SearchMvtAsync<TResponse>(string index, string field, integer zoom, integer X, integer Y, PostData body, SearchMvtRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_mvt/{field:field}/{zoom:zoom}/{X:X}/{Y:Y}"), ctx, body, RequestParams(requestParameters));
///<summary>POST on /_search_shards <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse SearchShards<TResponse>(SearchShardsRequestParameters requestParameters = null)
Expand Down
22 changes: 22 additions & 0 deletions src/Elasticsearch.Net/IElasticLowLevelClient.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,28 @@ TResponse SearchUsingType<TResponse>(string index, string type, PostData body, S
[Obsolete("Deprecated in version 7.0.0: Specifying types in urls has been deprecated")]
Task<TResponse> SearchUsingTypeAsync<TResponse>(string index, string type, PostData body, SearchRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new();
///<summary>POST on /{index}/_mvt/{field}/{zoom}/{x}/{y} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html</para></summary>
///<param name = "index">Comma-separated list of data streams, indices, or aliases to search</param>
///<param name = "field">Field containing geospatial data to return</param>
///<param name = "zoom">Zoom level for the vector tile to search</param>
///<param name = "X">X coordinate for the vector tile to search</param>
///<param name = "Y">Y coordinate for the vector tile to search</param>
///<param name = "body">Search request body.</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
///<remarks>Note: Experimental within the Elasticsearch server, this functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded.</remarks>
TResponse SearchMvt<TResponse>(string index, string field, integer zoom, integer X, integer Y, PostData body, SearchMvtRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new();
///<summary>POST on /{index}/_mvt/{field}/{zoom}/{x}/{y} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html</para></summary>
///<param name = "index">Comma-separated list of data streams, indices, or aliases to search</param>
///<param name = "field">Field containing geospatial data to return</param>
///<param name = "zoom">Zoom level for the vector tile to search</param>
///<param name = "X">X coordinate for the vector tile to search</param>
///<param name = "Y">Y coordinate for the vector tile to search</param>
///<param name = "body">Search request body.</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
///<remarks>Note: Experimental within the Elasticsearch server, this functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded.</remarks>
Task<TResponse> SearchMvtAsync<TResponse>(string index, string field, integer zoom, integer X, integer Y, PostData body, SearchMvtRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new();
///<summary>POST on /_search_shards <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
TResponse SearchShards<TResponse>(SearchShardsRequestParameters requestParameters = null)
Expand Down

0 comments on commit 84030a1

Please sign in to comment.