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