elasticsearch/
rollup.rs

1/*
2 * Licensed to Elasticsearch B.V. under one or more contributor
3 * license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright
5 * ownership. Elasticsearch B.V. licenses this file to you under
6 * the Apache License, Version 2.0 (the "License"); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *	http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20// -----------------------------------------------
21// This file is generated, Please do not edit it manually.
22// Run the following in the root of the repo to regenerate:
23//
24// cargo make generate-api
25// -----------------------------------------------
26
27//! Rollup APIs
28//!
29//! The Elastic Stack [data rollup features](https://www.elastic.co/guide/en/elasticsearch/reference/master/xpack-rollup.html)
30//! provide a means to summarize and store historical data so that it can still be used for analysis, but at a fraction of
31//! the storage cost of raw data.
32
33#![cfg(feature = "experimental-apis")]
34#![doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
35#![allow(unused_imports)]
36use crate::{
37    client::Elasticsearch,
38    error::Error,
39    http::{
40        self,
41        headers::{HeaderMap, HeaderName, HeaderValue, ACCEPT, CONTENT_TYPE},
42        request::{Body, JsonBody, NdBody, PARTS_ENCODED},
43        response::Response,
44        transport::Transport,
45    },
46    params::*,
47};
48use percent_encoding::percent_encode;
49use serde::Serialize;
50use std::{borrow::Cow, time::Duration};
51#[cfg(feature = "experimental-apis")]
52#[derive(Debug, Clone, PartialEq, Eq)]
53#[doc = "API parts for the Rollup Delete Job API"]
54pub enum RollupDeleteJobParts<'b> {
55    #[doc = "Id"]
56    Id(&'b str),
57}
58#[cfg(feature = "experimental-apis")]
59impl<'b> RollupDeleteJobParts<'b> {
60    #[doc = "Builds a relative URL path to the Rollup Delete Job API"]
61    pub fn url(self) -> Cow<'static, str> {
62        match self {
63            RollupDeleteJobParts::Id(id) => {
64                let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
65                let mut p = String::with_capacity(13usize + encoded_id.len());
66                p.push_str("/_rollup/job/");
67                p.push_str(encoded_id.as_ref());
68                p.into()
69            }
70        }
71    }
72}
73#[doc = "Builder for the [Rollup Delete Job API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-delete-job.html)\n\nDeletes an existing rollup job."]
74#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
75#[cfg(feature = "experimental-apis")]
76#[derive(Clone, Debug)]
77pub struct RollupDeleteJob<'a, 'b> {
78    transport: &'a Transport,
79    parts: RollupDeleteJobParts<'b>,
80    error_trace: Option<bool>,
81    filter_path: Option<&'b [&'b str]>,
82    headers: HeaderMap,
83    human: Option<bool>,
84    pretty: Option<bool>,
85    request_timeout: Option<Duration>,
86    source: Option<&'b str>,
87}
88#[cfg(feature = "experimental-apis")]
89impl<'a, 'b> RollupDeleteJob<'a, 'b> {
90    #[doc = "Creates a new instance of [RollupDeleteJob] with the specified API parts"]
91    pub fn new(transport: &'a Transport, parts: RollupDeleteJobParts<'b>) -> Self {
92        let headers = HeaderMap::new();
93        RollupDeleteJob {
94            transport,
95            parts,
96            headers,
97            error_trace: None,
98            filter_path: None,
99            human: None,
100            pretty: None,
101            request_timeout: None,
102            source: None,
103        }
104    }
105    #[doc = "Include the stack trace of returned errors."]
106    pub fn error_trace(mut self, error_trace: bool) -> Self {
107        self.error_trace = Some(error_trace);
108        self
109    }
110    #[doc = "A comma-separated list of filters used to reduce the response."]
111    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
112        self.filter_path = Some(filter_path);
113        self
114    }
115    #[doc = "Adds a HTTP header"]
116    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
117        self.headers.insert(key, value);
118        self
119    }
120    #[doc = "Return human readable values for statistics."]
121    pub fn human(mut self, human: bool) -> Self {
122        self.human = Some(human);
123        self
124    }
125    #[doc = "Pretty format the returned JSON response."]
126    pub fn pretty(mut self, pretty: bool) -> Self {
127        self.pretty = Some(pretty);
128        self
129    }
130    #[doc = "Sets a request timeout for this API call.\n\nThe timeout is applied from when the request starts connecting until the response body has finished."]
131    pub fn request_timeout(mut self, timeout: Duration) -> Self {
132        self.request_timeout = Some(timeout);
133        self
134    }
135    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
136    pub fn source(mut self, source: &'b str) -> Self {
137        self.source = Some(source);
138        self
139    }
140    #[doc = "Creates an asynchronous call to the Rollup Delete Job API that can be awaited"]
141    pub async fn send(self) -> Result<Response, Error> {
142        let path = self.parts.url();
143        let method = http::Method::Delete;
144        let headers = self.headers;
145        let timeout = self.request_timeout;
146        let query_string = {
147            #[serde_with::skip_serializing_none]
148            #[derive(Serialize)]
149            struct QueryParams<'b> {
150                error_trace: Option<bool>,
151                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
152                filter_path: Option<&'b [&'b str]>,
153                human: Option<bool>,
154                pretty: Option<bool>,
155                source: Option<&'b str>,
156            }
157            let query_params = QueryParams {
158                error_trace: self.error_trace,
159                filter_path: self.filter_path,
160                human: self.human,
161                pretty: self.pretty,
162                source: self.source,
163            };
164            Some(query_params)
165        };
166        let body = Option::<()>::None;
167        let response = self
168            .transport
169            .send(method, &path, headers, query_string.as_ref(), body, timeout)
170            .await?;
171        Ok(response)
172    }
173}
174#[cfg(feature = "experimental-apis")]
175#[derive(Debug, Clone, PartialEq, Eq)]
176#[doc = "API parts for the Rollup Get Jobs API"]
177pub enum RollupGetJobsParts<'b> {
178    #[doc = "Id"]
179    Id(&'b str),
180    #[doc = "No parts"]
181    None,
182}
183#[cfg(feature = "experimental-apis")]
184impl<'b> RollupGetJobsParts<'b> {
185    #[doc = "Builds a relative URL path to the Rollup Get Jobs API"]
186    pub fn url(self) -> Cow<'static, str> {
187        match self {
188            RollupGetJobsParts::Id(id) => {
189                let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
190                let mut p = String::with_capacity(13usize + encoded_id.len());
191                p.push_str("/_rollup/job/");
192                p.push_str(encoded_id.as_ref());
193                p.into()
194            }
195            RollupGetJobsParts::None => "/_rollup/job".into(),
196        }
197    }
198}
199#[doc = "Builder for the [Rollup Get Jobs API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-get-job.html)\n\nRetrieves the configuration, stats, and status of rollup jobs."]
200#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
201#[cfg(feature = "experimental-apis")]
202#[derive(Clone, Debug)]
203pub struct RollupGetJobs<'a, 'b> {
204    transport: &'a Transport,
205    parts: RollupGetJobsParts<'b>,
206    error_trace: Option<bool>,
207    filter_path: Option<&'b [&'b str]>,
208    headers: HeaderMap,
209    human: Option<bool>,
210    pretty: Option<bool>,
211    request_timeout: Option<Duration>,
212    source: Option<&'b str>,
213}
214#[cfg(feature = "experimental-apis")]
215impl<'a, 'b> RollupGetJobs<'a, 'b> {
216    #[doc = "Creates a new instance of [RollupGetJobs] with the specified API parts"]
217    pub fn new(transport: &'a Transport, parts: RollupGetJobsParts<'b>) -> Self {
218        let headers = HeaderMap::new();
219        RollupGetJobs {
220            transport,
221            parts,
222            headers,
223            error_trace: None,
224            filter_path: None,
225            human: None,
226            pretty: None,
227            request_timeout: None,
228            source: None,
229        }
230    }
231    #[doc = "Include the stack trace of returned errors."]
232    pub fn error_trace(mut self, error_trace: bool) -> Self {
233        self.error_trace = Some(error_trace);
234        self
235    }
236    #[doc = "A comma-separated list of filters used to reduce the response."]
237    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
238        self.filter_path = Some(filter_path);
239        self
240    }
241    #[doc = "Adds a HTTP header"]
242    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
243        self.headers.insert(key, value);
244        self
245    }
246    #[doc = "Return human readable values for statistics."]
247    pub fn human(mut self, human: bool) -> Self {
248        self.human = Some(human);
249        self
250    }
251    #[doc = "Pretty format the returned JSON response."]
252    pub fn pretty(mut self, pretty: bool) -> Self {
253        self.pretty = Some(pretty);
254        self
255    }
256    #[doc = "Sets a request timeout for this API call.\n\nThe timeout is applied from when the request starts connecting until the response body has finished."]
257    pub fn request_timeout(mut self, timeout: Duration) -> Self {
258        self.request_timeout = Some(timeout);
259        self
260    }
261    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
262    pub fn source(mut self, source: &'b str) -> Self {
263        self.source = Some(source);
264        self
265    }
266    #[doc = "Creates an asynchronous call to the Rollup Get Jobs API that can be awaited"]
267    pub async fn send(self) -> Result<Response, Error> {
268        let path = self.parts.url();
269        let method = http::Method::Get;
270        let headers = self.headers;
271        let timeout = self.request_timeout;
272        let query_string = {
273            #[serde_with::skip_serializing_none]
274            #[derive(Serialize)]
275            struct QueryParams<'b> {
276                error_trace: Option<bool>,
277                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
278                filter_path: Option<&'b [&'b str]>,
279                human: Option<bool>,
280                pretty: Option<bool>,
281                source: Option<&'b str>,
282            }
283            let query_params = QueryParams {
284                error_trace: self.error_trace,
285                filter_path: self.filter_path,
286                human: self.human,
287                pretty: self.pretty,
288                source: self.source,
289            };
290            Some(query_params)
291        };
292        let body = Option::<()>::None;
293        let response = self
294            .transport
295            .send(method, &path, headers, query_string.as_ref(), body, timeout)
296            .await?;
297        Ok(response)
298    }
299}
300#[cfg(feature = "experimental-apis")]
301#[derive(Debug, Clone, PartialEq, Eq)]
302#[doc = "API parts for the Rollup Get Rollup Caps API"]
303pub enum RollupGetRollupCapsParts<'b> {
304    #[doc = "Id"]
305    Id(&'b str),
306    #[doc = "No parts"]
307    None,
308}
309#[cfg(feature = "experimental-apis")]
310impl<'b> RollupGetRollupCapsParts<'b> {
311    #[doc = "Builds a relative URL path to the Rollup Get Rollup Caps API"]
312    pub fn url(self) -> Cow<'static, str> {
313        match self {
314            RollupGetRollupCapsParts::Id(id) => {
315                let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
316                let mut p = String::with_capacity(14usize + encoded_id.len());
317                p.push_str("/_rollup/data/");
318                p.push_str(encoded_id.as_ref());
319                p.into()
320            }
321            RollupGetRollupCapsParts::None => "/_rollup/data".into(),
322        }
323    }
324}
325#[doc = "Builder for the [Rollup Get Rollup Caps API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-get-rollup-caps.html)\n\nReturns the capabilities of any rollup jobs that have been configured for a specific index or index pattern."]
326#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
327#[cfg(feature = "experimental-apis")]
328#[derive(Clone, Debug)]
329pub struct RollupGetRollupCaps<'a, 'b> {
330    transport: &'a Transport,
331    parts: RollupGetRollupCapsParts<'b>,
332    error_trace: Option<bool>,
333    filter_path: Option<&'b [&'b str]>,
334    headers: HeaderMap,
335    human: Option<bool>,
336    pretty: Option<bool>,
337    request_timeout: Option<Duration>,
338    source: Option<&'b str>,
339}
340#[cfg(feature = "experimental-apis")]
341impl<'a, 'b> RollupGetRollupCaps<'a, 'b> {
342    #[doc = "Creates a new instance of [RollupGetRollupCaps] with the specified API parts"]
343    pub fn new(transport: &'a Transport, parts: RollupGetRollupCapsParts<'b>) -> Self {
344        let headers = HeaderMap::new();
345        RollupGetRollupCaps {
346            transport,
347            parts,
348            headers,
349            error_trace: None,
350            filter_path: None,
351            human: None,
352            pretty: None,
353            request_timeout: None,
354            source: None,
355        }
356    }
357    #[doc = "Include the stack trace of returned errors."]
358    pub fn error_trace(mut self, error_trace: bool) -> Self {
359        self.error_trace = Some(error_trace);
360        self
361    }
362    #[doc = "A comma-separated list of filters used to reduce the response."]
363    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
364        self.filter_path = Some(filter_path);
365        self
366    }
367    #[doc = "Adds a HTTP header"]
368    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
369        self.headers.insert(key, value);
370        self
371    }
372    #[doc = "Return human readable values for statistics."]
373    pub fn human(mut self, human: bool) -> Self {
374        self.human = Some(human);
375        self
376    }
377    #[doc = "Pretty format the returned JSON response."]
378    pub fn pretty(mut self, pretty: bool) -> Self {
379        self.pretty = Some(pretty);
380        self
381    }
382    #[doc = "Sets a request timeout for this API call.\n\nThe timeout is applied from when the request starts connecting until the response body has finished."]
383    pub fn request_timeout(mut self, timeout: Duration) -> Self {
384        self.request_timeout = Some(timeout);
385        self
386    }
387    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
388    pub fn source(mut self, source: &'b str) -> Self {
389        self.source = Some(source);
390        self
391    }
392    #[doc = "Creates an asynchronous call to the Rollup Get Rollup Caps API that can be awaited"]
393    pub async fn send(self) -> Result<Response, Error> {
394        let path = self.parts.url();
395        let method = http::Method::Get;
396        let headers = self.headers;
397        let timeout = self.request_timeout;
398        let query_string = {
399            #[serde_with::skip_serializing_none]
400            #[derive(Serialize)]
401            struct QueryParams<'b> {
402                error_trace: Option<bool>,
403                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
404                filter_path: Option<&'b [&'b str]>,
405                human: Option<bool>,
406                pretty: Option<bool>,
407                source: Option<&'b str>,
408            }
409            let query_params = QueryParams {
410                error_trace: self.error_trace,
411                filter_path: self.filter_path,
412                human: self.human,
413                pretty: self.pretty,
414                source: self.source,
415            };
416            Some(query_params)
417        };
418        let body = Option::<()>::None;
419        let response = self
420            .transport
421            .send(method, &path, headers, query_string.as_ref(), body, timeout)
422            .await?;
423        Ok(response)
424    }
425}
426#[cfg(feature = "experimental-apis")]
427#[derive(Debug, Clone, PartialEq, Eq)]
428#[doc = "API parts for the Rollup Get Rollup Index Caps API"]
429pub enum RollupGetRollupIndexCapsParts<'b> {
430    #[doc = "Index"]
431    Index(&'b str),
432}
433#[cfg(feature = "experimental-apis")]
434impl<'b> RollupGetRollupIndexCapsParts<'b> {
435    #[doc = "Builds a relative URL path to the Rollup Get Rollup Index Caps API"]
436    pub fn url(self) -> Cow<'static, str> {
437        match self {
438            RollupGetRollupIndexCapsParts::Index(index) => {
439                let encoded_index: Cow<str> =
440                    percent_encode(index.as_bytes(), PARTS_ENCODED).into();
441                let mut p = String::with_capacity(14usize + encoded_index.len());
442                p.push('/');
443                p.push_str(encoded_index.as_ref());
444                p.push_str("/_rollup/data");
445                p.into()
446            }
447        }
448    }
449}
450#[doc = "Builder for the [Rollup Get Rollup Index Caps API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-get-rollup-index-caps.html)\n\nReturns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored)."]
451#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
452#[cfg(feature = "experimental-apis")]
453#[derive(Clone, Debug)]
454pub struct RollupGetRollupIndexCaps<'a, 'b> {
455    transport: &'a Transport,
456    parts: RollupGetRollupIndexCapsParts<'b>,
457    error_trace: Option<bool>,
458    filter_path: Option<&'b [&'b str]>,
459    headers: HeaderMap,
460    human: Option<bool>,
461    pretty: Option<bool>,
462    request_timeout: Option<Duration>,
463    source: Option<&'b str>,
464}
465#[cfg(feature = "experimental-apis")]
466impl<'a, 'b> RollupGetRollupIndexCaps<'a, 'b> {
467    #[doc = "Creates a new instance of [RollupGetRollupIndexCaps] with the specified API parts"]
468    pub fn new(transport: &'a Transport, parts: RollupGetRollupIndexCapsParts<'b>) -> Self {
469        let headers = HeaderMap::new();
470        RollupGetRollupIndexCaps {
471            transport,
472            parts,
473            headers,
474            error_trace: None,
475            filter_path: None,
476            human: None,
477            pretty: None,
478            request_timeout: None,
479            source: None,
480        }
481    }
482    #[doc = "Include the stack trace of returned errors."]
483    pub fn error_trace(mut self, error_trace: bool) -> Self {
484        self.error_trace = Some(error_trace);
485        self
486    }
487    #[doc = "A comma-separated list of filters used to reduce the response."]
488    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
489        self.filter_path = Some(filter_path);
490        self
491    }
492    #[doc = "Adds a HTTP header"]
493    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
494        self.headers.insert(key, value);
495        self
496    }
497    #[doc = "Return human readable values for statistics."]
498    pub fn human(mut self, human: bool) -> Self {
499        self.human = Some(human);
500        self
501    }
502    #[doc = "Pretty format the returned JSON response."]
503    pub fn pretty(mut self, pretty: bool) -> Self {
504        self.pretty = Some(pretty);
505        self
506    }
507    #[doc = "Sets a request timeout for this API call.\n\nThe timeout is applied from when the request starts connecting until the response body has finished."]
508    pub fn request_timeout(mut self, timeout: Duration) -> Self {
509        self.request_timeout = Some(timeout);
510        self
511    }
512    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
513    pub fn source(mut self, source: &'b str) -> Self {
514        self.source = Some(source);
515        self
516    }
517    #[doc = "Creates an asynchronous call to the Rollup Get Rollup Index Caps API that can be awaited"]
518    pub async fn send(self) -> Result<Response, Error> {
519        let path = self.parts.url();
520        let method = http::Method::Get;
521        let headers = self.headers;
522        let timeout = self.request_timeout;
523        let query_string = {
524            #[serde_with::skip_serializing_none]
525            #[derive(Serialize)]
526            struct QueryParams<'b> {
527                error_trace: Option<bool>,
528                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
529                filter_path: Option<&'b [&'b str]>,
530                human: Option<bool>,
531                pretty: Option<bool>,
532                source: Option<&'b str>,
533            }
534            let query_params = QueryParams {
535                error_trace: self.error_trace,
536                filter_path: self.filter_path,
537                human: self.human,
538                pretty: self.pretty,
539                source: self.source,
540            };
541            Some(query_params)
542        };
543        let body = Option::<()>::None;
544        let response = self
545            .transport
546            .send(method, &path, headers, query_string.as_ref(), body, timeout)
547            .await?;
548        Ok(response)
549    }
550}
551#[cfg(feature = "experimental-apis")]
552#[derive(Debug, Clone, PartialEq, Eq)]
553#[doc = "API parts for the Rollup Put Job API"]
554pub enum RollupPutJobParts<'b> {
555    #[doc = "Id"]
556    Id(&'b str),
557}
558#[cfg(feature = "experimental-apis")]
559impl<'b> RollupPutJobParts<'b> {
560    #[doc = "Builds a relative URL path to the Rollup Put Job API"]
561    pub fn url(self) -> Cow<'static, str> {
562        match self {
563            RollupPutJobParts::Id(id) => {
564                let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
565                let mut p = String::with_capacity(13usize + encoded_id.len());
566                p.push_str("/_rollup/job/");
567                p.push_str(encoded_id.as_ref());
568                p.into()
569            }
570        }
571    }
572}
573#[doc = "Builder for the [Rollup Put Job API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-put-job.html)\n\nCreates a rollup job."]
574#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
575#[cfg(feature = "experimental-apis")]
576#[derive(Clone, Debug)]
577pub struct RollupPutJob<'a, 'b, B> {
578    transport: &'a Transport,
579    parts: RollupPutJobParts<'b>,
580    body: Option<B>,
581    error_trace: Option<bool>,
582    filter_path: Option<&'b [&'b str]>,
583    headers: HeaderMap,
584    human: Option<bool>,
585    pretty: Option<bool>,
586    request_timeout: Option<Duration>,
587    source: Option<&'b str>,
588}
589#[cfg(feature = "experimental-apis")]
590impl<'a, 'b, B> RollupPutJob<'a, 'b, B>
591where
592    B: Body,
593{
594    #[doc = "Creates a new instance of [RollupPutJob] with the specified API parts"]
595    pub fn new(transport: &'a Transport, parts: RollupPutJobParts<'b>) -> Self {
596        let headers = HeaderMap::new();
597        RollupPutJob {
598            transport,
599            parts,
600            headers,
601            body: None,
602            error_trace: None,
603            filter_path: None,
604            human: None,
605            pretty: None,
606            request_timeout: None,
607            source: None,
608        }
609    }
610    #[doc = "The body for the API call"]
611    pub fn body<T>(self, body: T) -> RollupPutJob<'a, 'b, JsonBody<T>>
612    where
613        T: Serialize,
614    {
615        RollupPutJob {
616            transport: self.transport,
617            parts: self.parts,
618            body: Some(body.into()),
619            error_trace: self.error_trace,
620            filter_path: self.filter_path,
621            headers: self.headers,
622            human: self.human,
623            pretty: self.pretty,
624            request_timeout: self.request_timeout,
625            source: self.source,
626        }
627    }
628    #[doc = "Include the stack trace of returned errors."]
629    pub fn error_trace(mut self, error_trace: bool) -> Self {
630        self.error_trace = Some(error_trace);
631        self
632    }
633    #[doc = "A comma-separated list of filters used to reduce the response."]
634    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
635        self.filter_path = Some(filter_path);
636        self
637    }
638    #[doc = "Adds a HTTP header"]
639    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
640        self.headers.insert(key, value);
641        self
642    }
643    #[doc = "Return human readable values for statistics."]
644    pub fn human(mut self, human: bool) -> Self {
645        self.human = Some(human);
646        self
647    }
648    #[doc = "Pretty format the returned JSON response."]
649    pub fn pretty(mut self, pretty: bool) -> Self {
650        self.pretty = Some(pretty);
651        self
652    }
653    #[doc = "Sets a request timeout for this API call.\n\nThe timeout is applied from when the request starts connecting until the response body has finished."]
654    pub fn request_timeout(mut self, timeout: Duration) -> Self {
655        self.request_timeout = Some(timeout);
656        self
657    }
658    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
659    pub fn source(mut self, source: &'b str) -> Self {
660        self.source = Some(source);
661        self
662    }
663    #[doc = "Creates an asynchronous call to the Rollup Put Job API that can be awaited"]
664    pub async fn send(self) -> Result<Response, Error> {
665        let path = self.parts.url();
666        let method = http::Method::Put;
667        let headers = self.headers;
668        let timeout = self.request_timeout;
669        let query_string = {
670            #[serde_with::skip_serializing_none]
671            #[derive(Serialize)]
672            struct QueryParams<'b> {
673                error_trace: Option<bool>,
674                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
675                filter_path: Option<&'b [&'b str]>,
676                human: Option<bool>,
677                pretty: Option<bool>,
678                source: Option<&'b str>,
679            }
680            let query_params = QueryParams {
681                error_trace: self.error_trace,
682                filter_path: self.filter_path,
683                human: self.human,
684                pretty: self.pretty,
685                source: self.source,
686            };
687            Some(query_params)
688        };
689        let body = self.body;
690        let response = self
691            .transport
692            .send(method, &path, headers, query_string.as_ref(), body, timeout)
693            .await?;
694        Ok(response)
695    }
696}
697#[cfg(feature = "experimental-apis")]
698#[derive(Debug, Clone, PartialEq, Eq)]
699#[doc = "API parts for the Rollup Rollup Search API"]
700pub enum RollupRollupSearchParts<'b> {
701    #[doc = "Index"]
702    Index(&'b [&'b str]),
703}
704#[cfg(feature = "experimental-apis")]
705impl<'b> RollupRollupSearchParts<'b> {
706    #[doc = "Builds a relative URL path to the Rollup Rollup Search API"]
707    pub fn url(self) -> Cow<'static, str> {
708        match self {
709            RollupRollupSearchParts::Index(index) => {
710                let index_str = index.join(",");
711                let encoded_index: Cow<str> =
712                    percent_encode(index_str.as_bytes(), PARTS_ENCODED).into();
713                let mut p = String::with_capacity(16usize + encoded_index.len());
714                p.push('/');
715                p.push_str(encoded_index.as_ref());
716                p.push_str("/_rollup_search");
717                p.into()
718            }
719        }
720    }
721}
722#[doc = "Builder for the [Rollup Rollup Search API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-search.html)\n\nEnables searching rolled-up data using the standard query DSL."]
723#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
724#[cfg(feature = "experimental-apis")]
725#[derive(Clone, Debug)]
726pub struct RollupRollupSearch<'a, 'b, B> {
727    transport: &'a Transport,
728    parts: RollupRollupSearchParts<'b>,
729    body: Option<B>,
730    error_trace: Option<bool>,
731    filter_path: Option<&'b [&'b str]>,
732    headers: HeaderMap,
733    human: Option<bool>,
734    pretty: Option<bool>,
735    request_timeout: Option<Duration>,
736    rest_total_hits_as_int: Option<bool>,
737    source: Option<&'b str>,
738    typed_keys: Option<bool>,
739}
740#[cfg(feature = "experimental-apis")]
741impl<'a, 'b, B> RollupRollupSearch<'a, 'b, B>
742where
743    B: Body,
744{
745    #[doc = "Creates a new instance of [RollupRollupSearch] with the specified API parts"]
746    pub fn new(transport: &'a Transport, parts: RollupRollupSearchParts<'b>) -> Self {
747        let headers = HeaderMap::new();
748        RollupRollupSearch {
749            transport,
750            parts,
751            headers,
752            body: None,
753            error_trace: None,
754            filter_path: None,
755            human: None,
756            pretty: None,
757            request_timeout: None,
758            rest_total_hits_as_int: None,
759            source: None,
760            typed_keys: None,
761        }
762    }
763    #[doc = "The body for the API call"]
764    pub fn body<T>(self, body: T) -> RollupRollupSearch<'a, 'b, JsonBody<T>>
765    where
766        T: Serialize,
767    {
768        RollupRollupSearch {
769            transport: self.transport,
770            parts: self.parts,
771            body: Some(body.into()),
772            error_trace: self.error_trace,
773            filter_path: self.filter_path,
774            headers: self.headers,
775            human: self.human,
776            pretty: self.pretty,
777            request_timeout: self.request_timeout,
778            rest_total_hits_as_int: self.rest_total_hits_as_int,
779            source: self.source,
780            typed_keys: self.typed_keys,
781        }
782    }
783    #[doc = "Include the stack trace of returned errors."]
784    pub fn error_trace(mut self, error_trace: bool) -> Self {
785        self.error_trace = Some(error_trace);
786        self
787    }
788    #[doc = "A comma-separated list of filters used to reduce the response."]
789    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
790        self.filter_path = Some(filter_path);
791        self
792    }
793    #[doc = "Adds a HTTP header"]
794    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
795        self.headers.insert(key, value);
796        self
797    }
798    #[doc = "Return human readable values for statistics."]
799    pub fn human(mut self, human: bool) -> Self {
800        self.human = Some(human);
801        self
802    }
803    #[doc = "Pretty format the returned JSON response."]
804    pub fn pretty(mut self, pretty: bool) -> Self {
805        self.pretty = Some(pretty);
806        self
807    }
808    #[doc = "Sets a request timeout for this API call.\n\nThe timeout is applied from when the request starts connecting until the response body has finished."]
809    pub fn request_timeout(mut self, timeout: Duration) -> Self {
810        self.request_timeout = Some(timeout);
811        self
812    }
813    #[doc = "Indicates whether hits.total should be rendered as an integer or an object in the rest search response"]
814    pub fn rest_total_hits_as_int(mut self, rest_total_hits_as_int: bool) -> Self {
815        self.rest_total_hits_as_int = Some(rest_total_hits_as_int);
816        self
817    }
818    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
819    pub fn source(mut self, source: &'b str) -> Self {
820        self.source = Some(source);
821        self
822    }
823    #[doc = "Specify whether aggregation and suggester names should be prefixed by their respective types in the response"]
824    pub fn typed_keys(mut self, typed_keys: bool) -> Self {
825        self.typed_keys = Some(typed_keys);
826        self
827    }
828    #[doc = "Creates an asynchronous call to the Rollup Rollup Search API that can be awaited"]
829    pub async fn send(self) -> Result<Response, Error> {
830        let path = self.parts.url();
831        let method = match self.body {
832            Some(_) => http::Method::Post,
833            None => http::Method::Get,
834        };
835        let headers = self.headers;
836        let timeout = self.request_timeout;
837        let query_string = {
838            #[serde_with::skip_serializing_none]
839            #[derive(Serialize)]
840            struct QueryParams<'b> {
841                error_trace: Option<bool>,
842                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
843                filter_path: Option<&'b [&'b str]>,
844                human: Option<bool>,
845                pretty: Option<bool>,
846                rest_total_hits_as_int: Option<bool>,
847                source: Option<&'b str>,
848                typed_keys: Option<bool>,
849            }
850            let query_params = QueryParams {
851                error_trace: self.error_trace,
852                filter_path: self.filter_path,
853                human: self.human,
854                pretty: self.pretty,
855                rest_total_hits_as_int: self.rest_total_hits_as_int,
856                source: self.source,
857                typed_keys: self.typed_keys,
858            };
859            Some(query_params)
860        };
861        let body = self.body;
862        let response = self
863            .transport
864            .send(method, &path, headers, query_string.as_ref(), body, timeout)
865            .await?;
866        Ok(response)
867    }
868}
869#[cfg(feature = "experimental-apis")]
870#[derive(Debug, Clone, PartialEq, Eq)]
871#[doc = "API parts for the Rollup Start Job API"]
872pub enum RollupStartJobParts<'b> {
873    #[doc = "Id"]
874    Id(&'b str),
875}
876#[cfg(feature = "experimental-apis")]
877impl<'b> RollupStartJobParts<'b> {
878    #[doc = "Builds a relative URL path to the Rollup Start Job API"]
879    pub fn url(self) -> Cow<'static, str> {
880        match self {
881            RollupStartJobParts::Id(id) => {
882                let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
883                let mut p = String::with_capacity(20usize + encoded_id.len());
884                p.push_str("/_rollup/job/");
885                p.push_str(encoded_id.as_ref());
886                p.push_str("/_start");
887                p.into()
888            }
889        }
890    }
891}
892#[doc = "Builder for the [Rollup Start Job API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-start-job.html)\n\nStarts an existing, stopped rollup job."]
893#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
894#[cfg(feature = "experimental-apis")]
895#[derive(Clone, Debug)]
896pub struct RollupStartJob<'a, 'b, B> {
897    transport: &'a Transport,
898    parts: RollupStartJobParts<'b>,
899    body: Option<B>,
900    error_trace: Option<bool>,
901    filter_path: Option<&'b [&'b str]>,
902    headers: HeaderMap,
903    human: Option<bool>,
904    pretty: Option<bool>,
905    request_timeout: Option<Duration>,
906    source: Option<&'b str>,
907}
908#[cfg(feature = "experimental-apis")]
909impl<'a, 'b, B> RollupStartJob<'a, 'b, B>
910where
911    B: Body,
912{
913    #[doc = "Creates a new instance of [RollupStartJob] with the specified API parts"]
914    pub fn new(transport: &'a Transport, parts: RollupStartJobParts<'b>) -> Self {
915        let headers = HeaderMap::new();
916        RollupStartJob {
917            transport,
918            parts,
919            headers,
920            body: None,
921            error_trace: None,
922            filter_path: None,
923            human: None,
924            pretty: None,
925            request_timeout: None,
926            source: None,
927        }
928    }
929    #[doc = "The body for the API call"]
930    pub fn body<T>(self, body: T) -> RollupStartJob<'a, 'b, JsonBody<T>>
931    where
932        T: Serialize,
933    {
934        RollupStartJob {
935            transport: self.transport,
936            parts: self.parts,
937            body: Some(body.into()),
938            error_trace: self.error_trace,
939            filter_path: self.filter_path,
940            headers: self.headers,
941            human: self.human,
942            pretty: self.pretty,
943            request_timeout: self.request_timeout,
944            source: self.source,
945        }
946    }
947    #[doc = "Include the stack trace of returned errors."]
948    pub fn error_trace(mut self, error_trace: bool) -> Self {
949        self.error_trace = Some(error_trace);
950        self
951    }
952    #[doc = "A comma-separated list of filters used to reduce the response."]
953    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
954        self.filter_path = Some(filter_path);
955        self
956    }
957    #[doc = "Adds a HTTP header"]
958    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
959        self.headers.insert(key, value);
960        self
961    }
962    #[doc = "Return human readable values for statistics."]
963    pub fn human(mut self, human: bool) -> Self {
964        self.human = Some(human);
965        self
966    }
967    #[doc = "Pretty format the returned JSON response."]
968    pub fn pretty(mut self, pretty: bool) -> Self {
969        self.pretty = Some(pretty);
970        self
971    }
972    #[doc = "Sets a request timeout for this API call.\n\nThe timeout is applied from when the request starts connecting until the response body has finished."]
973    pub fn request_timeout(mut self, timeout: Duration) -> Self {
974        self.request_timeout = Some(timeout);
975        self
976    }
977    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
978    pub fn source(mut self, source: &'b str) -> Self {
979        self.source = Some(source);
980        self
981    }
982    #[doc = "Creates an asynchronous call to the Rollup Start Job API that can be awaited"]
983    pub async fn send(self) -> Result<Response, Error> {
984        let path = self.parts.url();
985        let method = http::Method::Post;
986        let headers = self.headers;
987        let timeout = self.request_timeout;
988        let query_string = {
989            #[serde_with::skip_serializing_none]
990            #[derive(Serialize)]
991            struct QueryParams<'b> {
992                error_trace: Option<bool>,
993                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
994                filter_path: Option<&'b [&'b str]>,
995                human: Option<bool>,
996                pretty: Option<bool>,
997                source: Option<&'b str>,
998            }
999            let query_params = QueryParams {
1000                error_trace: self.error_trace,
1001                filter_path: self.filter_path,
1002                human: self.human,
1003                pretty: self.pretty,
1004                source: self.source,
1005            };
1006            Some(query_params)
1007        };
1008        let body = self.body;
1009        let response = self
1010            .transport
1011            .send(method, &path, headers, query_string.as_ref(), body, timeout)
1012            .await?;
1013        Ok(response)
1014    }
1015}
1016#[cfg(feature = "experimental-apis")]
1017#[derive(Debug, Clone, PartialEq, Eq)]
1018#[doc = "API parts for the Rollup Stop Job API"]
1019pub enum RollupStopJobParts<'b> {
1020    #[doc = "Id"]
1021    Id(&'b str),
1022}
1023#[cfg(feature = "experimental-apis")]
1024impl<'b> RollupStopJobParts<'b> {
1025    #[doc = "Builds a relative URL path to the Rollup Stop Job API"]
1026    pub fn url(self) -> Cow<'static, str> {
1027        match self {
1028            RollupStopJobParts::Id(id) => {
1029                let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
1030                let mut p = String::with_capacity(19usize + encoded_id.len());
1031                p.push_str("/_rollup/job/");
1032                p.push_str(encoded_id.as_ref());
1033                p.push_str("/_stop");
1034                p.into()
1035            }
1036        }
1037    }
1038}
1039#[doc = "Builder for the [Rollup Stop Job API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-stop-job.html)\n\nStops an existing, started rollup job."]
1040#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1041#[cfg(feature = "experimental-apis")]
1042#[derive(Clone, Debug)]
1043pub struct RollupStopJob<'a, 'b, B> {
1044    transport: &'a Transport,
1045    parts: RollupStopJobParts<'b>,
1046    body: Option<B>,
1047    error_trace: Option<bool>,
1048    filter_path: Option<&'b [&'b str]>,
1049    headers: HeaderMap,
1050    human: Option<bool>,
1051    pretty: Option<bool>,
1052    request_timeout: Option<Duration>,
1053    source: Option<&'b str>,
1054    timeout: Option<&'b str>,
1055    wait_for_completion: Option<bool>,
1056}
1057#[cfg(feature = "experimental-apis")]
1058impl<'a, 'b, B> RollupStopJob<'a, 'b, B>
1059where
1060    B: Body,
1061{
1062    #[doc = "Creates a new instance of [RollupStopJob] with the specified API parts"]
1063    pub fn new(transport: &'a Transport, parts: RollupStopJobParts<'b>) -> Self {
1064        let headers = HeaderMap::new();
1065        RollupStopJob {
1066            transport,
1067            parts,
1068            headers,
1069            body: None,
1070            error_trace: None,
1071            filter_path: None,
1072            human: None,
1073            pretty: None,
1074            request_timeout: None,
1075            source: None,
1076            timeout: None,
1077            wait_for_completion: None,
1078        }
1079    }
1080    #[doc = "The body for the API call"]
1081    pub fn body<T>(self, body: T) -> RollupStopJob<'a, 'b, JsonBody<T>>
1082    where
1083        T: Serialize,
1084    {
1085        RollupStopJob {
1086            transport: self.transport,
1087            parts: self.parts,
1088            body: Some(body.into()),
1089            error_trace: self.error_trace,
1090            filter_path: self.filter_path,
1091            headers: self.headers,
1092            human: self.human,
1093            pretty: self.pretty,
1094            request_timeout: self.request_timeout,
1095            source: self.source,
1096            timeout: self.timeout,
1097            wait_for_completion: self.wait_for_completion,
1098        }
1099    }
1100    #[doc = "Include the stack trace of returned errors."]
1101    pub fn error_trace(mut self, error_trace: bool) -> Self {
1102        self.error_trace = Some(error_trace);
1103        self
1104    }
1105    #[doc = "A comma-separated list of filters used to reduce the response."]
1106    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1107        self.filter_path = Some(filter_path);
1108        self
1109    }
1110    #[doc = "Adds a HTTP header"]
1111    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1112        self.headers.insert(key, value);
1113        self
1114    }
1115    #[doc = "Return human readable values for statistics."]
1116    pub fn human(mut self, human: bool) -> Self {
1117        self.human = Some(human);
1118        self
1119    }
1120    #[doc = "Pretty format the returned JSON response."]
1121    pub fn pretty(mut self, pretty: bool) -> Self {
1122        self.pretty = Some(pretty);
1123        self
1124    }
1125    #[doc = "Sets a request timeout for this API call.\n\nThe timeout is applied from when the request starts connecting until the response body has finished."]
1126    pub fn request_timeout(mut self, timeout: Duration) -> Self {
1127        self.request_timeout = Some(timeout);
1128        self
1129    }
1130    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1131    pub fn source(mut self, source: &'b str) -> Self {
1132        self.source = Some(source);
1133        self
1134    }
1135    #[doc = "Block for (at maximum) the specified duration while waiting for the job to stop.  Defaults to 30s."]
1136    pub fn timeout(mut self, timeout: &'b str) -> Self {
1137        self.timeout = Some(timeout);
1138        self
1139    }
1140    #[doc = "True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false."]
1141    pub fn wait_for_completion(mut self, wait_for_completion: bool) -> Self {
1142        self.wait_for_completion = Some(wait_for_completion);
1143        self
1144    }
1145    #[doc = "Creates an asynchronous call to the Rollup Stop Job API that can be awaited"]
1146    pub async fn send(self) -> Result<Response, Error> {
1147        let path = self.parts.url();
1148        let method = http::Method::Post;
1149        let headers = self.headers;
1150        let timeout = self.request_timeout;
1151        let query_string = {
1152            #[serde_with::skip_serializing_none]
1153            #[derive(Serialize)]
1154            struct QueryParams<'b> {
1155                error_trace: Option<bool>,
1156                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1157                filter_path: Option<&'b [&'b str]>,
1158                human: Option<bool>,
1159                pretty: Option<bool>,
1160                source: Option<&'b str>,
1161                timeout: Option<&'b str>,
1162                wait_for_completion: Option<bool>,
1163            }
1164            let query_params = QueryParams {
1165                error_trace: self.error_trace,
1166                filter_path: self.filter_path,
1167                human: self.human,
1168                pretty: self.pretty,
1169                source: self.source,
1170                timeout: self.timeout,
1171                wait_for_completion: self.wait_for_completion,
1172            };
1173            Some(query_params)
1174        };
1175        let body = self.body;
1176        let response = self
1177            .transport
1178            .send(method, &path, headers, query_string.as_ref(), body, timeout)
1179            .await?;
1180        Ok(response)
1181    }
1182}
1183#[doc = "Namespace client for Rollup APIs"]
1184#[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1185#[cfg(feature = "experimental-apis")]
1186pub struct Rollup<'a> {
1187    transport: &'a Transport,
1188}
1189#[cfg(feature = "experimental-apis")]
1190impl<'a> Rollup<'a> {
1191    #[doc = "Creates a new instance of [Rollup]"]
1192    pub fn new(transport: &'a Transport) -> Self {
1193        Self { transport }
1194    }
1195    pub fn transport(&self) -> &Transport {
1196        self.transport
1197    }
1198    #[doc = "[Rollup Delete Job API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-delete-job.html)\n\nDeletes an existing rollup job."]
1199    #[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1200    #[cfg(feature = "experimental-apis")]
1201    pub fn delete_job<'b>(&'a self, parts: RollupDeleteJobParts<'b>) -> RollupDeleteJob<'a, 'b> {
1202        RollupDeleteJob::new(self.transport(), parts)
1203    }
1204    #[doc = "[Rollup Get Jobs API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-get-job.html)\n\nRetrieves the configuration, stats, and status of rollup jobs."]
1205    #[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1206    #[cfg(feature = "experimental-apis")]
1207    pub fn get_jobs<'b>(&'a self, parts: RollupGetJobsParts<'b>) -> RollupGetJobs<'a, 'b> {
1208        RollupGetJobs::new(self.transport(), parts)
1209    }
1210    #[doc = "[Rollup Get Rollup Caps API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-get-rollup-caps.html)\n\nReturns the capabilities of any rollup jobs that have been configured for a specific index or index pattern."]
1211    #[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1212    #[cfg(feature = "experimental-apis")]
1213    pub fn get_rollup_caps<'b>(
1214        &'a self,
1215        parts: RollupGetRollupCapsParts<'b>,
1216    ) -> RollupGetRollupCaps<'a, 'b> {
1217        RollupGetRollupCaps::new(self.transport(), parts)
1218    }
1219    #[doc = "[Rollup Get Rollup Index Caps API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-get-rollup-index-caps.html)\n\nReturns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored)."]
1220    #[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1221    #[cfg(feature = "experimental-apis")]
1222    pub fn get_rollup_index_caps<'b>(
1223        &'a self,
1224        parts: RollupGetRollupIndexCapsParts<'b>,
1225    ) -> RollupGetRollupIndexCaps<'a, 'b> {
1226        RollupGetRollupIndexCaps::new(self.transport(), parts)
1227    }
1228    #[doc = "[Rollup Put Job API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-put-job.html)\n\nCreates a rollup job."]
1229    #[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1230    #[cfg(feature = "experimental-apis")]
1231    pub fn put_job<'b>(&'a self, parts: RollupPutJobParts<'b>) -> RollupPutJob<'a, 'b, ()> {
1232        RollupPutJob::new(self.transport(), parts)
1233    }
1234    #[doc = "[Rollup Rollup Search API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-search.html)\n\nEnables searching rolled-up data using the standard query DSL."]
1235    #[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1236    #[cfg(feature = "experimental-apis")]
1237    pub fn rollup_search<'b>(
1238        &'a self,
1239        parts: RollupRollupSearchParts<'b>,
1240    ) -> RollupRollupSearch<'a, 'b, ()> {
1241        RollupRollupSearch::new(self.transport(), parts)
1242    }
1243    #[doc = "[Rollup Start Job API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-start-job.html)\n\nStarts an existing, stopped rollup job."]
1244    #[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1245    #[cfg(feature = "experimental-apis")]
1246    pub fn start_job<'b>(&'a self, parts: RollupStartJobParts<'b>) -> RollupStartJob<'a, 'b, ()> {
1247        RollupStartJob::new(self.transport(), parts)
1248    }
1249    #[doc = "[Rollup Stop Job API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/rollup-stop-job.html)\n\nStops an existing, started rollup job."]
1250    #[doc = "&nbsp;\n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n        "]
1251    #[cfg(feature = "experimental-apis")]
1252    pub fn stop_job<'b>(&'a self, parts: RollupStopJobParts<'b>) -> RollupStopJob<'a, 'b, ()> {
1253        RollupStopJob::new(self.transport(), parts)
1254    }
1255}
1256#[cfg(feature = "experimental-apis")]
1257impl Elasticsearch {
1258    #[doc = "Creates a namespace client for Rollup APIs"]
1259    pub fn rollup(&self) -> Rollup {
1260        Rollup::new(self.transport())
1261    }
1262}