diff --git a/api_generator/src/generator/code_gen/request/request_builder.rs b/api_generator/src/generator/code_gen/request/request_builder.rs index 7997d7f5..2855174a 100644 --- a/api_generator/src/generator/code_gen/request/request_builder.rs +++ b/api_generator/src/generator/code_gen/request/request_builder.rs @@ -171,7 +171,7 @@ impl<'a> RequestBuilder<'a> { enum_builder: &EnumBuilder, default_fields: &[&syn::Ident], ) -> Tokens { - let (enum_ty, _, _) = enum_builder.clone().build(); + let (enum_ty, _, _, _) = enum_builder.clone().build(); let default_fields = Self::create_default_fields(default_fields); // default cat APIs to using text/plain Content-Type and Accept headers. Not all @@ -212,12 +212,14 @@ impl<'a> RequestBuilder<'a> { )); quote!( #doc - pub fn new(transport: &'a Transport, parts: #enum_ty) -> Self { - #headers - + pub fn new

(transport: &'a Transport, parts: P) -> Self + where P: Into<#enum_ty> + { + #headers + #builder_ident { transport, - parts, + parts: parts.into(), headers, #(#default_fields),*, } @@ -446,7 +448,7 @@ impl<'a> RequestBuilder<'a> { let supports_body = endpoint.supports_body(); let builder_ident = ident(builder_name); - let (enum_ty, enum_struct, enum_impl) = enum_builder.clone().build(); + let (enum_ty, enum_struct, enum_impl, from_impls) = enum_builder.clone().build(); // collect all the fields for the builder struct. Start with url parameters let mut fields: Vec = endpoint @@ -574,6 +576,8 @@ impl<'a> RequestBuilder<'a> { #enum_impl + #(#from_impls)* + #[derive(Clone, Debug)] #[doc = #builder_doc] pub struct #builder_expr { @@ -617,11 +621,15 @@ impl<'a> RequestBuilder<'a> { let i = ident(name); let b = builder_ident.clone(); - match (endpoint.supports_body(), is_root_method) { - (true, true) => (quote!(#i<'a, 'b>), quote!(#b<'a, 'b, ()>)), - (false, true) => (quote!(#i<'a, 'b>), quote!(#b<'a, 'b>)), - (true, false) => (quote!(#i<'b>), quote!(#b<'a, 'b, ()>)), - (false, false) => (quote!(#i<'b>), quote!(#b<'a, 'b>)), + match (endpoint.supports_body(), is_root_method, enum_builder.contains_single_parameterless_part()) { + (true, true, true) => (quote!(#i<'a, 'b>), quote!(#b<'a, 'b, ()>)), + (true, true, false) => (quote!(#i<'a, 'b, P>), quote!(#b<'a, 'b, ()>)), + (false, true, true) => (quote!(#i<'a, 'b>), quote!(#b<'a, 'b>)), + (false, true, false) => (quote!(#i<'a, 'b, P>), quote!(#b<'a, 'b>)), + (true, false, true) => (quote!(#i<'b>), quote!(#b<'a, 'b, ()>)), + (true, false, false) => (quote!(#i<'b, P>), quote!(#b<'a, 'b, ()>)), + (false, false, true) => (quote!(#i<'b>), quote!(#b<'a, 'b>)), + (false, false, false) => (quote!(#i<'b, P>), quote!(#b<'a, 'b>)), } }; @@ -672,10 +680,12 @@ impl<'a> RequestBuilder<'a> { } ) } else { - let (enum_ty, _, _) = enum_builder.clone().build(); + let (enum_ty, _, _, _) = enum_builder.clone().build(); quote!( #method_doc - pub fn #fn_name(&'a self, parts: #enum_ty) -> #builder_ident_ret { + pub fn #fn_name(&'a self, parts: P) -> #builder_ident_ret + where P: Into<#enum_ty> + { #builder_ident::new(#clone_expr, parts) } ) diff --git a/api_generator/src/generator/code_gen/url/enum_builder.rs b/api_generator/src/generator/code_gen/url/enum_builder.rs index 0e4cbb82..5342dc1a 100644 --- a/api_generator/src/generator/code_gen/url/enum_builder.rs +++ b/api_generator/src/generator/code_gen/url/enum_builder.rs @@ -40,6 +40,7 @@ use crate::generator::{ ApiEndpoint, Path, }; use inflector::Inflector; +use std::collections::HashSet; /// Builder for request url parts enum /// @@ -190,7 +191,7 @@ impl<'a> EnumBuilder<'a> { } /// Build this enum and return ASTs for its type, struct declaration and impl - pub fn build(self) -> (syn::Ty, syn::Item, syn::Item) { + pub fn build(self) -> (syn::Ty, syn::Item, syn::Item, Vec) { let variants = match self.variants.len() { 0 => vec![Self::parts_none()], _ => self.variants, @@ -223,6 +224,7 @@ impl<'a> EnumBuilder<'a> { body: Box::new(body), }); } + let match_expr: syn::Expr = syn::ExprKind::Match(Box::new(path_none("self").into_expr()), arms).into(); @@ -269,6 +271,114 @@ impl<'a> EnumBuilder<'a> { } }; + let from_impls = { + let mut from_impls = Vec::new(); + + // some APIs have more than one variant that accepts the same + // tuple struct of argument values. Emit a From impl only for the + // first one seen. + let mut seen_tys = HashSet::new(); + + for (variant, &path) in variants.iter().zip(self.paths.iter()) { + let tys: Vec = path + .path + .params() + .iter() + .map(|&p| { + let ty = &path.parts[p].ty; + typekind_to_ty(p, ty, true, false) + }) + .collect(); + + if tys.len() > 0 && seen_tys.insert(tys.clone()) { + let enum_ident = &self.ident; + let variant_ident = &variant.ident; + + let (fn_decl, stmt, path) = { + let (input_ty, stmt, from) = match tys.len() { + 1 => { + let ty = &tys[0]; + ( + ty.clone(), + quote!(#enum_ident::#variant_ident(t)), + quote!(From<#ty>), + ) + } + n => { + let input_ty = syn::Ty::Tup(tys.clone()); + let tuple_destr = { + let mut idents = Vec::with_capacity(n); + for i in 0..n { + idents.push(ident(format!("t.{}", i))) + } + idents + }; + + ( + input_ty, + quote!(#enum_ident::#variant_ident(#(#tuple_destr),*)), + quote!(From<(#(#tys),*)>), + ) + } + }; + + ( + syn::FnDecl { + inputs: vec![syn::FnArg::Captured( + syn::Pat::Path(None, path_none("t")), + input_ty, + )], + output: syn::FunctionRetTy::Ty(enum_ty.clone()), + variadic: false, + }, + syn::parse_expr(stmt.to_string().as_str()) + .unwrap() + .into_stmt(), + Some(syn::parse_path(from.to_string().as_str()).unwrap()), + ) + }; + + let item = syn::ImplItem { + ident: ident("from"), + vis: syn::Visibility::Inherited, + defaultness: syn::Defaultness::Final, + attrs: vec![doc(format!( + "Builds a [{}::{}] for the {} API", + enum_ident, variant_ident, self.api_name + ))], + node: syn::ImplItemKind::Method( + syn::MethodSig { + unsafety: syn::Unsafety::Normal, + constness: syn::Constness::NotConst, + abi: None, + decl: fn_decl, + generics: generics_none(), + }, + syn::Block { stmts: vec![stmt] }, + ), + }; + + let item = syn::Item { + ident: ident(""), + vis: syn::Visibility::Inherited, + attrs: vec![], + node: syn::ItemKind::Impl( + syn::Unsafety::Normal, + syn::ImplPolarity::Positive, + generics.clone(), + path, + Box::new(enum_ty.clone()), + vec![item], + ), + }; + + from_impls.push(item); + } + } + + from_impls + }; + let enum_decl = syn::Item { ident: self.ident, vis: syn::Visibility::Public, @@ -290,7 +400,7 @@ impl<'a> EnumBuilder<'a> { node: syn::ItemKind::Enum(variants, generics), }; - (enum_ty, enum_decl, enum_impl) + (enum_ty, enum_decl, enum_impl, from_impls) } } @@ -384,7 +494,7 @@ mod tests { }, ); - let (enum_ty, enum_decl, enum_impl) = EnumBuilder::from(&endpoint).build(); + let (enum_ty, enum_decl, enum_impl, _) = EnumBuilder::from(&endpoint).build(); assert_eq!(ty_b("SearchParts"), enum_ty); diff --git a/elasticsearch/src/generated/namespace_clients/async_search.rs b/elasticsearch/src/generated/namespace_clients/async_search.rs index b4a69877..50c5a498 100644 --- a/elasticsearch/src/generated/namespace_clients/async_search.rs +++ b/elasticsearch/src/generated/namespace_clients/async_search.rs @@ -58,6 +58,12 @@ impl<'b> AsyncSearchDeleteParts<'b> { } } } +impl<'b> From<&'b str> for AsyncSearchDeleteParts<'b> { + #[doc = "Builds a [AsyncSearchDeleteParts::Id] for the Async Search Delete API"] + fn from(t: &'b str) -> AsyncSearchDeleteParts<'b> { + AsyncSearchDeleteParts::Id(t) + } +} #[derive(Clone, Debug)] #[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."] pub struct AsyncSearchDelete<'a, 'b> { @@ -72,11 +78,14 @@ pub struct AsyncSearchDelete<'a, 'b> { } impl<'a, 'b> AsyncSearchDelete<'a, 'b> { #[doc = "Creates a new instance of [AsyncSearchDelete] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: AsyncSearchDeleteParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); AsyncSearchDelete { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -175,6 +184,12 @@ impl<'b> AsyncSearchGetParts<'b> { } } } +impl<'b> From<&'b str> for AsyncSearchGetParts<'b> { + #[doc = "Builds a [AsyncSearchGetParts::Id] for the Async Search Get API"] + fn from(t: &'b str) -> AsyncSearchGetParts<'b> { + AsyncSearchGetParts::Id(t) + } +} #[derive(Clone, Debug)] #[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."] pub struct AsyncSearchGet<'a, 'b> { @@ -192,11 +207,14 @@ pub struct AsyncSearchGet<'a, 'b> { } impl<'a, 'b> AsyncSearchGet<'a, 'b> { #[doc = "Creates a new instance of [AsyncSearchGet] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: AsyncSearchGetParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); AsyncSearchGet { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -328,6 +346,12 @@ impl<'b> AsyncSearchSubmitParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for AsyncSearchSubmitParts<'b> { + #[doc = "Builds a [AsyncSearchSubmitParts::Index] for the Async Search Submit API"] + fn from(t: &'b [&'b str]) -> AsyncSearchSubmitParts<'b> { + AsyncSearchSubmitParts::Index(t) + } +} #[derive(Clone, Debug)] #[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."] pub struct AsyncSearchSubmit<'a, 'b, B> { @@ -387,11 +411,14 @@ where B: Body, { #[doc = "Creates a new instance of [AsyncSearchSubmit] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: AsyncSearchSubmitParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); AsyncSearchSubmit { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -932,18 +959,24 @@ impl<'a> AsyncSearch<'a> { self.transport } #[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."] - pub fn delete<'b>(&'a self, parts: AsyncSearchDeleteParts<'b>) -> AsyncSearchDelete<'a, 'b> { + pub fn delete<'b, P>(&'a self, parts: P) -> AsyncSearchDelete<'a, 'b> + where + P: Into>, + { AsyncSearchDelete::new(self.transport(), parts) } #[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."] - pub fn get<'b>(&'a self, parts: AsyncSearchGetParts<'b>) -> AsyncSearchGet<'a, 'b> { + pub fn get<'b, P>(&'a self, parts: P) -> AsyncSearchGet<'a, 'b> + where + P: Into>, + { AsyncSearchGet::new(self.transport(), parts) } #[doc = "[Async Search Submit API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/async-search.html)\n\nExecutes a search request asynchronously."] - pub fn submit<'b>( - &'a self, - parts: AsyncSearchSubmitParts<'b>, - ) -> AsyncSearchSubmit<'a, 'b, ()> { + pub fn submit<'b, P>(&'a self, parts: P) -> AsyncSearchSubmit<'a, 'b, ()> + where + P: Into>, + { AsyncSearchSubmit::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/cat.rs b/elasticsearch/src/generated/namespace_clients/cat.rs index a2ace077..8acd4da9 100644 --- a/elasticsearch/src/generated/namespace_clients/cat.rs +++ b/elasticsearch/src/generated/namespace_clients/cat.rs @@ -63,6 +63,12 @@ impl<'b> CatAliasesParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatAliasesParts<'b> { + #[doc = "Builds a [CatAliasesParts::Name] for the Cat Aliases API"] + fn from(t: &'b [&'b str]) -> CatAliasesParts<'b> { + CatAliasesParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Aliases API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-alias.html)\n\nShows information about currently configured aliases to indices including filter and routing infos."] pub struct CatAliases<'a, 'b> { @@ -84,13 +90,16 @@ pub struct CatAliases<'a, 'b> { } impl<'a, 'b> CatAliases<'a, 'b> { #[doc = "Creates a new instance of [CatAliases] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatAliasesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatAliases { transport, - parts, + parts: parts.into(), headers, error_trace: None, expand_wildcards: None, @@ -260,6 +269,12 @@ impl<'b> CatAllocationParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatAllocationParts<'b> { + #[doc = "Builds a [CatAllocationParts::NodeId] for the Cat Allocation API"] + fn from(t: &'b [&'b str]) -> CatAllocationParts<'b> { + CatAllocationParts::NodeId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Allocation API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-allocation.html)\n\nProvides a snapshot of how many shards are allocated to each data node and how much disk space they are using."] pub struct CatAllocation<'a, 'b> { @@ -282,13 +297,16 @@ pub struct CatAllocation<'a, 'b> { } impl<'a, 'b> CatAllocation<'a, 'b> { #[doc = "Creates a new instance of [CatAllocation] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatAllocationParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatAllocation { transport, - parts, + parts: parts.into(), headers, bytes: None, error_trace: None, @@ -464,6 +482,12 @@ impl<'b> CatCountParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatCountParts<'b> { + #[doc = "Builds a [CatCountParts::Index] for the Cat Count API"] + fn from(t: &'b [&'b str]) -> CatCountParts<'b> { + CatCountParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Count API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-count.html)\n\nProvides quick access to the document count of the entire cluster, or individual indices."] pub struct CatCount<'a, 'b> { @@ -483,13 +507,16 @@ pub struct CatCount<'a, 'b> { } impl<'a, 'b> CatCount<'a, 'b> { #[doc = "Creates a new instance of [CatCount] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatCountParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatCount { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -638,6 +665,12 @@ impl<'b> CatFielddataParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatFielddataParts<'b> { + #[doc = "Builds a [CatFielddataParts::Fields] for the Cat Fielddata API"] + fn from(t: &'b [&'b str]) -> CatFielddataParts<'b> { + CatFielddataParts::Fields(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Fielddata API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-fielddata.html)\n\nShows how much heap memory is currently being used by fielddata on every data node in the cluster."] pub struct CatFielddata<'a, 'b> { @@ -659,13 +692,16 @@ pub struct CatFielddata<'a, 'b> { } impl<'a, 'b> CatFielddata<'a, 'b> { #[doc = "Creates a new instance of [CatFielddata] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatFielddataParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatFielddata { transport, - parts, + parts: parts.into(), headers, bytes: None, error_trace: None, @@ -1148,6 +1184,12 @@ impl<'b> CatIndicesParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatIndicesParts<'b> { + #[doc = "Builds a [CatIndicesParts::Index] for the Cat Indices API"] + fn from(t: &'b [&'b str]) -> CatIndicesParts<'b> { + CatIndicesParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Indices API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-indices.html)\n\nReturns information about indices: number of primaries and replicas, document counts, disk size, ..."] pub struct CatIndices<'a, 'b> { @@ -1175,13 +1217,16 @@ pub struct CatIndices<'a, 'b> { } impl<'a, 'b> CatIndices<'a, 'b> { #[doc = "Creates a new instance of [CatIndices] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatIndicesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatIndices { transport, - parts, + parts: parts.into(), headers, bytes: None, error_trace: None, @@ -1586,6 +1631,12 @@ impl<'b> CatMlDataFrameAnalyticsParts<'b> { } } } +impl<'b> From<&'b str> for CatMlDataFrameAnalyticsParts<'b> { + #[doc = "Builds a [CatMlDataFrameAnalyticsParts::Id] for the Cat Ml Data Frame Analytics API"] + fn from(t: &'b str) -> CatMlDataFrameAnalyticsParts<'b> { + CatMlDataFrameAnalyticsParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Ml Data Frame Analytics API](http://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-dfanalytics.html)\n\nGets configuration and usage information about data frame analytics jobs."] pub struct CatMlDataFrameAnalytics<'a, 'b> { @@ -1608,13 +1659,16 @@ pub struct CatMlDataFrameAnalytics<'a, 'b> { } impl<'a, 'b> CatMlDataFrameAnalytics<'a, 'b> { #[doc = "Creates a new instance of [CatMlDataFrameAnalytics] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatMlDataFrameAnalyticsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatMlDataFrameAnalytics { transport, - parts, + parts: parts.into(), headers, allow_no_match: None, bytes: None, @@ -1789,6 +1843,12 @@ impl<'b> CatMlDatafeedsParts<'b> { } } } +impl<'b> From<&'b str> for CatMlDatafeedsParts<'b> { + #[doc = "Builds a [CatMlDatafeedsParts::DatafeedId] for the Cat Ml Datafeeds API"] + fn from(t: &'b str) -> CatMlDatafeedsParts<'b> { + CatMlDatafeedsParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Ml Datafeeds API](http://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-datafeeds.html)\n\nGets configuration and usage information about datafeeds."] pub struct CatMlDatafeeds<'a, 'b> { @@ -1810,13 +1870,16 @@ pub struct CatMlDatafeeds<'a, 'b> { } impl<'a, 'b> CatMlDatafeeds<'a, 'b> { #[doc = "Creates a new instance of [CatMlDatafeeds] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatMlDatafeedsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatMlDatafeeds { transport, - parts, + parts: parts.into(), headers, allow_no_datafeeds: None, error_trace: None, @@ -1982,6 +2045,12 @@ impl<'b> CatMlJobsParts<'b> { } } } +impl<'b> From<&'b str> for CatMlJobsParts<'b> { + #[doc = "Builds a [CatMlJobsParts::JobId] for the Cat Ml Jobs API"] + fn from(t: &'b str) -> CatMlJobsParts<'b> { + CatMlJobsParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Ml Jobs API](http://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-anomaly-detectors.html)\n\nGets configuration and usage information about anomaly detection jobs."] pub struct CatMlJobs<'a, 'b> { @@ -2004,13 +2073,16 @@ pub struct CatMlJobs<'a, 'b> { } impl<'a, 'b> CatMlJobs<'a, 'b> { #[doc = "Creates a new instance of [CatMlJobs] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatMlJobsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatMlJobs { transport, - parts, + parts: parts.into(), headers, allow_no_jobs: None, bytes: None, @@ -2185,6 +2257,12 @@ impl<'b> CatMlTrainedModelsParts<'b> { } } } +impl<'b> From<&'b str> for CatMlTrainedModelsParts<'b> { + #[doc = "Builds a [CatMlTrainedModelsParts::ModelId] for the Cat Ml Trained Models API"] + fn from(t: &'b str) -> CatMlTrainedModelsParts<'b> { + CatMlTrainedModelsParts::ModelId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Ml Trained Models API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-trained-model.html)\n\nGets configuration and usage information about inference trained models."] pub struct CatMlTrainedModels<'a, 'b> { @@ -2209,13 +2287,16 @@ pub struct CatMlTrainedModels<'a, 'b> { } impl<'a, 'b> CatMlTrainedModels<'a, 'b> { #[doc = "Creates a new instance of [CatMlTrainedModels] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatMlTrainedModelsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatMlTrainedModels { transport, - parts, + parts: parts.into(), headers, allow_no_match: None, bytes: None, @@ -3171,6 +3252,12 @@ impl<'b> CatRecoveryParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatRecoveryParts<'b> { + #[doc = "Builds a [CatRecoveryParts::Index] for the Cat Recovery API"] + fn from(t: &'b [&'b str]) -> CatRecoveryParts<'b> { + CatRecoveryParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Recovery API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-recovery.html)\n\nReturns information about index shard recoveries, both on-going completed."] pub struct CatRecovery<'a, 'b> { @@ -3195,13 +3282,16 @@ pub struct CatRecovery<'a, 'b> { } impl<'a, 'b> CatRecovery<'a, 'b> { #[doc = "Creates a new instance of [CatRecovery] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatRecoveryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatRecovery { transport, - parts, + parts: parts.into(), headers, active_only: None, bytes: None, @@ -3578,6 +3668,12 @@ impl<'b> CatSegmentsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatSegmentsParts<'b> { + #[doc = "Builds a [CatSegmentsParts::Index] for the Cat Segments API"] + fn from(t: &'b [&'b str]) -> CatSegmentsParts<'b> { + CatSegmentsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Segments API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-segments.html)\n\nProvides low-level information about the segments in the shards of an index."] pub struct CatSegments<'a, 'b> { @@ -3598,13 +3694,16 @@ pub struct CatSegments<'a, 'b> { } impl<'a, 'b> CatSegments<'a, 'b> { #[doc = "Creates a new instance of [CatSegments] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatSegmentsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatSegments { transport, - parts, + parts: parts.into(), headers, bytes: None, error_trace: None, @@ -3762,6 +3861,12 @@ impl<'b> CatShardsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatShardsParts<'b> { + #[doc = "Builds a [CatShardsParts::Index] for the Cat Shards API"] + fn from(t: &'b [&'b str]) -> CatShardsParts<'b> { + CatShardsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Shards API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-shards.html)\n\nProvides a detailed view of shard allocation on nodes."] pub struct CatShards<'a, 'b> { @@ -3785,13 +3890,16 @@ pub struct CatShards<'a, 'b> { } impl<'a, 'b> CatShards<'a, 'b> { #[doc = "Creates a new instance of [CatShards] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatShardsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatShards { transport, - parts, + parts: parts.into(), headers, bytes: None, error_trace: None, @@ -3976,6 +4084,12 @@ impl<'b> CatSnapshotsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatSnapshotsParts<'b> { + #[doc = "Builds a [CatSnapshotsParts::Repository] for the Cat Snapshots API"] + fn from(t: &'b [&'b str]) -> CatSnapshotsParts<'b> { + CatSnapshotsParts::Repository(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Snapshots API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-snapshots.html)\n\nReturns all snapshots in a specific repository."] pub struct CatSnapshots<'a, 'b> { @@ -3998,13 +4112,16 @@ pub struct CatSnapshots<'a, 'b> { } impl<'a, 'b> CatSnapshots<'a, 'b> { #[doc = "Creates a new instance of [CatSnapshots] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatSnapshotsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatSnapshots { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -4397,6 +4514,12 @@ impl<'b> CatTemplatesParts<'b> { } } } +impl<'b> From<&'b str> for CatTemplatesParts<'b> { + #[doc = "Builds a [CatTemplatesParts::Name] for the Cat Templates API"] + fn from(t: &'b str) -> CatTemplatesParts<'b> { + CatTemplatesParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Templates API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-templates.html)\n\nReturns information about existing templates."] pub struct CatTemplates<'a, 'b> { @@ -4418,13 +4541,16 @@ pub struct CatTemplates<'a, 'b> { } impl<'a, 'b> CatTemplates<'a, 'b> { #[doc = "Creates a new instance of [CatTemplates] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatTemplatesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatTemplates { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -4591,6 +4717,12 @@ impl<'b> CatThreadPoolParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CatThreadPoolParts<'b> { + #[doc = "Builds a [CatThreadPoolParts::ThreadPoolPatterns] for the Cat Thread Pool API"] + fn from(t: &'b [&'b str]) -> CatThreadPoolParts<'b> { + CatThreadPoolParts::ThreadPoolPatterns(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Thread Pool API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-thread-pool.html)\n\nReturns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools."] pub struct CatThreadPool<'a, 'b> { @@ -4613,13 +4745,16 @@ pub struct CatThreadPool<'a, 'b> { } impl<'a, 'b> CatThreadPool<'a, 'b> { #[doc = "Creates a new instance of [CatThreadPool] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatThreadPoolParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatThreadPool { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -4794,6 +4929,12 @@ impl<'b> CatTransformsParts<'b> { } } } +impl<'b> From<&'b str> for CatTransformsParts<'b> { + #[doc = "Builds a [CatTransformsParts::TransformId] for the Cat Transforms API"] + fn from(t: &'b str) -> CatTransformsParts<'b> { + CatTransformsParts::TransformId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cat Transforms API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-transforms.html)\n\nGets configuration and usage information about transforms."] pub struct CatTransforms<'a, 'b> { @@ -4817,13 +4958,16 @@ pub struct CatTransforms<'a, 'b> { } impl<'a, 'b> CatTransforms<'a, 'b> { #[doc = "Creates a new instance of [CatTransforms] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CatTransformsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let mut headers = HeaderMap::with_capacity(2); headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain")); headers.insert(ACCEPT, HeaderValue::from_static("text/plain")); CatTransforms { transport, - parts, + parts: parts.into(), headers, allow_no_match: None, error_trace: None, @@ -4996,19 +5140,31 @@ impl<'a> Cat<'a> { self.transport } #[doc = "[Cat Aliases API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-alias.html)\n\nShows information about currently configured aliases to indices including filter and routing infos."] - pub fn aliases<'b>(&'a self, parts: CatAliasesParts<'b>) -> CatAliases<'a, 'b> { + pub fn aliases<'b, P>(&'a self, parts: P) -> CatAliases<'a, 'b> + where + P: Into>, + { CatAliases::new(self.transport(), parts) } #[doc = "[Cat Allocation API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-allocation.html)\n\nProvides a snapshot of how many shards are allocated to each data node and how much disk space they are using."] - pub fn allocation<'b>(&'a self, parts: CatAllocationParts<'b>) -> CatAllocation<'a, 'b> { + pub fn allocation<'b, P>(&'a self, parts: P) -> CatAllocation<'a, 'b> + where + P: Into>, + { CatAllocation::new(self.transport(), parts) } #[doc = "[Cat Count API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-count.html)\n\nProvides quick access to the document count of the entire cluster, or individual indices."] - pub fn count<'b>(&'a self, parts: CatCountParts<'b>) -> CatCount<'a, 'b> { + pub fn count<'b, P>(&'a self, parts: P) -> CatCount<'a, 'b> + where + P: Into>, + { CatCount::new(self.transport(), parts) } #[doc = "[Cat Fielddata API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-fielddata.html)\n\nShows how much heap memory is currently being used by fielddata on every data node in the cluster."] - pub fn fielddata<'b>(&'a self, parts: CatFielddataParts<'b>) -> CatFielddata<'a, 'b> { + pub fn fielddata<'b, P>(&'a self, parts: P) -> CatFielddata<'a, 'b> + where + P: Into>, + { CatFielddata::new(self.transport(), parts) } #[doc = "[Cat Health API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-health.html)\n\nReturns a concise representation of the cluster health."] @@ -5020,7 +5176,10 @@ impl<'a> Cat<'a> { CatHelp::new(self.transport()) } #[doc = "[Cat Indices API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-indices.html)\n\nReturns information about indices: number of primaries and replicas, document counts, disk size, ..."] - pub fn indices<'b>(&'a self, parts: CatIndicesParts<'b>) -> CatIndices<'a, 'b> { + pub fn indices<'b, P>(&'a self, parts: P) -> CatIndices<'a, 'b> + where + P: Into>, + { CatIndices::new(self.transport(), parts) } #[doc = "[Cat Master API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-master.html)\n\nReturns information about the master node."] @@ -5028,25 +5187,31 @@ impl<'a> Cat<'a> { CatMaster::new(self.transport()) } #[doc = "[Cat Ml Data Frame Analytics API](http://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-dfanalytics.html)\n\nGets configuration and usage information about data frame analytics jobs."] - pub fn ml_data_frame_analytics<'b>( - &'a self, - parts: CatMlDataFrameAnalyticsParts<'b>, - ) -> CatMlDataFrameAnalytics<'a, 'b> { + pub fn ml_data_frame_analytics<'b, P>(&'a self, parts: P) -> CatMlDataFrameAnalytics<'a, 'b> + where + P: Into>, + { CatMlDataFrameAnalytics::new(self.transport(), parts) } #[doc = "[Cat Ml Datafeeds API](http://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-datafeeds.html)\n\nGets configuration and usage information about datafeeds."] - pub fn ml_datafeeds<'b>(&'a self, parts: CatMlDatafeedsParts<'b>) -> CatMlDatafeeds<'a, 'b> { + pub fn ml_datafeeds<'b, P>(&'a self, parts: P) -> CatMlDatafeeds<'a, 'b> + where + P: Into>, + { CatMlDatafeeds::new(self.transport(), parts) } #[doc = "[Cat Ml Jobs API](http://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-anomaly-detectors.html)\n\nGets configuration and usage information about anomaly detection jobs."] - pub fn ml_jobs<'b>(&'a self, parts: CatMlJobsParts<'b>) -> CatMlJobs<'a, 'b> { + pub fn ml_jobs<'b, P>(&'a self, parts: P) -> CatMlJobs<'a, 'b> + where + P: Into>, + { CatMlJobs::new(self.transport(), parts) } #[doc = "[Cat Ml Trained Models API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-trained-model.html)\n\nGets configuration and usage information about inference trained models."] - pub fn ml_trained_models<'b>( - &'a self, - parts: CatMlTrainedModelsParts<'b>, - ) -> CatMlTrainedModels<'a, 'b> { + pub fn ml_trained_models<'b, P>(&'a self, parts: P) -> CatMlTrainedModels<'a, 'b> + where + P: Into>, + { CatMlTrainedModels::new(self.transport(), parts) } #[doc = "[Cat Nodeattrs API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-nodeattrs.html)\n\nReturns information about custom node attributes."] @@ -5066,7 +5231,10 @@ impl<'a> Cat<'a> { CatPlugins::new(self.transport()) } #[doc = "[Cat Recovery API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-recovery.html)\n\nReturns information about index shard recoveries, both on-going completed."] - pub fn recovery<'b>(&'a self, parts: CatRecoveryParts<'b>) -> CatRecovery<'a, 'b> { + pub fn recovery<'b, P>(&'a self, parts: P) -> CatRecovery<'a, 'b> + where + P: Into>, + { CatRecovery::new(self.transport(), parts) } #[doc = "[Cat Repositories API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-repositories.html)\n\nReturns information about snapshot repositories registered in the cluster."] @@ -5074,15 +5242,24 @@ impl<'a> Cat<'a> { CatRepositories::new(self.transport()) } #[doc = "[Cat Segments API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-segments.html)\n\nProvides low-level information about the segments in the shards of an index."] - pub fn segments<'b>(&'a self, parts: CatSegmentsParts<'b>) -> CatSegments<'a, 'b> { + pub fn segments<'b, P>(&'a self, parts: P) -> CatSegments<'a, 'b> + where + P: Into>, + { CatSegments::new(self.transport(), parts) } #[doc = "[Cat Shards API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-shards.html)\n\nProvides a detailed view of shard allocation on nodes."] - pub fn shards<'b>(&'a self, parts: CatShardsParts<'b>) -> CatShards<'a, 'b> { + pub fn shards<'b, P>(&'a self, parts: P) -> CatShards<'a, 'b> + where + P: Into>, + { CatShards::new(self.transport(), parts) } #[doc = "[Cat Snapshots API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-snapshots.html)\n\nReturns all snapshots in a specific repository."] - pub fn snapshots<'b>(&'a self, parts: CatSnapshotsParts<'b>) -> CatSnapshots<'a, 'b> { + pub fn snapshots<'b, P>(&'a self, parts: P) -> CatSnapshots<'a, 'b> + where + P: Into>, + { CatSnapshots::new(self.transport(), parts) } #[doc = "[Cat Tasks API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html)\n\nReturns information about the tasks currently executing on one or more nodes in the cluster."] @@ -5090,15 +5267,24 @@ impl<'a> Cat<'a> { CatTasks::new(self.transport()) } #[doc = "[Cat Templates API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-templates.html)\n\nReturns information about existing templates."] - pub fn templates<'b>(&'a self, parts: CatTemplatesParts<'b>) -> CatTemplates<'a, 'b> { + pub fn templates<'b, P>(&'a self, parts: P) -> CatTemplates<'a, 'b> + where + P: Into>, + { CatTemplates::new(self.transport(), parts) } #[doc = "[Cat Thread Pool API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-thread-pool.html)\n\nReturns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools."] - pub fn thread_pool<'b>(&'a self, parts: CatThreadPoolParts<'b>) -> CatThreadPool<'a, 'b> { + pub fn thread_pool<'b, P>(&'a self, parts: P) -> CatThreadPool<'a, 'b> + where + P: Into>, + { CatThreadPool::new(self.transport(), parts) } #[doc = "[Cat Transforms API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-transforms.html)\n\nGets configuration and usage information about transforms."] - pub fn transforms<'b>(&'a self, parts: CatTransformsParts<'b>) -> CatTransforms<'a, 'b> { + pub fn transforms<'b, P>(&'a self, parts: P) -> CatTransforms<'a, 'b> + where + P: Into>, + { CatTransforms::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/ccr.rs b/elasticsearch/src/generated/namespace_clients/ccr.rs index 7d5946e5..00d79ccc 100644 --- a/elasticsearch/src/generated/namespace_clients/ccr.rs +++ b/elasticsearch/src/generated/namespace_clients/ccr.rs @@ -58,6 +58,12 @@ impl<'b> CcrDeleteAutoFollowPatternParts<'b> { } } } +impl<'b> From<&'b str> for CcrDeleteAutoFollowPatternParts<'b> { + #[doc = "Builds a [CcrDeleteAutoFollowPatternParts::Name] for the Ccr Delete Auto Follow Pattern API"] + fn from(t: &'b str) -> CcrDeleteAutoFollowPatternParts<'b> { + CcrDeleteAutoFollowPatternParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Delete Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-delete-auto-follow-pattern.html)\n\nDeletes auto-follow patterns."] pub struct CcrDeleteAutoFollowPattern<'a, 'b> { @@ -72,11 +78,14 @@ pub struct CcrDeleteAutoFollowPattern<'a, 'b> { } impl<'a, 'b> CcrDeleteAutoFollowPattern<'a, 'b> { #[doc = "Creates a new instance of [CcrDeleteAutoFollowPattern] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrDeleteAutoFollowPatternParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrDeleteAutoFollowPattern { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -177,6 +186,12 @@ impl<'b> CcrFollowParts<'b> { } } } +impl<'b> From<&'b str> for CcrFollowParts<'b> { + #[doc = "Builds a [CcrFollowParts::Index] for the Ccr Follow API"] + fn from(t: &'b str) -> CcrFollowParts<'b> { + CcrFollowParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Follow API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-put-follow.html)\n\nCreates a new follower index configured to follow the referenced leader index."] pub struct CcrFollow<'a, 'b, B> { @@ -196,11 +211,14 @@ where B: Body, { #[doc = "Creates a new instance of [CcrFollow] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrFollowParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrFollow { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -330,6 +348,12 @@ impl<'b> CcrFollowInfoParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CcrFollowInfoParts<'b> { + #[doc = "Builds a [CcrFollowInfoParts::Index] for the Ccr Follow Info API"] + fn from(t: &'b [&'b str]) -> CcrFollowInfoParts<'b> { + CcrFollowInfoParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Follow Info API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-follow-info.html)\n\nRetrieves information about all follower indices, including parameters and status for each follower index"] pub struct CcrFollowInfo<'a, 'b> { @@ -344,11 +368,14 @@ pub struct CcrFollowInfo<'a, 'b> { } impl<'a, 'b> CcrFollowInfo<'a, 'b> { #[doc = "Creates a new instance of [CcrFollowInfo] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrFollowInfoParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrFollowInfo { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -450,6 +477,12 @@ impl<'b> CcrFollowStatsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CcrFollowStatsParts<'b> { + #[doc = "Builds a [CcrFollowStatsParts::Index] for the Ccr Follow Stats API"] + fn from(t: &'b [&'b str]) -> CcrFollowStatsParts<'b> { + CcrFollowStatsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Follow Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-follow-stats.html)\n\nRetrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices."] pub struct CcrFollowStats<'a, 'b> { @@ -464,11 +497,14 @@ pub struct CcrFollowStats<'a, 'b> { } impl<'a, 'b> CcrFollowStats<'a, 'b> { #[doc = "Creates a new instance of [CcrFollowStats] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrFollowStatsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrFollowStats { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -569,6 +605,12 @@ impl<'b> CcrForgetFollowerParts<'b> { } } } +impl<'b> From<&'b str> for CcrForgetFollowerParts<'b> { + #[doc = "Builds a [CcrForgetFollowerParts::Index] for the Ccr Forget Follower API"] + fn from(t: &'b str) -> CcrForgetFollowerParts<'b> { + CcrForgetFollowerParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Forget Follower API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-forget-follower.html)\n\nRemoves the follower retention leases from the leader."] pub struct CcrForgetFollower<'a, 'b, B> { @@ -587,11 +629,14 @@ where B: Body, { #[doc = "Creates a new instance of [CcrForgetFollower] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrForgetFollowerParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrForgetFollower { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -711,6 +756,12 @@ impl<'b> CcrGetAutoFollowPatternParts<'b> { } } } +impl<'b> From<&'b str> for CcrGetAutoFollowPatternParts<'b> { + #[doc = "Builds a [CcrGetAutoFollowPatternParts::Name] for the Ccr Get Auto Follow Pattern API"] + fn from(t: &'b str) -> CcrGetAutoFollowPatternParts<'b> { + CcrGetAutoFollowPatternParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Get Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-auto-follow-pattern.html)\n\nGets configured auto-follow patterns. Returns the specified auto-follow pattern collection."] pub struct CcrGetAutoFollowPattern<'a, 'b> { @@ -725,11 +776,14 @@ pub struct CcrGetAutoFollowPattern<'a, 'b> { } impl<'a, 'b> CcrGetAutoFollowPattern<'a, 'b> { #[doc = "Creates a new instance of [CcrGetAutoFollowPattern] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrGetAutoFollowPatternParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrGetAutoFollowPattern { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -829,6 +883,12 @@ impl<'b> CcrPauseAutoFollowPatternParts<'b> { } } } +impl<'b> From<&'b str> for CcrPauseAutoFollowPatternParts<'b> { + #[doc = "Builds a [CcrPauseAutoFollowPatternParts::Name] for the Ccr Pause Auto Follow Pattern API"] + fn from(t: &'b str) -> CcrPauseAutoFollowPatternParts<'b> { + CcrPauseAutoFollowPatternParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Pause Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-pause-auto-follow-pattern.html)\n\nPauses an auto-follow pattern"] pub struct CcrPauseAutoFollowPattern<'a, 'b, B> { @@ -847,11 +907,14 @@ where B: Body, { #[doc = "Creates a new instance of [CcrPauseAutoFollowPattern] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrPauseAutoFollowPatternParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrPauseAutoFollowPattern { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -970,6 +1033,12 @@ impl<'b> CcrPauseFollowParts<'b> { } } } +impl<'b> From<&'b str> for CcrPauseFollowParts<'b> { + #[doc = "Builds a [CcrPauseFollowParts::Index] for the Ccr Pause Follow API"] + fn from(t: &'b str) -> CcrPauseFollowParts<'b> { + CcrPauseFollowParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Pause Follow API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-pause-follow.html)\n\nPauses a follower index. The follower index will not fetch any additional operations from the leader index."] pub struct CcrPauseFollow<'a, 'b, B> { @@ -988,11 +1057,14 @@ where B: Body, { #[doc = "Creates a new instance of [CcrPauseFollow] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrPauseFollowParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrPauseFollow { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1109,6 +1181,12 @@ impl<'b> CcrPutAutoFollowPatternParts<'b> { } } } +impl<'b> From<&'b str> for CcrPutAutoFollowPatternParts<'b> { + #[doc = "Builds a [CcrPutAutoFollowPatternParts::Name] for the Ccr Put Auto Follow Pattern API"] + fn from(t: &'b str) -> CcrPutAutoFollowPatternParts<'b> { + CcrPutAutoFollowPatternParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Put Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-put-auto-follow-pattern.html)\n\nCreates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices."] pub struct CcrPutAutoFollowPattern<'a, 'b, B> { @@ -1127,11 +1205,14 @@ where B: Body, { #[doc = "Creates a new instance of [CcrPutAutoFollowPattern] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrPutAutoFollowPatternParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrPutAutoFollowPattern { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1249,6 +1330,12 @@ impl<'b> CcrResumeAutoFollowPatternParts<'b> { } } } +impl<'b> From<&'b str> for CcrResumeAutoFollowPatternParts<'b> { + #[doc = "Builds a [CcrResumeAutoFollowPatternParts::Name] for the Ccr Resume Auto Follow Pattern API"] + fn from(t: &'b str) -> CcrResumeAutoFollowPatternParts<'b> { + CcrResumeAutoFollowPatternParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Resume Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-resume-auto-follow-pattern.html)\n\nResumes an auto-follow pattern that has been paused"] pub struct CcrResumeAutoFollowPattern<'a, 'b, B> { @@ -1267,11 +1354,14 @@ where B: Body, { #[doc = "Creates a new instance of [CcrResumeAutoFollowPattern] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrResumeAutoFollowPatternParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrResumeAutoFollowPattern { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1390,6 +1480,12 @@ impl<'b> CcrResumeFollowParts<'b> { } } } +impl<'b> From<&'b str> for CcrResumeFollowParts<'b> { + #[doc = "Builds a [CcrResumeFollowParts::Index] for the Ccr Resume Follow API"] + fn from(t: &'b str) -> CcrResumeFollowParts<'b> { + CcrResumeFollowParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Resume Follow API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-resume-follow.html)\n\nResumes a follower index that has been paused"] pub struct CcrResumeFollow<'a, 'b, B> { @@ -1408,11 +1504,14 @@ where B: Body, { #[doc = "Creates a new instance of [CcrResumeFollow] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrResumeFollowParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrResumeFollow { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1642,6 +1741,12 @@ impl<'b> CcrUnfollowParts<'b> { } } } +impl<'b> From<&'b str> for CcrUnfollowParts<'b> { + #[doc = "Builds a [CcrUnfollowParts::Index] for the Ccr Unfollow API"] + fn from(t: &'b str) -> CcrUnfollowParts<'b> { + CcrUnfollowParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ccr Unfollow API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-unfollow.html)\n\nStops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication."] pub struct CcrUnfollow<'a, 'b, B> { @@ -1660,11 +1765,14 @@ where B: Body, { #[doc = "Creates a new instance of [CcrUnfollow] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CcrUnfollowParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); CcrUnfollow { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1774,71 +1882,89 @@ impl<'a> Ccr<'a> { self.transport } #[doc = "[Ccr Delete Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-delete-auto-follow-pattern.html)\n\nDeletes auto-follow patterns."] - pub fn delete_auto_follow_pattern<'b>( + pub fn delete_auto_follow_pattern<'b, P>( &'a self, - parts: CcrDeleteAutoFollowPatternParts<'b>, - ) -> CcrDeleteAutoFollowPattern<'a, 'b> { + parts: P, + ) -> CcrDeleteAutoFollowPattern<'a, 'b> + where + P: Into>, + { CcrDeleteAutoFollowPattern::new(self.transport(), parts) } #[doc = "[Ccr Follow API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-put-follow.html)\n\nCreates a new follower index configured to follow the referenced leader index."] - pub fn follow<'b>(&'a self, parts: CcrFollowParts<'b>) -> CcrFollow<'a, 'b, ()> { + pub fn follow<'b, P>(&'a self, parts: P) -> CcrFollow<'a, 'b, ()> + where + P: Into>, + { CcrFollow::new(self.transport(), parts) } #[doc = "[Ccr Follow Info API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-follow-info.html)\n\nRetrieves information about all follower indices, including parameters and status for each follower index"] - pub fn follow_info<'b>(&'a self, parts: CcrFollowInfoParts<'b>) -> CcrFollowInfo<'a, 'b> { + pub fn follow_info<'b, P>(&'a self, parts: P) -> CcrFollowInfo<'a, 'b> + where + P: Into>, + { CcrFollowInfo::new(self.transport(), parts) } #[doc = "[Ccr Follow Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-follow-stats.html)\n\nRetrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices."] - pub fn follow_stats<'b>(&'a self, parts: CcrFollowStatsParts<'b>) -> CcrFollowStats<'a, 'b> { + pub fn follow_stats<'b, P>(&'a self, parts: P) -> CcrFollowStats<'a, 'b> + where + P: Into>, + { CcrFollowStats::new(self.transport(), parts) } #[doc = "[Ccr Forget Follower API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-forget-follower.html)\n\nRemoves the follower retention leases from the leader."] - pub fn forget_follower<'b>( - &'a self, - parts: CcrForgetFollowerParts<'b>, - ) -> CcrForgetFollower<'a, 'b, ()> { + pub fn forget_follower<'b, P>(&'a self, parts: P) -> CcrForgetFollower<'a, 'b, ()> + where + P: Into>, + { CcrForgetFollower::new(self.transport(), parts) } #[doc = "[Ccr Get Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-auto-follow-pattern.html)\n\nGets configured auto-follow patterns. Returns the specified auto-follow pattern collection."] - pub fn get_auto_follow_pattern<'b>( - &'a self, - parts: CcrGetAutoFollowPatternParts<'b>, - ) -> CcrGetAutoFollowPattern<'a, 'b> { + pub fn get_auto_follow_pattern<'b, P>(&'a self, parts: P) -> CcrGetAutoFollowPattern<'a, 'b> + where + P: Into>, + { CcrGetAutoFollowPattern::new(self.transport(), parts) } #[doc = "[Ccr Pause Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-pause-auto-follow-pattern.html)\n\nPauses an auto-follow pattern"] - pub fn pause_auto_follow_pattern<'b>( + pub fn pause_auto_follow_pattern<'b, P>( &'a self, - parts: CcrPauseAutoFollowPatternParts<'b>, - ) -> CcrPauseAutoFollowPattern<'a, 'b, ()> { + parts: P, + ) -> CcrPauseAutoFollowPattern<'a, 'b, ()> + where + P: Into>, + { CcrPauseAutoFollowPattern::new(self.transport(), parts) } #[doc = "[Ccr Pause Follow API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-pause-follow.html)\n\nPauses a follower index. The follower index will not fetch any additional operations from the leader index."] - pub fn pause_follow<'b>( - &'a self, - parts: CcrPauseFollowParts<'b>, - ) -> CcrPauseFollow<'a, 'b, ()> { + pub fn pause_follow<'b, P>(&'a self, parts: P) -> CcrPauseFollow<'a, 'b, ()> + where + P: Into>, + { CcrPauseFollow::new(self.transport(), parts) } #[doc = "[Ccr Put Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-put-auto-follow-pattern.html)\n\nCreates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices."] - pub fn put_auto_follow_pattern<'b>( - &'a self, - parts: CcrPutAutoFollowPatternParts<'b>, - ) -> CcrPutAutoFollowPattern<'a, 'b, ()> { + pub fn put_auto_follow_pattern<'b, P>(&'a self, parts: P) -> CcrPutAutoFollowPattern<'a, 'b, ()> + where + P: Into>, + { CcrPutAutoFollowPattern::new(self.transport(), parts) } #[doc = "[Ccr Resume Auto Follow Pattern API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-resume-auto-follow-pattern.html)\n\nResumes an auto-follow pattern that has been paused"] - pub fn resume_auto_follow_pattern<'b>( + pub fn resume_auto_follow_pattern<'b, P>( &'a self, - parts: CcrResumeAutoFollowPatternParts<'b>, - ) -> CcrResumeAutoFollowPattern<'a, 'b, ()> { + parts: P, + ) -> CcrResumeAutoFollowPattern<'a, 'b, ()> + where + P: Into>, + { CcrResumeAutoFollowPattern::new(self.transport(), parts) } #[doc = "[Ccr Resume Follow API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-resume-follow.html)\n\nResumes a follower index that has been paused"] - pub fn resume_follow<'b>( - &'a self, - parts: CcrResumeFollowParts<'b>, - ) -> CcrResumeFollow<'a, 'b, ()> { + pub fn resume_follow<'b, P>(&'a self, parts: P) -> CcrResumeFollow<'a, 'b, ()> + where + P: Into>, + { CcrResumeFollow::new(self.transport(), parts) } #[doc = "[Ccr Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-stats.html)\n\nGets all stats related to cross-cluster replication."] @@ -1846,7 +1972,10 @@ impl<'a> Ccr<'a> { CcrStats::new(self.transport()) } #[doc = "[Ccr Unfollow API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-unfollow.html)\n\nStops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication."] - pub fn unfollow<'b>(&'a self, parts: CcrUnfollowParts<'b>) -> CcrUnfollow<'a, 'b, ()> { + pub fn unfollow<'b, P>(&'a self, parts: P) -> CcrUnfollow<'a, 'b, ()> + where + P: Into>, + { CcrUnfollow::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/cluster.rs b/elasticsearch/src/generated/namespace_clients/cluster.rs index 774926f3..6228ee38 100644 --- a/elasticsearch/src/generated/namespace_clients/cluster.rs +++ b/elasticsearch/src/generated/namespace_clients/cluster.rs @@ -495,6 +495,12 @@ impl<'b> ClusterHealthParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for ClusterHealthParts<'b> { + #[doc = "Builds a [ClusterHealthParts::Index] for the Cluster Health API"] + fn from(t: &'b [&'b str]) -> ClusterHealthParts<'b> { + ClusterHealthParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cluster Health API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-health.html)\n\nReturns basic information about the health of the cluster."] pub struct ClusterHealth<'a, 'b> { @@ -520,11 +526,14 @@ pub struct ClusterHealth<'a, 'b> { } impl<'a, 'b> ClusterHealth<'a, 'b> { #[doc = "Creates a new instance of [ClusterHealth] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ClusterHealthParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); ClusterHealth { transport, - parts, + parts: parts.into(), headers, error_trace: None, expand_wildcards: None, @@ -1525,6 +1534,18 @@ impl<'b> ClusterStateParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for ClusterStateParts<'b> { + #[doc = "Builds a [ClusterStateParts::Metric] for the Cluster State API"] + fn from(t: &'b [&'b str]) -> ClusterStateParts<'b> { + ClusterStateParts::Metric(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for ClusterStateParts<'b> { + #[doc = "Builds a [ClusterStateParts::MetricIndex] for the Cluster State API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> ClusterStateParts<'b> { + ClusterStateParts::MetricIndex(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cluster State API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-state.html)\n\nReturns a comprehensive information about the state of the cluster."] pub struct ClusterState<'a, 'b> { @@ -1547,11 +1568,14 @@ pub struct ClusterState<'a, 'b> { } impl<'a, 'b> ClusterState<'a, 'b> { #[doc = "Creates a new instance of [ClusterState] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ClusterStateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); ClusterState { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -1730,6 +1754,12 @@ impl<'b> ClusterStatsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for ClusterStatsParts<'b> { + #[doc = "Builds a [ClusterStatsParts::NodeId] for the Cluster Stats API"] + fn from(t: &'b [&'b str]) -> ClusterStatsParts<'b> { + ClusterStatsParts::NodeId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Cluster Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-stats.html)\n\nReturns high-level overview of cluster statistics."] pub struct ClusterStats<'a, 'b> { @@ -1746,11 +1776,14 @@ pub struct ClusterStats<'a, 'b> { } impl<'a, 'b> ClusterStats<'a, 'b> { #[doc = "Creates a new instance of [ClusterStats] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ClusterStatsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); ClusterStats { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1874,7 +1907,10 @@ impl<'a> Cluster<'a> { ClusterGetSettings::new(self.transport()) } #[doc = "[Cluster Health API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-health.html)\n\nReturns basic information about the health of the cluster."] - pub fn health<'b>(&'a self, parts: ClusterHealthParts<'b>) -> ClusterHealth<'a, 'b> { + pub fn health<'b, P>(&'a self, parts: P) -> ClusterHealth<'a, 'b> + where + P: Into>, + { ClusterHealth::new(self.transport(), parts) } #[doc = "[Cluster Pending Tasks API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-pending.html)\n\nReturns a list of any cluster-level changes (e.g. create index, update mapping,\nallocate or fail shard) which have not yet been executed."] @@ -1900,11 +1936,17 @@ impl<'a> Cluster<'a> { ClusterReroute::new(self.transport()) } #[doc = "[Cluster State API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-state.html)\n\nReturns a comprehensive information about the state of the cluster."] - pub fn state<'b>(&'a self, parts: ClusterStateParts<'b>) -> ClusterState<'a, 'b> { + pub fn state<'b, P>(&'a self, parts: P) -> ClusterState<'a, 'b> + where + P: Into>, + { ClusterState::new(self.transport(), parts) } #[doc = "[Cluster Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-stats.html)\n\nReturns high-level overview of cluster statistics."] - pub fn stats<'b>(&'a self, parts: ClusterStatsParts<'b>) -> ClusterStats<'a, 'b> { + pub fn stats<'b, P>(&'a self, parts: P) -> ClusterStats<'a, 'b> + where + P: Into>, + { ClusterStats::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/dangling_indices.rs b/elasticsearch/src/generated/namespace_clients/dangling_indices.rs index e3c83123..e5ff0fa0 100644 --- a/elasticsearch/src/generated/namespace_clients/dangling_indices.rs +++ b/elasticsearch/src/generated/namespace_clients/dangling_indices.rs @@ -59,6 +59,12 @@ impl<'b> DanglingIndicesDeleteDanglingIndexParts<'b> { } } } +impl<'b> From<&'b str> for DanglingIndicesDeleteDanglingIndexParts<'b> { + #[doc = "Builds a [DanglingIndicesDeleteDanglingIndexParts::IndexUuid] for the Dangling Indices Delete Dangling Index API"] + fn from(t: &'b str) -> DanglingIndicesDeleteDanglingIndexParts<'b> { + DanglingIndicesDeleteDanglingIndexParts::IndexUuid(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Dangling Indices Delete Dangling Index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-gateway-dangling-indices.html)\n\nDeletes the specified dangling index"] pub struct DanglingIndicesDeleteDanglingIndex<'a, 'b> { @@ -76,14 +82,14 @@ pub struct DanglingIndicesDeleteDanglingIndex<'a, 'b> { } impl<'a, 'b> DanglingIndicesDeleteDanglingIndex<'a, 'b> { #[doc = "Creates a new instance of [DanglingIndicesDeleteDanglingIndex] with the specified API parts"] - pub fn new( - transport: &'a Transport, - parts: DanglingIndicesDeleteDanglingIndexParts<'b>, - ) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); DanglingIndicesDeleteDanglingIndex { transport, - parts, + parts: parts.into(), headers, accept_data_loss: None, error_trace: None, @@ -210,6 +216,12 @@ impl<'b> DanglingIndicesImportDanglingIndexParts<'b> { } } } +impl<'b> From<&'b str> for DanglingIndicesImportDanglingIndexParts<'b> { + #[doc = "Builds a [DanglingIndicesImportDanglingIndexParts::IndexUuid] for the Dangling Indices Import Dangling Index API"] + fn from(t: &'b str) -> DanglingIndicesImportDanglingIndexParts<'b> { + DanglingIndicesImportDanglingIndexParts::IndexUuid(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Dangling Indices Import Dangling Index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-gateway-dangling-indices.html)\n\nImports the specified dangling index"] pub struct DanglingIndicesImportDanglingIndex<'a, 'b, B> { @@ -231,14 +243,14 @@ where B: Body, { #[doc = "Creates a new instance of [DanglingIndicesImportDanglingIndex] with the specified API parts"] - pub fn new( - transport: &'a Transport, - parts: DanglingIndicesImportDanglingIndexParts<'b>, - ) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); DanglingIndicesImportDanglingIndex { transport, - parts, + parts: parts.into(), headers, accept_data_loss: None, body: None, @@ -489,17 +501,23 @@ impl<'a> DanglingIndices<'a> { self.transport } #[doc = "[Dangling Indices Delete Dangling Index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-gateway-dangling-indices.html)\n\nDeletes the specified dangling index"] - pub fn delete_dangling_index<'b>( + pub fn delete_dangling_index<'b, P>( &'a self, - parts: DanglingIndicesDeleteDanglingIndexParts<'b>, - ) -> DanglingIndicesDeleteDanglingIndex<'a, 'b> { + parts: P, + ) -> DanglingIndicesDeleteDanglingIndex<'a, 'b> + where + P: Into>, + { DanglingIndicesDeleteDanglingIndex::new(self.transport(), parts) } #[doc = "[Dangling Indices Import Dangling Index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-gateway-dangling-indices.html)\n\nImports the specified dangling index"] - pub fn import_dangling_index<'b>( + pub fn import_dangling_index<'b, P>( &'a self, - parts: DanglingIndicesImportDanglingIndexParts<'b>, - ) -> DanglingIndicesImportDanglingIndex<'a, 'b, ()> { + parts: P, + ) -> DanglingIndicesImportDanglingIndex<'a, 'b, ()> + where + P: Into>, + { DanglingIndicesImportDanglingIndex::new(self.transport(), parts) } #[doc = "[Dangling Indices List Dangling Indices API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-gateway-dangling-indices.html)\n\nReturns all dangling indices."] diff --git a/elasticsearch/src/generated/namespace_clients/enrich.rs b/elasticsearch/src/generated/namespace_clients/enrich.rs index e2d21f3d..57a59b81 100644 --- a/elasticsearch/src/generated/namespace_clients/enrich.rs +++ b/elasticsearch/src/generated/namespace_clients/enrich.rs @@ -58,6 +58,12 @@ impl<'b> EnrichDeletePolicyParts<'b> { } } } +impl<'b> From<&'b str> for EnrichDeletePolicyParts<'b> { + #[doc = "Builds a [EnrichDeletePolicyParts::Name] for the Enrich Delete Policy API"] + fn from(t: &'b str) -> EnrichDeletePolicyParts<'b> { + EnrichDeletePolicyParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Enrich Delete Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/delete-enrich-policy-api.html)\n\nDeletes an existing enrich policy and its enrich index."] pub struct EnrichDeletePolicy<'a, 'b> { @@ -72,11 +78,14 @@ pub struct EnrichDeletePolicy<'a, 'b> { } impl<'a, 'b> EnrichDeletePolicy<'a, 'b> { #[doc = "Creates a new instance of [EnrichDeletePolicy] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: EnrichDeletePolicyParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); EnrichDeletePolicy { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -176,6 +185,12 @@ impl<'b> EnrichExecutePolicyParts<'b> { } } } +impl<'b> From<&'b str> for EnrichExecutePolicyParts<'b> { + #[doc = "Builds a [EnrichExecutePolicyParts::Name] for the Enrich Execute Policy API"] + fn from(t: &'b str) -> EnrichExecutePolicyParts<'b> { + EnrichExecutePolicyParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Enrich Execute Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/execute-enrich-policy-api.html)\n\nCreates the enrich index for an existing enrich policy."] pub struct EnrichExecutePolicy<'a, 'b, B> { @@ -195,11 +210,14 @@ where B: Body, { #[doc = "Creates a new instance of [EnrichExecutePolicy] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: EnrichExecutePolicyParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); EnrichExecutePolicy { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -331,6 +349,12 @@ impl<'b> EnrichGetPolicyParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for EnrichGetPolicyParts<'b> { + #[doc = "Builds a [EnrichGetPolicyParts::Name] for the Enrich Get Policy API"] + fn from(t: &'b [&'b str]) -> EnrichGetPolicyParts<'b> { + EnrichGetPolicyParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Enrich Get Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-enrich-policy-api.html)\n\nGets information about an enrich policy."] pub struct EnrichGetPolicy<'a, 'b> { @@ -345,11 +369,14 @@ pub struct EnrichGetPolicy<'a, 'b> { } impl<'a, 'b> EnrichGetPolicy<'a, 'b> { #[doc = "Creates a new instance of [EnrichGetPolicy] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: EnrichGetPolicyParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); EnrichGetPolicy { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -448,6 +475,12 @@ impl<'b> EnrichPutPolicyParts<'b> { } } } +impl<'b> From<&'b str> for EnrichPutPolicyParts<'b> { + #[doc = "Builds a [EnrichPutPolicyParts::Name] for the Enrich Put Policy API"] + fn from(t: &'b str) -> EnrichPutPolicyParts<'b> { + EnrichPutPolicyParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Enrich Put Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/put-enrich-policy-api.html)\n\nCreates a new enrich policy."] pub struct EnrichPutPolicy<'a, 'b, B> { @@ -466,11 +499,14 @@ where B: Body, { #[doc = "Creates a new instance of [EnrichPutPolicy] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: EnrichPutPolicyParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); EnrichPutPolicy { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -691,28 +727,31 @@ impl<'a> Enrich<'a> { self.transport } #[doc = "[Enrich Delete Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/delete-enrich-policy-api.html)\n\nDeletes an existing enrich policy and its enrich index."] - pub fn delete_policy<'b>( - &'a self, - parts: EnrichDeletePolicyParts<'b>, - ) -> EnrichDeletePolicy<'a, 'b> { + pub fn delete_policy<'b, P>(&'a self, parts: P) -> EnrichDeletePolicy<'a, 'b> + where + P: Into>, + { EnrichDeletePolicy::new(self.transport(), parts) } #[doc = "[Enrich Execute Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/execute-enrich-policy-api.html)\n\nCreates the enrich index for an existing enrich policy."] - pub fn execute_policy<'b>( - &'a self, - parts: EnrichExecutePolicyParts<'b>, - ) -> EnrichExecutePolicy<'a, 'b, ()> { + pub fn execute_policy<'b, P>(&'a self, parts: P) -> EnrichExecutePolicy<'a, 'b, ()> + where + P: Into>, + { EnrichExecutePolicy::new(self.transport(), parts) } #[doc = "[Enrich Get Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-enrich-policy-api.html)\n\nGets information about an enrich policy."] - pub fn get_policy<'b>(&'a self, parts: EnrichGetPolicyParts<'b>) -> EnrichGetPolicy<'a, 'b> { + pub fn get_policy<'b, P>(&'a self, parts: P) -> EnrichGetPolicy<'a, 'b> + where + P: Into>, + { EnrichGetPolicy::new(self.transport(), parts) } #[doc = "[Enrich Put Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/put-enrich-policy-api.html)\n\nCreates a new enrich policy."] - pub fn put_policy<'b>( - &'a self, - parts: EnrichPutPolicyParts<'b>, - ) -> EnrichPutPolicy<'a, 'b, ()> { + pub fn put_policy<'b, P>(&'a self, parts: P) -> EnrichPutPolicy<'a, 'b, ()> + where + P: Into>, + { EnrichPutPolicy::new(self.transport(), parts) } #[doc = "[Enrich Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/enrich-stats-api.html)\n\nGets enrich coordinator statistics and information about enrich policies that are currently executing."] diff --git a/elasticsearch/src/generated/namespace_clients/graph.rs b/elasticsearch/src/generated/namespace_clients/graph.rs index 0b89e825..c3b2da84 100644 --- a/elasticsearch/src/generated/namespace_clients/graph.rs +++ b/elasticsearch/src/generated/namespace_clients/graph.rs @@ -61,6 +61,12 @@ impl<'b> GraphExploreParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for GraphExploreParts<'b> { + #[doc = "Builds a [GraphExploreParts::Index] for the Graph Explore API"] + fn from(t: &'b [&'b str]) -> GraphExploreParts<'b> { + GraphExploreParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Graph Explore API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/graph-explore-api.html)\n\nExplore extracted and summarized information about the documents and terms in an index."] pub struct GraphExplore<'a, 'b, B> { @@ -81,11 +87,14 @@ where B: Body, { #[doc = "Creates a new instance of [GraphExplore] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: GraphExploreParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); GraphExplore { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -218,7 +227,10 @@ impl<'a> Graph<'a> { self.transport } #[doc = "[Graph Explore API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/graph-explore-api.html)\n\nExplore extracted and summarized information about the documents and terms in an index."] - pub fn explore<'b>(&'a self, parts: GraphExploreParts<'b>) -> GraphExplore<'a, 'b, ()> { + pub fn explore<'b, P>(&'a self, parts: P) -> GraphExplore<'a, 'b, ()> + where + P: Into>, + { GraphExplore::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/ilm.rs b/elasticsearch/src/generated/namespace_clients/ilm.rs index 66e925cb..281e16a4 100644 --- a/elasticsearch/src/generated/namespace_clients/ilm.rs +++ b/elasticsearch/src/generated/namespace_clients/ilm.rs @@ -59,6 +59,12 @@ impl<'b> IlmDeleteLifecycleParts<'b> { } } } +impl<'b> From<&'b str> for IlmDeleteLifecycleParts<'b> { + #[doc = "Builds a [IlmDeleteLifecycleParts::Policy] for the Ilm Delete Lifecycle API"] + fn from(t: &'b str) -> IlmDeleteLifecycleParts<'b> { + IlmDeleteLifecycleParts::Policy(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ilm Delete Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-delete-lifecycle.html)\n\nDeletes the specified lifecycle policy definition. A currently used policy cannot be deleted."] pub struct IlmDeleteLifecycle<'a, 'b> { @@ -73,11 +79,14 @@ pub struct IlmDeleteLifecycle<'a, 'b> { } impl<'a, 'b> IlmDeleteLifecycle<'a, 'b> { #[doc = "Creates a new instance of [IlmDeleteLifecycle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IlmDeleteLifecycleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IlmDeleteLifecycle { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -178,6 +187,12 @@ impl<'b> IlmExplainLifecycleParts<'b> { } } } +impl<'b> From<&'b str> for IlmExplainLifecycleParts<'b> { + #[doc = "Builds a [IlmExplainLifecycleParts::Index] for the Ilm Explain Lifecycle API"] + fn from(t: &'b str) -> IlmExplainLifecycleParts<'b> { + IlmExplainLifecycleParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ilm Explain Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-explain-lifecycle.html)\n\nRetrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step."] pub struct IlmExplainLifecycle<'a, 'b> { @@ -194,11 +209,14 @@ pub struct IlmExplainLifecycle<'a, 'b> { } impl<'a, 'b> IlmExplainLifecycle<'a, 'b> { #[doc = "Creates a new instance of [IlmExplainLifecycle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IlmExplainLifecycleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IlmExplainLifecycle { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -319,6 +337,12 @@ impl<'b> IlmGetLifecycleParts<'b> { } } } +impl<'b> From<&'b str> for IlmGetLifecycleParts<'b> { + #[doc = "Builds a [IlmGetLifecycleParts::Policy] for the Ilm Get Lifecycle API"] + fn from(t: &'b str) -> IlmGetLifecycleParts<'b> { + IlmGetLifecycleParts::Policy(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ilm Get Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-get-lifecycle.html)\n\nReturns the specified policy definition. Includes the policy version and last modified date."] pub struct IlmGetLifecycle<'a, 'b> { @@ -333,11 +357,14 @@ pub struct IlmGetLifecycle<'a, 'b> { } impl<'a, 'b> IlmGetLifecycle<'a, 'b> { #[doc = "Creates a new instance of [IlmGetLifecycle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IlmGetLifecycleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IlmGetLifecycle { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -548,6 +575,12 @@ impl<'b> IlmMoveToStepParts<'b> { } } } +impl<'b> From<&'b str> for IlmMoveToStepParts<'b> { + #[doc = "Builds a [IlmMoveToStepParts::Index] for the Ilm Move To Step API"] + fn from(t: &'b str) -> IlmMoveToStepParts<'b> { + IlmMoveToStepParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ilm Move To Step API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-move-to-step.html)\n\nManually moves an index into the specified step and executes that step."] pub struct IlmMoveToStep<'a, 'b, B> { @@ -566,11 +599,14 @@ where B: Body, { #[doc = "Creates a new instance of [IlmMoveToStep] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IlmMoveToStepParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IlmMoveToStep { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -688,6 +724,12 @@ impl<'b> IlmPutLifecycleParts<'b> { } } } +impl<'b> From<&'b str> for IlmPutLifecycleParts<'b> { + #[doc = "Builds a [IlmPutLifecycleParts::Policy] for the Ilm Put Lifecycle API"] + fn from(t: &'b str) -> IlmPutLifecycleParts<'b> { + IlmPutLifecycleParts::Policy(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ilm Put Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-put-lifecycle.html)\n\nCreates a lifecycle policy"] pub struct IlmPutLifecycle<'a, 'b, B> { @@ -706,11 +748,14 @@ where B: Body, { #[doc = "Creates a new instance of [IlmPutLifecycle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IlmPutLifecycleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IlmPutLifecycle { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -829,6 +874,12 @@ impl<'b> IlmRemovePolicyParts<'b> { } } } +impl<'b> From<&'b str> for IlmRemovePolicyParts<'b> { + #[doc = "Builds a [IlmRemovePolicyParts::Index] for the Ilm Remove Policy API"] + fn from(t: &'b str) -> IlmRemovePolicyParts<'b> { + IlmRemovePolicyParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ilm Remove Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-remove-policy.html)\n\nRemoves the assigned lifecycle policy and stops managing the specified index"] pub struct IlmRemovePolicy<'a, 'b, B> { @@ -847,11 +898,14 @@ where B: Body, { #[doc = "Creates a new instance of [IlmRemovePolicy] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IlmRemovePolicyParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IlmRemovePolicy { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -970,6 +1024,12 @@ impl<'b> IlmRetryParts<'b> { } } } +impl<'b> From<&'b str> for IlmRetryParts<'b> { + #[doc = "Builds a [IlmRetryParts::Index] for the Ilm Retry API"] + fn from(t: &'b str) -> IlmRetryParts<'b> { + IlmRetryParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ilm Retry API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-retry-policy.html)\n\nRetries executing the policy for an index that is in the ERROR step."] pub struct IlmRetry<'a, 'b, B> { @@ -988,11 +1048,14 @@ where B: Body, { #[doc = "Creates a new instance of [IlmRetry] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IlmRetryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IlmRetry { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1368,21 +1431,24 @@ impl<'a> Ilm<'a> { self.transport } #[doc = "[Ilm Delete Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-delete-lifecycle.html)\n\nDeletes the specified lifecycle policy definition. A currently used policy cannot be deleted."] - pub fn delete_lifecycle<'b>( - &'a self, - parts: IlmDeleteLifecycleParts<'b>, - ) -> IlmDeleteLifecycle<'a, 'b> { + pub fn delete_lifecycle<'b, P>(&'a self, parts: P) -> IlmDeleteLifecycle<'a, 'b> + where + P: Into>, + { IlmDeleteLifecycle::new(self.transport(), parts) } #[doc = "[Ilm Explain Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-explain-lifecycle.html)\n\nRetrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step."] - pub fn explain_lifecycle<'b>( - &'a self, - parts: IlmExplainLifecycleParts<'b>, - ) -> IlmExplainLifecycle<'a, 'b> { + pub fn explain_lifecycle<'b, P>(&'a self, parts: P) -> IlmExplainLifecycle<'a, 'b> + where + P: Into>, + { IlmExplainLifecycle::new(self.transport(), parts) } #[doc = "[Ilm Get Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-get-lifecycle.html)\n\nReturns the specified policy definition. Includes the policy version and last modified date."] - pub fn get_lifecycle<'b>(&'a self, parts: IlmGetLifecycleParts<'b>) -> IlmGetLifecycle<'a, 'b> { + pub fn get_lifecycle<'b, P>(&'a self, parts: P) -> IlmGetLifecycle<'a, 'b> + where + P: Into>, + { IlmGetLifecycle::new(self.transport(), parts) } #[doc = "[Ilm Get Status API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-get-status.html)\n\nRetrieves the current index lifecycle management (ILM) status."] @@ -1390,25 +1456,31 @@ impl<'a> Ilm<'a> { IlmGetStatus::new(self.transport()) } #[doc = "[Ilm Move To Step API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-move-to-step.html)\n\nManually moves an index into the specified step and executes that step."] - pub fn move_to_step<'b>(&'a self, parts: IlmMoveToStepParts<'b>) -> IlmMoveToStep<'a, 'b, ()> { + pub fn move_to_step<'b, P>(&'a self, parts: P) -> IlmMoveToStep<'a, 'b, ()> + where + P: Into>, + { IlmMoveToStep::new(self.transport(), parts) } #[doc = "[Ilm Put Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-put-lifecycle.html)\n\nCreates a lifecycle policy"] - pub fn put_lifecycle<'b>( - &'a self, - parts: IlmPutLifecycleParts<'b>, - ) -> IlmPutLifecycle<'a, 'b, ()> { + pub fn put_lifecycle<'b, P>(&'a self, parts: P) -> IlmPutLifecycle<'a, 'b, ()> + where + P: Into>, + { IlmPutLifecycle::new(self.transport(), parts) } #[doc = "[Ilm Remove Policy API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-remove-policy.html)\n\nRemoves the assigned lifecycle policy and stops managing the specified index"] - pub fn remove_policy<'b>( - &'a self, - parts: IlmRemovePolicyParts<'b>, - ) -> IlmRemovePolicy<'a, 'b, ()> { + pub fn remove_policy<'b, P>(&'a self, parts: P) -> IlmRemovePolicy<'a, 'b, ()> + where + P: Into>, + { IlmRemovePolicy::new(self.transport(), parts) } #[doc = "[Ilm Retry API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-retry-policy.html)\n\nRetries executing the policy for an index that is in the ERROR step."] - pub fn retry<'b>(&'a self, parts: IlmRetryParts<'b>) -> IlmRetry<'a, 'b, ()> { + pub fn retry<'b, P>(&'a self, parts: P) -> IlmRetry<'a, 'b, ()> + where + P: Into>, + { IlmRetry::new(self.transport(), parts) } #[doc = "[Ilm Start API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ilm-start.html)\n\nStart the index lifecycle management (ILM) plugin."] diff --git a/elasticsearch/src/generated/namespace_clients/indices.rs b/elasticsearch/src/generated/namespace_clients/indices.rs index b26da387..6e7f2350 100644 --- a/elasticsearch/src/generated/namespace_clients/indices.rs +++ b/elasticsearch/src/generated/namespace_clients/indices.rs @@ -65,6 +65,12 @@ impl<'b> IndicesAddBlockParts<'b> { } } } +impl<'b> From<(&'b [&'b str], &'b str)> for IndicesAddBlockParts<'b> { + #[doc = "Builds a [IndicesAddBlockParts::IndexBlock] for the Indices Add Block API"] + fn from(t: (&'b [&'b str], &'b str)) -> IndicesAddBlockParts<'b> { + IndicesAddBlockParts::IndexBlock(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Add Block API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-blocks.html)\n\nAdds a block to an index."] pub struct IndicesAddBlock<'a, 'b, B> { @@ -88,11 +94,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesAddBlock] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesAddBlockParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesAddBlock { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -267,6 +276,12 @@ impl<'b> IndicesAnalyzeParts<'b> { } } } +impl<'b> From<&'b str> for IndicesAnalyzeParts<'b> { + #[doc = "Builds a [IndicesAnalyzeParts::Index] for the Indices Analyze API"] + fn from(t: &'b str) -> IndicesAnalyzeParts<'b> { + IndicesAnalyzeParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Analyze API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-analyze.html)\n\nPerforms the analysis process on a text and return the tokens breakdown of the text."] pub struct IndicesAnalyze<'a, 'b, B> { @@ -286,11 +301,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesAnalyze] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesAnalyzeParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesAnalyze { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -426,6 +444,12 @@ impl<'b> IndicesClearCacheParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesClearCacheParts<'b> { + #[doc = "Builds a [IndicesClearCacheParts::Index] for the Indices Clear Cache API"] + fn from(t: &'b [&'b str]) -> IndicesClearCacheParts<'b> { + IndicesClearCacheParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Clear Cache API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-clearcache.html)\n\nClears all or specific caches for one or more indices."] pub struct IndicesClearCache<'a, 'b, B> { @@ -452,11 +476,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesClearCache] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesClearCacheParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesClearCache { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -662,6 +689,12 @@ impl<'b> IndicesCloneParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for IndicesCloneParts<'b> { + #[doc = "Builds a [IndicesCloneParts::IndexTarget] for the Indices Clone API"] + fn from(t: (&'b str, &'b str)) -> IndicesCloneParts<'b> { + IndicesCloneParts::IndexTarget(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Clone API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-clone-index.html)\n\nClones an index"] pub struct IndicesClone<'a, 'b, B> { @@ -683,11 +716,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesClone] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesCloneParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesClone { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -837,6 +873,12 @@ impl<'b> IndicesCloseParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesCloseParts<'b> { + #[doc = "Builds a [IndicesCloseParts::Index] for the Indices Close API"] + fn from(t: &'b [&'b str]) -> IndicesCloseParts<'b> { + IndicesCloseParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Close API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-open-close.html)\n\nCloses an index."] pub struct IndicesClose<'a, 'b, B> { @@ -861,11 +903,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesClose] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesCloseParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesClose { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -1046,6 +1091,12 @@ impl<'b> IndicesCreateParts<'b> { } } } +impl<'b> From<&'b str> for IndicesCreateParts<'b> { + #[doc = "Builds a [IndicesCreateParts::Index] for the Indices Create API"] + fn from(t: &'b str) -> IndicesCreateParts<'b> { + IndicesCreateParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Create API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-create-index.html)\n\nCreates an index with optional settings and mappings."] pub struct IndicesCreate<'a, 'b, B> { @@ -1067,11 +1118,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesCreate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesCreateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesCreate { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1220,6 +1274,12 @@ impl<'b> IndicesDeleteParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesDeleteParts<'b> { + #[doc = "Builds a [IndicesDeleteParts::Index] for the Indices Delete API"] + fn from(t: &'b [&'b str]) -> IndicesDeleteParts<'b> { + IndicesDeleteParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-delete-index.html)\n\nDeletes an index."] pub struct IndicesDelete<'a, 'b> { @@ -1239,11 +1299,14 @@ pub struct IndicesDelete<'a, 'b> { } impl<'a, 'b> IndicesDelete<'a, 'b> { #[doc = "Creates a new instance of [IndicesDelete] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesDeleteParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesDelete { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -1398,6 +1461,12 @@ impl<'b> IndicesDeleteAliasParts<'b> { } } } +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for IndicesDeleteAliasParts<'b> { + #[doc = "Builds a [IndicesDeleteAliasParts::IndexName] for the Indices Delete Alias API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> IndicesDeleteAliasParts<'b> { + IndicesDeleteAliasParts::IndexName(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Delete Alias API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nDeletes an alias."] pub struct IndicesDeleteAlias<'a, 'b> { @@ -1414,11 +1483,14 @@ pub struct IndicesDeleteAlias<'a, 'b> { } impl<'a, 'b> IndicesDeleteAlias<'a, 'b> { #[doc = "Creates a new instance of [IndicesDeleteAlias] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesDeleteAliasParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesDeleteAlias { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1535,6 +1607,12 @@ impl<'b> IndicesDeleteTemplateParts<'b> { } } } +impl<'b> From<&'b str> for IndicesDeleteTemplateParts<'b> { + #[doc = "Builds a [IndicesDeleteTemplateParts::Name] for the Indices Delete Template API"] + fn from(t: &'b str) -> IndicesDeleteTemplateParts<'b> { + IndicesDeleteTemplateParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Delete Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-templates.html)\n\nDeletes an index template."] pub struct IndicesDeleteTemplate<'a, 'b> { @@ -1551,11 +1629,14 @@ pub struct IndicesDeleteTemplate<'a, 'b> { } impl<'a, 'b> IndicesDeleteTemplate<'a, 'b> { #[doc = "Creates a new instance of [IndicesDeleteTemplate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesDeleteTemplateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesDeleteTemplate { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1674,6 +1755,12 @@ impl<'b> IndicesExistsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesExistsParts<'b> { + #[doc = "Builds a [IndicesExistsParts::Index] for the Indices Exists API"] + fn from(t: &'b [&'b str]) -> IndicesExistsParts<'b> { + IndicesExistsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Exists API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-exists.html)\n\nReturns information about whether a particular index exists."] pub struct IndicesExists<'a, 'b> { @@ -1694,11 +1781,14 @@ pub struct IndicesExists<'a, 'b> { } impl<'a, 'b> IndicesExists<'a, 'b> { #[doc = "Creates a new instance of [IndicesExists] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesExistsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesExists { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -1873,6 +1963,18 @@ impl<'b> IndicesExistsAliasParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesExistsAliasParts<'b> { + #[doc = "Builds a [IndicesExistsAliasParts::Name] for the Indices Exists Alias API"] + fn from(t: &'b [&'b str]) -> IndicesExistsAliasParts<'b> { + IndicesExistsAliasParts::Name(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for IndicesExistsAliasParts<'b> { + #[doc = "Builds a [IndicesExistsAliasParts::IndexName] for the Indices Exists Alias API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> IndicesExistsAliasParts<'b> { + IndicesExistsAliasParts::IndexName(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Exists Alias API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nReturns information about whether a particular alias exists."] pub struct IndicesExistsAlias<'a, 'b> { @@ -1891,11 +1993,14 @@ pub struct IndicesExistsAlias<'a, 'b> { } impl<'a, 'b> IndicesExistsAlias<'a, 'b> { #[doc = "Creates a new instance of [IndicesExistsAlias] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesExistsAliasParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesExistsAlias { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -2035,6 +2140,12 @@ impl<'b> IndicesExistsTemplateParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesExistsTemplateParts<'b> { + #[doc = "Builds a [IndicesExistsTemplateParts::Name] for the Indices Exists Template API"] + fn from(t: &'b [&'b str]) -> IndicesExistsTemplateParts<'b> { + IndicesExistsTemplateParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Exists Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-templates.html)\n\nReturns information about whether a particular index template exists."] pub struct IndicesExistsTemplate<'a, 'b> { @@ -2052,11 +2163,14 @@ pub struct IndicesExistsTemplate<'a, 'b> { } impl<'a, 'b> IndicesExistsTemplate<'a, 'b> { #[doc = "Creates a new instance of [IndicesExistsTemplate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesExistsTemplateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesExistsTemplate { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -2188,6 +2302,12 @@ impl<'b> IndicesExistsTypeParts<'b> { } } } +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for IndicesExistsTypeParts<'b> { + #[doc = "Builds a [IndicesExistsTypeParts::IndexType] for the Indices Exists Type API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> IndicesExistsTypeParts<'b> { + IndicesExistsTypeParts::IndexType(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Exists Type API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-types-exists.html)\n\nReturns information about whether a particular document type exists. (DEPRECATED)"] pub struct IndicesExistsType<'a, 'b> { @@ -2206,11 +2326,14 @@ pub struct IndicesExistsType<'a, 'b> { } impl<'a, 'b> IndicesExistsType<'a, 'b> { #[doc = "Creates a new instance of [IndicesExistsType] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesExistsTypeParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesExistsType { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -2354,6 +2477,12 @@ impl<'b> IndicesFlushParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesFlushParts<'b> { + #[doc = "Builds a [IndicesFlushParts::Index] for the Indices Flush API"] + fn from(t: &'b [&'b str]) -> IndicesFlushParts<'b> { + IndicesFlushParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Flush API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-flush.html)\n\nPerforms the flush operation on one or more indices."] pub struct IndicesFlush<'a, 'b, B> { @@ -2377,11 +2506,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesFlush] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesFlushParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesFlush { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -2560,6 +2692,12 @@ impl<'b> IndicesForcemergeParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesForcemergeParts<'b> { + #[doc = "Builds a [IndicesForcemergeParts::Index] for the Indices Forcemerge API"] + fn from(t: &'b [&'b str]) -> IndicesForcemergeParts<'b> { + IndicesForcemergeParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Forcemerge API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-forcemerge.html)\n\nPerforms the force merge operation on one or more indices."] pub struct IndicesForcemerge<'a, 'b, B> { @@ -2584,11 +2722,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesForcemerge] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesForcemergeParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesForcemerge { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -2770,6 +2911,12 @@ impl<'b> IndicesFreezeParts<'b> { } } } +impl<'b> From<&'b str> for IndicesFreezeParts<'b> { + #[doc = "Builds a [IndicesFreezeParts::Index] for the Indices Freeze API"] + fn from(t: &'b str) -> IndicesFreezeParts<'b> { + IndicesFreezeParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Freeze API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/freeze-index-api.html)\n\nFreezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only."] pub struct IndicesFreeze<'a, 'b, B> { @@ -2794,11 +2941,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesFreeze] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesFreezeParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesFreeze { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -2980,6 +3130,12 @@ impl<'b> IndicesGetParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesGetParts<'b> { + #[doc = "Builds a [IndicesGetParts::Index] for the Indices Get API"] + fn from(t: &'b [&'b str]) -> IndicesGetParts<'b> { + IndicesGetParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-get-index.html)\n\nReturns information about one or more indices."] pub struct IndicesGet<'a, 'b> { @@ -3001,11 +3157,14 @@ pub struct IndicesGet<'a, 'b> { } impl<'a, 'b> IndicesGet<'a, 'b> { #[doc = "Creates a new instance of [IndicesGet] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesGetParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesGet { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -3204,6 +3363,18 @@ impl<'b> IndicesGetAliasParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesGetAliasParts<'b> { + #[doc = "Builds a [IndicesGetAliasParts::Name] for the Indices Get Alias API"] + fn from(t: &'b [&'b str]) -> IndicesGetAliasParts<'b> { + IndicesGetAliasParts::Name(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for IndicesGetAliasParts<'b> { + #[doc = "Builds a [IndicesGetAliasParts::IndexName] for the Indices Get Alias API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> IndicesGetAliasParts<'b> { + IndicesGetAliasParts::IndexName(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Get Alias API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nReturns an alias."] pub struct IndicesGetAlias<'a, 'b> { @@ -3222,11 +3393,14 @@ pub struct IndicesGetAlias<'a, 'b> { } impl<'a, 'b> IndicesGetAlias<'a, 'b> { #[doc = "Creates a new instance of [IndicesGetAlias] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesGetAliasParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesGetAlias { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -3383,6 +3557,18 @@ impl<'b> IndicesGetFieldMappingParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesGetFieldMappingParts<'b> { + #[doc = "Builds a [IndicesGetFieldMappingParts::Fields] for the Indices Get Field Mapping API"] + fn from(t: &'b [&'b str]) -> IndicesGetFieldMappingParts<'b> { + IndicesGetFieldMappingParts::Fields(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for IndicesGetFieldMappingParts<'b> { + #[doc = "Builds a [IndicesGetFieldMappingParts::IndexFields] for the Indices Get Field Mapping API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> IndicesGetFieldMappingParts<'b> { + IndicesGetFieldMappingParts::IndexFields(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Get Field Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-get-field-mapping.html)\n\nReturns mapping for one or more fields."] pub struct IndicesGetFieldMapping<'a, 'b> { @@ -3402,11 +3588,14 @@ pub struct IndicesGetFieldMapping<'a, 'b> { } impl<'a, 'b> IndicesGetFieldMapping<'a, 'b> { #[doc = "Creates a new instance of [IndicesGetFieldMapping] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesGetFieldMappingParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesGetFieldMapping { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -3559,6 +3748,12 @@ impl<'b> IndicesGetMappingParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesGetMappingParts<'b> { + #[doc = "Builds a [IndicesGetMappingParts::Index] for the Indices Get Mapping API"] + fn from(t: &'b [&'b str]) -> IndicesGetMappingParts<'b> { + IndicesGetMappingParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Get Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-get-mapping.html)\n\nReturns mappings for one or more indices."] pub struct IndicesGetMapping<'a, 'b> { @@ -3578,11 +3773,14 @@ pub struct IndicesGetMapping<'a, 'b> { } impl<'a, 'b> IndicesGetMapping<'a, 'b> { #[doc = "Creates a new instance of [IndicesGetMapping] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesGetMappingParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesGetMapping { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -3763,6 +3961,18 @@ impl<'b> IndicesGetSettingsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesGetSettingsParts<'b> { + #[doc = "Builds a [IndicesGetSettingsParts::Index] for the Indices Get Settings API"] + fn from(t: &'b [&'b str]) -> IndicesGetSettingsParts<'b> { + IndicesGetSettingsParts::Index(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for IndicesGetSettingsParts<'b> { + #[doc = "Builds a [IndicesGetSettingsParts::IndexName] for the Indices Get Settings API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> IndicesGetSettingsParts<'b> { + IndicesGetSettingsParts::IndexName(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Get Settings API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-get-settings.html)\n\nReturns settings for one or more indices."] pub struct IndicesGetSettings<'a, 'b> { @@ -3784,11 +3994,14 @@ pub struct IndicesGetSettings<'a, 'b> { } impl<'a, 'b> IndicesGetSettings<'a, 'b> { #[doc = "Creates a new instance of [IndicesGetSettings] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesGetSettingsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesGetSettings { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -3958,6 +4171,12 @@ impl<'b> IndicesGetTemplateParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesGetTemplateParts<'b> { + #[doc = "Builds a [IndicesGetTemplateParts::Name] for the Indices Get Template API"] + fn from(t: &'b [&'b str]) -> IndicesGetTemplateParts<'b> { + IndicesGetTemplateParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Get Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-templates.html)\n\nReturns an index template."] pub struct IndicesGetTemplate<'a, 'b> { @@ -3975,11 +4194,14 @@ pub struct IndicesGetTemplate<'a, 'b> { } impl<'a, 'b> IndicesGetTemplate<'a, 'b> { #[doc = "Creates a new instance of [IndicesGetTemplate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesGetTemplateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesGetTemplate { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -4111,6 +4333,12 @@ impl<'b> IndicesGetUpgradeParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesGetUpgradeParts<'b> { + #[doc = "Builds a [IndicesGetUpgradeParts::Index] for the Indices Get Upgrade API"] + fn from(t: &'b [&'b str]) -> IndicesGetUpgradeParts<'b> { + IndicesGetUpgradeParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Get Upgrade API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-upgrade.html)\n\nDEPRECATED Returns a progress status of current upgrade."] pub struct IndicesGetUpgrade<'a, 'b> { @@ -4128,11 +4356,14 @@ pub struct IndicesGetUpgrade<'a, 'b> { } impl<'a, 'b> IndicesGetUpgrade<'a, 'b> { #[doc = "Creates a new instance of [IndicesGetUpgrade] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesGetUpgradeParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesGetUpgrade { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -4264,6 +4495,12 @@ impl<'b> IndicesOpenParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesOpenParts<'b> { + #[doc = "Builds a [IndicesOpenParts::Index] for the Indices Open API"] + fn from(t: &'b [&'b str]) -> IndicesOpenParts<'b> { + IndicesOpenParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Open API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-open-close.html)\n\nOpens an index."] pub struct IndicesOpen<'a, 'b, B> { @@ -4288,11 +4525,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesOpen] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesOpenParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesOpen { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -4478,6 +4718,12 @@ impl<'b> IndicesPutAliasParts<'b> { } } } +impl<'b> From<(&'b [&'b str], &'b str)> for IndicesPutAliasParts<'b> { + #[doc = "Builds a [IndicesPutAliasParts::IndexName] for the Indices Put Alias API"] + fn from(t: (&'b [&'b str], &'b str)) -> IndicesPutAliasParts<'b> { + IndicesPutAliasParts::IndexName(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Put Alias API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nCreates or updates an alias."] pub struct IndicesPutAlias<'a, 'b, B> { @@ -4498,11 +4744,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesPutAlias] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesPutAliasParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesPutAlias { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -4642,6 +4891,12 @@ impl<'b> IndicesPutMappingParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesPutMappingParts<'b> { + #[doc = "Builds a [IndicesPutMappingParts::Index] for the Indices Put Mapping API"] + fn from(t: &'b [&'b str]) -> IndicesPutMappingParts<'b> { + IndicesPutMappingParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Put Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-put-mapping.html)\n\nUpdates the index mappings."] pub struct IndicesPutMapping<'a, 'b, B> { @@ -4666,11 +4921,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesPutMapping] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesPutMappingParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesPutMapping { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -4856,6 +5114,12 @@ impl<'b> IndicesPutSettingsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesPutSettingsParts<'b> { + #[doc = "Builds a [IndicesPutSettingsParts::Index] for the Indices Put Settings API"] + fn from(t: &'b [&'b str]) -> IndicesPutSettingsParts<'b> { + IndicesPutSettingsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Put Settings API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-update-settings.html)\n\nUpdates the index settings."] pub struct IndicesPutSettings<'a, 'b, B> { @@ -4881,11 +5145,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesPutSettings] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesPutSettingsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesPutSettings { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -5075,6 +5342,12 @@ impl<'b> IndicesPutTemplateParts<'b> { } } } +impl<'b> From<&'b str> for IndicesPutTemplateParts<'b> { + #[doc = "Builds a [IndicesPutTemplateParts::Name] for the Indices Put Template API"] + fn from(t: &'b str) -> IndicesPutTemplateParts<'b> { + IndicesPutTemplateParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Put Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-templates.html)\n\nCreates or updates an index template."] pub struct IndicesPutTemplate<'a, 'b, B> { @@ -5096,11 +5369,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesPutTemplate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesPutTemplateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesPutTemplate { transport, - parts, + parts: parts.into(), headers, body: None, create: None, @@ -5253,6 +5529,12 @@ impl<'b> IndicesRecoveryParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesRecoveryParts<'b> { + #[doc = "Builds a [IndicesRecoveryParts::Index] for the Indices Recovery API"] + fn from(t: &'b [&'b str]) -> IndicesRecoveryParts<'b> { + IndicesRecoveryParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Recovery API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-recovery.html)\n\nReturns information about ongoing index shard recoveries."] pub struct IndicesRecovery<'a, 'b> { @@ -5269,11 +5551,14 @@ pub struct IndicesRecovery<'a, 'b> { } impl<'a, 'b> IndicesRecovery<'a, 'b> { #[doc = "Creates a new instance of [IndicesRecovery] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesRecoveryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesRecovery { transport, - parts, + parts: parts.into(), headers, active_only: None, detailed: None, @@ -5396,6 +5681,12 @@ impl<'b> IndicesRefreshParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesRefreshParts<'b> { + #[doc = "Builds a [IndicesRefreshParts::Index] for the Indices Refresh API"] + fn from(t: &'b [&'b str]) -> IndicesRefreshParts<'b> { + IndicesRefreshParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Refresh API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-refresh.html)\n\nPerforms the refresh operation in one or more indices."] pub struct IndicesRefresh<'a, 'b, B> { @@ -5417,11 +5708,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesRefresh] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesRefreshParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesRefresh { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -5577,6 +5871,12 @@ impl<'b> IndicesReloadSearchAnalyzersParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesReloadSearchAnalyzersParts<'b> { + #[doc = "Builds a [IndicesReloadSearchAnalyzersParts::Index] for the Indices Reload Search Analyzers API"] + fn from(t: &'b [&'b str]) -> IndicesReloadSearchAnalyzersParts<'b> { + IndicesReloadSearchAnalyzersParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Reload Search Analyzers API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-reload-analyzers.html)\n\nReloads an index's search analyzers and their resources."] pub struct IndicesReloadSearchAnalyzers<'a, 'b, B> { @@ -5598,11 +5898,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesReloadSearchAnalyzers] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesReloadSearchAnalyzersParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesReloadSearchAnalyzers { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -5772,6 +6075,18 @@ impl<'b> IndicesRolloverParts<'b> { } } } +impl<'b> From<&'b str> for IndicesRolloverParts<'b> { + #[doc = "Builds a [IndicesRolloverParts::Alias] for the Indices Rollover API"] + fn from(t: &'b str) -> IndicesRolloverParts<'b> { + IndicesRolloverParts::Alias(t) + } +} +impl<'b> From<(&'b str, &'b str)> for IndicesRolloverParts<'b> { + #[doc = "Builds a [IndicesRolloverParts::AliasNewIndex] for the Indices Rollover API"] + fn from(t: (&'b str, &'b str)) -> IndicesRolloverParts<'b> { + IndicesRolloverParts::AliasNewIndex(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Rollover API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-rollover-index.html)\n\nUpdates an alias to point to a new index when the existing index\nis considered to be too large or too old."] pub struct IndicesRollover<'a, 'b, B> { @@ -5794,11 +6109,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesRollover] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesRolloverParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesRollover { transport, - parts, + parts: parts.into(), headers, body: None, dry_run: None, @@ -5961,6 +6279,12 @@ impl<'b> IndicesSegmentsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesSegmentsParts<'b> { + #[doc = "Builds a [IndicesSegmentsParts::Index] for the Indices Segments API"] + fn from(t: &'b [&'b str]) -> IndicesSegmentsParts<'b> { + IndicesSegmentsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Segments API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-segments.html)\n\nProvides low-level information about segments in a Lucene index."] pub struct IndicesSegments<'a, 'b> { @@ -5979,11 +6303,14 @@ pub struct IndicesSegments<'a, 'b> { } impl<'a, 'b> IndicesSegments<'a, 'b> { #[doc = "Creates a new instance of [IndicesSegments] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesSegmentsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesSegments { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -6127,6 +6454,12 @@ impl<'b> IndicesShardStoresParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesShardStoresParts<'b> { + #[doc = "Builds a [IndicesShardStoresParts::Index] for the Indices Shard Stores API"] + fn from(t: &'b [&'b str]) -> IndicesShardStoresParts<'b> { + IndicesShardStoresParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Shard Stores API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-shards-stores.html)\n\nProvides store information for shard copies of indices."] pub struct IndicesShardStores<'a, 'b> { @@ -6145,11 +6478,14 @@ pub struct IndicesShardStores<'a, 'b> { } impl<'a, 'b> IndicesShardStores<'a, 'b> { #[doc = "Creates a new instance of [IndicesShardStores] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesShardStoresParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesShardStores { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, error_trace: None, @@ -6293,6 +6629,12 @@ impl<'b> IndicesShrinkParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for IndicesShrinkParts<'b> { + #[doc = "Builds a [IndicesShrinkParts::IndexTarget] for the Indices Shrink API"] + fn from(t: (&'b str, &'b str)) -> IndicesShrinkParts<'b> { + IndicesShrinkParts::IndexTarget(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Shrink API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-shrink-index.html)\n\nAllow to shrink an existing index into a new index with fewer primary shards."] pub struct IndicesShrink<'a, 'b, B> { @@ -6314,11 +6656,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesShrink] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesShrinkParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesShrink { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -6471,6 +6816,12 @@ impl<'b> IndicesSplitParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for IndicesSplitParts<'b> { + #[doc = "Builds a [IndicesSplitParts::IndexTarget] for the Indices Split API"] + fn from(t: (&'b str, &'b str)) -> IndicesSplitParts<'b> { + IndicesSplitParts::IndexTarget(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Split API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-split-index.html)\n\nAllows you to split an existing index into a new index with more primary shards."] pub struct IndicesSplit<'a, 'b, B> { @@ -6492,11 +6843,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesSplit] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesSplitParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesSplit { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -6677,6 +7031,18 @@ impl<'b> IndicesStatsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesStatsParts<'b> { + #[doc = "Builds a [IndicesStatsParts::Metric] for the Indices Stats API"] + fn from(t: &'b [&'b str]) -> IndicesStatsParts<'b> { + IndicesStatsParts::Metric(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for IndicesStatsParts<'b> { + #[doc = "Builds a [IndicesStatsParts::IndexMetric] for the Indices Stats API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> IndicesStatsParts<'b> { + IndicesStatsParts::IndexMetric(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-stats.html)\n\nProvides statistics on operations happening in an index."] pub struct IndicesStats<'a, 'b> { @@ -6701,11 +7067,14 @@ pub struct IndicesStats<'a, 'b> { } impl<'a, 'b> IndicesStats<'a, 'b> { #[doc = "Creates a new instance of [IndicesStats] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesStatsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesStats { transport, - parts, + parts: parts.into(), headers, completion_fields: None, error_trace: None, @@ -6905,6 +7274,12 @@ impl<'b> IndicesUnfreezeParts<'b> { } } } +impl<'b> From<&'b str> for IndicesUnfreezeParts<'b> { + #[doc = "Builds a [IndicesUnfreezeParts::Index] for the Indices Unfreeze API"] + fn from(t: &'b str) -> IndicesUnfreezeParts<'b> { + IndicesUnfreezeParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Unfreeze API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/unfreeze-index-api.html)\n\nUnfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again."] pub struct IndicesUnfreeze<'a, 'b, B> { @@ -6929,11 +7304,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesUnfreeze] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesUnfreezeParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesUnfreeze { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -7274,6 +7652,12 @@ impl<'b> IndicesUpgradeParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesUpgradeParts<'b> { + #[doc = "Builds a [IndicesUpgradeParts::Index] for the Indices Upgrade API"] + fn from(t: &'b [&'b str]) -> IndicesUpgradeParts<'b> { + IndicesUpgradeParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Upgrade API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-upgrade.html)\n\nDEPRECATED Upgrades to the current version of Lucene."] pub struct IndicesUpgrade<'a, 'b, B> { @@ -7297,11 +7681,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesUpgrade] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesUpgradeParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesUpgrade { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -7493,6 +7880,18 @@ impl<'b> IndicesValidateQueryParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for IndicesValidateQueryParts<'b> { + #[doc = "Builds a [IndicesValidateQueryParts::Index] for the Indices Validate Query API"] + fn from(t: &'b [&'b str]) -> IndicesValidateQueryParts<'b> { + IndicesValidateQueryParts::Index(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for IndicesValidateQueryParts<'b> { + #[doc = "Builds a [IndicesValidateQueryParts::IndexType] for the Indices Validate Query API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> IndicesValidateQueryParts<'b> { + IndicesValidateQueryParts::IndexType(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Indices Validate Query API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-validate.html)\n\nAllows a user to validate a potentially expensive query without executing it."] pub struct IndicesValidateQuery<'a, 'b, B> { @@ -7523,11 +7922,14 @@ where B: Body, { #[doc = "Creates a new instance of [IndicesValidateQuery] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndicesValidateQueryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IndicesValidateQuery { transport, - parts, + parts: parts.into(), headers, all_shards: None, allow_no_indices: None, @@ -7763,206 +8165,272 @@ impl<'a> Indices<'a> { self.transport } #[doc = "[Indices Add Block API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-blocks.html)\n\nAdds a block to an index."] - pub fn add_block<'b>(&'a self, parts: IndicesAddBlockParts<'b>) -> IndicesAddBlock<'a, 'b, ()> { + pub fn add_block<'b, P>(&'a self, parts: P) -> IndicesAddBlock<'a, 'b, ()> + where + P: Into>, + { IndicesAddBlock::new(self.transport(), parts) } #[doc = "[Indices Analyze API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-analyze.html)\n\nPerforms the analysis process on a text and return the tokens breakdown of the text."] - pub fn analyze<'b>(&'a self, parts: IndicesAnalyzeParts<'b>) -> IndicesAnalyze<'a, 'b, ()> { + pub fn analyze<'b, P>(&'a self, parts: P) -> IndicesAnalyze<'a, 'b, ()> + where + P: Into>, + { IndicesAnalyze::new(self.transport(), parts) } #[doc = "[Indices Clear Cache API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-clearcache.html)\n\nClears all or specific caches for one or more indices."] - pub fn clear_cache<'b>( - &'a self, - parts: IndicesClearCacheParts<'b>, - ) -> IndicesClearCache<'a, 'b, ()> { + pub fn clear_cache<'b, P>(&'a self, parts: P) -> IndicesClearCache<'a, 'b, ()> + where + P: Into>, + { IndicesClearCache::new(self.transport(), parts) } #[doc = "[Indices Clone API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-clone-index.html)\n\nClones an index"] - pub fn clone<'b>(&'a self, parts: IndicesCloneParts<'b>) -> IndicesClone<'a, 'b, ()> { + pub fn clone<'b, P>(&'a self, parts: P) -> IndicesClone<'a, 'b, ()> + where + P: Into>, + { IndicesClone::new(self.transport(), parts) } #[doc = "[Indices Close API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-open-close.html)\n\nCloses an index."] - pub fn close<'b>(&'a self, parts: IndicesCloseParts<'b>) -> IndicesClose<'a, 'b, ()> { + pub fn close<'b, P>(&'a self, parts: P) -> IndicesClose<'a, 'b, ()> + where + P: Into>, + { IndicesClose::new(self.transport(), parts) } #[doc = "[Indices Create API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-create-index.html)\n\nCreates an index with optional settings and mappings.\n\n# Examples\n\nCreate an index with a mapping\n\n```rust,no_run\n# use elasticsearch::{Elasticsearch, Error, indices::IndicesCreateParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box> {\nlet client = Elasticsearch::default();\nlet response = client\n .indices()\n .create(IndicesCreateParts::Index(\"test_index\"))\n .body(json!({\n \"mappings\" : {\n \"properties\" : {\n \"field1\" : { \"type\" : \"text\" }\n }\n }\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"] - pub fn create<'b>(&'a self, parts: IndicesCreateParts<'b>) -> IndicesCreate<'a, 'b, ()> { + pub fn create<'b, P>(&'a self, parts: P) -> IndicesCreate<'a, 'b, ()> + where + P: Into>, + { IndicesCreate::new(self.transport(), parts) } #[doc = "[Indices Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-delete-index.html)\n\nDeletes an index."] - pub fn delete<'b>(&'a self, parts: IndicesDeleteParts<'b>) -> IndicesDelete<'a, 'b> { + pub fn delete<'b, P>(&'a self, parts: P) -> IndicesDelete<'a, 'b> + where + P: Into>, + { IndicesDelete::new(self.transport(), parts) } #[doc = "[Indices Delete Alias API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nDeletes an alias."] - pub fn delete_alias<'b>( - &'a self, - parts: IndicesDeleteAliasParts<'b>, - ) -> IndicesDeleteAlias<'a, 'b> { + pub fn delete_alias<'b, P>(&'a self, parts: P) -> IndicesDeleteAlias<'a, 'b> + where + P: Into>, + { IndicesDeleteAlias::new(self.transport(), parts) } #[doc = "[Indices Delete Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-templates.html)\n\nDeletes an index template."] - pub fn delete_template<'b>( - &'a self, - parts: IndicesDeleteTemplateParts<'b>, - ) -> IndicesDeleteTemplate<'a, 'b> { + pub fn delete_template<'b, P>(&'a self, parts: P) -> IndicesDeleteTemplate<'a, 'b> + where + P: Into>, + { IndicesDeleteTemplate::new(self.transport(), parts) } #[doc = "[Indices Exists API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-exists.html)\n\nReturns information about whether a particular index exists."] - pub fn exists<'b>(&'a self, parts: IndicesExistsParts<'b>) -> IndicesExists<'a, 'b> { + pub fn exists<'b, P>(&'a self, parts: P) -> IndicesExists<'a, 'b> + where + P: Into>, + { IndicesExists::new(self.transport(), parts) } #[doc = "[Indices Exists Alias API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nReturns information about whether a particular alias exists."] - pub fn exists_alias<'b>( - &'a self, - parts: IndicesExistsAliasParts<'b>, - ) -> IndicesExistsAlias<'a, 'b> { + pub fn exists_alias<'b, P>(&'a self, parts: P) -> IndicesExistsAlias<'a, 'b> + where + P: Into>, + { IndicesExistsAlias::new(self.transport(), parts) } #[doc = "[Indices Exists Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-templates.html)\n\nReturns information about whether a particular index template exists."] - pub fn exists_template<'b>( - &'a self, - parts: IndicesExistsTemplateParts<'b>, - ) -> IndicesExistsTemplate<'a, 'b> { + pub fn exists_template<'b, P>(&'a self, parts: P) -> IndicesExistsTemplate<'a, 'b> + where + P: Into>, + { IndicesExistsTemplate::new(self.transport(), parts) } #[doc = "[Indices Exists Type API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-types-exists.html)\n\nReturns information about whether a particular document type exists. (DEPRECATED)"] - pub fn exists_type<'b>( - &'a self, - parts: IndicesExistsTypeParts<'b>, - ) -> IndicesExistsType<'a, 'b> { + pub fn exists_type<'b, P>(&'a self, parts: P) -> IndicesExistsType<'a, 'b> + where + P: Into>, + { IndicesExistsType::new(self.transport(), parts) } #[doc = "[Indices Flush API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-flush.html)\n\nPerforms the flush operation on one or more indices."] - pub fn flush<'b>(&'a self, parts: IndicesFlushParts<'b>) -> IndicesFlush<'a, 'b, ()> { + pub fn flush<'b, P>(&'a self, parts: P) -> IndicesFlush<'a, 'b, ()> + where + P: Into>, + { IndicesFlush::new(self.transport(), parts) } #[doc = "[Indices Forcemerge API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-forcemerge.html)\n\nPerforms the force merge operation on one or more indices."] - pub fn forcemerge<'b>( - &'a self, - parts: IndicesForcemergeParts<'b>, - ) -> IndicesForcemerge<'a, 'b, ()> { + pub fn forcemerge<'b, P>(&'a self, parts: P) -> IndicesForcemerge<'a, 'b, ()> + where + P: Into>, + { IndicesForcemerge::new(self.transport(), parts) } #[doc = "[Indices Freeze API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/freeze-index-api.html)\n\nFreezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only."] - pub fn freeze<'b>(&'a self, parts: IndicesFreezeParts<'b>) -> IndicesFreeze<'a, 'b, ()> { + pub fn freeze<'b, P>(&'a self, parts: P) -> IndicesFreeze<'a, 'b, ()> + where + P: Into>, + { IndicesFreeze::new(self.transport(), parts) } #[doc = "[Indices Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-get-index.html)\n\nReturns information about one or more indices."] - pub fn get<'b>(&'a self, parts: IndicesGetParts<'b>) -> IndicesGet<'a, 'b> { + pub fn get<'b, P>(&'a self, parts: P) -> IndicesGet<'a, 'b> + where + P: Into>, + { IndicesGet::new(self.transport(), parts) } #[doc = "[Indices Get Alias API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nReturns an alias."] - pub fn get_alias<'b>(&'a self, parts: IndicesGetAliasParts<'b>) -> IndicesGetAlias<'a, 'b> { + pub fn get_alias<'b, P>(&'a self, parts: P) -> IndicesGetAlias<'a, 'b> + where + P: Into>, + { IndicesGetAlias::new(self.transport(), parts) } #[doc = "[Indices Get Field Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-get-field-mapping.html)\n\nReturns mapping for one or more fields."] - pub fn get_field_mapping<'b>( - &'a self, - parts: IndicesGetFieldMappingParts<'b>, - ) -> IndicesGetFieldMapping<'a, 'b> { + pub fn get_field_mapping<'b, P>(&'a self, parts: P) -> IndicesGetFieldMapping<'a, 'b> + where + P: Into>, + { IndicesGetFieldMapping::new(self.transport(), parts) } #[doc = "[Indices Get Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-get-mapping.html)\n\nReturns mappings for one or more indices."] - pub fn get_mapping<'b>( - &'a self, - parts: IndicesGetMappingParts<'b>, - ) -> IndicesGetMapping<'a, 'b> { + pub fn get_mapping<'b, P>(&'a self, parts: P) -> IndicesGetMapping<'a, 'b> + where + P: Into>, + { IndicesGetMapping::new(self.transport(), parts) } #[doc = "[Indices Get Settings API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-get-settings.html)\n\nReturns settings for one or more indices."] - pub fn get_settings<'b>( - &'a self, - parts: IndicesGetSettingsParts<'b>, - ) -> IndicesGetSettings<'a, 'b> { + pub fn get_settings<'b, P>(&'a self, parts: P) -> IndicesGetSettings<'a, 'b> + where + P: Into>, + { IndicesGetSettings::new(self.transport(), parts) } #[doc = "[Indices Get Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-templates.html)\n\nReturns an index template."] - pub fn get_template<'b>( - &'a self, - parts: IndicesGetTemplateParts<'b>, - ) -> IndicesGetTemplate<'a, 'b> { + pub fn get_template<'b, P>(&'a self, parts: P) -> IndicesGetTemplate<'a, 'b> + where + P: Into>, + { IndicesGetTemplate::new(self.transport(), parts) } #[doc = "[Indices Get Upgrade API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-upgrade.html)\n\nDEPRECATED Returns a progress status of current upgrade."] - pub fn get_upgrade<'b>( - &'a self, - parts: IndicesGetUpgradeParts<'b>, - ) -> IndicesGetUpgrade<'a, 'b> { + pub fn get_upgrade<'b, P>(&'a self, parts: P) -> IndicesGetUpgrade<'a, 'b> + where + P: Into>, + { IndicesGetUpgrade::new(self.transport(), parts) } #[doc = "[Indices Open API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-open-close.html)\n\nOpens an index."] - pub fn open<'b>(&'a self, parts: IndicesOpenParts<'b>) -> IndicesOpen<'a, 'b, ()> { + pub fn open<'b, P>(&'a self, parts: P) -> IndicesOpen<'a, 'b, ()> + where + P: Into>, + { IndicesOpen::new(self.transport(), parts) } #[doc = "[Indices Put Alias API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nCreates or updates an alias."] - pub fn put_alias<'b>(&'a self, parts: IndicesPutAliasParts<'b>) -> IndicesPutAlias<'a, 'b, ()> { + pub fn put_alias<'b, P>(&'a self, parts: P) -> IndicesPutAlias<'a, 'b, ()> + where + P: Into>, + { IndicesPutAlias::new(self.transport(), parts) } #[doc = "[Indices Put Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-put-mapping.html)\n\nUpdates the index mappings.\n\n# Examples\n\nPut a mapping into an existing index, assuming the index does not have a mapping, \nor that any properties specified do not conflict with existing properties\n\n```rust,no_run\n# use elasticsearch::{Elasticsearch, Error, indices::IndicesPutMappingParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box> {\nlet client = Elasticsearch::default();\nlet response = client\n .indices()\n .put_mapping(IndicesPutMappingParts::Index(&[\"test_index\"]))\n .body(json!({\n \"properties\" : {\n \"field1\" : { \"type\" : \"text\" }\n }\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"] - pub fn put_mapping<'b>( - &'a self, - parts: IndicesPutMappingParts<'b>, - ) -> IndicesPutMapping<'a, 'b, ()> { + pub fn put_mapping<'b, P>(&'a self, parts: P) -> IndicesPutMapping<'a, 'b, ()> + where + P: Into>, + { IndicesPutMapping::new(self.transport(), parts) } #[doc = "[Indices Put Settings API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-update-settings.html)\n\nUpdates the index settings."] - pub fn put_settings<'b>( - &'a self, - parts: IndicesPutSettingsParts<'b>, - ) -> IndicesPutSettings<'a, 'b, ()> { + pub fn put_settings<'b, P>(&'a self, parts: P) -> IndicesPutSettings<'a, 'b, ()> + where + P: Into>, + { IndicesPutSettings::new(self.transport(), parts) } #[doc = "[Indices Put Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-templates.html)\n\nCreates or updates an index template."] - pub fn put_template<'b>( - &'a self, - parts: IndicesPutTemplateParts<'b>, - ) -> IndicesPutTemplate<'a, 'b, ()> { + pub fn put_template<'b, P>(&'a self, parts: P) -> IndicesPutTemplate<'a, 'b, ()> + where + P: Into>, + { IndicesPutTemplate::new(self.transport(), parts) } #[doc = "[Indices Recovery API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-recovery.html)\n\nReturns information about ongoing index shard recoveries."] - pub fn recovery<'b>(&'a self, parts: IndicesRecoveryParts<'b>) -> IndicesRecovery<'a, 'b> { + pub fn recovery<'b, P>(&'a self, parts: P) -> IndicesRecovery<'a, 'b> + where + P: Into>, + { IndicesRecovery::new(self.transport(), parts) } #[doc = "[Indices Refresh API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-refresh.html)\n\nPerforms the refresh operation in one or more indices."] - pub fn refresh<'b>(&'a self, parts: IndicesRefreshParts<'b>) -> IndicesRefresh<'a, 'b, ()> { + pub fn refresh<'b, P>(&'a self, parts: P) -> IndicesRefresh<'a, 'b, ()> + where + P: Into>, + { IndicesRefresh::new(self.transport(), parts) } #[doc = "[Indices Reload Search Analyzers API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-reload-analyzers.html)\n\nReloads an index's search analyzers and their resources."] - pub fn reload_search_analyzers<'b>( + pub fn reload_search_analyzers<'b, P>( &'a self, - parts: IndicesReloadSearchAnalyzersParts<'b>, - ) -> IndicesReloadSearchAnalyzers<'a, 'b, ()> { + parts: P, + ) -> IndicesReloadSearchAnalyzers<'a, 'b, ()> + where + P: Into>, + { IndicesReloadSearchAnalyzers::new(self.transport(), parts) } #[doc = "[Indices Rollover API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-rollover-index.html)\n\nUpdates an alias to point to a new index when the existing index\nis considered to be too large or too old."] - pub fn rollover<'b>(&'a self, parts: IndicesRolloverParts<'b>) -> IndicesRollover<'a, 'b, ()> { + pub fn rollover<'b, P>(&'a self, parts: P) -> IndicesRollover<'a, 'b, ()> + where + P: Into>, + { IndicesRollover::new(self.transport(), parts) } #[doc = "[Indices Segments API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-segments.html)\n\nProvides low-level information about segments in a Lucene index."] - pub fn segments<'b>(&'a self, parts: IndicesSegmentsParts<'b>) -> IndicesSegments<'a, 'b> { + pub fn segments<'b, P>(&'a self, parts: P) -> IndicesSegments<'a, 'b> + where + P: Into>, + { IndicesSegments::new(self.transport(), parts) } #[doc = "[Indices Shard Stores API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-shards-stores.html)\n\nProvides store information for shard copies of indices."] - pub fn shard_stores<'b>( - &'a self, - parts: IndicesShardStoresParts<'b>, - ) -> IndicesShardStores<'a, 'b> { + pub fn shard_stores<'b, P>(&'a self, parts: P) -> IndicesShardStores<'a, 'b> + where + P: Into>, + { IndicesShardStores::new(self.transport(), parts) } #[doc = "[Indices Shrink API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-shrink-index.html)\n\nAllow to shrink an existing index into a new index with fewer primary shards."] - pub fn shrink<'b>(&'a self, parts: IndicesShrinkParts<'b>) -> IndicesShrink<'a, 'b, ()> { + pub fn shrink<'b, P>(&'a self, parts: P) -> IndicesShrink<'a, 'b, ()> + where + P: Into>, + { IndicesShrink::new(self.transport(), parts) } #[doc = "[Indices Split API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-split-index.html)\n\nAllows you to split an existing index into a new index with more primary shards."] - pub fn split<'b>(&'a self, parts: IndicesSplitParts<'b>) -> IndicesSplit<'a, 'b, ()> { + pub fn split<'b, P>(&'a self, parts: P) -> IndicesSplit<'a, 'b, ()> + where + P: Into>, + { IndicesSplit::new(self.transport(), parts) } #[doc = "[Indices Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-stats.html)\n\nProvides statistics on operations happening in an index."] - pub fn stats<'b>(&'a self, parts: IndicesStatsParts<'b>) -> IndicesStats<'a, 'b> { + pub fn stats<'b, P>(&'a self, parts: P) -> IndicesStats<'a, 'b> + where + P: Into>, + { IndicesStats::new(self.transport(), parts) } #[doc = "[Indices Unfreeze API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/unfreeze-index-api.html)\n\nUnfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again."] - pub fn unfreeze<'b>(&'a self, parts: IndicesUnfreezeParts<'b>) -> IndicesUnfreeze<'a, 'b, ()> { + pub fn unfreeze<'b, P>(&'a self, parts: P) -> IndicesUnfreeze<'a, 'b, ()> + where + P: Into>, + { IndicesUnfreeze::new(self.transport(), parts) } #[doc = "[Indices Update Aliases API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-aliases.html)\n\nUpdates index aliases."] @@ -7970,14 +8438,17 @@ impl<'a> Indices<'a> { IndicesUpdateAliases::new(self.transport()) } #[doc = "[Indices Upgrade API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-upgrade.html)\n\nDEPRECATED Upgrades to the current version of Lucene."] - pub fn upgrade<'b>(&'a self, parts: IndicesUpgradeParts<'b>) -> IndicesUpgrade<'a, 'b, ()> { + pub fn upgrade<'b, P>(&'a self, parts: P) -> IndicesUpgrade<'a, 'b, ()> + where + P: Into>, + { IndicesUpgrade::new(self.transport(), parts) } #[doc = "[Indices Validate Query API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-validate.html)\n\nAllows a user to validate a potentially expensive query without executing it."] - pub fn validate_query<'b>( - &'a self, - parts: IndicesValidateQueryParts<'b>, - ) -> IndicesValidateQuery<'a, 'b, ()> { + pub fn validate_query<'b, P>(&'a self, parts: P) -> IndicesValidateQuery<'a, 'b, ()> + where + P: Into>, + { IndicesValidateQuery::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/ingest.rs b/elasticsearch/src/generated/namespace_clients/ingest.rs index cb7945d4..9cae10c8 100644 --- a/elasticsearch/src/generated/namespace_clients/ingest.rs +++ b/elasticsearch/src/generated/namespace_clients/ingest.rs @@ -58,6 +58,12 @@ impl<'b> IngestDeletePipelineParts<'b> { } } } +impl<'b> From<&'b str> for IngestDeletePipelineParts<'b> { + #[doc = "Builds a [IngestDeletePipelineParts::Id] for the Ingest Delete Pipeline API"] + fn from(t: &'b str) -> IngestDeletePipelineParts<'b> { + IngestDeletePipelineParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ingest Delete Pipeline API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/delete-pipeline-api.html)\n\nDeletes a pipeline."] pub struct IngestDeletePipeline<'a, 'b> { @@ -74,11 +80,14 @@ pub struct IngestDeletePipeline<'a, 'b> { } impl<'a, 'b> IngestDeletePipeline<'a, 'b> { #[doc = "Creates a new instance of [IngestDeletePipeline] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IngestDeletePipelineParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IngestDeletePipeline { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -198,6 +207,12 @@ impl<'b> IngestGetPipelineParts<'b> { } } } +impl<'b> From<&'b str> for IngestGetPipelineParts<'b> { + #[doc = "Builds a [IngestGetPipelineParts::Id] for the Ingest Get Pipeline API"] + fn from(t: &'b str) -> IngestGetPipelineParts<'b> { + IngestGetPipelineParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ingest Get Pipeline API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-pipeline-api.html)\n\nReturns a pipeline."] pub struct IngestGetPipeline<'a, 'b> { @@ -213,11 +228,14 @@ pub struct IngestGetPipeline<'a, 'b> { } impl<'a, 'b> IngestGetPipeline<'a, 'b> { #[doc = "Creates a new instance of [IngestGetPipeline] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IngestGetPipelineParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IngestGetPipeline { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -436,6 +454,12 @@ impl<'b> IngestPutPipelineParts<'b> { } } } +impl<'b> From<&'b str> for IngestPutPipelineParts<'b> { + #[doc = "Builds a [IngestPutPipelineParts::Id] for the Ingest Put Pipeline API"] + fn from(t: &'b str) -> IngestPutPipelineParts<'b> { + IngestPutPipelineParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ingest Put Pipeline API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/put-pipeline-api.html)\n\nCreates or updates a pipeline."] pub struct IngestPutPipeline<'a, 'b, B> { @@ -456,11 +480,14 @@ where B: Body, { #[doc = "Creates a new instance of [IngestPutPipeline] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IngestPutPipelineParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IngestPutPipeline { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -601,6 +628,12 @@ impl<'b> IngestSimulateParts<'b> { } } } +impl<'b> From<&'b str> for IngestSimulateParts<'b> { + #[doc = "Builds a [IngestSimulateParts::Id] for the Ingest Simulate API"] + fn from(t: &'b str) -> IngestSimulateParts<'b> { + IngestSimulateParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ingest Simulate API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/simulate-pipeline-api.html)\n\nAllows to simulate a pipeline with example documents."] pub struct IngestSimulate<'a, 'b, B> { @@ -620,11 +653,14 @@ where B: Body, { #[doc = "Creates a new instance of [IngestSimulate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IngestSimulateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); IngestSimulate { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -747,17 +783,17 @@ impl<'a> Ingest<'a> { self.transport } #[doc = "[Ingest Delete Pipeline API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/delete-pipeline-api.html)\n\nDeletes a pipeline."] - pub fn delete_pipeline<'b>( - &'a self, - parts: IngestDeletePipelineParts<'b>, - ) -> IngestDeletePipeline<'a, 'b> { + pub fn delete_pipeline<'b, P>(&'a self, parts: P) -> IngestDeletePipeline<'a, 'b> + where + P: Into>, + { IngestDeletePipeline::new(self.transport(), parts) } #[doc = "[Ingest Get Pipeline API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-pipeline-api.html)\n\nReturns a pipeline."] - pub fn get_pipeline<'b>( - &'a self, - parts: IngestGetPipelineParts<'b>, - ) -> IngestGetPipeline<'a, 'b> { + pub fn get_pipeline<'b, P>(&'a self, parts: P) -> IngestGetPipeline<'a, 'b> + where + P: Into>, + { IngestGetPipeline::new(self.transport(), parts) } #[doc = "[Ingest Processor Grok API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/grok-processor.html#grok-processor-rest-get)\n\nReturns a list of the built-in patterns."] @@ -765,14 +801,17 @@ impl<'a> Ingest<'a> { IngestProcessorGrok::new(self.transport()) } #[doc = "[Ingest Put Pipeline API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/put-pipeline-api.html)\n\nCreates or updates a pipeline."] - pub fn put_pipeline<'b>( - &'a self, - parts: IngestPutPipelineParts<'b>, - ) -> IngestPutPipeline<'a, 'b, ()> { + pub fn put_pipeline<'b, P>(&'a self, parts: P) -> IngestPutPipeline<'a, 'b, ()> + where + P: Into>, + { IngestPutPipeline::new(self.transport(), parts) } #[doc = "[Ingest Simulate API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/simulate-pipeline-api.html)\n\nAllows to simulate a pipeline with example documents."] - pub fn simulate<'b>(&'a self, parts: IngestSimulateParts<'b>) -> IngestSimulate<'a, 'b, ()> { + pub fn simulate<'b, P>(&'a self, parts: P) -> IngestSimulate<'a, 'b, ()> + where + P: Into>, + { IngestSimulate::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/migration.rs b/elasticsearch/src/generated/namespace_clients/migration.rs index 34239a58..41002ea5 100644 --- a/elasticsearch/src/generated/namespace_clients/migration.rs +++ b/elasticsearch/src/generated/namespace_clients/migration.rs @@ -63,6 +63,12 @@ impl<'b> MigrationDeprecationsParts<'b> { } } } +impl<'b> From<&'b str> for MigrationDeprecationsParts<'b> { + #[doc = "Builds a [MigrationDeprecationsParts::Index] for the Migration Deprecations API"] + fn from(t: &'b str) -> MigrationDeprecationsParts<'b> { + MigrationDeprecationsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Migration Deprecations API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/migration-api-deprecation.html)\n\nRetrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version."] pub struct MigrationDeprecations<'a, 'b> { @@ -77,11 +83,14 @@ pub struct MigrationDeprecations<'a, 'b> { } impl<'a, 'b> MigrationDeprecations<'a, 'b> { #[doc = "Creates a new instance of [MigrationDeprecations] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MigrationDeprecationsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MigrationDeprecations { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -173,10 +182,10 @@ impl<'a> Migration<'a> { self.transport } #[doc = "[Migration Deprecations API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/migration-api-deprecation.html)\n\nRetrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version."] - pub fn deprecations<'b>( - &'a self, - parts: MigrationDeprecationsParts<'b>, - ) -> MigrationDeprecations<'a, 'b> { + pub fn deprecations<'b, P>(&'a self, parts: P) -> MigrationDeprecations<'a, 'b> + where + P: Into>, + { MigrationDeprecations::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/ml.rs b/elasticsearch/src/generated/namespace_clients/ml.rs index 49b8b56e..9e928a8a 100644 --- a/elasticsearch/src/generated/namespace_clients/ml.rs +++ b/elasticsearch/src/generated/namespace_clients/ml.rs @@ -60,6 +60,12 @@ impl<'b> MlCloseJobParts<'b> { } } } +impl<'b> From<&'b str> for MlCloseJobParts<'b> { + #[doc = "Builds a [MlCloseJobParts::JobId] for the Ml Close Job API"] + fn from(t: &'b str) -> MlCloseJobParts<'b> { + MlCloseJobParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Close Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-close-job.html)\n\nCloses one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle."] pub struct MlCloseJob<'a, 'b, B> { @@ -81,11 +87,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlCloseJob] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlCloseJobParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlCloseJob { transport, - parts, + parts: parts.into(), headers, allow_no_jobs: None, body: None, @@ -233,6 +242,12 @@ impl<'b> MlDeleteCalendarParts<'b> { } } } +impl<'b> From<&'b str> for MlDeleteCalendarParts<'b> { + #[doc = "Builds a [MlDeleteCalendarParts::CalendarId] for the Ml Delete Calendar API"] + fn from(t: &'b str) -> MlDeleteCalendarParts<'b> { + MlDeleteCalendarParts::CalendarId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Calendar API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar.html)\n\nDeletes a calendar."] pub struct MlDeleteCalendar<'a, 'b> { @@ -247,11 +262,14 @@ pub struct MlDeleteCalendar<'a, 'b> { } impl<'a, 'b> MlDeleteCalendar<'a, 'b> { #[doc = "Creates a new instance of [MlDeleteCalendar] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteCalendarParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteCalendar { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -357,6 +375,12 @@ impl<'b> MlDeleteCalendarEventParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for MlDeleteCalendarEventParts<'b> { + #[doc = "Builds a [MlDeleteCalendarEventParts::CalendarIdEventId] for the Ml Delete Calendar Event API"] + fn from(t: (&'b str, &'b str)) -> MlDeleteCalendarEventParts<'b> { + MlDeleteCalendarEventParts::CalendarIdEventId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Calendar Event API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar-event.html)\n\nDeletes scheduled events from a calendar."] pub struct MlDeleteCalendarEvent<'a, 'b> { @@ -371,11 +395,14 @@ pub struct MlDeleteCalendarEvent<'a, 'b> { } impl<'a, 'b> MlDeleteCalendarEvent<'a, 'b> { #[doc = "Creates a new instance of [MlDeleteCalendarEvent] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteCalendarEventParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteCalendarEvent { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -481,6 +508,12 @@ impl<'b> MlDeleteCalendarJobParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for MlDeleteCalendarJobParts<'b> { + #[doc = "Builds a [MlDeleteCalendarJobParts::CalendarIdJobId] for the Ml Delete Calendar Job API"] + fn from(t: (&'b str, &'b str)) -> MlDeleteCalendarJobParts<'b> { + MlDeleteCalendarJobParts::CalendarIdJobId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Calendar Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar-job.html)\n\nDeletes anomaly detection jobs from a calendar."] pub struct MlDeleteCalendarJob<'a, 'b> { @@ -495,11 +528,14 @@ pub struct MlDeleteCalendarJob<'a, 'b> { } impl<'a, 'b> MlDeleteCalendarJob<'a, 'b> { #[doc = "Creates a new instance of [MlDeleteCalendarJob] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteCalendarJobParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteCalendarJob { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -599,6 +635,12 @@ impl<'b> MlDeleteDatafeedParts<'b> { } } } +impl<'b> From<&'b str> for MlDeleteDatafeedParts<'b> { + #[doc = "Builds a [MlDeleteDatafeedParts::DatafeedId] for the Ml Delete Datafeed API"] + fn from(t: &'b str) -> MlDeleteDatafeedParts<'b> { + MlDeleteDatafeedParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-datafeed.html)\n\nDeletes an existing datafeed."] pub struct MlDeleteDatafeed<'a, 'b> { @@ -614,11 +656,14 @@ pub struct MlDeleteDatafeed<'a, 'b> { } impl<'a, 'b> MlDeleteDatafeed<'a, 'b> { #[doc = "Creates a new instance of [MlDeleteDatafeed] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteDatafeedParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteDatafeed { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -730,6 +775,12 @@ impl<'b> MlDeleteExpiredDataParts<'b> { } } } +impl<'b> From<&'b str> for MlDeleteExpiredDataParts<'b> { + #[doc = "Builds a [MlDeleteExpiredDataParts::JobId] for the Ml Delete Expired Data API"] + fn from(t: &'b str) -> MlDeleteExpiredDataParts<'b> { + MlDeleteExpiredDataParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Expired Data API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-expired-data.html)\n\nDeletes expired and unused machine learning data."] pub struct MlDeleteExpiredData<'a, 'b, B> { @@ -750,11 +801,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlDeleteExpiredData] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteExpiredDataParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteExpiredData { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -892,6 +946,12 @@ impl<'b> MlDeleteFilterParts<'b> { } } } +impl<'b> From<&'b str> for MlDeleteFilterParts<'b> { + #[doc = "Builds a [MlDeleteFilterParts::FilterId] for the Ml Delete Filter API"] + fn from(t: &'b str) -> MlDeleteFilterParts<'b> { + MlDeleteFilterParts::FilterId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Filter API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-filter.html)\n\nDeletes a filter."] pub struct MlDeleteFilter<'a, 'b> { @@ -906,11 +966,14 @@ pub struct MlDeleteFilter<'a, 'b> { } impl<'a, 'b> MlDeleteFilter<'a, 'b> { #[doc = "Creates a new instance of [MlDeleteFilter] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteFilterParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteFilter { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1027,6 +1090,18 @@ impl<'b> MlDeleteForecastParts<'b> { } } } +impl<'b> From<&'b str> for MlDeleteForecastParts<'b> { + #[doc = "Builds a [MlDeleteForecastParts::JobId] for the Ml Delete Forecast API"] + fn from(t: &'b str) -> MlDeleteForecastParts<'b> { + MlDeleteForecastParts::JobId(t) + } +} +impl<'b> From<(&'b str, &'b str)> for MlDeleteForecastParts<'b> { + #[doc = "Builds a [MlDeleteForecastParts::JobIdForecastId] for the Ml Delete Forecast API"] + fn from(t: (&'b str, &'b str)) -> MlDeleteForecastParts<'b> { + MlDeleteForecastParts::JobIdForecastId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Forecast API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-forecast.html)\n\nDeletes forecasts from a machine learning job."] pub struct MlDeleteForecast<'a, 'b> { @@ -1043,11 +1118,14 @@ pub struct MlDeleteForecast<'a, 'b> { } impl<'a, 'b> MlDeleteForecast<'a, 'b> { #[doc = "Creates a new instance of [MlDeleteForecast] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteForecastParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteForecast { transport, - parts, + parts: parts.into(), headers, allow_no_forecasts: None, error_trace: None, @@ -1165,6 +1243,12 @@ impl<'b> MlDeleteJobParts<'b> { } } } +impl<'b> From<&'b str> for MlDeleteJobParts<'b> { + #[doc = "Builds a [MlDeleteJobParts::JobId] for the Ml Delete Job API"] + fn from(t: &'b str) -> MlDeleteJobParts<'b> { + MlDeleteJobParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-job.html)\n\nDeletes an existing anomaly detection job."] pub struct MlDeleteJob<'a, 'b> { @@ -1181,11 +1265,14 @@ pub struct MlDeleteJob<'a, 'b> { } impl<'a, 'b> MlDeleteJob<'a, 'b> { #[doc = "Creates a new instance of [MlDeleteJob] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteJobParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteJob { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1309,6 +1396,12 @@ impl<'b> MlDeleteModelSnapshotParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for MlDeleteModelSnapshotParts<'b> { + #[doc = "Builds a [MlDeleteModelSnapshotParts::JobIdSnapshotId] for the Ml Delete Model Snapshot API"] + fn from(t: (&'b str, &'b str)) -> MlDeleteModelSnapshotParts<'b> { + MlDeleteModelSnapshotParts::JobIdSnapshotId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Delete Model Snapshot API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-snapshot.html)\n\nDeletes an existing model snapshot."] pub struct MlDeleteModelSnapshot<'a, 'b> { @@ -1323,11 +1416,14 @@ pub struct MlDeleteModelSnapshot<'a, 'b> { } impl<'a, 'b> MlDeleteModelSnapshot<'a, 'b> { #[doc = "Creates a new instance of [MlDeleteModelSnapshot] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlDeleteModelSnapshotParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlDeleteModelSnapshot { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1563,6 +1659,12 @@ impl<'b> MlFlushJobParts<'b> { } } } +impl<'b> From<&'b str> for MlFlushJobParts<'b> { + #[doc = "Builds a [MlFlushJobParts::JobId] for the Ml Flush Job API"] + fn from(t: &'b str) -> MlFlushJobParts<'b> { + MlFlushJobParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Flush Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-flush-job.html)\n\nForces any buffered data to be processed by the job."] pub struct MlFlushJob<'a, 'b, B> { @@ -1586,11 +1688,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlFlushJob] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlFlushJobParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlFlushJob { transport, - parts, + parts: parts.into(), headers, advance_time: None, body: None, @@ -1759,6 +1864,12 @@ impl<'b> MlForecastParts<'b> { } } } +impl<'b> From<&'b str> for MlForecastParts<'b> { + #[doc = "Builds a [MlForecastParts::JobId] for the Ml Forecast API"] + fn from(t: &'b str) -> MlForecastParts<'b> { + MlForecastParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Forecast API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-forecast.html)\n\nPredicts the future behavior of a time series by using its historical behavior."] pub struct MlForecast<'a, 'b, B> { @@ -1780,11 +1891,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlForecast] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlForecastParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlForecast { transport, - parts, + parts: parts.into(), headers, body: None, duration: None, @@ -1948,6 +2062,18 @@ impl<'b> MlGetBucketsParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for MlGetBucketsParts<'b> { + #[doc = "Builds a [MlGetBucketsParts::JobIdTimestamp] for the Ml Get Buckets API"] + fn from(t: (&'b str, &'b str)) -> MlGetBucketsParts<'b> { + MlGetBucketsParts::JobIdTimestamp(t.0, t.1) + } +} +impl<'b> From<&'b str> for MlGetBucketsParts<'b> { + #[doc = "Builds a [MlGetBucketsParts::JobId] for the Ml Get Buckets API"] + fn from(t: &'b str) -> MlGetBucketsParts<'b> { + MlGetBucketsParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Buckets API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-bucket.html)\n\nRetrieves anomaly detection job results for one or more buckets."] pub struct MlGetBuckets<'a, 'b, B> { @@ -1975,11 +2101,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlGetBuckets] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetBucketsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetBuckets { transport, - parts, + parts: parts.into(), headers, anomaly_score: None, body: None, @@ -2191,6 +2320,12 @@ impl<'b> MlGetCalendarEventsParts<'b> { } } } +impl<'b> From<&'b str> for MlGetCalendarEventsParts<'b> { + #[doc = "Builds a [MlGetCalendarEventsParts::CalendarId] for the Ml Get Calendar Events API"] + fn from(t: &'b str) -> MlGetCalendarEventsParts<'b> { + MlGetCalendarEventsParts::CalendarId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Calendar Events API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-calendar-event.html)\n\nRetrieves information about the scheduled events in calendars."] pub struct MlGetCalendarEvents<'a, 'b> { @@ -2210,11 +2345,14 @@ pub struct MlGetCalendarEvents<'a, 'b> { } impl<'a, 'b> MlGetCalendarEvents<'a, 'b> { #[doc = "Creates a new instance of [MlGetCalendarEvents] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetCalendarEventsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetCalendarEvents { transport, - parts, + parts: parts.into(), headers, end: None, error_trace: None, @@ -2362,6 +2500,12 @@ impl<'b> MlGetCalendarsParts<'b> { } } } +impl<'b> From<&'b str> for MlGetCalendarsParts<'b> { + #[doc = "Builds a [MlGetCalendarsParts::CalendarId] for the Ml Get Calendars API"] + fn from(t: &'b str) -> MlGetCalendarsParts<'b> { + MlGetCalendarsParts::CalendarId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Calendars API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-calendar.html)\n\nRetrieves configuration information for calendars."] pub struct MlGetCalendars<'a, 'b, B> { @@ -2382,11 +2526,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlGetCalendars] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetCalendarsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetCalendars { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -2545,6 +2692,18 @@ impl<'b> MlGetCategoriesParts<'b> { } } } +impl<'b> From<(&'b str, i64)> for MlGetCategoriesParts<'b> { + #[doc = "Builds a [MlGetCategoriesParts::JobIdCategoryId] for the Ml Get Categories API"] + fn from(t: (&'b str, i64)) -> MlGetCategoriesParts<'b> { + MlGetCategoriesParts::JobIdCategoryId(t.0, t.1) + } +} +impl<'b> From<&'b str> for MlGetCategoriesParts<'b> { + #[doc = "Builds a [MlGetCategoriesParts::JobId] for the Ml Get Categories API"] + fn from(t: &'b str) -> MlGetCategoriesParts<'b> { + MlGetCategoriesParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Categories API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-category.html)\n\nRetrieves anomaly detection job results for one or more categories."] pub struct MlGetCategories<'a, 'b, B> { @@ -2566,11 +2725,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlGetCategories] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetCategoriesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetCategories { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -2725,6 +2887,12 @@ impl<'b> MlGetDatafeedStatsParts<'b> { } } } +impl<'b> From<&'b str> for MlGetDatafeedStatsParts<'b> { + #[doc = "Builds a [MlGetDatafeedStatsParts::DatafeedId] for the Ml Get Datafeed Stats API"] + fn from(t: &'b str) -> MlGetDatafeedStatsParts<'b> { + MlGetDatafeedStatsParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Datafeed Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-datafeed-stats.html)\n\nRetrieves usage information for datafeeds."] pub struct MlGetDatafeedStats<'a, 'b> { @@ -2740,11 +2908,14 @@ pub struct MlGetDatafeedStats<'a, 'b> { } impl<'a, 'b> MlGetDatafeedStats<'a, 'b> { #[doc = "Creates a new instance of [MlGetDatafeedStats] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetDatafeedStatsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetDatafeedStats { transport, - parts, + parts: parts.into(), headers, allow_no_datafeeds: None, error_trace: None, @@ -2856,6 +3027,12 @@ impl<'b> MlGetDatafeedsParts<'b> { } } } +impl<'b> From<&'b str> for MlGetDatafeedsParts<'b> { + #[doc = "Builds a [MlGetDatafeedsParts::DatafeedId] for the Ml Get Datafeeds API"] + fn from(t: &'b str) -> MlGetDatafeedsParts<'b> { + MlGetDatafeedsParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Datafeeds API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-datafeed.html)\n\nRetrieves configuration information for datafeeds."] pub struct MlGetDatafeeds<'a, 'b> { @@ -2871,11 +3048,14 @@ pub struct MlGetDatafeeds<'a, 'b> { } impl<'a, 'b> MlGetDatafeeds<'a, 'b> { #[doc = "Creates a new instance of [MlGetDatafeeds] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetDatafeedsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetDatafeeds { transport, - parts, + parts: parts.into(), headers, allow_no_datafeeds: None, error_trace: None, @@ -2987,6 +3167,12 @@ impl<'b> MlGetFiltersParts<'b> { } } } +impl<'b> From<&'b str> for MlGetFiltersParts<'b> { + #[doc = "Builds a [MlGetFiltersParts::FilterId] for the Ml Get Filters API"] + fn from(t: &'b str) -> MlGetFiltersParts<'b> { + MlGetFiltersParts::FilterId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Filters API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-filter.html)\n\nRetrieves filters."] pub struct MlGetFilters<'a, 'b> { @@ -3003,11 +3189,14 @@ pub struct MlGetFilters<'a, 'b> { } impl<'a, 'b> MlGetFilters<'a, 'b> { #[doc = "Creates a new instance of [MlGetFilters] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetFiltersParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetFilters { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -3126,6 +3315,12 @@ impl<'b> MlGetInfluencersParts<'b> { } } } +impl<'b> From<&'b str> for MlGetInfluencersParts<'b> { + #[doc = "Builds a [MlGetInfluencersParts::JobId] for the Ml Get Influencers API"] + fn from(t: &'b str) -> MlGetInfluencersParts<'b> { + MlGetInfluencersParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Influencers API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-influencer.html)\n\nRetrieves anomaly detection job results for one or more influencers."] pub struct MlGetInfluencers<'a, 'b, B> { @@ -3152,11 +3347,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlGetInfluencers] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetInfluencersParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetInfluencers { transport, - parts, + parts: parts.into(), headers, body: None, desc: None, @@ -3361,6 +3559,12 @@ impl<'b> MlGetJobStatsParts<'b> { } } } +impl<'b> From<&'b str> for MlGetJobStatsParts<'b> { + #[doc = "Builds a [MlGetJobStatsParts::JobId] for the Ml Get Job Stats API"] + fn from(t: &'b str) -> MlGetJobStatsParts<'b> { + MlGetJobStatsParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Job Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-job-stats.html)\n\nRetrieves usage information for anomaly detection jobs."] pub struct MlGetJobStats<'a, 'b> { @@ -3376,11 +3580,14 @@ pub struct MlGetJobStats<'a, 'b> { } impl<'a, 'b> MlGetJobStats<'a, 'b> { #[doc = "Creates a new instance of [MlGetJobStats] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetJobStatsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetJobStats { transport, - parts, + parts: parts.into(), headers, allow_no_jobs: None, error_trace: None, @@ -3492,6 +3699,12 @@ impl<'b> MlGetJobsParts<'b> { } } } +impl<'b> From<&'b str> for MlGetJobsParts<'b> { + #[doc = "Builds a [MlGetJobsParts::JobId] for the Ml Get Jobs API"] + fn from(t: &'b str) -> MlGetJobsParts<'b> { + MlGetJobsParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Jobs API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-job.html)\n\nRetrieves configuration information for anomaly detection jobs."] pub struct MlGetJobs<'a, 'b> { @@ -3507,11 +3720,14 @@ pub struct MlGetJobs<'a, 'b> { } impl<'a, 'b> MlGetJobs<'a, 'b> { #[doc = "Creates a new instance of [MlGetJobs] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetJobsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetJobs { transport, - parts, + parts: parts.into(), headers, allow_no_jobs: None, error_trace: None, @@ -3637,6 +3853,18 @@ impl<'b> MlGetModelSnapshotsParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for MlGetModelSnapshotsParts<'b> { + #[doc = "Builds a [MlGetModelSnapshotsParts::JobIdSnapshotId] for the Ml Get Model Snapshots API"] + fn from(t: (&'b str, &'b str)) -> MlGetModelSnapshotsParts<'b> { + MlGetModelSnapshotsParts::JobIdSnapshotId(t.0, t.1) + } +} +impl<'b> From<&'b str> for MlGetModelSnapshotsParts<'b> { + #[doc = "Builds a [MlGetModelSnapshotsParts::JobId] for the Ml Get Model Snapshots API"] + fn from(t: &'b str) -> MlGetModelSnapshotsParts<'b> { + MlGetModelSnapshotsParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Model Snapshots API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-snapshot.html)\n\nRetrieves information about model snapshots."] pub struct MlGetModelSnapshots<'a, 'b, B> { @@ -3661,11 +3889,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlGetModelSnapshots] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetModelSnapshotsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetModelSnapshots { transport, - parts, + parts: parts.into(), headers, body: None, desc: None, @@ -3847,6 +4078,12 @@ impl<'b> MlGetOverallBucketsParts<'b> { } } } +impl<'b> From<&'b str> for MlGetOverallBucketsParts<'b> { + #[doc = "Builds a [MlGetOverallBucketsParts::JobId] for the Ml Get Overall Buckets API"] + fn from(t: &'b str) -> MlGetOverallBucketsParts<'b> { + MlGetOverallBucketsParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Overall Buckets API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-overall-buckets.html)\n\nRetrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs."] pub struct MlGetOverallBuckets<'a, 'b, B> { @@ -3872,11 +4109,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlGetOverallBuckets] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetOverallBucketsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetOverallBuckets { transport, - parts, + parts: parts.into(), headers, allow_no_jobs: None, body: None, @@ -4068,6 +4308,12 @@ impl<'b> MlGetRecordsParts<'b> { } } } +impl<'b> From<&'b str> for MlGetRecordsParts<'b> { + #[doc = "Builds a [MlGetRecordsParts::JobId] for the Ml Get Records API"] + fn from(t: &'b str) -> MlGetRecordsParts<'b> { + MlGetRecordsParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Get Records API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-record.html)\n\nRetrieves anomaly records for an anomaly detection job."] pub struct MlGetRecords<'a, 'b, B> { @@ -4094,11 +4340,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlGetRecords] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlGetRecordsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlGetRecords { transport, - parts, + parts: parts.into(), headers, body: None, desc: None, @@ -4411,6 +4660,12 @@ impl<'b> MlOpenJobParts<'b> { } } } +impl<'b> From<&'b str> for MlOpenJobParts<'b> { + #[doc = "Builds a [MlOpenJobParts::JobId] for the Ml Open Job API"] + fn from(t: &'b str) -> MlOpenJobParts<'b> { + MlOpenJobParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Open Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-open-job.html)\n\nOpens one or more anomaly detection jobs."] pub struct MlOpenJob<'a, 'b, B> { @@ -4429,11 +4684,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlOpenJob] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlOpenJobParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlOpenJob { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -4552,6 +4810,12 @@ impl<'b> MlPostCalendarEventsParts<'b> { } } } +impl<'b> From<&'b str> for MlPostCalendarEventsParts<'b> { + #[doc = "Builds a [MlPostCalendarEventsParts::CalendarId] for the Ml Post Calendar Events API"] + fn from(t: &'b str) -> MlPostCalendarEventsParts<'b> { + MlPostCalendarEventsParts::CalendarId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Post Calendar Events API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-post-calendar-event.html)\n\nPosts scheduled events in a calendar."] pub struct MlPostCalendarEvents<'a, 'b, B> { @@ -4570,11 +4834,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlPostCalendarEvents] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlPostCalendarEventsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlPostCalendarEvents { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -4693,6 +4960,12 @@ impl<'b> MlPostDataParts<'b> { } } } +impl<'b> From<&'b str> for MlPostDataParts<'b> { + #[doc = "Builds a [MlPostDataParts::JobId] for the Ml Post Data API"] + fn from(t: &'b str) -> MlPostDataParts<'b> { + MlPostDataParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Post Data API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-post-data.html)\n\nSends data to an anomaly detection job for analysis."] pub struct MlPostData<'a, 'b, B> { @@ -4713,11 +4986,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlPostData] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlPostDataParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlPostData { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -4856,6 +5132,12 @@ impl<'b> MlPreviewDatafeedParts<'b> { } } } +impl<'b> From<&'b str> for MlPreviewDatafeedParts<'b> { + #[doc = "Builds a [MlPreviewDatafeedParts::DatafeedId] for the Ml Preview Datafeed API"] + fn from(t: &'b str) -> MlPreviewDatafeedParts<'b> { + MlPreviewDatafeedParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Preview Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-preview-datafeed.html)\n\nPreviews a datafeed."] pub struct MlPreviewDatafeed<'a, 'b> { @@ -4870,11 +5152,14 @@ pub struct MlPreviewDatafeed<'a, 'b> { } impl<'a, 'b> MlPreviewDatafeed<'a, 'b> { #[doc = "Creates a new instance of [MlPreviewDatafeed] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlPreviewDatafeedParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlPreviewDatafeed { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -4974,6 +5259,12 @@ impl<'b> MlPutCalendarParts<'b> { } } } +impl<'b> From<&'b str> for MlPutCalendarParts<'b> { + #[doc = "Builds a [MlPutCalendarParts::CalendarId] for the Ml Put Calendar API"] + fn from(t: &'b str) -> MlPutCalendarParts<'b> { + MlPutCalendarParts::CalendarId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Put Calendar API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-calendar.html)\n\nInstantiates a calendar."] pub struct MlPutCalendar<'a, 'b, B> { @@ -4992,11 +5283,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlPutCalendar] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlPutCalendarParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlPutCalendar { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -5120,6 +5414,12 @@ impl<'b> MlPutCalendarJobParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for MlPutCalendarJobParts<'b> { + #[doc = "Builds a [MlPutCalendarJobParts::CalendarIdJobId] for the Ml Put Calendar Job API"] + fn from(t: (&'b str, &'b str)) -> MlPutCalendarJobParts<'b> { + MlPutCalendarJobParts::CalendarIdJobId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Put Calendar Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-calendar-job.html)\n\nAdds an anomaly detection job to a calendar."] pub struct MlPutCalendarJob<'a, 'b, B> { @@ -5138,11 +5438,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlPutCalendarJob] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlPutCalendarJobParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlPutCalendarJob { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -5260,6 +5563,12 @@ impl<'b> MlPutDatafeedParts<'b> { } } } +impl<'b> From<&'b str> for MlPutDatafeedParts<'b> { + #[doc = "Builds a [MlPutDatafeedParts::DatafeedId] for the Ml Put Datafeed API"] + fn from(t: &'b str) -> MlPutDatafeedParts<'b> { + MlPutDatafeedParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Put Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-datafeed.html)\n\nInstantiates a datafeed."] pub struct MlPutDatafeed<'a, 'b, B> { @@ -5282,11 +5591,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlPutDatafeed] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlPutDatafeedParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlPutDatafeed { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -5447,6 +5759,12 @@ impl<'b> MlPutFilterParts<'b> { } } } +impl<'b> From<&'b str> for MlPutFilterParts<'b> { + #[doc = "Builds a [MlPutFilterParts::FilterId] for the Ml Put Filter API"] + fn from(t: &'b str) -> MlPutFilterParts<'b> { + MlPutFilterParts::FilterId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Put Filter API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-filter.html)\n\nInstantiates a filter."] pub struct MlPutFilter<'a, 'b, B> { @@ -5465,11 +5783,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlPutFilter] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlPutFilterParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlPutFilter { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -5587,6 +5908,12 @@ impl<'b> MlPutJobParts<'b> { } } } +impl<'b> From<&'b str> for MlPutJobParts<'b> { + #[doc = "Builds a [MlPutJobParts::JobId] for the Ml Put Job API"] + fn from(t: &'b str) -> MlPutJobParts<'b> { + MlPutJobParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Put Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-job.html)\n\nInstantiates an anomaly detection job."] pub struct MlPutJob<'a, 'b, B> { @@ -5605,11 +5932,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlPutJob] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlPutJobParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlPutJob { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -5734,6 +6064,12 @@ impl<'b> MlRevertModelSnapshotParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for MlRevertModelSnapshotParts<'b> { + #[doc = "Builds a [MlRevertModelSnapshotParts::JobIdSnapshotId] for the Ml Revert Model Snapshot API"] + fn from(t: (&'b str, &'b str)) -> MlRevertModelSnapshotParts<'b> { + MlRevertModelSnapshotParts::JobIdSnapshotId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Revert Model Snapshot API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-revert-snapshot.html)\n\nReverts to a specific snapshot."] pub struct MlRevertModelSnapshot<'a, 'b, B> { @@ -5753,11 +6089,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlRevertModelSnapshot] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlRevertModelSnapshotParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlRevertModelSnapshot { transport, - parts, + parts: parts.into(), headers, body: None, delete_intervening_results: None, @@ -6041,6 +6380,12 @@ impl<'b> MlStartDatafeedParts<'b> { } } } +impl<'b> From<&'b str> for MlStartDatafeedParts<'b> { + #[doc = "Builds a [MlStartDatafeedParts::DatafeedId] for the Ml Start Datafeed API"] + fn from(t: &'b str) -> MlStartDatafeedParts<'b> { + MlStartDatafeedParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Start Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-start-datafeed.html)\n\nStarts one or more datafeeds."] pub struct MlStartDatafeed<'a, 'b, B> { @@ -6062,11 +6407,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlStartDatafeed] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlStartDatafeedParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlStartDatafeed { transport, - parts, + parts: parts.into(), headers, body: None, end: None, @@ -6215,6 +6563,12 @@ impl<'b> MlStopDatafeedParts<'b> { } } } +impl<'b> From<&'b str> for MlStopDatafeedParts<'b> { + #[doc = "Builds a [MlStopDatafeedParts::DatafeedId] for the Ml Stop Datafeed API"] + fn from(t: &'b str) -> MlStopDatafeedParts<'b> { + MlStopDatafeedParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Stop Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-stop-datafeed.html)\n\nStops one or more datafeeds."] pub struct MlStopDatafeed<'a, 'b, B> { @@ -6236,11 +6590,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlStopDatafeed] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlStopDatafeedParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlStopDatafeed { transport, - parts, + parts: parts.into(), headers, allow_no_datafeeds: None, body: None, @@ -6389,6 +6746,12 @@ impl<'b> MlUpdateDatafeedParts<'b> { } } } +impl<'b> From<&'b str> for MlUpdateDatafeedParts<'b> { + #[doc = "Builds a [MlUpdateDatafeedParts::DatafeedId] for the Ml Update Datafeed API"] + fn from(t: &'b str) -> MlUpdateDatafeedParts<'b> { + MlUpdateDatafeedParts::DatafeedId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Update Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-update-datafeed.html)\n\nUpdates certain properties of a datafeed."] pub struct MlUpdateDatafeed<'a, 'b, B> { @@ -6411,11 +6774,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlUpdateDatafeed] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlUpdateDatafeedParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlUpdateDatafeed { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -6577,6 +6943,12 @@ impl<'b> MlUpdateFilterParts<'b> { } } } +impl<'b> From<&'b str> for MlUpdateFilterParts<'b> { + #[doc = "Builds a [MlUpdateFilterParts::FilterId] for the Ml Update Filter API"] + fn from(t: &'b str) -> MlUpdateFilterParts<'b> { + MlUpdateFilterParts::FilterId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Update Filter API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-update-filter.html)\n\nUpdates the description of a filter, adds items, or removes items."] pub struct MlUpdateFilter<'a, 'b, B> { @@ -6595,11 +6967,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlUpdateFilter] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlUpdateFilterParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlUpdateFilter { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -6718,6 +7093,12 @@ impl<'b> MlUpdateJobParts<'b> { } } } +impl<'b> From<&'b str> for MlUpdateJobParts<'b> { + #[doc = "Builds a [MlUpdateJobParts::JobId] for the Ml Update Job API"] + fn from(t: &'b str) -> MlUpdateJobParts<'b> { + MlUpdateJobParts::JobId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Update Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-update-job.html)\n\nUpdates certain properties of an anomaly detection job."] pub struct MlUpdateJob<'a, 'b, B> { @@ -6736,11 +7117,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlUpdateJob] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlUpdateJobParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlUpdateJob { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -6865,6 +7249,12 @@ impl<'b> MlUpdateModelSnapshotParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for MlUpdateModelSnapshotParts<'b> { + #[doc = "Builds a [MlUpdateModelSnapshotParts::JobIdSnapshotId] for the Ml Update Model Snapshot API"] + fn from(t: (&'b str, &'b str)) -> MlUpdateModelSnapshotParts<'b> { + MlUpdateModelSnapshotParts::JobIdSnapshotId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Ml Update Model Snapshot API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-update-snapshot.html)\n\nUpdates certain properties of a snapshot."] pub struct MlUpdateModelSnapshot<'a, 'b, B> { @@ -6883,11 +7273,14 @@ where B: Body, { #[doc = "Creates a new instance of [MlUpdateModelSnapshot] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MlUpdateModelSnapshotParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MlUpdateModelSnapshot { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -7263,64 +7656,73 @@ impl<'a> Ml<'a> { self.transport } #[doc = "[Ml Close Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-close-job.html)\n\nCloses one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle."] - pub fn close_job<'b>(&'a self, parts: MlCloseJobParts<'b>) -> MlCloseJob<'a, 'b, ()> { + pub fn close_job<'b, P>(&'a self, parts: P) -> MlCloseJob<'a, 'b, ()> + where + P: Into>, + { MlCloseJob::new(self.transport(), parts) } #[doc = "[Ml Delete Calendar API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar.html)\n\nDeletes a calendar."] - pub fn delete_calendar<'b>( - &'a self, - parts: MlDeleteCalendarParts<'b>, - ) -> MlDeleteCalendar<'a, 'b> { + pub fn delete_calendar<'b, P>(&'a self, parts: P) -> MlDeleteCalendar<'a, 'b> + where + P: Into>, + { MlDeleteCalendar::new(self.transport(), parts) } #[doc = "[Ml Delete Calendar Event API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar-event.html)\n\nDeletes scheduled events from a calendar."] - pub fn delete_calendar_event<'b>( - &'a self, - parts: MlDeleteCalendarEventParts<'b>, - ) -> MlDeleteCalendarEvent<'a, 'b> { + pub fn delete_calendar_event<'b, P>(&'a self, parts: P) -> MlDeleteCalendarEvent<'a, 'b> + where + P: Into>, + { MlDeleteCalendarEvent::new(self.transport(), parts) } #[doc = "[Ml Delete Calendar Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar-job.html)\n\nDeletes anomaly detection jobs from a calendar."] - pub fn delete_calendar_job<'b>( - &'a self, - parts: MlDeleteCalendarJobParts<'b>, - ) -> MlDeleteCalendarJob<'a, 'b> { + pub fn delete_calendar_job<'b, P>(&'a self, parts: P) -> MlDeleteCalendarJob<'a, 'b> + where + P: Into>, + { MlDeleteCalendarJob::new(self.transport(), parts) } #[doc = "[Ml Delete Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-datafeed.html)\n\nDeletes an existing datafeed."] - pub fn delete_datafeed<'b>( - &'a self, - parts: MlDeleteDatafeedParts<'b>, - ) -> MlDeleteDatafeed<'a, 'b> { + pub fn delete_datafeed<'b, P>(&'a self, parts: P) -> MlDeleteDatafeed<'a, 'b> + where + P: Into>, + { MlDeleteDatafeed::new(self.transport(), parts) } #[doc = "[Ml Delete Expired Data API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-expired-data.html)\n\nDeletes expired and unused machine learning data."] - pub fn delete_expired_data<'b>( - &'a self, - parts: MlDeleteExpiredDataParts<'b>, - ) -> MlDeleteExpiredData<'a, 'b, ()> { + pub fn delete_expired_data<'b, P>(&'a self, parts: P) -> MlDeleteExpiredData<'a, 'b, ()> + where + P: Into>, + { MlDeleteExpiredData::new(self.transport(), parts) } #[doc = "[Ml Delete Filter API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-filter.html)\n\nDeletes a filter."] - pub fn delete_filter<'b>(&'a self, parts: MlDeleteFilterParts<'b>) -> MlDeleteFilter<'a, 'b> { + pub fn delete_filter<'b, P>(&'a self, parts: P) -> MlDeleteFilter<'a, 'b> + where + P: Into>, + { MlDeleteFilter::new(self.transport(), parts) } #[doc = "[Ml Delete Forecast API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-forecast.html)\n\nDeletes forecasts from a machine learning job."] - pub fn delete_forecast<'b>( - &'a self, - parts: MlDeleteForecastParts<'b>, - ) -> MlDeleteForecast<'a, 'b> { + pub fn delete_forecast<'b, P>(&'a self, parts: P) -> MlDeleteForecast<'a, 'b> + where + P: Into>, + { MlDeleteForecast::new(self.transport(), parts) } #[doc = "[Ml Delete Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-job.html)\n\nDeletes an existing anomaly detection job."] - pub fn delete_job<'b>(&'a self, parts: MlDeleteJobParts<'b>) -> MlDeleteJob<'a, 'b> { + pub fn delete_job<'b, P>(&'a self, parts: P) -> MlDeleteJob<'a, 'b> + where + P: Into>, + { MlDeleteJob::new(self.transport(), parts) } #[doc = "[Ml Delete Model Snapshot API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-snapshot.html)\n\nDeletes an existing model snapshot."] - pub fn delete_model_snapshot<'b>( - &'a self, - parts: MlDeleteModelSnapshotParts<'b>, - ) -> MlDeleteModelSnapshot<'a, 'b> { + pub fn delete_model_snapshot<'b, P>(&'a self, parts: P) -> MlDeleteModelSnapshot<'a, 'b> + where + P: Into>, + { MlDeleteModelSnapshot::new(self.transport(), parts) } #[doc = "[Ml Estimate Model Memory API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-apis.html)\n\nEstimates the model memory"] @@ -7328,84 +7730,108 @@ impl<'a> Ml<'a> { MlEstimateModelMemory::new(self.transport()) } #[doc = "[Ml Flush Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-flush-job.html)\n\nForces any buffered data to be processed by the job."] - pub fn flush_job<'b>(&'a self, parts: MlFlushJobParts<'b>) -> MlFlushJob<'a, 'b, ()> { + pub fn flush_job<'b, P>(&'a self, parts: P) -> MlFlushJob<'a, 'b, ()> + where + P: Into>, + { MlFlushJob::new(self.transport(), parts) } #[doc = "[Ml Forecast API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-forecast.html)\n\nPredicts the future behavior of a time series by using its historical behavior."] - pub fn forecast<'b>(&'a self, parts: MlForecastParts<'b>) -> MlForecast<'a, 'b, ()> { + pub fn forecast<'b, P>(&'a self, parts: P) -> MlForecast<'a, 'b, ()> + where + P: Into>, + { MlForecast::new(self.transport(), parts) } #[doc = "[Ml Get Buckets API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-bucket.html)\n\nRetrieves anomaly detection job results for one or more buckets."] - pub fn get_buckets<'b>(&'a self, parts: MlGetBucketsParts<'b>) -> MlGetBuckets<'a, 'b, ()> { + pub fn get_buckets<'b, P>(&'a self, parts: P) -> MlGetBuckets<'a, 'b, ()> + where + P: Into>, + { MlGetBuckets::new(self.transport(), parts) } #[doc = "[Ml Get Calendar Events API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-calendar-event.html)\n\nRetrieves information about the scheduled events in calendars."] - pub fn get_calendar_events<'b>( - &'a self, - parts: MlGetCalendarEventsParts<'b>, - ) -> MlGetCalendarEvents<'a, 'b> { + pub fn get_calendar_events<'b, P>(&'a self, parts: P) -> MlGetCalendarEvents<'a, 'b> + where + P: Into>, + { MlGetCalendarEvents::new(self.transport(), parts) } #[doc = "[Ml Get Calendars API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-calendar.html)\n\nRetrieves configuration information for calendars."] - pub fn get_calendars<'b>( - &'a self, - parts: MlGetCalendarsParts<'b>, - ) -> MlGetCalendars<'a, 'b, ()> { + pub fn get_calendars<'b, P>(&'a self, parts: P) -> MlGetCalendars<'a, 'b, ()> + where + P: Into>, + { MlGetCalendars::new(self.transport(), parts) } #[doc = "[Ml Get Categories API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-category.html)\n\nRetrieves anomaly detection job results for one or more categories."] - pub fn get_categories<'b>( - &'a self, - parts: MlGetCategoriesParts<'b>, - ) -> MlGetCategories<'a, 'b, ()> { + pub fn get_categories<'b, P>(&'a self, parts: P) -> MlGetCategories<'a, 'b, ()> + where + P: Into>, + { MlGetCategories::new(self.transport(), parts) } #[doc = "[Ml Get Datafeed Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-datafeed-stats.html)\n\nRetrieves usage information for datafeeds."] - pub fn get_datafeed_stats<'b>( - &'a self, - parts: MlGetDatafeedStatsParts<'b>, - ) -> MlGetDatafeedStats<'a, 'b> { + pub fn get_datafeed_stats<'b, P>(&'a self, parts: P) -> MlGetDatafeedStats<'a, 'b> + where + P: Into>, + { MlGetDatafeedStats::new(self.transport(), parts) } #[doc = "[Ml Get Datafeeds API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-datafeed.html)\n\nRetrieves configuration information for datafeeds."] - pub fn get_datafeeds<'b>(&'a self, parts: MlGetDatafeedsParts<'b>) -> MlGetDatafeeds<'a, 'b> { + pub fn get_datafeeds<'b, P>(&'a self, parts: P) -> MlGetDatafeeds<'a, 'b> + where + P: Into>, + { MlGetDatafeeds::new(self.transport(), parts) } #[doc = "[Ml Get Filters API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-filter.html)\n\nRetrieves filters."] - pub fn get_filters<'b>(&'a self, parts: MlGetFiltersParts<'b>) -> MlGetFilters<'a, 'b> { + pub fn get_filters<'b, P>(&'a self, parts: P) -> MlGetFilters<'a, 'b> + where + P: Into>, + { MlGetFilters::new(self.transport(), parts) } #[doc = "[Ml Get Influencers API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-influencer.html)\n\nRetrieves anomaly detection job results for one or more influencers."] - pub fn get_influencers<'b>( - &'a self, - parts: MlGetInfluencersParts<'b>, - ) -> MlGetInfluencers<'a, 'b, ()> { + pub fn get_influencers<'b, P>(&'a self, parts: P) -> MlGetInfluencers<'a, 'b, ()> + where + P: Into>, + { MlGetInfluencers::new(self.transport(), parts) } #[doc = "[Ml Get Job Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-job-stats.html)\n\nRetrieves usage information for anomaly detection jobs."] - pub fn get_job_stats<'b>(&'a self, parts: MlGetJobStatsParts<'b>) -> MlGetJobStats<'a, 'b> { + pub fn get_job_stats<'b, P>(&'a self, parts: P) -> MlGetJobStats<'a, 'b> + where + P: Into>, + { MlGetJobStats::new(self.transport(), parts) } #[doc = "[Ml Get Jobs API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-job.html)\n\nRetrieves configuration information for anomaly detection jobs."] - pub fn get_jobs<'b>(&'a self, parts: MlGetJobsParts<'b>) -> MlGetJobs<'a, 'b> { + pub fn get_jobs<'b, P>(&'a self, parts: P) -> MlGetJobs<'a, 'b> + where + P: Into>, + { MlGetJobs::new(self.transport(), parts) } #[doc = "[Ml Get Model Snapshots API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-snapshot.html)\n\nRetrieves information about model snapshots."] - pub fn get_model_snapshots<'b>( - &'a self, - parts: MlGetModelSnapshotsParts<'b>, - ) -> MlGetModelSnapshots<'a, 'b, ()> { + pub fn get_model_snapshots<'b, P>(&'a self, parts: P) -> MlGetModelSnapshots<'a, 'b, ()> + where + P: Into>, + { MlGetModelSnapshots::new(self.transport(), parts) } #[doc = "[Ml Get Overall Buckets API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-overall-buckets.html)\n\nRetrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs."] - pub fn get_overall_buckets<'b>( - &'a self, - parts: MlGetOverallBucketsParts<'b>, - ) -> MlGetOverallBuckets<'a, 'b, ()> { + pub fn get_overall_buckets<'b, P>(&'a self, parts: P) -> MlGetOverallBuckets<'a, 'b, ()> + where + P: Into>, + { MlGetOverallBuckets::new(self.transport(), parts) } #[doc = "[Ml Get Records API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-get-record.html)\n\nRetrieves anomaly records for an anomaly detection job."] - pub fn get_records<'b>(&'a self, parts: MlGetRecordsParts<'b>) -> MlGetRecords<'a, 'b, ()> { + pub fn get_records<'b, P>(&'a self, parts: P) -> MlGetRecords<'a, 'b, ()> + where + P: Into>, + { MlGetRecords::new(self.transport(), parts) } #[doc = "[Ml Info API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-ml-info.html)\n\nReturns defaults and limits used by machine learning."] @@ -7413,55 +7839,73 @@ impl<'a> Ml<'a> { MlInfo::new(self.transport()) } #[doc = "[Ml Open Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-open-job.html)\n\nOpens one or more anomaly detection jobs."] - pub fn open_job<'b>(&'a self, parts: MlOpenJobParts<'b>) -> MlOpenJob<'a, 'b, ()> { + pub fn open_job<'b, P>(&'a self, parts: P) -> MlOpenJob<'a, 'b, ()> + where + P: Into>, + { MlOpenJob::new(self.transport(), parts) } #[doc = "[Ml Post Calendar Events API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-post-calendar-event.html)\n\nPosts scheduled events in a calendar."] - pub fn post_calendar_events<'b>( - &'a self, - parts: MlPostCalendarEventsParts<'b>, - ) -> MlPostCalendarEvents<'a, 'b, ()> { + pub fn post_calendar_events<'b, P>(&'a self, parts: P) -> MlPostCalendarEvents<'a, 'b, ()> + where + P: Into>, + { MlPostCalendarEvents::new(self.transport(), parts) } #[doc = "[Ml Post Data API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-post-data.html)\n\nSends data to an anomaly detection job for analysis."] - pub fn post_data<'b>(&'a self, parts: MlPostDataParts<'b>) -> MlPostData<'a, 'b, ()> { + pub fn post_data<'b, P>(&'a self, parts: P) -> MlPostData<'a, 'b, ()> + where + P: Into>, + { MlPostData::new(self.transport(), parts) } #[doc = "[Ml Preview Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-preview-datafeed.html)\n\nPreviews a datafeed."] - pub fn preview_datafeed<'b>( - &'a self, - parts: MlPreviewDatafeedParts<'b>, - ) -> MlPreviewDatafeed<'a, 'b> { + pub fn preview_datafeed<'b, P>(&'a self, parts: P) -> MlPreviewDatafeed<'a, 'b> + where + P: Into>, + { MlPreviewDatafeed::new(self.transport(), parts) } #[doc = "[Ml Put Calendar API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-calendar.html)\n\nInstantiates a calendar."] - pub fn put_calendar<'b>(&'a self, parts: MlPutCalendarParts<'b>) -> MlPutCalendar<'a, 'b, ()> { + pub fn put_calendar<'b, P>(&'a self, parts: P) -> MlPutCalendar<'a, 'b, ()> + where + P: Into>, + { MlPutCalendar::new(self.transport(), parts) } #[doc = "[Ml Put Calendar Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-calendar-job.html)\n\nAdds an anomaly detection job to a calendar."] - pub fn put_calendar_job<'b>( - &'a self, - parts: MlPutCalendarJobParts<'b>, - ) -> MlPutCalendarJob<'a, 'b, ()> { + pub fn put_calendar_job<'b, P>(&'a self, parts: P) -> MlPutCalendarJob<'a, 'b, ()> + where + P: Into>, + { MlPutCalendarJob::new(self.transport(), parts) } #[doc = "[Ml Put Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-datafeed.html)\n\nInstantiates a datafeed."] - pub fn put_datafeed<'b>(&'a self, parts: MlPutDatafeedParts<'b>) -> MlPutDatafeed<'a, 'b, ()> { + pub fn put_datafeed<'b, P>(&'a self, parts: P) -> MlPutDatafeed<'a, 'b, ()> + where + P: Into>, + { MlPutDatafeed::new(self.transport(), parts) } #[doc = "[Ml Put Filter API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-filter.html)\n\nInstantiates a filter."] - pub fn put_filter<'b>(&'a self, parts: MlPutFilterParts<'b>) -> MlPutFilter<'a, 'b, ()> { + pub fn put_filter<'b, P>(&'a self, parts: P) -> MlPutFilter<'a, 'b, ()> + where + P: Into>, + { MlPutFilter::new(self.transport(), parts) } #[doc = "[Ml Put Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-put-job.html)\n\nInstantiates an anomaly detection job."] - pub fn put_job<'b>(&'a self, parts: MlPutJobParts<'b>) -> MlPutJob<'a, 'b, ()> { + pub fn put_job<'b, P>(&'a self, parts: P) -> MlPutJob<'a, 'b, ()> + where + P: Into>, + { MlPutJob::new(self.transport(), parts) } #[doc = "[Ml Revert Model Snapshot API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-revert-snapshot.html)\n\nReverts to a specific snapshot."] - pub fn revert_model_snapshot<'b>( - &'a self, - parts: MlRevertModelSnapshotParts<'b>, - ) -> MlRevertModelSnapshot<'a, 'b, ()> { + pub fn revert_model_snapshot<'b, P>(&'a self, parts: P) -> MlRevertModelSnapshot<'a, 'b, ()> + where + P: Into>, + { MlRevertModelSnapshot::new(self.transport(), parts) } #[doc = "[Ml Set Upgrade Mode API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-set-upgrade-mode.html)\n\nSets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade."] @@ -7469,42 +7913,45 @@ impl<'a> Ml<'a> { MlSetUpgradeMode::new(self.transport()) } #[doc = "[Ml Start Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-start-datafeed.html)\n\nStarts one or more datafeeds."] - pub fn start_datafeed<'b>( - &'a self, - parts: MlStartDatafeedParts<'b>, - ) -> MlStartDatafeed<'a, 'b, ()> { + pub fn start_datafeed<'b, P>(&'a self, parts: P) -> MlStartDatafeed<'a, 'b, ()> + where + P: Into>, + { MlStartDatafeed::new(self.transport(), parts) } #[doc = "[Ml Stop Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-stop-datafeed.html)\n\nStops one or more datafeeds."] - pub fn stop_datafeed<'b>( - &'a self, - parts: MlStopDatafeedParts<'b>, - ) -> MlStopDatafeed<'a, 'b, ()> { + pub fn stop_datafeed<'b, P>(&'a self, parts: P) -> MlStopDatafeed<'a, 'b, ()> + where + P: Into>, + { MlStopDatafeed::new(self.transport(), parts) } #[doc = "[Ml Update Datafeed API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-update-datafeed.html)\n\nUpdates certain properties of a datafeed."] - pub fn update_datafeed<'b>( - &'a self, - parts: MlUpdateDatafeedParts<'b>, - ) -> MlUpdateDatafeed<'a, 'b, ()> { + pub fn update_datafeed<'b, P>(&'a self, parts: P) -> MlUpdateDatafeed<'a, 'b, ()> + where + P: Into>, + { MlUpdateDatafeed::new(self.transport(), parts) } #[doc = "[Ml Update Filter API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-update-filter.html)\n\nUpdates the description of a filter, adds items, or removes items."] - pub fn update_filter<'b>( - &'a self, - parts: MlUpdateFilterParts<'b>, - ) -> MlUpdateFilter<'a, 'b, ()> { + pub fn update_filter<'b, P>(&'a self, parts: P) -> MlUpdateFilter<'a, 'b, ()> + where + P: Into>, + { MlUpdateFilter::new(self.transport(), parts) } #[doc = "[Ml Update Job API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-update-job.html)\n\nUpdates certain properties of an anomaly detection job."] - pub fn update_job<'b>(&'a self, parts: MlUpdateJobParts<'b>) -> MlUpdateJob<'a, 'b, ()> { + pub fn update_job<'b, P>(&'a self, parts: P) -> MlUpdateJob<'a, 'b, ()> + where + P: Into>, + { MlUpdateJob::new(self.transport(), parts) } #[doc = "[Ml Update Model Snapshot API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-update-snapshot.html)\n\nUpdates certain properties of a snapshot."] - pub fn update_model_snapshot<'b>( - &'a self, - parts: MlUpdateModelSnapshotParts<'b>, - ) -> MlUpdateModelSnapshot<'a, 'b, ()> { + pub fn update_model_snapshot<'b, P>(&'a self, parts: P) -> MlUpdateModelSnapshot<'a, 'b, ()> + where + P: Into>, + { MlUpdateModelSnapshot::new(self.transport(), parts) } #[doc = "[Ml Validate API](https://www.elastic.co/guide/en/machine-learning/8.0/ml-jobs.html)\n\nValidates an anomaly detection job."] diff --git a/elasticsearch/src/generated/namespace_clients/nodes.rs b/elasticsearch/src/generated/namespace_clients/nodes.rs index 1505836c..0acbcc91 100644 --- a/elasticsearch/src/generated/namespace_clients/nodes.rs +++ b/elasticsearch/src/generated/namespace_clients/nodes.rs @@ -64,6 +64,12 @@ impl<'b> NodesHotThreadsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for NodesHotThreadsParts<'b> { + #[doc = "Builds a [NodesHotThreadsParts::NodeId] for the Nodes Hot Threads API"] + fn from(t: &'b [&'b str]) -> NodesHotThreadsParts<'b> { + NodesHotThreadsParts::NodeId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Nodes Hot Threads API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-hot-threads.html)\n\nReturns information about hot threads on each node in the cluster."] pub struct NodesHotThreads<'a, 'b> { @@ -84,11 +90,14 @@ pub struct NodesHotThreads<'a, 'b> { } impl<'a, 'b> NodesHotThreads<'a, 'b> { #[doc = "Creates a new instance of [NodesHotThreads] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: NodesHotThreadsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); NodesHotThreads { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -274,6 +283,18 @@ impl<'b> NodesInfoParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for NodesInfoParts<'b> { + #[doc = "Builds a [NodesInfoParts::NodeId] for the Nodes Info API"] + fn from(t: &'b [&'b str]) -> NodesInfoParts<'b> { + NodesInfoParts::NodeId(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for NodesInfoParts<'b> { + #[doc = "Builds a [NodesInfoParts::NodeIdMetric] for the Nodes Info API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> NodesInfoParts<'b> { + NodesInfoParts::NodeIdMetric(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Nodes Info API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-info.html)\n\nReturns information about nodes in the cluster."] pub struct NodesInfo<'a, 'b> { @@ -290,11 +311,14 @@ pub struct NodesInfo<'a, 'b> { } impl<'a, 'b> NodesInfo<'a, 'b> { #[doc = "Creates a new instance of [NodesInfo] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: NodesInfoParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); NodesInfo { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -417,6 +441,12 @@ impl<'b> NodesReloadSecureSettingsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for NodesReloadSecureSettingsParts<'b> { + #[doc = "Builds a [NodesReloadSecureSettingsParts::NodeId] for the Nodes Reload Secure Settings API"] + fn from(t: &'b [&'b str]) -> NodesReloadSecureSettingsParts<'b> { + NodesReloadSecureSettingsParts::NodeId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Nodes Reload Secure Settings API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/secure-settings.html#reloadable-secure-settings)\n\nReloads secure settings."] pub struct NodesReloadSecureSettings<'a, 'b, B> { @@ -436,11 +466,14 @@ where B: Body, { #[doc = "Creates a new instance of [NodesReloadSecureSettings] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: NodesReloadSecureSettingsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); NodesReloadSecureSettings { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -645,6 +678,24 @@ impl<'b> NodesStatsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for NodesStatsParts<'b> { + #[doc = "Builds a [NodesStatsParts::NodeId] for the Nodes Stats API"] + fn from(t: &'b [&'b str]) -> NodesStatsParts<'b> { + NodesStatsParts::NodeId(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for NodesStatsParts<'b> { + #[doc = "Builds a [NodesStatsParts::NodeIdMetric] for the Nodes Stats API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> NodesStatsParts<'b> { + NodesStatsParts::NodeIdMetric(t.0, t.1) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str], &'b [&'b str])> for NodesStatsParts<'b> { + #[doc = "Builds a [NodesStatsParts::NodeIdMetricIndexMetric] for the Nodes Stats API"] + fn from(t: (&'b [&'b str], &'b [&'b str], &'b [&'b str])) -> NodesStatsParts<'b> { + NodesStatsParts::NodeIdMetricIndexMetric(t.0, t.1, t.2) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Nodes Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-stats.html)\n\nReturns statistical information about nodes in the cluster."] pub struct NodesStats<'a, 'b> { @@ -667,11 +718,14 @@ pub struct NodesStats<'a, 'b> { } impl<'a, 'b> NodesStats<'a, 'b> { #[doc = "Creates a new instance of [NodesStats] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: NodesStatsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); NodesStats { transport, - parts, + parts: parts.into(), headers, completion_fields: None, error_trace: None, @@ -882,6 +936,18 @@ impl<'b> NodesUsageParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for NodesUsageParts<'b> { + #[doc = "Builds a [NodesUsageParts::NodeId] for the Nodes Usage API"] + fn from(t: &'b [&'b str]) -> NodesUsageParts<'b> { + NodesUsageParts::NodeId(t) + } +} +impl<'b> From<(&'b [&'b str], &'b [&'b str])> for NodesUsageParts<'b> { + #[doc = "Builds a [NodesUsageParts::NodeIdMetric] for the Nodes Usage API"] + fn from(t: (&'b [&'b str], &'b [&'b str])) -> NodesUsageParts<'b> { + NodesUsageParts::NodeIdMetric(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Nodes Usage API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-usage.html)\n\nReturns low-level information about REST actions usage on nodes."] pub struct NodesUsage<'a, 'b> { @@ -897,11 +963,14 @@ pub struct NodesUsage<'a, 'b> { } impl<'a, 'b> NodesUsage<'a, 'b> { #[doc = "Creates a new instance of [NodesUsage] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: NodesUsageParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); NodesUsage { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1002,26 +1071,41 @@ impl<'a> Nodes<'a> { self.transport } #[doc = "[Nodes Hot Threads API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-hot-threads.html)\n\nReturns information about hot threads on each node in the cluster."] - pub fn hot_threads<'b>(&'a self, parts: NodesHotThreadsParts<'b>) -> NodesHotThreads<'a, 'b> { + pub fn hot_threads<'b, P>(&'a self, parts: P) -> NodesHotThreads<'a, 'b> + where + P: Into>, + { NodesHotThreads::new(self.transport(), parts) } #[doc = "[Nodes Info API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-info.html)\n\nReturns information about nodes in the cluster."] - pub fn info<'b>(&'a self, parts: NodesInfoParts<'b>) -> NodesInfo<'a, 'b> { + pub fn info<'b, P>(&'a self, parts: P) -> NodesInfo<'a, 'b> + where + P: Into>, + { NodesInfo::new(self.transport(), parts) } #[doc = "[Nodes Reload Secure Settings API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/secure-settings.html#reloadable-secure-settings)\n\nReloads secure settings."] - pub fn reload_secure_settings<'b>( + pub fn reload_secure_settings<'b, P>( &'a self, - parts: NodesReloadSecureSettingsParts<'b>, - ) -> NodesReloadSecureSettings<'a, 'b, ()> { + parts: P, + ) -> NodesReloadSecureSettings<'a, 'b, ()> + where + P: Into>, + { NodesReloadSecureSettings::new(self.transport(), parts) } #[doc = "[Nodes Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-stats.html)\n\nReturns statistical information about nodes in the cluster."] - pub fn stats<'b>(&'a self, parts: NodesStatsParts<'b>) -> NodesStats<'a, 'b> { + pub fn stats<'b, P>(&'a self, parts: P) -> NodesStats<'a, 'b> + where + P: Into>, + { NodesStats::new(self.transport(), parts) } #[doc = "[Nodes Usage API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-usage.html)\n\nReturns low-level information about REST actions usage on nodes."] - pub fn usage<'b>(&'a self, parts: NodesUsageParts<'b>) -> NodesUsage<'a, 'b> { + pub fn usage<'b, P>(&'a self, parts: P) -> NodesUsage<'a, 'b> + where + P: Into>, + { NodesUsage::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/security.rs b/elasticsearch/src/generated/namespace_clients/security.rs index a4a8f2f0..1d1e205c 100644 --- a/elasticsearch/src/generated/namespace_clients/security.rs +++ b/elasticsearch/src/generated/namespace_clients/security.rs @@ -174,6 +174,12 @@ impl<'b> SecurityChangePasswordParts<'b> { } } } +impl<'b> From<&'b str> for SecurityChangePasswordParts<'b> { + #[doc = "Builds a [SecurityChangePasswordParts::Username] for the Security Change Password API"] + fn from(t: &'b str) -> SecurityChangePasswordParts<'b> { + SecurityChangePasswordParts::Username(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Change Password API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-change-password.html)\n\nChanges the passwords of users in the native realm and built-in users."] pub struct SecurityChangePassword<'a, 'b, B> { @@ -193,11 +199,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityChangePassword] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityChangePasswordParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityChangePassword { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -327,6 +336,12 @@ impl<'b> SecurityClearCachedPrivilegesParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SecurityClearCachedPrivilegesParts<'b> { + #[doc = "Builds a [SecurityClearCachedPrivilegesParts::Application] for the Security Clear Cached Privileges API"] + fn from(t: &'b [&'b str]) -> SecurityClearCachedPrivilegesParts<'b> { + SecurityClearCachedPrivilegesParts::Application(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Clear Cached Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-clear-privilege-cache.html)\n\nEvicts application privileges from the native application privileges cache."] pub struct SecurityClearCachedPrivileges<'a, 'b, B> { @@ -345,11 +360,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityClearCachedPrivileges] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityClearCachedPrivilegesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityClearCachedPrivileges { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -469,6 +487,12 @@ impl<'b> SecurityClearCachedRealmsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SecurityClearCachedRealmsParts<'b> { + #[doc = "Builds a [SecurityClearCachedRealmsParts::Realms] for the Security Clear Cached Realms API"] + fn from(t: &'b [&'b str]) -> SecurityClearCachedRealmsParts<'b> { + SecurityClearCachedRealmsParts::Realms(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Clear Cached Realms API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-clear-cache.html)\n\nEvicts users from the user cache. Can completely clear the cache or evict specific users."] pub struct SecurityClearCachedRealms<'a, 'b, B> { @@ -488,11 +512,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityClearCachedRealms] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityClearCachedRealmsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityClearCachedRealms { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -625,6 +652,12 @@ impl<'b> SecurityClearCachedRolesParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SecurityClearCachedRolesParts<'b> { + #[doc = "Builds a [SecurityClearCachedRolesParts::Name] for the Security Clear Cached Roles API"] + fn from(t: &'b [&'b str]) -> SecurityClearCachedRolesParts<'b> { + SecurityClearCachedRolesParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Clear Cached Roles API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-clear-role-cache.html)\n\nEvicts roles from the native role cache."] pub struct SecurityClearCachedRoles<'a, 'b, B> { @@ -643,11 +676,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityClearCachedRoles] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityClearCachedRolesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityClearCachedRoles { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -913,6 +949,12 @@ impl<'b> SecurityDeletePrivilegesParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for SecurityDeletePrivilegesParts<'b> { + #[doc = "Builds a [SecurityDeletePrivilegesParts::ApplicationName] for the Security Delete Privileges API"] + fn from(t: (&'b str, &'b str)) -> SecurityDeletePrivilegesParts<'b> { + SecurityDeletePrivilegesParts::ApplicationName(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Delete Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-delete-privilege.html)\n\nRemoves application privileges."] pub struct SecurityDeletePrivileges<'a, 'b> { @@ -928,11 +970,14 @@ pub struct SecurityDeletePrivileges<'a, 'b> { } impl<'a, 'b> SecurityDeletePrivileges<'a, 'b> { #[doc = "Creates a new instance of [SecurityDeletePrivileges] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityDeletePrivilegesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityDeletePrivileges { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1040,6 +1085,12 @@ impl<'b> SecurityDeleteRoleParts<'b> { } } } +impl<'b> From<&'b str> for SecurityDeleteRoleParts<'b> { + #[doc = "Builds a [SecurityDeleteRoleParts::Name] for the Security Delete Role API"] + fn from(t: &'b str) -> SecurityDeleteRoleParts<'b> { + SecurityDeleteRoleParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Delete Role API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-delete-role.html)\n\nRemoves roles in the native realm."] pub struct SecurityDeleteRole<'a, 'b> { @@ -1055,11 +1106,14 @@ pub struct SecurityDeleteRole<'a, 'b> { } impl<'a, 'b> SecurityDeleteRole<'a, 'b> { #[doc = "Creates a new instance of [SecurityDeleteRole] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityDeleteRoleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityDeleteRole { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1167,6 +1221,12 @@ impl<'b> SecurityDeleteRoleMappingParts<'b> { } } } +impl<'b> From<&'b str> for SecurityDeleteRoleMappingParts<'b> { + #[doc = "Builds a [SecurityDeleteRoleMappingParts::Name] for the Security Delete Role Mapping API"] + fn from(t: &'b str) -> SecurityDeleteRoleMappingParts<'b> { + SecurityDeleteRoleMappingParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Delete Role Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-delete-role-mapping.html)\n\nRemoves role mappings."] pub struct SecurityDeleteRoleMapping<'a, 'b> { @@ -1182,11 +1242,14 @@ pub struct SecurityDeleteRoleMapping<'a, 'b> { } impl<'a, 'b> SecurityDeleteRoleMapping<'a, 'b> { #[doc = "Creates a new instance of [SecurityDeleteRoleMapping] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityDeleteRoleMappingParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityDeleteRoleMapping { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1295,6 +1358,12 @@ impl<'b> SecurityDeleteUserParts<'b> { } } } +impl<'b> From<&'b str> for SecurityDeleteUserParts<'b> { + #[doc = "Builds a [SecurityDeleteUserParts::Username] for the Security Delete User API"] + fn from(t: &'b str) -> SecurityDeleteUserParts<'b> { + SecurityDeleteUserParts::Username(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Delete User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-delete-user.html)\n\nDeletes users from the native realm."] pub struct SecurityDeleteUser<'a, 'b> { @@ -1310,11 +1379,14 @@ pub struct SecurityDeleteUser<'a, 'b> { } impl<'a, 'b> SecurityDeleteUser<'a, 'b> { #[doc = "Creates a new instance of [SecurityDeleteUser] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityDeleteUserParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityDeleteUser { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1424,6 +1496,12 @@ impl<'b> SecurityDisableUserParts<'b> { } } } +impl<'b> From<&'b str> for SecurityDisableUserParts<'b> { + #[doc = "Builds a [SecurityDisableUserParts::Username] for the Security Disable User API"] + fn from(t: &'b str) -> SecurityDisableUserParts<'b> { + SecurityDisableUserParts::Username(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Disable User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-disable-user.html)\n\nDisables users in the native realm."] pub struct SecurityDisableUser<'a, 'b, B> { @@ -1443,11 +1521,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityDisableUser] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityDisableUserParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityDisableUser { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1576,6 +1657,12 @@ impl<'b> SecurityEnableUserParts<'b> { } } } +impl<'b> From<&'b str> for SecurityEnableUserParts<'b> { + #[doc = "Builds a [SecurityEnableUserParts::Username] for the Security Enable User API"] + fn from(t: &'b str) -> SecurityEnableUserParts<'b> { + SecurityEnableUserParts::Username(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Enable User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-enable-user.html)\n\nEnables users in the native realm."] pub struct SecurityEnableUser<'a, 'b, B> { @@ -1595,11 +1682,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityEnableUser] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityEnableUserParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityEnableUser { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -2016,6 +2106,18 @@ impl<'b> SecurityGetPrivilegesParts<'b> { } } } +impl<'b> From<&'b str> for SecurityGetPrivilegesParts<'b> { + #[doc = "Builds a [SecurityGetPrivilegesParts::Application] for the Security Get Privileges API"] + fn from(t: &'b str) -> SecurityGetPrivilegesParts<'b> { + SecurityGetPrivilegesParts::Application(t) + } +} +impl<'b> From<(&'b str, &'b str)> for SecurityGetPrivilegesParts<'b> { + #[doc = "Builds a [SecurityGetPrivilegesParts::ApplicationName] for the Security Get Privileges API"] + fn from(t: (&'b str, &'b str)) -> SecurityGetPrivilegesParts<'b> { + SecurityGetPrivilegesParts::ApplicationName(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Get Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-privileges.html)\n\nRetrieves application privileges."] pub struct SecurityGetPrivileges<'a, 'b> { @@ -2030,11 +2132,14 @@ pub struct SecurityGetPrivileges<'a, 'b> { } impl<'a, 'b> SecurityGetPrivileges<'a, 'b> { #[doc = "Creates a new instance of [SecurityGetPrivileges] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityGetPrivilegesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityGetPrivileges { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -2138,6 +2243,12 @@ impl<'b> SecurityGetRoleParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SecurityGetRoleParts<'b> { + #[doc = "Builds a [SecurityGetRoleParts::Name] for the Security Get Role API"] + fn from(t: &'b [&'b str]) -> SecurityGetRoleParts<'b> { + SecurityGetRoleParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Get Role API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-role.html)\n\nRetrieves roles in the native realm."] pub struct SecurityGetRole<'a, 'b> { @@ -2152,11 +2263,14 @@ pub struct SecurityGetRole<'a, 'b> { } impl<'a, 'b> SecurityGetRole<'a, 'b> { #[doc = "Creates a new instance of [SecurityGetRole] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityGetRoleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityGetRole { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -2260,6 +2374,12 @@ impl<'b> SecurityGetRoleMappingParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SecurityGetRoleMappingParts<'b> { + #[doc = "Builds a [SecurityGetRoleMappingParts::Name] for the Security Get Role Mapping API"] + fn from(t: &'b [&'b str]) -> SecurityGetRoleMappingParts<'b> { + SecurityGetRoleMappingParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Get Role Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-role-mapping.html)\n\nRetrieves role mappings."] pub struct SecurityGetRoleMapping<'a, 'b> { @@ -2274,11 +2394,14 @@ pub struct SecurityGetRoleMapping<'a, 'b> { } impl<'a, 'b> SecurityGetRoleMapping<'a, 'b> { #[doc = "Creates a new instance of [SecurityGetRoleMapping] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityGetRoleMappingParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityGetRoleMapping { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -2515,6 +2638,12 @@ impl<'b> SecurityGetUserParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SecurityGetUserParts<'b> { + #[doc = "Builds a [SecurityGetUserParts::Username] for the Security Get User API"] + fn from(t: &'b [&'b str]) -> SecurityGetUserParts<'b> { + SecurityGetUserParts::Username(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Get User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-user.html)\n\nRetrieves information about users in the native realm and built-in users."] pub struct SecurityGetUser<'a, 'b> { @@ -2529,11 +2658,14 @@ pub struct SecurityGetUser<'a, 'b> { } impl<'a, 'b> SecurityGetUser<'a, 'b> { #[doc = "Creates a new instance of [SecurityGetUser] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityGetUserParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityGetUser { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -2747,6 +2879,12 @@ impl<'b> SecurityHasPrivilegesParts<'b> { } } } +impl<'b> From<&'b str> for SecurityHasPrivilegesParts<'b> { + #[doc = "Builds a [SecurityHasPrivilegesParts::User] for the Security Has Privileges API"] + fn from(t: &'b str) -> SecurityHasPrivilegesParts<'b> { + SecurityHasPrivilegesParts::User(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Has Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-has-privileges.html)\n\nDetermines whether the specified user has a specified list of privileges."] pub struct SecurityHasPrivileges<'a, 'b, B> { @@ -2765,11 +2903,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityHasPrivileges] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityHasPrivilegesParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityHasPrivileges { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -3299,6 +3440,12 @@ impl<'b> SecurityPutRoleParts<'b> { } } } +impl<'b> From<&'b str> for SecurityPutRoleParts<'b> { + #[doc = "Builds a [SecurityPutRoleParts::Name] for the Security Put Role API"] + fn from(t: &'b str) -> SecurityPutRoleParts<'b> { + SecurityPutRoleParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Put Role API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-put-role.html)\n\nAdds and updates roles in the native realm."] pub struct SecurityPutRole<'a, 'b, B> { @@ -3318,11 +3465,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityPutRole] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityPutRoleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityPutRole { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -3449,6 +3599,12 @@ impl<'b> SecurityPutRoleMappingParts<'b> { } } } +impl<'b> From<&'b str> for SecurityPutRoleMappingParts<'b> { + #[doc = "Builds a [SecurityPutRoleMappingParts::Name] for the Security Put Role Mapping API"] + fn from(t: &'b str) -> SecurityPutRoleMappingParts<'b> { + SecurityPutRoleMappingParts::Name(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Put Role Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-put-role-mapping.html)\n\nCreates and updates role mappings."] pub struct SecurityPutRoleMapping<'a, 'b, B> { @@ -3468,11 +3624,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityPutRoleMapping] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityPutRoleMappingParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityPutRoleMapping { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -3600,6 +3759,12 @@ impl<'b> SecurityPutUserParts<'b> { } } } +impl<'b> From<&'b str> for SecurityPutUserParts<'b> { + #[doc = "Builds a [SecurityPutUserParts::Username] for the Security Put User API"] + fn from(t: &'b str) -> SecurityPutUserParts<'b> { + SecurityPutUserParts::Username(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Security Put User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-put-user.html)\n\nAdds and updates users in the native realm. These users are commonly referred to as native users."] pub struct SecurityPutUser<'a, 'b, B> { @@ -3619,11 +3784,14 @@ where B: Body, { #[doc = "Creates a new instance of [SecurityPutUser] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SecurityPutUserParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SecurityPutUser { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -3747,31 +3915,34 @@ impl<'a> Security<'a> { SecurityAuthenticate::new(self.transport()) } #[doc = "[Security Change Password API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-change-password.html)\n\nChanges the passwords of users in the native realm and built-in users."] - pub fn change_password<'b>( - &'a self, - parts: SecurityChangePasswordParts<'b>, - ) -> SecurityChangePassword<'a, 'b, ()> { + pub fn change_password<'b, P>(&'a self, parts: P) -> SecurityChangePassword<'a, 'b, ()> + where + P: Into>, + { SecurityChangePassword::new(self.transport(), parts) } #[doc = "[Security Clear Cached Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-clear-privilege-cache.html)\n\nEvicts application privileges from the native application privileges cache."] - pub fn clear_cached_privileges<'b>( + pub fn clear_cached_privileges<'b, P>( &'a self, - parts: SecurityClearCachedPrivilegesParts<'b>, - ) -> SecurityClearCachedPrivileges<'a, 'b, ()> { + parts: P, + ) -> SecurityClearCachedPrivileges<'a, 'b, ()> + where + P: Into>, + { SecurityClearCachedPrivileges::new(self.transport(), parts) } #[doc = "[Security Clear Cached Realms API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-clear-cache.html)\n\nEvicts users from the user cache. Can completely clear the cache or evict specific users."] - pub fn clear_cached_realms<'b>( - &'a self, - parts: SecurityClearCachedRealmsParts<'b>, - ) -> SecurityClearCachedRealms<'a, 'b, ()> { + pub fn clear_cached_realms<'b, P>(&'a self, parts: P) -> SecurityClearCachedRealms<'a, 'b, ()> + where + P: Into>, + { SecurityClearCachedRealms::new(self.transport(), parts) } #[doc = "[Security Clear Cached Roles API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-clear-role-cache.html)\n\nEvicts roles from the native role cache."] - pub fn clear_cached_roles<'b>( - &'a self, - parts: SecurityClearCachedRolesParts<'b>, - ) -> SecurityClearCachedRoles<'a, 'b, ()> { + pub fn clear_cached_roles<'b, P>(&'a self, parts: P) -> SecurityClearCachedRoles<'a, 'b, ()> + where + P: Into>, + { SecurityClearCachedRoles::new(self.transport(), parts) } #[doc = "[Security Create Api Key API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-create-api-key.html)\n\nCreates an API key for access without requiring basic authentication."] @@ -3779,45 +3950,45 @@ impl<'a> Security<'a> { SecurityCreateApiKey::new(self.transport()) } #[doc = "[Security Delete Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-delete-privilege.html)\n\nRemoves application privileges."] - pub fn delete_privileges<'b>( - &'a self, - parts: SecurityDeletePrivilegesParts<'b>, - ) -> SecurityDeletePrivileges<'a, 'b> { + pub fn delete_privileges<'b, P>(&'a self, parts: P) -> SecurityDeletePrivileges<'a, 'b> + where + P: Into>, + { SecurityDeletePrivileges::new(self.transport(), parts) } #[doc = "[Security Delete Role API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-delete-role.html)\n\nRemoves roles in the native realm."] - pub fn delete_role<'b>( - &'a self, - parts: SecurityDeleteRoleParts<'b>, - ) -> SecurityDeleteRole<'a, 'b> { + pub fn delete_role<'b, P>(&'a self, parts: P) -> SecurityDeleteRole<'a, 'b> + where + P: Into>, + { SecurityDeleteRole::new(self.transport(), parts) } #[doc = "[Security Delete Role Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-delete-role-mapping.html)\n\nRemoves role mappings."] - pub fn delete_role_mapping<'b>( - &'a self, - parts: SecurityDeleteRoleMappingParts<'b>, - ) -> SecurityDeleteRoleMapping<'a, 'b> { + pub fn delete_role_mapping<'b, P>(&'a self, parts: P) -> SecurityDeleteRoleMapping<'a, 'b> + where + P: Into>, + { SecurityDeleteRoleMapping::new(self.transport(), parts) } #[doc = "[Security Delete User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-delete-user.html)\n\nDeletes users from the native realm."] - pub fn delete_user<'b>( - &'a self, - parts: SecurityDeleteUserParts<'b>, - ) -> SecurityDeleteUser<'a, 'b> { + pub fn delete_user<'b, P>(&'a self, parts: P) -> SecurityDeleteUser<'a, 'b> + where + P: Into>, + { SecurityDeleteUser::new(self.transport(), parts) } #[doc = "[Security Disable User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-disable-user.html)\n\nDisables users in the native realm."] - pub fn disable_user<'b>( - &'a self, - parts: SecurityDisableUserParts<'b>, - ) -> SecurityDisableUser<'a, 'b, ()> { + pub fn disable_user<'b, P>(&'a self, parts: P) -> SecurityDisableUser<'a, 'b, ()> + where + P: Into>, + { SecurityDisableUser::new(self.transport(), parts) } #[doc = "[Security Enable User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-enable-user.html)\n\nEnables users in the native realm."] - pub fn enable_user<'b>( - &'a self, - parts: SecurityEnableUserParts<'b>, - ) -> SecurityEnableUser<'a, 'b, ()> { + pub fn enable_user<'b, P>(&'a self, parts: P) -> SecurityEnableUser<'a, 'b, ()> + where + P: Into>, + { SecurityEnableUser::new(self.transport(), parts) } #[doc = "[Security Get Api Key API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-api-key.html)\n\nRetrieves information for one or more API keys."] @@ -3829,21 +4000,24 @@ impl<'a> Security<'a> { SecurityGetBuiltinPrivileges::new(self.transport()) } #[doc = "[Security Get Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-privileges.html)\n\nRetrieves application privileges."] - pub fn get_privileges<'b>( - &'a self, - parts: SecurityGetPrivilegesParts<'b>, - ) -> SecurityGetPrivileges<'a, 'b> { + pub fn get_privileges<'b, P>(&'a self, parts: P) -> SecurityGetPrivileges<'a, 'b> + where + P: Into>, + { SecurityGetPrivileges::new(self.transport(), parts) } #[doc = "[Security Get Role API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-role.html)\n\nRetrieves roles in the native realm."] - pub fn get_role<'b>(&'a self, parts: SecurityGetRoleParts<'b>) -> SecurityGetRole<'a, 'b> { + pub fn get_role<'b, P>(&'a self, parts: P) -> SecurityGetRole<'a, 'b> + where + P: Into>, + { SecurityGetRole::new(self.transport(), parts) } #[doc = "[Security Get Role Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-role-mapping.html)\n\nRetrieves role mappings."] - pub fn get_role_mapping<'b>( - &'a self, - parts: SecurityGetRoleMappingParts<'b>, - ) -> SecurityGetRoleMapping<'a, 'b> { + pub fn get_role_mapping<'b, P>(&'a self, parts: P) -> SecurityGetRoleMapping<'a, 'b> + where + P: Into>, + { SecurityGetRoleMapping::new(self.transport(), parts) } #[doc = "[Security Get Token API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-token.html)\n\nCreates a bearer token for access without requiring basic authentication."] @@ -3851,7 +4025,10 @@ impl<'a> Security<'a> { SecurityGetToken::new(self.transport()) } #[doc = "[Security Get User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-user.html)\n\nRetrieves information about users in the native realm and built-in users."] - pub fn get_user<'b>(&'a self, parts: SecurityGetUserParts<'b>) -> SecurityGetUser<'a, 'b> { + pub fn get_user<'b, P>(&'a self, parts: P) -> SecurityGetUser<'a, 'b> + where + P: Into>, + { SecurityGetUser::new(self.transport(), parts) } #[doc = "[Security Get User Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-get-privileges.html)\n\nRetrieves application privileges."] @@ -3859,10 +4036,10 @@ impl<'a> Security<'a> { SecurityGetUserPrivileges::new(self.transport()) } #[doc = "[Security Has Privileges API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-has-privileges.html)\n\nDetermines whether the specified user has a specified list of privileges."] - pub fn has_privileges<'b>( - &'a self, - parts: SecurityHasPrivilegesParts<'b>, - ) -> SecurityHasPrivileges<'a, 'b, ()> { + pub fn has_privileges<'b, P>(&'a self, parts: P) -> SecurityHasPrivileges<'a, 'b, ()> + where + P: Into>, + { SecurityHasPrivileges::new(self.transport(), parts) } #[doc = "[Security Invalidate Api Key API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-invalidate-api-key.html)\n\nInvalidates one or more API keys."] @@ -3878,18 +4055,24 @@ impl<'a> Security<'a> { SecurityPutPrivileges::new(self.transport()) } #[doc = "[Security Put Role API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-put-role.html)\n\nAdds and updates roles in the native realm."] - pub fn put_role<'b>(&'a self, parts: SecurityPutRoleParts<'b>) -> SecurityPutRole<'a, 'b, ()> { + pub fn put_role<'b, P>(&'a self, parts: P) -> SecurityPutRole<'a, 'b, ()> + where + P: Into>, + { SecurityPutRole::new(self.transport(), parts) } #[doc = "[Security Put Role Mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-put-role-mapping.html)\n\nCreates and updates role mappings."] - pub fn put_role_mapping<'b>( - &'a self, - parts: SecurityPutRoleMappingParts<'b>, - ) -> SecurityPutRoleMapping<'a, 'b, ()> { + pub fn put_role_mapping<'b, P>(&'a self, parts: P) -> SecurityPutRoleMapping<'a, 'b, ()> + where + P: Into>, + { SecurityPutRoleMapping::new(self.transport(), parts) } #[doc = "[Security Put User API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/security-api-put-user.html)\n\nAdds and updates users in the native realm. These users are commonly referred to as native users."] - pub fn put_user<'b>(&'a self, parts: SecurityPutUserParts<'b>) -> SecurityPutUser<'a, 'b, ()> { + pub fn put_user<'b, P>(&'a self, parts: P) -> SecurityPutUser<'a, 'b, ()> + where + P: Into>, + { SecurityPutUser::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/slm.rs b/elasticsearch/src/generated/namespace_clients/slm.rs index 40616a04..551febf6 100644 --- a/elasticsearch/src/generated/namespace_clients/slm.rs +++ b/elasticsearch/src/generated/namespace_clients/slm.rs @@ -59,6 +59,12 @@ impl<'b> SlmDeleteLifecycleParts<'b> { } } } +impl<'b> From<&'b str> for SlmDeleteLifecycleParts<'b> { + #[doc = "Builds a [SlmDeleteLifecycleParts::PolicyId] for the Slm Delete Lifecycle API"] + fn from(t: &'b str) -> SlmDeleteLifecycleParts<'b> { + SlmDeleteLifecycleParts::PolicyId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Slm Delete Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-delete-policy.html)\n\nDeletes an existing snapshot lifecycle policy."] pub struct SlmDeleteLifecycle<'a, 'b> { @@ -73,11 +79,14 @@ pub struct SlmDeleteLifecycle<'a, 'b> { } impl<'a, 'b> SlmDeleteLifecycle<'a, 'b> { #[doc = "Creates a new instance of [SlmDeleteLifecycle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SlmDeleteLifecycleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SlmDeleteLifecycle { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -178,6 +187,12 @@ impl<'b> SlmExecuteLifecycleParts<'b> { } } } +impl<'b> From<&'b str> for SlmExecuteLifecycleParts<'b> { + #[doc = "Builds a [SlmExecuteLifecycleParts::PolicyId] for the Slm Execute Lifecycle API"] + fn from(t: &'b str) -> SlmExecuteLifecycleParts<'b> { + SlmExecuteLifecycleParts::PolicyId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Slm Execute Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-execute-lifecycle.html)\n\nImmediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time."] pub struct SlmExecuteLifecycle<'a, 'b, B> { @@ -196,11 +211,14 @@ where B: Body, { #[doc = "Creates a new instance of [SlmExecuteLifecycle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SlmExecuteLifecycleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SlmExecuteLifecycle { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -455,6 +473,12 @@ impl<'b> SlmGetLifecycleParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SlmGetLifecycleParts<'b> { + #[doc = "Builds a [SlmGetLifecycleParts::PolicyId] for the Slm Get Lifecycle API"] + fn from(t: &'b [&'b str]) -> SlmGetLifecycleParts<'b> { + SlmGetLifecycleParts::PolicyId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Slm Get Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-get-policy.html)\n\nRetrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts."] pub struct SlmGetLifecycle<'a, 'b> { @@ -469,11 +493,14 @@ pub struct SlmGetLifecycle<'a, 'b> { } impl<'a, 'b> SlmGetLifecycle<'a, 'b> { #[doc = "Creates a new instance of [SlmGetLifecycle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SlmGetLifecycleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SlmGetLifecycle { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -795,6 +822,12 @@ impl<'b> SlmPutLifecycleParts<'b> { } } } +impl<'b> From<&'b str> for SlmPutLifecycleParts<'b> { + #[doc = "Builds a [SlmPutLifecycleParts::PolicyId] for the Slm Put Lifecycle API"] + fn from(t: &'b str) -> SlmPutLifecycleParts<'b> { + SlmPutLifecycleParts::PolicyId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Slm Put Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-put-policy.html)\n\nCreates or updates a snapshot lifecycle policy."] pub struct SlmPutLifecycle<'a, 'b, B> { @@ -813,11 +846,14 @@ where B: Body, { #[doc = "Creates a new instance of [SlmPutLifecycle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SlmPutLifecycleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SlmPutLifecycle { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1193,17 +1229,17 @@ impl<'a> Slm<'a> { self.transport } #[doc = "[Slm Delete Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-delete-policy.html)\n\nDeletes an existing snapshot lifecycle policy."] - pub fn delete_lifecycle<'b>( - &'a self, - parts: SlmDeleteLifecycleParts<'b>, - ) -> SlmDeleteLifecycle<'a, 'b> { + pub fn delete_lifecycle<'b, P>(&'a self, parts: P) -> SlmDeleteLifecycle<'a, 'b> + where + P: Into>, + { SlmDeleteLifecycle::new(self.transport(), parts) } #[doc = "[Slm Execute Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-execute-lifecycle.html)\n\nImmediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time."] - pub fn execute_lifecycle<'b>( - &'a self, - parts: SlmExecuteLifecycleParts<'b>, - ) -> SlmExecuteLifecycle<'a, 'b, ()> { + pub fn execute_lifecycle<'b, P>(&'a self, parts: P) -> SlmExecuteLifecycle<'a, 'b, ()> + where + P: Into>, + { SlmExecuteLifecycle::new(self.transport(), parts) } #[doc = "[Slm Execute Retention API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-execute-retention.html)\n\nDeletes any snapshots that are expired according to the policy's retention rules."] @@ -1211,7 +1247,10 @@ impl<'a> Slm<'a> { SlmExecuteRetention::new(self.transport()) } #[doc = "[Slm Get Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-get-policy.html)\n\nRetrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts."] - pub fn get_lifecycle<'b>(&'a self, parts: SlmGetLifecycleParts<'b>) -> SlmGetLifecycle<'a, 'b> { + pub fn get_lifecycle<'b, P>(&'a self, parts: P) -> SlmGetLifecycle<'a, 'b> + where + P: Into>, + { SlmGetLifecycle::new(self.transport(), parts) } #[doc = "[Slm Get Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-get-stats.html)\n\nReturns global and policy-level statistics about actions taken by snapshot lifecycle management."] @@ -1223,10 +1262,10 @@ impl<'a> Slm<'a> { SlmGetStatus::new(self.transport()) } #[doc = "[Slm Put Lifecycle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-put-policy.html)\n\nCreates or updates a snapshot lifecycle policy."] - pub fn put_lifecycle<'b>( - &'a self, - parts: SlmPutLifecycleParts<'b>, - ) -> SlmPutLifecycle<'a, 'b, ()> { + pub fn put_lifecycle<'b, P>(&'a self, parts: P) -> SlmPutLifecycle<'a, 'b, ()> + where + P: Into>, + { SlmPutLifecycle::new(self.transport(), parts) } #[doc = "[Slm Start API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/slm-api-start.html)\n\nTurns on snapshot lifecycle management (SLM)."] diff --git a/elasticsearch/src/generated/namespace_clients/snapshot.rs b/elasticsearch/src/generated/namespace_clients/snapshot.rs index a56d106f..e2484318 100644 --- a/elasticsearch/src/generated/namespace_clients/snapshot.rs +++ b/elasticsearch/src/generated/namespace_clients/snapshot.rs @@ -60,6 +60,12 @@ impl<'b> SnapshotCleanupRepositoryParts<'b> { } } } +impl<'b> From<&'b str> for SnapshotCleanupRepositoryParts<'b> { + #[doc = "Builds a [SnapshotCleanupRepositoryParts::Repository] for the Snapshot Cleanup Repository API"] + fn from(t: &'b str) -> SnapshotCleanupRepositoryParts<'b> { + SnapshotCleanupRepositoryParts::Repository(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Cleanup Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/clean-up-snapshot-repo-api.html)\n\nRemoves stale data from repository."] pub struct SnapshotCleanupRepository<'a, 'b, B> { @@ -80,11 +86,14 @@ where B: Body, { #[doc = "Creates a new instance of [SnapshotCleanupRepository] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotCleanupRepositoryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotCleanupRepository { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -228,6 +237,12 @@ impl<'b> SnapshotCreateParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for SnapshotCreateParts<'b> { + #[doc = "Builds a [SnapshotCreateParts::RepositorySnapshot] for the Snapshot Create API"] + fn from(t: (&'b str, &'b str)) -> SnapshotCreateParts<'b> { + SnapshotCreateParts::RepositorySnapshot(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Create API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nCreates a snapshot in a repository."] pub struct SnapshotCreate<'a, 'b, B> { @@ -248,11 +263,14 @@ where B: Body, { #[doc = "Creates a new instance of [SnapshotCreate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotCreateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotCreate { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -390,6 +408,12 @@ impl<'b> SnapshotCreateRepositoryParts<'b> { } } } +impl<'b> From<&'b str> for SnapshotCreateRepositoryParts<'b> { + #[doc = "Builds a [SnapshotCreateRepositoryParts::Repository] for the Snapshot Create Repository API"] + fn from(t: &'b str) -> SnapshotCreateRepositoryParts<'b> { + SnapshotCreateRepositoryParts::Repository(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Create Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nCreates a repository."] pub struct SnapshotCreateRepository<'a, 'b, B> { @@ -411,11 +435,14 @@ where B: Body, { #[doc = "Creates a new instance of [SnapshotCreateRepository] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotCreateRepositoryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotCreateRepository { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -570,6 +597,12 @@ impl<'b> SnapshotDeleteParts<'b> { } } } +impl<'b> From<(&'b str, &'b [&'b str])> for SnapshotDeleteParts<'b> { + #[doc = "Builds a [SnapshotDeleteParts::RepositorySnapshot] for the Snapshot Delete API"] + fn from(t: (&'b str, &'b [&'b str])) -> SnapshotDeleteParts<'b> { + SnapshotDeleteParts::RepositorySnapshot(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nDeletes one or more snapshots."] pub struct SnapshotDelete<'a, 'b> { @@ -585,11 +618,14 @@ pub struct SnapshotDelete<'a, 'b> { } impl<'a, 'b> SnapshotDelete<'a, 'b> { #[doc = "Creates a new instance of [SnapshotDelete] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotDeleteParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotDelete { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -699,6 +735,12 @@ impl<'b> SnapshotDeleteRepositoryParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SnapshotDeleteRepositoryParts<'b> { + #[doc = "Builds a [SnapshotDeleteRepositoryParts::Repository] for the Snapshot Delete Repository API"] + fn from(t: &'b [&'b str]) -> SnapshotDeleteRepositoryParts<'b> { + SnapshotDeleteRepositoryParts::Repository(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Delete Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nDeletes a repository."] pub struct SnapshotDeleteRepository<'a, 'b> { @@ -715,11 +757,14 @@ pub struct SnapshotDeleteRepository<'a, 'b> { } impl<'a, 'b> SnapshotDeleteRepository<'a, 'b> { #[doc = "Creates a new instance of [SnapshotDeleteRepository] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotDeleteRepositoryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotDeleteRepository { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -844,6 +889,12 @@ impl<'b> SnapshotGetParts<'b> { } } } +impl<'b> From<(&'b str, &'b [&'b str])> for SnapshotGetParts<'b> { + #[doc = "Builds a [SnapshotGetParts::RepositorySnapshot] for the Snapshot Get API"] + fn from(t: (&'b str, &'b [&'b str])) -> SnapshotGetParts<'b> { + SnapshotGetParts::RepositorySnapshot(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nReturns information about a snapshot."] pub struct SnapshotGet<'a, 'b> { @@ -861,11 +912,14 @@ pub struct SnapshotGet<'a, 'b> { } impl<'a, 'b> SnapshotGet<'a, 'b> { #[doc = "Creates a new instance of [SnapshotGet] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotGetParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotGet { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -996,6 +1050,12 @@ impl<'b> SnapshotGetRepositoryParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SnapshotGetRepositoryParts<'b> { + #[doc = "Builds a [SnapshotGetRepositoryParts::Repository] for the Snapshot Get Repository API"] + fn from(t: &'b [&'b str]) -> SnapshotGetRepositoryParts<'b> { + SnapshotGetRepositoryParts::Repository(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Get Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nReturns information about a repository."] pub struct SnapshotGetRepository<'a, 'b> { @@ -1012,11 +1072,14 @@ pub struct SnapshotGetRepository<'a, 'b> { } impl<'a, 'b> SnapshotGetRepository<'a, 'b> { #[doc = "Creates a new instance of [SnapshotGetRepository] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotGetRepositoryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotGetRepository { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1141,6 +1204,12 @@ impl<'b> SnapshotRestoreParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for SnapshotRestoreParts<'b> { + #[doc = "Builds a [SnapshotRestoreParts::RepositorySnapshot] for the Snapshot Restore API"] + fn from(t: (&'b str, &'b str)) -> SnapshotRestoreParts<'b> { + SnapshotRestoreParts::RepositorySnapshot(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Restore API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nRestores a snapshot."] pub struct SnapshotRestore<'a, 'b, B> { @@ -1161,11 +1230,14 @@ where B: Body, { #[doc = "Creates a new instance of [SnapshotRestore] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotRestoreParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotRestore { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1325,6 +1397,18 @@ impl<'b> SnapshotStatusParts<'b> { } } } +impl<'b> From<&'b str> for SnapshotStatusParts<'b> { + #[doc = "Builds a [SnapshotStatusParts::Repository] for the Snapshot Status API"] + fn from(t: &'b str) -> SnapshotStatusParts<'b> { + SnapshotStatusParts::Repository(t) + } +} +impl<'b> From<(&'b str, &'b [&'b str])> for SnapshotStatusParts<'b> { + #[doc = "Builds a [SnapshotStatusParts::RepositorySnapshot] for the Snapshot Status API"] + fn from(t: (&'b str, &'b [&'b str])) -> SnapshotStatusParts<'b> { + SnapshotStatusParts::RepositorySnapshot(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Status API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nReturns information about the status of a snapshot."] pub struct SnapshotStatus<'a, 'b> { @@ -1341,11 +1425,14 @@ pub struct SnapshotStatus<'a, 'b> { } impl<'a, 'b> SnapshotStatus<'a, 'b> { #[doc = "Creates a new instance of [SnapshotStatus] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotStatusParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotStatus { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1464,6 +1551,12 @@ impl<'b> SnapshotVerifyRepositoryParts<'b> { } } } +impl<'b> From<&'b str> for SnapshotVerifyRepositoryParts<'b> { + #[doc = "Builds a [SnapshotVerifyRepositoryParts::Repository] for the Snapshot Verify Repository API"] + fn from(t: &'b str) -> SnapshotVerifyRepositoryParts<'b> { + SnapshotVerifyRepositoryParts::Repository(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Snapshot Verify Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nVerifies a repository."] pub struct SnapshotVerifyRepository<'a, 'b, B> { @@ -1484,11 +1577,14 @@ where B: Body, { #[doc = "Creates a new instance of [SnapshotVerifyRepository] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SnapshotVerifyRepositoryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SnapshotVerifyRepository { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1618,58 +1714,73 @@ impl<'a> Snapshot<'a> { self.transport } #[doc = "[Snapshot Cleanup Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/clean-up-snapshot-repo-api.html)\n\nRemoves stale data from repository."] - pub fn cleanup_repository<'b>( - &'a self, - parts: SnapshotCleanupRepositoryParts<'b>, - ) -> SnapshotCleanupRepository<'a, 'b, ()> { + pub fn cleanup_repository<'b, P>(&'a self, parts: P) -> SnapshotCleanupRepository<'a, 'b, ()> + where + P: Into>, + { SnapshotCleanupRepository::new(self.transport(), parts) } #[doc = "[Snapshot Create API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nCreates a snapshot in a repository."] - pub fn create<'b>(&'a self, parts: SnapshotCreateParts<'b>) -> SnapshotCreate<'a, 'b, ()> { + pub fn create<'b, P>(&'a self, parts: P) -> SnapshotCreate<'a, 'b, ()> + where + P: Into>, + { SnapshotCreate::new(self.transport(), parts) } #[doc = "[Snapshot Create Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nCreates a repository."] - pub fn create_repository<'b>( - &'a self, - parts: SnapshotCreateRepositoryParts<'b>, - ) -> SnapshotCreateRepository<'a, 'b, ()> { + pub fn create_repository<'b, P>(&'a self, parts: P) -> SnapshotCreateRepository<'a, 'b, ()> + where + P: Into>, + { SnapshotCreateRepository::new(self.transport(), parts) } #[doc = "[Snapshot Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nDeletes one or more snapshots."] - pub fn delete<'b>(&'a self, parts: SnapshotDeleteParts<'b>) -> SnapshotDelete<'a, 'b> { + pub fn delete<'b, P>(&'a self, parts: P) -> SnapshotDelete<'a, 'b> + where + P: Into>, + { SnapshotDelete::new(self.transport(), parts) } #[doc = "[Snapshot Delete Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nDeletes a repository."] - pub fn delete_repository<'b>( - &'a self, - parts: SnapshotDeleteRepositoryParts<'b>, - ) -> SnapshotDeleteRepository<'a, 'b> { + pub fn delete_repository<'b, P>(&'a self, parts: P) -> SnapshotDeleteRepository<'a, 'b> + where + P: Into>, + { SnapshotDeleteRepository::new(self.transport(), parts) } #[doc = "[Snapshot Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nReturns information about a snapshot."] - pub fn get<'b>(&'a self, parts: SnapshotGetParts<'b>) -> SnapshotGet<'a, 'b> { + pub fn get<'b, P>(&'a self, parts: P) -> SnapshotGet<'a, 'b> + where + P: Into>, + { SnapshotGet::new(self.transport(), parts) } #[doc = "[Snapshot Get Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nReturns information about a repository."] - pub fn get_repository<'b>( - &'a self, - parts: SnapshotGetRepositoryParts<'b>, - ) -> SnapshotGetRepository<'a, 'b> { + pub fn get_repository<'b, P>(&'a self, parts: P) -> SnapshotGetRepository<'a, 'b> + where + P: Into>, + { SnapshotGetRepository::new(self.transport(), parts) } #[doc = "[Snapshot Restore API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nRestores a snapshot."] - pub fn restore<'b>(&'a self, parts: SnapshotRestoreParts<'b>) -> SnapshotRestore<'a, 'b, ()> { + pub fn restore<'b, P>(&'a self, parts: P) -> SnapshotRestore<'a, 'b, ()> + where + P: Into>, + { SnapshotRestore::new(self.transport(), parts) } #[doc = "[Snapshot Status API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nReturns information about the status of a snapshot."] - pub fn status<'b>(&'a self, parts: SnapshotStatusParts<'b>) -> SnapshotStatus<'a, 'b> { + pub fn status<'b, P>(&'a self, parts: P) -> SnapshotStatus<'a, 'b> + where + P: Into>, + { SnapshotStatus::new(self.transport(), parts) } #[doc = "[Snapshot Verify Repository API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-snapshots.html)\n\nVerifies a repository."] - pub fn verify_repository<'b>( - &'a self, - parts: SnapshotVerifyRepositoryParts<'b>, - ) -> SnapshotVerifyRepository<'a, 'b, ()> { + pub fn verify_repository<'b, P>(&'a self, parts: P) -> SnapshotVerifyRepository<'a, 'b, ()> + where + P: Into>, + { SnapshotVerifyRepository::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/tasks.rs b/elasticsearch/src/generated/namespace_clients/tasks.rs index 90494b5f..b6fcfa10 100644 --- a/elasticsearch/src/generated/namespace_clients/tasks.rs +++ b/elasticsearch/src/generated/namespace_clients/tasks.rs @@ -63,6 +63,12 @@ impl<'b> TasksCancelParts<'b> { } } } +impl<'b> From<&'b str> for TasksCancelParts<'b> { + #[doc = "Builds a [TasksCancelParts::TaskId] for the Tasks Cancel API"] + fn from(t: &'b str) -> TasksCancelParts<'b> { + TasksCancelParts::TaskId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Tasks Cancel API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html)\n\nCancels a task, if it can be cancelled through an API."] pub struct TasksCancel<'a, 'b, B> { @@ -85,11 +91,14 @@ where B: Body, { #[doc = "Creates a new instance of [TasksCancel] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TasksCancelParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TasksCancel { transport, - parts, + parts: parts.into(), headers, actions: None, body: None, @@ -250,6 +259,12 @@ impl<'b> TasksGetParts<'b> { } } } +impl<'b> From<&'b str> for TasksGetParts<'b> { + #[doc = "Builds a [TasksGetParts::TaskId] for the Tasks Get API"] + fn from(t: &'b str) -> TasksGetParts<'b> { + TasksGetParts::TaskId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Tasks Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html)\n\nReturns information about a task."] pub struct TasksGet<'a, 'b> { @@ -266,11 +281,14 @@ pub struct TasksGet<'a, 'b> { } impl<'a, 'b> TasksGet<'a, 'b> { #[doc = "Creates a new instance of [TasksGet] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TasksGetParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TasksGet { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -564,11 +582,17 @@ impl<'a> Tasks<'a> { self.transport } #[doc = "[Tasks Cancel API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html)\n\nCancels a task, if it can be cancelled through an API."] - pub fn cancel<'b>(&'a self, parts: TasksCancelParts<'b>) -> TasksCancel<'a, 'b, ()> { + pub fn cancel<'b, P>(&'a self, parts: P) -> TasksCancel<'a, 'b, ()> + where + P: Into>, + { TasksCancel::new(self.transport(), parts) } #[doc = "[Tasks Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html)\n\nReturns information about a task."] - pub fn get<'b>(&'a self, parts: TasksGetParts<'b>) -> TasksGet<'a, 'b> { + pub fn get<'b, P>(&'a self, parts: P) -> TasksGet<'a, 'b> + where + P: Into>, + { TasksGet::new(self.transport(), parts) } #[doc = "[Tasks List API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html)\n\nReturns a list of tasks."] diff --git a/elasticsearch/src/generated/namespace_clients/transform.rs b/elasticsearch/src/generated/namespace_clients/transform.rs index a2bbc3e7..4f5b78d2 100644 --- a/elasticsearch/src/generated/namespace_clients/transform.rs +++ b/elasticsearch/src/generated/namespace_clients/transform.rs @@ -59,6 +59,12 @@ impl<'b> TransformDeleteTransformParts<'b> { } } } +impl<'b> From<&'b str> for TransformDeleteTransformParts<'b> { + #[doc = "Builds a [TransformDeleteTransformParts::TransformId] for the Transform Delete Transform API"] + fn from(t: &'b str) -> TransformDeleteTransformParts<'b> { + TransformDeleteTransformParts::TransformId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Transform Delete Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/delete-transform.html)\n\nDeletes an existing transform."] pub struct TransformDeleteTransform<'a, 'b> { @@ -74,11 +80,14 @@ pub struct TransformDeleteTransform<'a, 'b> { } impl<'a, 'b> TransformDeleteTransform<'a, 'b> { #[doc = "Creates a new instance of [TransformDeleteTransform] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TransformDeleteTransformParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TransformDeleteTransform { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -190,6 +199,12 @@ impl<'b> TransformGetTransformParts<'b> { } } } +impl<'b> From<&'b str> for TransformGetTransformParts<'b> { + #[doc = "Builds a [TransformGetTransformParts::TransformId] for the Transform Get Transform API"] + fn from(t: &'b str) -> TransformGetTransformParts<'b> { + TransformGetTransformParts::TransformId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Transform Get Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-transform.html)\n\nRetrieves configuration information for transforms."] pub struct TransformGetTransform<'a, 'b> { @@ -207,11 +222,14 @@ pub struct TransformGetTransform<'a, 'b> { } impl<'a, 'b> TransformGetTransform<'a, 'b> { #[doc = "Creates a new instance of [TransformGetTransform] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TransformGetTransformParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TransformGetTransform { transport, - parts, + parts: parts.into(), headers, allow_no_match: None, error_trace: None, @@ -339,6 +357,12 @@ impl<'b> TransformGetTransformStatsParts<'b> { } } } +impl<'b> From<&'b str> for TransformGetTransformStatsParts<'b> { + #[doc = "Builds a [TransformGetTransformStatsParts::TransformId] for the Transform Get Transform Stats API"] + fn from(t: &'b str) -> TransformGetTransformStatsParts<'b> { + TransformGetTransformStatsParts::TransformId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Transform Get Transform Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-transform-stats.html)\n\nRetrieves usage information for transforms."] pub struct TransformGetTransformStats<'a, 'b> { @@ -356,11 +380,14 @@ pub struct TransformGetTransformStats<'a, 'b> { } impl<'a, 'b> TransformGetTransformStats<'a, 'b> { #[doc = "Creates a new instance of [TransformGetTransformStats] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TransformGetTransformStatsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TransformGetTransformStats { transport, - parts, + parts: parts.into(), headers, allow_no_match: None, error_trace: None, @@ -620,6 +647,12 @@ impl<'b> TransformPutTransformParts<'b> { } } } +impl<'b> From<&'b str> for TransformPutTransformParts<'b> { + #[doc = "Builds a [TransformPutTransformParts::TransformId] for the Transform Put Transform API"] + fn from(t: &'b str) -> TransformPutTransformParts<'b> { + TransformPutTransformParts::TransformId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Transform Put Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/put-transform.html)\n\nInstantiates a transform."] pub struct TransformPutTransform<'a, 'b, B> { @@ -639,11 +672,14 @@ where B: Body, { #[doc = "Creates a new instance of [TransformPutTransform] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TransformPutTransformParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TransformPutTransform { transport, - parts, + parts: parts.into(), headers, body: None, defer_validation: None, @@ -772,6 +808,12 @@ impl<'b> TransformStartTransformParts<'b> { } } } +impl<'b> From<&'b str> for TransformStartTransformParts<'b> { + #[doc = "Builds a [TransformStartTransformParts::TransformId] for the Transform Start Transform API"] + fn from(t: &'b str) -> TransformStartTransformParts<'b> { + TransformStartTransformParts::TransformId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Transform Start Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/start-transform.html)\n\nStarts one or more transforms."] pub struct TransformStartTransform<'a, 'b, B> { @@ -791,11 +833,14 @@ where B: Body, { #[doc = "Creates a new instance of [TransformStartTransform] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TransformStartTransformParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TransformStartTransform { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -924,6 +969,12 @@ impl<'b> TransformStopTransformParts<'b> { } } } +impl<'b> From<&'b str> for TransformStopTransformParts<'b> { + #[doc = "Builds a [TransformStopTransformParts::TransformId] for the Transform Stop Transform API"] + fn from(t: &'b str) -> TransformStopTransformParts<'b> { + TransformStopTransformParts::TransformId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Transform Stop Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/stop-transform.html)\n\nStops one or more transforms."] pub struct TransformStopTransform<'a, 'b, B> { @@ -947,11 +998,14 @@ where B: Body, { #[doc = "Creates a new instance of [TransformStopTransform] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TransformStopTransformParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TransformStopTransform { transport, - parts, + parts: parts.into(), headers, allow_no_match: None, body: None, @@ -1120,6 +1174,12 @@ impl<'b> TransformUpdateTransformParts<'b> { } } } +impl<'b> From<&'b str> for TransformUpdateTransformParts<'b> { + #[doc = "Builds a [TransformUpdateTransformParts::TransformId] for the Transform Update Transform API"] + fn from(t: &'b str) -> TransformUpdateTransformParts<'b> { + TransformUpdateTransformParts::TransformId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Transform Update Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/update-transform.html)\n\nUpdates certain properties of a transform."] pub struct TransformUpdateTransform<'a, 'b, B> { @@ -1139,11 +1199,14 @@ where B: Body, { #[doc = "Creates a new instance of [TransformUpdateTransform] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TransformUpdateTransformParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); TransformUpdateTransform { transport, - parts, + parts: parts.into(), headers, body: None, defer_validation: None, @@ -1263,24 +1326,24 @@ impl<'a> Transform<'a> { self.transport } #[doc = "[Transform Delete Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/delete-transform.html)\n\nDeletes an existing transform."] - pub fn delete_transform<'b>( - &'a self, - parts: TransformDeleteTransformParts<'b>, - ) -> TransformDeleteTransform<'a, 'b> { + pub fn delete_transform<'b, P>(&'a self, parts: P) -> TransformDeleteTransform<'a, 'b> + where + P: Into>, + { TransformDeleteTransform::new(self.transport(), parts) } #[doc = "[Transform Get Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-transform.html)\n\nRetrieves configuration information for transforms."] - pub fn get_transform<'b>( - &'a self, - parts: TransformGetTransformParts<'b>, - ) -> TransformGetTransform<'a, 'b> { + pub fn get_transform<'b, P>(&'a self, parts: P) -> TransformGetTransform<'a, 'b> + where + P: Into>, + { TransformGetTransform::new(self.transport(), parts) } #[doc = "[Transform Get Transform Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/get-transform-stats.html)\n\nRetrieves usage information for transforms."] - pub fn get_transform_stats<'b>( - &'a self, - parts: TransformGetTransformStatsParts<'b>, - ) -> TransformGetTransformStats<'a, 'b> { + pub fn get_transform_stats<'b, P>(&'a self, parts: P) -> TransformGetTransformStats<'a, 'b> + where + P: Into>, + { TransformGetTransformStats::new(self.transport(), parts) } #[doc = "[Transform Preview Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/preview-transform.html)\n\nPreviews a transform."] @@ -1288,31 +1351,31 @@ impl<'a> Transform<'a> { TransformPreviewTransform::new(self.transport()) } #[doc = "[Transform Put Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/put-transform.html)\n\nInstantiates a transform."] - pub fn put_transform<'b>( - &'a self, - parts: TransformPutTransformParts<'b>, - ) -> TransformPutTransform<'a, 'b, ()> { + pub fn put_transform<'b, P>(&'a self, parts: P) -> TransformPutTransform<'a, 'b, ()> + where + P: Into>, + { TransformPutTransform::new(self.transport(), parts) } #[doc = "[Transform Start Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/start-transform.html)\n\nStarts one or more transforms."] - pub fn start_transform<'b>( - &'a self, - parts: TransformStartTransformParts<'b>, - ) -> TransformStartTransform<'a, 'b, ()> { + pub fn start_transform<'b, P>(&'a self, parts: P) -> TransformStartTransform<'a, 'b, ()> + where + P: Into>, + { TransformStartTransform::new(self.transport(), parts) } #[doc = "[Transform Stop Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/stop-transform.html)\n\nStops one or more transforms."] - pub fn stop_transform<'b>( - &'a self, - parts: TransformStopTransformParts<'b>, - ) -> TransformStopTransform<'a, 'b, ()> { + pub fn stop_transform<'b, P>(&'a self, parts: P) -> TransformStopTransform<'a, 'b, ()> + where + P: Into>, + { TransformStopTransform::new(self.transport(), parts) } #[doc = "[Transform Update Transform API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/update-transform.html)\n\nUpdates certain properties of a transform."] - pub fn update_transform<'b>( - &'a self, - parts: TransformUpdateTransformParts<'b>, - ) -> TransformUpdateTransform<'a, 'b, ()> { + pub fn update_transform<'b, P>(&'a self, parts: P) -> TransformUpdateTransform<'a, 'b, ()> + where + P: Into>, + { TransformUpdateTransform::new(self.transport(), parts) } } diff --git a/elasticsearch/src/generated/namespace_clients/watcher.rs b/elasticsearch/src/generated/namespace_clients/watcher.rs index 215ded34..253cc9d0 100644 --- a/elasticsearch/src/generated/namespace_clients/watcher.rs +++ b/elasticsearch/src/generated/namespace_clients/watcher.rs @@ -77,6 +77,18 @@ impl<'b> WatcherAckWatchParts<'b> { } } } +impl<'b> From<&'b str> for WatcherAckWatchParts<'b> { + #[doc = "Builds a [WatcherAckWatchParts::WatchId] for the Watcher Ack Watch API"] + fn from(t: &'b str) -> WatcherAckWatchParts<'b> { + WatcherAckWatchParts::WatchId(t) + } +} +impl<'b> From<(&'b str, &'b [&'b str])> for WatcherAckWatchParts<'b> { + #[doc = "Builds a [WatcherAckWatchParts::WatchIdActionId] for the Watcher Ack Watch API"] + fn from(t: (&'b str, &'b [&'b str])) -> WatcherAckWatchParts<'b> { + WatcherAckWatchParts::WatchIdActionId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Watcher Ack Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-ack-watch.html)\n\nAcknowledges a watch, manually throttling the execution of the watch's actions."] pub struct WatcherAckWatch<'a, 'b, B> { @@ -95,11 +107,14 @@ where B: Body, { #[doc = "Creates a new instance of [WatcherAckWatch] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: WatcherAckWatchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); WatcherAckWatch { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -218,6 +233,12 @@ impl<'b> WatcherActivateWatchParts<'b> { } } } +impl<'b> From<&'b str> for WatcherActivateWatchParts<'b> { + #[doc = "Builds a [WatcherActivateWatchParts::WatchId] for the Watcher Activate Watch API"] + fn from(t: &'b str) -> WatcherActivateWatchParts<'b> { + WatcherActivateWatchParts::WatchId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Watcher Activate Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-activate-watch.html)\n\nActivates a currently inactive watch."] pub struct WatcherActivateWatch<'a, 'b, B> { @@ -236,11 +257,14 @@ where B: Body, { #[doc = "Creates a new instance of [WatcherActivateWatch] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: WatcherActivateWatchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); WatcherActivateWatch { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -359,6 +383,12 @@ impl<'b> WatcherDeactivateWatchParts<'b> { } } } +impl<'b> From<&'b str> for WatcherDeactivateWatchParts<'b> { + #[doc = "Builds a [WatcherDeactivateWatchParts::WatchId] for the Watcher Deactivate Watch API"] + fn from(t: &'b str) -> WatcherDeactivateWatchParts<'b> { + WatcherDeactivateWatchParts::WatchId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Watcher Deactivate Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-deactivate-watch.html)\n\nDeactivates a currently active watch."] pub struct WatcherDeactivateWatch<'a, 'b, B> { @@ -377,11 +407,14 @@ where B: Body, { #[doc = "Creates a new instance of [WatcherDeactivateWatch] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: WatcherDeactivateWatchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); WatcherDeactivateWatch { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -498,6 +531,12 @@ impl<'b> WatcherDeleteWatchParts<'b> { } } } +impl<'b> From<&'b str> for WatcherDeleteWatchParts<'b> { + #[doc = "Builds a [WatcherDeleteWatchParts::Id] for the Watcher Delete Watch API"] + fn from(t: &'b str) -> WatcherDeleteWatchParts<'b> { + WatcherDeleteWatchParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Watcher Delete Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-delete-watch.html)\n\nRemoves a watch from Watcher."] pub struct WatcherDeleteWatch<'a, 'b> { @@ -512,11 +551,14 @@ pub struct WatcherDeleteWatch<'a, 'b> { } impl<'a, 'b> WatcherDeleteWatch<'a, 'b> { #[doc = "Creates a new instance of [WatcherDeleteWatch] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: WatcherDeleteWatchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); WatcherDeleteWatch { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -619,6 +661,12 @@ impl<'b> WatcherExecuteWatchParts<'b> { } } } +impl<'b> From<&'b str> for WatcherExecuteWatchParts<'b> { + #[doc = "Builds a [WatcherExecuteWatchParts::Id] for the Watcher Execute Watch API"] + fn from(t: &'b str) -> WatcherExecuteWatchParts<'b> { + WatcherExecuteWatchParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Watcher Execute Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-execute-watch.html)\n\nForces the execution of a stored watch."] pub struct WatcherExecuteWatch<'a, 'b, B> { @@ -638,11 +686,14 @@ where B: Body, { #[doc = "Creates a new instance of [WatcherExecuteWatch] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: WatcherExecuteWatchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); WatcherExecuteWatch { transport, - parts, + parts: parts.into(), headers, body: None, debug: None, @@ -769,6 +820,12 @@ impl<'b> WatcherGetWatchParts<'b> { } } } +impl<'b> From<&'b str> for WatcherGetWatchParts<'b> { + #[doc = "Builds a [WatcherGetWatchParts::Id] for the Watcher Get Watch API"] + fn from(t: &'b str) -> WatcherGetWatchParts<'b> { + WatcherGetWatchParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Watcher Get Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-get-watch.html)\n\nRetrieves a watch by its ID."] pub struct WatcherGetWatch<'a, 'b> { @@ -783,11 +840,14 @@ pub struct WatcherGetWatch<'a, 'b> { } impl<'a, 'b> WatcherGetWatch<'a, 'b> { #[doc = "Creates a new instance of [WatcherGetWatch] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: WatcherGetWatchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); WatcherGetWatch { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -886,6 +946,12 @@ impl<'b> WatcherPutWatchParts<'b> { } } } +impl<'b> From<&'b str> for WatcherPutWatchParts<'b> { + #[doc = "Builds a [WatcherPutWatchParts::Id] for the Watcher Put Watch API"] + fn from(t: &'b str) -> WatcherPutWatchParts<'b> { + WatcherPutWatchParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Watcher Put Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-put-watch.html)\n\nCreates a new watch, or updates an existing one."] pub struct WatcherPutWatch<'a, 'b, B> { @@ -908,11 +974,14 @@ where B: Body, { #[doc = "Creates a new instance of [WatcherPutWatch] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: WatcherPutWatchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); WatcherPutWatch { transport, - parts, + parts: parts.into(), headers, active: None, body: None, @@ -1207,6 +1276,12 @@ impl<'b> WatcherStatsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for WatcherStatsParts<'b> { + #[doc = "Builds a [WatcherStatsParts::Metric] for the Watcher Stats API"] + fn from(t: &'b [&'b str]) -> WatcherStatsParts<'b> { + WatcherStatsParts::Metric(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Watcher Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-stats.html)\n\nRetrieves the current Watcher metrics."] pub struct WatcherStats<'a, 'b> { @@ -1223,11 +1298,14 @@ pub struct WatcherStats<'a, 'b> { } impl<'a, 'b> WatcherStats<'a, 'b> { #[doc = "Creates a new instance of [WatcherStats] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: WatcherStatsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); WatcherStats { transport, - parts, + parts: parts.into(), headers, emit_stacktraces: None, error_trace: None, @@ -1470,43 +1548,52 @@ impl<'a> Watcher<'a> { self.transport } #[doc = "[Watcher Ack Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-ack-watch.html)\n\nAcknowledges a watch, manually throttling the execution of the watch's actions."] - pub fn ack_watch<'b>(&'a self, parts: WatcherAckWatchParts<'b>) -> WatcherAckWatch<'a, 'b, ()> { + pub fn ack_watch<'b, P>(&'a self, parts: P) -> WatcherAckWatch<'a, 'b, ()> + where + P: Into>, + { WatcherAckWatch::new(self.transport(), parts) } #[doc = "[Watcher Activate Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-activate-watch.html)\n\nActivates a currently inactive watch."] - pub fn activate_watch<'b>( - &'a self, - parts: WatcherActivateWatchParts<'b>, - ) -> WatcherActivateWatch<'a, 'b, ()> { + pub fn activate_watch<'b, P>(&'a self, parts: P) -> WatcherActivateWatch<'a, 'b, ()> + where + P: Into>, + { WatcherActivateWatch::new(self.transport(), parts) } #[doc = "[Watcher Deactivate Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-deactivate-watch.html)\n\nDeactivates a currently active watch."] - pub fn deactivate_watch<'b>( - &'a self, - parts: WatcherDeactivateWatchParts<'b>, - ) -> WatcherDeactivateWatch<'a, 'b, ()> { + pub fn deactivate_watch<'b, P>(&'a self, parts: P) -> WatcherDeactivateWatch<'a, 'b, ()> + where + P: Into>, + { WatcherDeactivateWatch::new(self.transport(), parts) } #[doc = "[Watcher Delete Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-delete-watch.html)\n\nRemoves a watch from Watcher."] - pub fn delete_watch<'b>( - &'a self, - parts: WatcherDeleteWatchParts<'b>, - ) -> WatcherDeleteWatch<'a, 'b> { + pub fn delete_watch<'b, P>(&'a self, parts: P) -> WatcherDeleteWatch<'a, 'b> + where + P: Into>, + { WatcherDeleteWatch::new(self.transport(), parts) } #[doc = "[Watcher Execute Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-execute-watch.html)\n\nForces the execution of a stored watch."] - pub fn execute_watch<'b>( - &'a self, - parts: WatcherExecuteWatchParts<'b>, - ) -> WatcherExecuteWatch<'a, 'b, ()> { + pub fn execute_watch<'b, P>(&'a self, parts: P) -> WatcherExecuteWatch<'a, 'b, ()> + where + P: Into>, + { WatcherExecuteWatch::new(self.transport(), parts) } #[doc = "[Watcher Get Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-get-watch.html)\n\nRetrieves a watch by its ID."] - pub fn get_watch<'b>(&'a self, parts: WatcherGetWatchParts<'b>) -> WatcherGetWatch<'a, 'b> { + pub fn get_watch<'b, P>(&'a self, parts: P) -> WatcherGetWatch<'a, 'b> + where + P: Into>, + { WatcherGetWatch::new(self.transport(), parts) } #[doc = "[Watcher Put Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-put-watch.html)\n\nCreates a new watch, or updates an existing one."] - pub fn put_watch<'b>(&'a self, parts: WatcherPutWatchParts<'b>) -> WatcherPutWatch<'a, 'b, ()> { + pub fn put_watch<'b, P>(&'a self, parts: P) -> WatcherPutWatch<'a, 'b, ()> + where + P: Into>, + { WatcherPutWatch::new(self.transport(), parts) } #[doc = "[Watcher Start API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-start.html)\n\nStarts Watcher if it is not already running."] @@ -1514,7 +1601,10 @@ impl<'a> Watcher<'a> { WatcherStart::new(self.transport()) } #[doc = "[Watcher Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-stats.html)\n\nRetrieves the current Watcher metrics."] - pub fn stats<'b>(&'a self, parts: WatcherStatsParts<'b>) -> WatcherStats<'a, 'b> { + pub fn stats<'b, P>(&'a self, parts: P) -> WatcherStats<'a, 'b> + where + P: Into>, + { WatcherStats::new(self.transport(), parts) } #[doc = "[Watcher Stop API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/watcher-api-stop.html)\n\nStops Watcher if it is running."] diff --git a/elasticsearch/src/generated/root.rs b/elasticsearch/src/generated/root.rs index ac3adfa5..49e16761 100644 --- a/elasticsearch/src/generated/root.rs +++ b/elasticsearch/src/generated/root.rs @@ -77,6 +77,18 @@ impl<'b> BulkParts<'b> { } } } +impl<'b> From<&'b str> for BulkParts<'b> { + #[doc = "Builds a [BulkParts::Index] for the Bulk API"] + fn from(t: &'b str) -> BulkParts<'b> { + BulkParts::Index(t) + } +} +impl<'b> From<(&'b str, &'b str)> for BulkParts<'b> { + #[doc = "Builds a [BulkParts::IndexType] for the Bulk API"] + fn from(t: (&'b str, &'b str)) -> BulkParts<'b> { + BulkParts::IndexType(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Bulk API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-bulk.html)\n\nAllows to perform multiple index/update/delete operations in a single request."] pub struct Bulk<'a, 'b, B> { @@ -105,11 +117,14 @@ where B: Body, { #[doc = "Creates a new instance of [Bulk] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: BulkParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Bulk { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -340,6 +355,12 @@ impl<'b> ClearScrollParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for ClearScrollParts<'b> { + #[doc = "Builds a [ClearScrollParts::ScrollId] for the Clear Scroll API"] + fn from(t: &'b [&'b str]) -> ClearScrollParts<'b> { + ClearScrollParts::ScrollId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Clear Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-request-body.html#_clear_scroll_api)\n\nExplicitly clears the search context for a scroll."] pub struct ClearScroll<'a, 'b, B> { @@ -358,11 +379,14 @@ where B: Body, { #[doc = "Creates a new instance of [ClearScroll] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ClearScrollParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); ClearScroll { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -485,6 +509,12 @@ impl<'b> CountParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for CountParts<'b> { + #[doc = "Builds a [CountParts::Index] for the Count API"] + fn from(t: &'b [&'b str]) -> CountParts<'b> { + CountParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Count API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-count.html)\n\nReturns number of documents matching a query."] pub struct Count<'a, 'b, B> { @@ -517,11 +547,14 @@ where B: Body, { #[doc = "Creates a new instance of [Count] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CountParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Count { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, analyze_wildcard: None, @@ -810,6 +843,18 @@ impl<'b> CreateParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for CreateParts<'b> { + #[doc = "Builds a [CreateParts::IndexId] for the Create API"] + fn from(t: (&'b str, &'b str)) -> CreateParts<'b> { + CreateParts::IndexId(t.0, t.1) + } +} +impl<'b> From<(&'b str, &'b str, &'b str)> for CreateParts<'b> { + #[doc = "Builds a [CreateParts::IndexTypeId] for the Create API"] + fn from(t: (&'b str, &'b str, &'b str)) -> CreateParts<'b> { + CreateParts::IndexTypeId(t.0, t.1, t.2) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Create API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-index_.html)\n\nCreates a new document in the index.\n\nReturns a 409 response when a document with a same ID already exists in the index."] pub struct Create<'a, 'b, B> { @@ -835,11 +880,14 @@ where B: Body, { #[doc = "Creates a new instance of [Create] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: CreateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Create { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1048,6 +1096,18 @@ impl<'b> DeleteParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for DeleteParts<'b> { + #[doc = "Builds a [DeleteParts::IndexId] for the Delete API"] + fn from(t: (&'b str, &'b str)) -> DeleteParts<'b> { + DeleteParts::IndexId(t.0, t.1) + } +} +impl<'b> From<(&'b str, &'b str, &'b str)> for DeleteParts<'b> { + #[doc = "Builds a [DeleteParts::IndexTypeId] for the Delete API"] + fn from(t: (&'b str, &'b str, &'b str)) -> DeleteParts<'b> { + DeleteParts::IndexTypeId(t.0, t.1, t.2) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-delete.html)\n\nRemoves a document from the index."] pub struct Delete<'a, 'b> { @@ -1070,11 +1130,14 @@ pub struct Delete<'a, 'b> { } impl<'a, 'b> Delete<'a, 'b> { #[doc = "Creates a new instance of [Delete] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: DeleteParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Delete { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -1248,6 +1311,12 @@ impl<'b> DeleteByQueryParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for DeleteByQueryParts<'b> { + #[doc = "Builds a [DeleteByQueryParts::Index] for the Delete By Query API"] + fn from(t: &'b [&'b str]) -> DeleteByQueryParts<'b> { + DeleteByQueryParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Delete By Query API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-delete-by-query.html)\n\nDeletes documents matching the provided query."] pub struct DeleteByQuery<'a, 'b, B> { @@ -1298,11 +1367,14 @@ where B: Body, { #[doc = "Creates a new instance of [DeleteByQuery] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: DeleteByQueryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); DeleteByQuery { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -1756,6 +1828,12 @@ impl<'b> DeleteByQueryRethrottleParts<'b> { } } } +impl<'b> From<&'b str> for DeleteByQueryRethrottleParts<'b> { + #[doc = "Builds a [DeleteByQueryRethrottleParts::TaskId] for the Delete By Query Rethrottle API"] + fn from(t: &'b str) -> DeleteByQueryRethrottleParts<'b> { + DeleteByQueryRethrottleParts::TaskId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Delete By Query Rethrottle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-delete-by-query.html)\n\nChanges the number of requests per second for a particular Delete By Query operation."] pub struct DeleteByQueryRethrottle<'a, 'b, B> { @@ -1775,11 +1853,14 @@ where B: Body, { #[doc = "Creates a new instance of [DeleteByQueryRethrottle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: DeleteByQueryRethrottleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); DeleteByQueryRethrottle { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -1906,6 +1987,12 @@ impl<'b> DeleteScriptParts<'b> { } } } +impl<'b> From<&'b str> for DeleteScriptParts<'b> { + #[doc = "Builds a [DeleteScriptParts::Id] for the Delete Script API"] + fn from(t: &'b str) -> DeleteScriptParts<'b> { + DeleteScriptParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Delete Script API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-scripting.html)\n\nDeletes a script."] pub struct DeleteScript<'a, 'b> { @@ -1922,11 +2009,14 @@ pub struct DeleteScript<'a, 'b> { } impl<'a, 'b> DeleteScript<'a, 'b> { #[doc = "Creates a new instance of [DeleteScript] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: DeleteScriptParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); DeleteScript { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -2047,6 +2137,12 @@ impl<'b> ExistsParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for ExistsParts<'b> { + #[doc = "Builds a [ExistsParts::IndexId] for the Exists API"] + fn from(t: (&'b str, &'b str)) -> ExistsParts<'b> { + ExistsParts::IndexId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Exists API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-get.html)\n\nReturns information about whether a document exists in an index."] pub struct Exists<'a, 'b> { @@ -2071,11 +2167,14 @@ pub struct Exists<'a, 'b> { } impl<'a, 'b> Exists<'a, 'b> { #[doc = "Creates a new instance of [Exists] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ExistsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Exists { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -2299,6 +2398,18 @@ impl<'b> ExistsSourceParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for ExistsSourceParts<'b> { + #[doc = "Builds a [ExistsSourceParts::IndexId] for the Exists Source API"] + fn from(t: (&'b str, &'b str)) -> ExistsSourceParts<'b> { + ExistsSourceParts::IndexId(t.0, t.1) + } +} +impl<'b> From<(&'b str, &'b str, &'b str)> for ExistsSourceParts<'b> { + #[doc = "Builds a [ExistsSourceParts::IndexTypeId] for the Exists Source API"] + fn from(t: (&'b str, &'b str, &'b str)) -> ExistsSourceParts<'b> { + ExistsSourceParts::IndexTypeId(t.0, t.1, t.2) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Exists Source API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-get.html)\n\nReturns information about whether a document source exists in an index."] pub struct ExistsSource<'a, 'b> { @@ -2322,11 +2433,14 @@ pub struct ExistsSource<'a, 'b> { } impl<'a, 'b> ExistsSource<'a, 'b> { #[doc = "Creates a new instance of [ExistsSource] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ExistsSourceParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); ExistsSource { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -2519,6 +2633,12 @@ impl<'b> ExplainParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for ExplainParts<'b> { + #[doc = "Builds a [ExplainParts::IndexId] for the Explain API"] + fn from(t: (&'b str, &'b str)) -> ExplainParts<'b> { + ExplainParts::IndexId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Explain API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-explain.html)\n\nReturns information about why a specific matches (or doesn't match) a query."] pub struct Explain<'a, 'b, B> { @@ -2549,11 +2669,14 @@ where B: Body, { #[doc = "Creates a new instance of [Explain] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ExplainParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Explain { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -2811,6 +2934,12 @@ impl<'b> FieldCapsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for FieldCapsParts<'b> { + #[doc = "Builds a [FieldCapsParts::Index] for the Field Caps API"] + fn from(t: &'b [&'b str]) -> FieldCapsParts<'b> { + FieldCapsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Field Caps API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-field-caps.html)\n\nReturns the information about the capabilities of fields among multiple indices."] pub struct FieldCaps<'a, 'b, B> { @@ -2834,11 +2963,14 @@ where B: Body, { #[doc = "Creates a new instance of [FieldCaps] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: FieldCapsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); FieldCaps { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -3015,6 +3147,12 @@ impl<'b> GetParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for GetParts<'b> { + #[doc = "Builds a [GetParts::IndexId] for the Get API"] + fn from(t: (&'b str, &'b str)) -> GetParts<'b> { + GetParts::IndexId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-get.html)\n\nReturns a document."] pub struct Get<'a, 'b> { @@ -3039,11 +3177,14 @@ pub struct Get<'a, 'b> { } impl<'a, 'b> Get<'a, 'b> { #[doc = "Creates a new instance of [Get] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: GetParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Get { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -3244,6 +3385,12 @@ impl<'b> GetScriptParts<'b> { } } } +impl<'b> From<&'b str> for GetScriptParts<'b> { + #[doc = "Builds a [GetScriptParts::Id] for the Get Script API"] + fn from(t: &'b str) -> GetScriptParts<'b> { + GetScriptParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Get Script API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-scripting.html)\n\nReturns a script."] pub struct GetScript<'a, 'b> { @@ -3259,11 +3406,14 @@ pub struct GetScript<'a, 'b> { } impl<'a, 'b> GetScript<'a, 'b> { #[doc = "Creates a new instance of [GetScript] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: GetScriptParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); GetScript { transport, - parts, + parts: parts.into(), headers, error_trace: None, filter_path: None, @@ -3375,6 +3525,12 @@ impl<'b> GetSourceParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for GetSourceParts<'b> { + #[doc = "Builds a [GetSourceParts::IndexId] for the Get Source API"] + fn from(t: (&'b str, &'b str)) -> GetSourceParts<'b> { + GetSourceParts::IndexId(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Get Source API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-get.html)\n\nReturns the source of a document."] pub struct GetSource<'a, 'b> { @@ -3398,11 +3554,14 @@ pub struct GetSource<'a, 'b> { } impl<'a, 'b> GetSource<'a, 'b> { #[doc = "Creates a new instance of [GetSource] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: GetSourceParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); GetSource { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -3606,6 +3765,18 @@ impl<'b> IndexParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for IndexParts<'b> { + #[doc = "Builds a [IndexParts::IndexId] for the Index API"] + fn from(t: (&'b str, &'b str)) -> IndexParts<'b> { + IndexParts::IndexId(t.0, t.1) + } +} +impl<'b> From<&'b str> for IndexParts<'b> { + #[doc = "Builds a [IndexParts::Index] for the Index API"] + fn from(t: &'b str) -> IndexParts<'b> { + IndexParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-index_.html)\n\nCreates or updates a document in an index."] pub struct Index<'a, 'b, B> { @@ -3635,11 +3806,14 @@ where B: Body, { #[doc = "Creates a new instance of [Index] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: IndexParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Index { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -3982,6 +4156,12 @@ impl<'b> MgetParts<'b> { } } } +impl<'b> From<&'b str> for MgetParts<'b> { + #[doc = "Builds a [MgetParts::Index] for the Mget API"] + fn from(t: &'b str) -> MgetParts<'b> { + MgetParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Mget API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-multi-get.html)\n\nAllows to get multiple documents in one request."] pub struct Mget<'a, 'b, B> { @@ -4008,11 +4188,14 @@ where B: Body, { #[doc = "Creates a new instance of [Mget] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MgetParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Mget { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -4230,6 +4413,12 @@ impl<'b> MsearchParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for MsearchParts<'b> { + #[doc = "Builds a [MsearchParts::Index] for the Msearch API"] + fn from(t: &'b [&'b str]) -> MsearchParts<'b> { + MsearchParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Msearch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-multi-search.html)\n\nAllows to execute several search operations in one request."] pub struct Msearch<'a, 'b, B> { @@ -4255,11 +4444,14 @@ where B: Body, { #[doc = "Creates a new instance of [Msearch] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MsearchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Msearch { transport, - parts, + parts: parts.into(), headers, body: None, ccs_minimize_roundtrips: None, @@ -4455,6 +4647,12 @@ impl<'b> MsearchTemplateParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for MsearchTemplateParts<'b> { + #[doc = "Builds a [MsearchTemplateParts::Index] for the Msearch Template API"] + fn from(t: &'b [&'b str]) -> MsearchTemplateParts<'b> { + MsearchTemplateParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Msearch Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-multi-search.html)\n\nAllows to execute several search template operations in one request."] pub struct MsearchTemplate<'a, 'b, B> { @@ -4478,11 +4676,14 @@ where B: Body, { #[doc = "Creates a new instance of [MsearchTemplate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MsearchTemplateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); MsearchTemplate { transport, - parts, + parts: parts.into(), headers, body: None, ccs_minimize_roundtrips: None, @@ -4657,6 +4858,12 @@ impl<'b> MtermvectorsParts<'b> { } } } +impl<'b> From<&'b str> for MtermvectorsParts<'b> { + #[doc = "Builds a [MtermvectorsParts::Index] for the Mtermvectors API"] + fn from(t: &'b str) -> MtermvectorsParts<'b> { + MtermvectorsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Mtermvectors API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-multi-termvectors.html)\n\nReturns multiple termvectors in one request."] pub struct Mtermvectors<'a, 'b, B> { @@ -4687,11 +4894,14 @@ where B: Body, { #[doc = "Creates a new instance of [Mtermvectors] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: MtermvectorsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Mtermvectors { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -5056,6 +5266,18 @@ impl<'b> PutScriptParts<'b> { } } } +impl<'b> From<&'b str> for PutScriptParts<'b> { + #[doc = "Builds a [PutScriptParts::Id] for the Put Script API"] + fn from(t: &'b str) -> PutScriptParts<'b> { + PutScriptParts::Id(t) + } +} +impl<'b> From<(&'b str, &'b str)> for PutScriptParts<'b> { + #[doc = "Builds a [PutScriptParts::IdContext] for the Put Script API"] + fn from(t: (&'b str, &'b str)) -> PutScriptParts<'b> { + PutScriptParts::IdContext(t.0, t.1) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Put Script API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-scripting.html)\n\nCreates or updates a script."] pub struct PutScript<'a, 'b, B> { @@ -5077,11 +5299,14 @@ where B: Body, { #[doc = "Creates a new instance of [PutScript] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: PutScriptParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); PutScript { transport, - parts, + parts: parts.into(), headers, body: None, context: None, @@ -5451,6 +5676,12 @@ impl<'b> ReindexRethrottleParts<'b> { } } } +impl<'b> From<&'b str> for ReindexRethrottleParts<'b> { + #[doc = "Builds a [ReindexRethrottleParts::TaskId] for the Reindex Rethrottle API"] + fn from(t: &'b str) -> ReindexRethrottleParts<'b> { + ReindexRethrottleParts::TaskId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Reindex Rethrottle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-reindex.html)\n\nChanges the number of requests per second for a particular Reindex operation."] pub struct ReindexRethrottle<'a, 'b, B> { @@ -5470,11 +5701,14 @@ where B: Body, { #[doc = "Creates a new instance of [ReindexRethrottle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ReindexRethrottleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); ReindexRethrottle { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -5604,6 +5838,12 @@ impl<'b> RenderSearchTemplateParts<'b> { } } } +impl<'b> From<&'b str> for RenderSearchTemplateParts<'b> { + #[doc = "Builds a [RenderSearchTemplateParts::Id] for the Render Search Template API"] + fn from(t: &'b str) -> RenderSearchTemplateParts<'b> { + RenderSearchTemplateParts::Id(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Render Search Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-template.html#_validating_templates)\n\nAllows to use the Mustache language to pre-render a search definition."] pub struct RenderSearchTemplate<'a, 'b, B> { @@ -5622,11 +5862,14 @@ where B: Body, { #[doc = "Creates a new instance of [RenderSearchTemplate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: RenderSearchTemplateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); RenderSearchTemplate { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -5750,6 +5993,12 @@ impl<'b> ScrollParts<'b> { } } } +impl<'b> From<&'b str> for ScrollParts<'b> { + #[doc = "Builds a [ScrollParts::ScrollId] for the Scroll API"] + fn from(t: &'b str) -> ScrollParts<'b> { + ScrollParts::ScrollId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-request-body.html#request-body-search-scroll)\n\nAllows to retrieve a large numbers of results from a single search request."] pub struct Scroll<'a, 'b, B> { @@ -5771,11 +6020,14 @@ where B: Body, { #[doc = "Creates a new instance of [Scroll] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: ScrollParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Scroll { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -5931,6 +6183,12 @@ impl<'b> SearchParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SearchParts<'b> { + #[doc = "Builds a [SearchParts::Index] for the Search API"] + fn from(t: &'b [&'b str]) -> SearchParts<'b> { + SearchParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Search API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-search.html)\n\nReturns results matching a query."] pub struct Search<'a, 'b, B> { @@ -5991,11 +6249,14 @@ where B: Body, { #[doc = "Creates a new instance of [Search] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SearchParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Search { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -6562,6 +6823,12 @@ impl<'b> SearchShardsParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SearchShardsParts<'b> { + #[doc = "Builds a [SearchShardsParts::Index] for the Search Shards API"] + fn from(t: &'b [&'b str]) -> SearchShardsParts<'b> { + SearchShardsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Search Shards API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-shards.html)\n\nReturns information about the indices and shards that a search request would be executed against."] pub struct SearchShards<'a, 'b, B> { @@ -6586,11 +6853,14 @@ where B: Body, { #[doc = "Creates a new instance of [SearchShards] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SearchShardsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SearchShards { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -6779,6 +7049,12 @@ impl<'b> SearchTemplateParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for SearchTemplateParts<'b> { + #[doc = "Builds a [SearchTemplateParts::Index] for the Search Template API"] + fn from(t: &'b [&'b str]) -> SearchTemplateParts<'b> { + SearchTemplateParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Search Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-template.html)\n\nAllows to use the Mustache language to pre-render a search definition."] pub struct SearchTemplate<'a, 'b, B> { @@ -6810,11 +7086,14 @@ where B: Body, { #[doc = "Creates a new instance of [SearchTemplate] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: SearchTemplateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); SearchTemplate { transport, - parts, + parts: parts.into(), headers, allow_no_indices: None, body: None, @@ -7085,6 +7364,18 @@ impl<'b> TermvectorsParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for TermvectorsParts<'b> { + #[doc = "Builds a [TermvectorsParts::IndexId] for the Termvectors API"] + fn from(t: (&'b str, &'b str)) -> TermvectorsParts<'b> { + TermvectorsParts::IndexId(t.0, t.1) + } +} +impl<'b> From<&'b str> for TermvectorsParts<'b> { + #[doc = "Builds a [TermvectorsParts::Index] for the Termvectors API"] + fn from(t: &'b str) -> TermvectorsParts<'b> { + TermvectorsParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Termvectors API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-termvectors.html)\n\nReturns information and statistics about terms in the fields of a particular document."] pub struct Termvectors<'a, 'b, B> { @@ -7114,11 +7405,14 @@ where B: Body, { #[doc = "Creates a new instance of [Termvectors] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: TermvectorsParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Termvectors { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -7371,6 +7665,18 @@ impl<'b> UpdateParts<'b> { } } } +impl<'b> From<(&'b str, &'b str)> for UpdateParts<'b> { + #[doc = "Builds a [UpdateParts::IndexId] for the Update API"] + fn from(t: (&'b str, &'b str)) -> UpdateParts<'b> { + UpdateParts::IndexId(t.0, t.1) + } +} +impl<'b> From<(&'b str, &'b str, &'b str)> for UpdateParts<'b> { + #[doc = "Builds a [UpdateParts::IndexTypeId] for the Update API"] + fn from(t: (&'b str, &'b str, &'b str)) -> UpdateParts<'b> { + UpdateParts::IndexTypeId(t.0, t.1, t.2) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Update API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-update.html)\n\nUpdates a document with a script or partial document."] pub struct Update<'a, 'b, B> { @@ -7401,11 +7707,14 @@ where B: Body, { #[doc = "Creates a new instance of [Update] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: UpdateParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); Update { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -7654,6 +7963,12 @@ impl<'b> UpdateByQueryParts<'b> { } } } +impl<'b> From<&'b [&'b str]> for UpdateByQueryParts<'b> { + #[doc = "Builds a [UpdateByQueryParts::Index] for the Update By Query API"] + fn from(t: &'b [&'b str]) -> UpdateByQueryParts<'b> { + UpdateByQueryParts::Index(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Update By Query API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-update-by-query.html)\n\nPerforms an update on every document in the index without changing the source,\nfor example to pick up a mapping change."] pub struct UpdateByQuery<'a, 'b, B> { @@ -7706,11 +8021,14 @@ where B: Body, { #[doc = "Creates a new instance of [UpdateByQuery] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: UpdateByQueryParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); UpdateByQuery { transport, - parts, + parts: parts.into(), headers, _source: None, _source_excludes: None, @@ -8184,6 +8502,12 @@ impl<'b> UpdateByQueryRethrottleParts<'b> { } } } +impl<'b> From<&'b str> for UpdateByQueryRethrottleParts<'b> { + #[doc = "Builds a [UpdateByQueryRethrottleParts::TaskId] for the Update By Query Rethrottle API"] + fn from(t: &'b str) -> UpdateByQueryRethrottleParts<'b> { + UpdateByQueryRethrottleParts::TaskId(t) + } +} #[derive(Clone, Debug)] #[doc = "Builder for the [Update By Query Rethrottle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-update-by-query.html)\n\nChanges the number of requests per second for a particular Update By Query operation."] pub struct UpdateByQueryRethrottle<'a, 'b, B> { @@ -8203,11 +8527,14 @@ where B: Body, { #[doc = "Creates a new instance of [UpdateByQueryRethrottle] with the specified API parts"] - pub fn new(transport: &'a Transport, parts: UpdateByQueryRethrottleParts<'b>) -> Self { + pub fn new

(transport: &'a Transport, parts: P) -> Self + where + P: Into>, + { let headers = HeaderMap::new(); UpdateByQueryRethrottle { transport, - parts, + parts: parts.into(), headers, body: None, error_trace: None, @@ -8316,73 +8643,118 @@ where } impl Elasticsearch { #[doc = "[Bulk API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-bulk.html)\n\nAllows to perform multiple index/update/delete operations in a single request."] - pub fn bulk<'a, 'b>(&'a self, parts: BulkParts<'b>) -> Bulk<'a, 'b, ()> { + pub fn bulk<'a, 'b, P>(&'a self, parts: P) -> Bulk<'a, 'b, ()> + where + P: Into>, + { Bulk::new(self.transport(), parts) } #[doc = "[Clear Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-request-body.html#_clear_scroll_api)\n\nExplicitly clears the search context for a scroll."] - pub fn clear_scroll<'a, 'b>(&'a self, parts: ClearScrollParts<'b>) -> ClearScroll<'a, 'b, ()> { + pub fn clear_scroll<'a, 'b, P>(&'a self, parts: P) -> ClearScroll<'a, 'b, ()> + where + P: Into>, + { ClearScroll::new(self.transport(), parts) } #[doc = "[Count API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-count.html)\n\nReturns number of documents matching a query."] - pub fn count<'a, 'b>(&'a self, parts: CountParts<'b>) -> Count<'a, 'b, ()> { + pub fn count<'a, 'b, P>(&'a self, parts: P) -> Count<'a, 'b, ()> + where + P: Into>, + { Count::new(self.transport(), parts) } #[doc = "[Create API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-index_.html)\n\nCreates a new document in the index.\n\nReturns a 409 response when a document with a same ID already exists in the index."] - pub fn create<'a, 'b>(&'a self, parts: CreateParts<'b>) -> Create<'a, 'b, ()> { + pub fn create<'a, 'b, P>(&'a self, parts: P) -> Create<'a, 'b, ()> + where + P: Into>, + { Create::new(self.transport(), parts) } #[doc = "[Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-delete.html)\n\nRemoves a document from the index."] - pub fn delete<'a, 'b>(&'a self, parts: DeleteParts<'b>) -> Delete<'a, 'b> { + pub fn delete<'a, 'b, P>(&'a self, parts: P) -> Delete<'a, 'b> + where + P: Into>, + { Delete::new(self.transport(), parts) } #[doc = "[Delete By Query API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-delete-by-query.html)\n\nDeletes documents matching the provided query."] - pub fn delete_by_query<'a, 'b>( - &'a self, - parts: DeleteByQueryParts<'b>, - ) -> DeleteByQuery<'a, 'b, ()> { + pub fn delete_by_query<'a, 'b, P>(&'a self, parts: P) -> DeleteByQuery<'a, 'b, ()> + where + P: Into>, + { DeleteByQuery::new(self.transport(), parts) } #[doc = "[Delete By Query Rethrottle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-delete-by-query.html)\n\nChanges the number of requests per second for a particular Delete By Query operation."] - pub fn delete_by_query_rethrottle<'a, 'b>( + pub fn delete_by_query_rethrottle<'a, 'b, P>( &'a self, - parts: DeleteByQueryRethrottleParts<'b>, - ) -> DeleteByQueryRethrottle<'a, 'b, ()> { + parts: P, + ) -> DeleteByQueryRethrottle<'a, 'b, ()> + where + P: Into>, + { DeleteByQueryRethrottle::new(self.transport(), parts) } #[doc = "[Delete Script API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-scripting.html)\n\nDeletes a script."] - pub fn delete_script<'a, 'b>(&'a self, parts: DeleteScriptParts<'b>) -> DeleteScript<'a, 'b> { + pub fn delete_script<'a, 'b, P>(&'a self, parts: P) -> DeleteScript<'a, 'b> + where + P: Into>, + { DeleteScript::new(self.transport(), parts) } #[doc = "[Exists API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-get.html)\n\nReturns information about whether a document exists in an index."] - pub fn exists<'a, 'b>(&'a self, parts: ExistsParts<'b>) -> Exists<'a, 'b> { + pub fn exists<'a, 'b, P>(&'a self, parts: P) -> Exists<'a, 'b> + where + P: Into>, + { Exists::new(self.transport(), parts) } #[doc = "[Exists Source API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-get.html)\n\nReturns information about whether a document source exists in an index."] - pub fn exists_source<'a, 'b>(&'a self, parts: ExistsSourceParts<'b>) -> ExistsSource<'a, 'b> { + pub fn exists_source<'a, 'b, P>(&'a self, parts: P) -> ExistsSource<'a, 'b> + where + P: Into>, + { ExistsSource::new(self.transport(), parts) } #[doc = "[Explain API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-explain.html)\n\nReturns information about why a specific matches (or doesn't match) a query."] - pub fn explain<'a, 'b>(&'a self, parts: ExplainParts<'b>) -> Explain<'a, 'b, ()> { + pub fn explain<'a, 'b, P>(&'a self, parts: P) -> Explain<'a, 'b, ()> + where + P: Into>, + { Explain::new(self.transport(), parts) } #[doc = "[Field Caps API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-field-caps.html)\n\nReturns the information about the capabilities of fields among multiple indices."] - pub fn field_caps<'a, 'b>(&'a self, parts: FieldCapsParts<'b>) -> FieldCaps<'a, 'b, ()> { + pub fn field_caps<'a, 'b, P>(&'a self, parts: P) -> FieldCaps<'a, 'b, ()> + where + P: Into>, + { FieldCaps::new(self.transport(), parts) } #[doc = "[Get API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-get.html)\n\nReturns a document."] - pub fn get<'a, 'b>(&'a self, parts: GetParts<'b>) -> Get<'a, 'b> { + pub fn get<'a, 'b, P>(&'a self, parts: P) -> Get<'a, 'b> + where + P: Into>, + { Get::new(self.transport(), parts) } #[doc = "[Get Script API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-scripting.html)\n\nReturns a script."] - pub fn get_script<'a, 'b>(&'a self, parts: GetScriptParts<'b>) -> GetScript<'a, 'b> { + pub fn get_script<'a, 'b, P>(&'a self, parts: P) -> GetScript<'a, 'b> + where + P: Into>, + { GetScript::new(self.transport(), parts) } #[doc = "[Get Source API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-get.html)\n\nReturns the source of a document."] - pub fn get_source<'a, 'b>(&'a self, parts: GetSourceParts<'b>) -> GetSource<'a, 'b> { + pub fn get_source<'a, 'b, P>(&'a self, parts: P) -> GetSource<'a, 'b> + where + P: Into>, + { GetSource::new(self.transport(), parts) } #[doc = "[Index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-index_.html)\n\nCreates or updates a document in an index."] - pub fn index<'a, 'b>(&'a self, parts: IndexParts<'b>) -> Index<'a, 'b, ()> { + pub fn index<'a, 'b, P>(&'a self, parts: P) -> Index<'a, 'b, ()> + where + P: Into>, + { Index::new(self.transport(), parts) } #[doc = "[Info API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/index.html)\n\nReturns basic information about the cluster."] @@ -8390,25 +8762,31 @@ impl Elasticsearch { Info::new(self.transport()) } #[doc = "[Mget API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-multi-get.html)\n\nAllows to get multiple documents in one request."] - pub fn mget<'a, 'b>(&'a self, parts: MgetParts<'b>) -> Mget<'a, 'b, ()> { + pub fn mget<'a, 'b, P>(&'a self, parts: P) -> Mget<'a, 'b, ()> + where + P: Into>, + { Mget::new(self.transport(), parts) } #[doc = "[Msearch API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-multi-search.html)\n\nAllows to execute several search operations in one request."] - pub fn msearch<'a, 'b>(&'a self, parts: MsearchParts<'b>) -> Msearch<'a, 'b, ()> { + pub fn msearch<'a, 'b, P>(&'a self, parts: P) -> Msearch<'a, 'b, ()> + where + P: Into>, + { Msearch::new(self.transport(), parts) } #[doc = "[Msearch Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-multi-search.html)\n\nAllows to execute several search template operations in one request."] - pub fn msearch_template<'a, 'b>( - &'a self, - parts: MsearchTemplateParts<'b>, - ) -> MsearchTemplate<'a, 'b, ()> { + pub fn msearch_template<'a, 'b, P>(&'a self, parts: P) -> MsearchTemplate<'a, 'b, ()> + where + P: Into>, + { MsearchTemplate::new(self.transport(), parts) } #[doc = "[Mtermvectors API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-multi-termvectors.html)\n\nReturns multiple termvectors in one request."] - pub fn mtermvectors<'a, 'b>( - &'a self, - parts: MtermvectorsParts<'b>, - ) -> Mtermvectors<'a, 'b, ()> { + pub fn mtermvectors<'a, 'b, P>(&'a self, parts: P) -> Mtermvectors<'a, 'b, ()> + where + P: Into>, + { Mtermvectors::new(self.transport(), parts) } #[doc = "[Ping API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/index.html)\n\nReturns whether the cluster is running."] @@ -8416,7 +8794,10 @@ impl Elasticsearch { Ping::new(self.transport()) } #[doc = "[Put Script API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/modules-scripting.html)\n\nCreates or updates a script."] - pub fn put_script<'a, 'b>(&'a self, parts: PutScriptParts<'b>) -> PutScript<'a, 'b, ()> { + pub fn put_script<'a, 'b, P>(&'a self, parts: P) -> PutScript<'a, 'b, ()> + where + P: Into>, + { PutScript::new(self.transport(), parts) } #[doc = "[Reindex API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-reindex.html)\n\nAllows to copy documents from one index to another, optionally filtering the source\ndocuments by a query, changing the destination index settings, or fetching the\ndocuments from a remote cluster."] @@ -8424,61 +8805,76 @@ impl Elasticsearch { Reindex::new(self.transport()) } #[doc = "[Reindex Rethrottle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-reindex.html)\n\nChanges the number of requests per second for a particular Reindex operation."] - pub fn reindex_rethrottle<'a, 'b>( - &'a self, - parts: ReindexRethrottleParts<'b>, - ) -> ReindexRethrottle<'a, 'b, ()> { + pub fn reindex_rethrottle<'a, 'b, P>(&'a self, parts: P) -> ReindexRethrottle<'a, 'b, ()> + where + P: Into>, + { ReindexRethrottle::new(self.transport(), parts) } #[doc = "[Render Search Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-template.html#_validating_templates)\n\nAllows to use the Mustache language to pre-render a search definition."] - pub fn render_search_template<'a, 'b>( - &'a self, - parts: RenderSearchTemplateParts<'b>, - ) -> RenderSearchTemplate<'a, 'b, ()> { + pub fn render_search_template<'a, 'b, P>(&'a self, parts: P) -> RenderSearchTemplate<'a, 'b, ()> + where + P: Into>, + { RenderSearchTemplate::new(self.transport(), parts) } #[doc = "[Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-request-body.html#request-body-search-scroll)\n\nAllows to retrieve a large numbers of results from a single search request.\n\n# Examples\n\nTo initiate a scroll, make search API call with a specified `scroll` timeout,\nthen fetch the next set of hits using the `_scroll_id` returned in\nthe response. Once no more hits are returned, clear the scroll.\n\n```rust,no_run\n# use elasticsearch::{Elasticsearch, Error, SearchParts, ScrollParts, ClearScrollParts};\n# use serde_json::{json, Value};\n# async fn doc() -> Result<(), Box> {\nlet client = Elasticsearch::default();\n\nfn print_hits(hits: &[Value]) {\n for hit in hits {\n println!(\n \"id: '{}', source: '{}', score: '{}'\",\n hit[\"_id\"].as_str().unwrap(),\n hit[\"_source\"],\n hit[\"_score\"].as_f64().unwrap()\n );\n }\n}\n\nlet scroll = \"1m\";\nlet mut response = client\n .search(SearchParts::Index(&[\"tweets\"]))\n .scroll(scroll)\n .body(json!({\n \"query\": {\n \"match\": {\n \"body\": {\n \"query\": \"Elasticsearch rust\",\n \"operator\": \"AND\"\n }\n }\n }\n }))\n .send()\n .await?;\n\nlet mut response_body = response.json::().await?;\nlet mut scroll_id = response_body[\"_scroll_id\"].as_str().unwrap();\nlet mut hits = response_body[\"hits\"][\"hits\"].as_array().unwrap();\n\nprint_hits(hits);\n\nwhile hits.len() > 0 {\n response = client\n .scroll(ScrollParts::None)\n .body(json!({\n \"scroll\": scroll,\n \"scroll_id\": scroll_id\n }))\n .send()\n .await?;\n\n response_body = response.json::().await?;\n scroll_id = response_body[\"_scroll_id\"].as_str().unwrap();\n hits = response_body[\"hits\"][\"hits\"].as_array().unwrap();\n print_hits(hits);\n}\n\nresponse = client\n .clear_scroll(ClearScrollParts::None)\n .body(json!({\n \"scroll_id\": scroll_id\n }))\n .send()\n .await?;\n \n# Ok(())\n# }\n```"] - pub fn scroll<'a, 'b>(&'a self, parts: ScrollParts<'b>) -> Scroll<'a, 'b, ()> { + pub fn scroll<'a, 'b, P>(&'a self, parts: P) -> Scroll<'a, 'b, ()> + where + P: Into>, + { Scroll::new(self.transport(), parts) } #[doc = "[Search API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-search.html)\n\nReturns results matching a query."] - pub fn search<'a, 'b>(&'a self, parts: SearchParts<'b>) -> Search<'a, 'b, ()> { + pub fn search<'a, 'b, P>(&'a self, parts: P) -> Search<'a, 'b, ()> + where + P: Into>, + { Search::new(self.transport(), parts) } #[doc = "[Search Shards API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-shards.html)\n\nReturns information about the indices and shards that a search request would be executed against."] - pub fn search_shards<'a, 'b>( - &'a self, - parts: SearchShardsParts<'b>, - ) -> SearchShards<'a, 'b, ()> { + pub fn search_shards<'a, 'b, P>(&'a self, parts: P) -> SearchShards<'a, 'b, ()> + where + P: Into>, + { SearchShards::new(self.transport(), parts) } #[doc = "[Search Template API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-template.html)\n\nAllows to use the Mustache language to pre-render a search definition."] - pub fn search_template<'a, 'b>( - &'a self, - parts: SearchTemplateParts<'b>, - ) -> SearchTemplate<'a, 'b, ()> { + pub fn search_template<'a, 'b, P>(&'a self, parts: P) -> SearchTemplate<'a, 'b, ()> + where + P: Into>, + { SearchTemplate::new(self.transport(), parts) } #[doc = "[Termvectors API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-termvectors.html)\n\nReturns information and statistics about terms in the fields of a particular document."] - pub fn termvectors<'a, 'b>(&'a self, parts: TermvectorsParts<'b>) -> Termvectors<'a, 'b, ()> { + pub fn termvectors<'a, 'b, P>(&'a self, parts: P) -> Termvectors<'a, 'b, ()> + where + P: Into>, + { Termvectors::new(self.transport(), parts) } #[doc = "[Update API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-update.html)\n\nUpdates a document with a script or partial document."] - pub fn update<'a, 'b>(&'a self, parts: UpdateParts<'b>) -> Update<'a, 'b, ()> { + pub fn update<'a, 'b, P>(&'a self, parts: P) -> Update<'a, 'b, ()> + where + P: Into>, + { Update::new(self.transport(), parts) } #[doc = "[Update By Query API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-update-by-query.html)\n\nPerforms an update on every document in the index without changing the source,\nfor example to pick up a mapping change."] - pub fn update_by_query<'a, 'b>( - &'a self, - parts: UpdateByQueryParts<'b>, - ) -> UpdateByQuery<'a, 'b, ()> { + pub fn update_by_query<'a, 'b, P>(&'a self, parts: P) -> UpdateByQuery<'a, 'b, ()> + where + P: Into>, + { UpdateByQuery::new(self.transport(), parts) } #[doc = "[Update By Query Rethrottle API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-update-by-query.html)\n\nChanges the number of requests per second for a particular Update By Query operation."] - pub fn update_by_query_rethrottle<'a, 'b>( + pub fn update_by_query_rethrottle<'a, 'b, P>( &'a self, - parts: UpdateByQueryRethrottleParts<'b>, - ) -> UpdateByQueryRethrottle<'a, 'b, ()> { + parts: P, + ) -> UpdateByQueryRethrottle<'a, 'b, ()> + where + P: Into>, + { UpdateByQueryRethrottle::new(self.transport(), parts) } } diff --git a/elasticsearch/src/lib.rs b/elasticsearch/src/lib.rs index 24e3a8e0..4b471f06 100644 --- a/elasticsearch/src/lib.rs +++ b/elasticsearch/src/lib.rs @@ -198,6 +198,27 @@ //! variants are modelled as an `enum`, such as [CatIndicesParts](cat::CatIndicesParts) in the above example, which models //! the variants of the [CatIndices](cat::CatIndices) API. //! +//! An Url path `enum` variant can often be built from a value or tuple of values that form +//! the arguments to the variant. Taking the previous cat indices API call as an example, it +//! can be slightly shortened to +//! +//! ```rust,no_run +//! # use elasticsearch; +//! # use elasticsearch::{Elasticsearch, Error, cat::CatIndicesParts}; +//! # use url::Url; +//! # use elasticsearch::auth::Credentials; +//! # use serde_json::{json, Value}; +//! # async fn run() -> Result<(), Error> { +//! # let client = Elasticsearch::default(); +//! let response = client +//! .cat() +//! .indices(&["*"][..]) +//! .send() +//! .await?; +//! # Ok(()) +//! # } +//! ``` +//! //! ### Indexing //! //! Indexing a single document can be achieved with the index API diff --git a/elasticsearch/tests/client.rs b/elasticsearch/tests/client.rs index 196f55a8..80f478f3 100644 --- a/elasticsearch/tests/client.rs +++ b/elasticsearch/tests/client.rs @@ -243,6 +243,29 @@ async fn search_with_no_body() -> Result<(), failure::Error> { Ok(()) } +#[tokio::test] +async fn search_with_parts_using_from() -> Result<(), failure::Error> { + let client = client::create_default(); + let _ = index_documents(&client).await?; + let response = client + .search(&[client::POSTS_INDEX][..]) + .pretty(true) + .q("title:Elasticsearch") + .send() + .await?; + + assert_eq!(response.status_code(), StatusCode::OK); + assert_eq!(response.method(), elasticsearch::http::Method::Get); + let response_body = response.json::().await?; + assert!(response_body["took"].as_i64().is_some()); + + for hit in response_body["hits"]["hits"].as_array().unwrap() { + assert!(hit["_source"]["title"].as_str().is_some()); + } + + Ok(()) +} + #[tokio::test] async fn cat_health_format_json() -> Result<(), failure::Error> { let client = client::create_default(); diff --git a/elasticsearch/tests/common/client.rs b/elasticsearch/tests/common/client.rs index e692d4fd..7499abc7 100644 --- a/elasticsearch/tests/common/client.rs +++ b/elasticsearch/tests/common/client.rs @@ -33,6 +33,8 @@ use serde_json::json; use sysinfo::{RefreshKind, System, SystemExt}; use url::Url; +pub static POSTS_INDEX: &'static str = "posts"; + /// Gets the address to the Elasticsearch instance from environment variables /// and assumes an instance running locally on the default port otherwise pub fn cluster_addr() -> String { @@ -96,10 +98,9 @@ pub fn create(mut builder: TransportBuilder) -> Elasticsearch { /// /// TODO: This is a temporary measure until https://github.com/elastic/elasticsearch-rs/issues/19 is implemented. pub async fn index_documents(client: &Elasticsearch) -> Result { - let index = "posts"; let exists_response = client .indices() - .exists(IndicesExistsParts::Index(&[index])) + .exists(IndicesExistsParts::Index(&[POSTS_INDEX])) .send() .await?; @@ -113,7 +114,7 @@ pub async fn index_documents(client: &Elasticsearch) -> Result } client - .bulk(BulkParts::Index(index)) + .bulk(BulkParts::Index(POSTS_INDEX)) .body(body) .refresh(Refresh::WaitFor) .send()