Skip to content

Commit 1b469ae

Browse files
russcamswallez
authored andcommitted
Implement Body for Box<T> where T: Body + ?Sized
Some yaml integration tests specify inputs for bulk API calls using different types to represent documents e.g. objects intermixed with strings. Handle different body representations with Vec<Box<dyn Body>>
1 parent 8113b45 commit 1b469ae

40 files changed

+854
-853
lines changed

api_generator/src/generator/code_gen/request/request_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl<'a> RequestBuilder<'a> {
263263
let (fn_arg, field_arg, ret_ty) = if accepts_nd_body {
264264
(
265265
syn::parse_type("Vec<T>").unwrap(),
266-
quote!(Some(NdBody(body))),
266+
quote!(Some(NdBody::new(body))),
267267
syn::FunctionRetTy::Ty(code_gen::ty(
268268
format!("{}<'a, 'b, NdBody<T>> where T: Body", &builder_name).as_ref(),
269269
)),

elasticsearch/src/async_search.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'b> AsyncSearchDeleteParts<'b> {
6666
}
6767
}
6868
}
69-
#[doc = "Builder for the [Async Search Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nDeletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted."]
69+
#[doc = "Builder for the [Async Search Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/async-search.html)\n\nDeletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted."]
7070
#[derive(Clone, Debug)]
7171
pub struct AsyncSearchDelete<'a, 'b> {
7272
transport: &'a Transport,
@@ -184,7 +184,7 @@ impl<'b> AsyncSearchGetParts<'b> {
184184
}
185185
}
186186
}
187-
#[doc = "Builder for the [Async Search Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nRetrieves the results of a previously submitted async search request given its ID."]
187+
#[doc = "Builder for the [Async Search Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/async-search.html)\n\nRetrieves the results of a previously submitted async search request given its ID."]
188188
#[derive(Clone, Debug)]
189189
pub struct AsyncSearchGet<'a, 'b> {
190190
transport: &'a Transport,
@@ -329,7 +329,7 @@ impl<'b> AsyncSearchStatusParts<'b> {
329329
}
330330
}
331331
}
332-
#[doc = "Builder for the [Async Search Status API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nRetrieves the status of a previously submitted async search request given its ID."]
332+
#[doc = "Builder for the [Async Search Status API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/async-search.html)\n\nRetrieves the status of a previously submitted async search request given its ID."]
333333
#[derive(Clone, Debug)]
334334
pub struct AsyncSearchStatus<'a, 'b> {
335335
transport: &'a Transport,
@@ -453,7 +453,7 @@ impl<'b> AsyncSearchSubmitParts<'b> {
453453
}
454454
}
455455
}
456-
#[doc = "Builder for the [Async Search Submit API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nExecutes a search request asynchronously."]
456+
#[doc = "Builder for the [Async Search Submit API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/async-search.html)\n\nExecutes a search request asynchronously."]
457457
#[derive(Clone, Debug)]
458458
pub struct AsyncSearchSubmit<'a, 'b, B> {
459459
transport: &'a Transport,
@@ -1005,19 +1005,19 @@ impl<'a> AsyncSearch<'a> {
10051005
pub fn transport(&self) -> &Transport {
10061006
self.transport
10071007
}
1008-
#[doc = "[Async Search Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nDeletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted."]
1008+
#[doc = "[Async Search Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/async-search.html)\n\nDeletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted."]
10091009
pub fn delete<'b>(&'a self, parts: AsyncSearchDeleteParts<'b>) -> AsyncSearchDelete<'a, 'b> {
10101010
AsyncSearchDelete::new(self.transport(), parts)
10111011
}
1012-
#[doc = "[Async Search Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nRetrieves the results of a previously submitted async search request given its ID."]
1012+
#[doc = "[Async Search Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/async-search.html)\n\nRetrieves the results of a previously submitted async search request given its ID."]
10131013
pub fn get<'b>(&'a self, parts: AsyncSearchGetParts<'b>) -> AsyncSearchGet<'a, 'b> {
10141014
AsyncSearchGet::new(self.transport(), parts)
10151015
}
1016-
#[doc = "[Async Search Status API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nRetrieves the status of a previously submitted async search request given its ID."]
1016+
#[doc = "[Async Search Status API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/async-search.html)\n\nRetrieves the status of a previously submitted async search request given its ID."]
10171017
pub fn status<'b>(&'a self, parts: AsyncSearchStatusParts<'b>) -> AsyncSearchStatus<'a, 'b> {
10181018
AsyncSearchStatus::new(self.transport(), parts)
10191019
}
1020-
#[doc = "[Async Search Submit API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nExecutes a search request asynchronously."]
1020+
#[doc = "[Async Search Submit API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/async-search.html)\n\nExecutes a search request asynchronously."]
10211021
pub fn submit<'b>(
10221022
&'a self,
10231023
parts: AsyncSearchSubmitParts<'b>,

elasticsearch/src/autoscaling.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'b> AutoscalingDeleteAutoscalingPolicyParts<'b> {
6666
}
6767
}
6868
}
69-
#[doc = "Builder for the [Autoscaling Delete Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-delete-autoscaling-policy.html)\n\nDeletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
69+
#[doc = "Builder for the [Autoscaling Delete Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/autoscaling-delete-autoscaling-policy.html)\n\nDeletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
7070
#[derive(Clone, Debug)]
7171
pub struct AutoscalingDeleteAutoscalingPolicy<'a, 'b> {
7272
transport: &'a Transport,
@@ -181,7 +181,7 @@ impl AutoscalingGetAutoscalingCapacityParts {
181181
}
182182
}
183183
}
184-
#[doc = "Builder for the [Autoscaling Get Autoscaling Capacity API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-get-autoscaling-capacity.html)\n\nGets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
184+
#[doc = "Builder for the [Autoscaling Get Autoscaling Capacity API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/autoscaling-get-autoscaling-capacity.html)\n\nGets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
185185
#[derive(Clone, Debug)]
186186
pub struct AutoscalingGetAutoscalingCapacity<'a, 'b> {
187187
transport: &'a Transport,
@@ -299,7 +299,7 @@ impl<'b> AutoscalingGetAutoscalingPolicyParts<'b> {
299299
}
300300
}
301301
}
302-
#[doc = "Builder for the [Autoscaling Get Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-get-autoscaling-policy.html)\n\nRetrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
302+
#[doc = "Builder for the [Autoscaling Get Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/autoscaling-get-autoscaling-policy.html)\n\nRetrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
303303
#[derive(Clone, Debug)]
304304
pub struct AutoscalingGetAutoscalingPolicy<'a, 'b> {
305305
transport: &'a Transport,
@@ -417,7 +417,7 @@ impl<'b> AutoscalingPutAutoscalingPolicyParts<'b> {
417417
}
418418
}
419419
}
420-
#[doc = "Builder for the [Autoscaling Put Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-put-autoscaling-policy.html)\n\nCreates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
420+
#[doc = "Builder for the [Autoscaling Put Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/autoscaling-put-autoscaling-policy.html)\n\nCreates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
421421
#[derive(Clone, Debug)]
422422
pub struct AutoscalingPutAutoscalingPolicy<'a, 'b, B> {
423423
transport: &'a Transport,
@@ -550,25 +550,25 @@ impl<'a> Autoscaling<'a> {
550550
pub fn transport(&self) -> &Transport {
551551
self.transport
552552
}
553-
#[doc = "[Autoscaling Delete Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-delete-autoscaling-policy.html)\n\nDeletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
553+
#[doc = "[Autoscaling Delete Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/autoscaling-delete-autoscaling-policy.html)\n\nDeletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
554554
pub fn delete_autoscaling_policy<'b>(
555555
&'a self,
556556
parts: AutoscalingDeleteAutoscalingPolicyParts<'b>,
557557
) -> AutoscalingDeleteAutoscalingPolicy<'a, 'b> {
558558
AutoscalingDeleteAutoscalingPolicy::new(self.transport(), parts)
559559
}
560-
#[doc = "[Autoscaling Get Autoscaling Capacity API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-get-autoscaling-capacity.html)\n\nGets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
560+
#[doc = "[Autoscaling Get Autoscaling Capacity API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/autoscaling-get-autoscaling-capacity.html)\n\nGets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
561561
pub fn get_autoscaling_capacity<'b>(&'a self) -> AutoscalingGetAutoscalingCapacity<'a, 'b> {
562562
AutoscalingGetAutoscalingCapacity::new(self.transport())
563563
}
564-
#[doc = "[Autoscaling Get Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-get-autoscaling-policy.html)\n\nRetrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
564+
#[doc = "[Autoscaling Get Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/autoscaling-get-autoscaling-policy.html)\n\nRetrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
565565
pub fn get_autoscaling_policy<'b>(
566566
&'a self,
567567
parts: AutoscalingGetAutoscalingPolicyParts<'b>,
568568
) -> AutoscalingGetAutoscalingPolicy<'a, 'b> {
569569
AutoscalingGetAutoscalingPolicy::new(self.transport(), parts)
570570
}
571-
#[doc = "[Autoscaling Put Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-put-autoscaling-policy.html)\n\nCreates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
571+
#[doc = "[Autoscaling Put Autoscaling Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.3/autoscaling-put-autoscaling-policy.html)\n\nCreates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported."]
572572
pub fn put_autoscaling_policy<'b>(
573573
&'a self,
574574
parts: AutoscalingPutAutoscalingPolicyParts<'b>,

0 commit comments

Comments
 (0)