aditjind_crate/
cat.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//! Cat APIs
28//!
29//! The [Cat APIs](https://opensearch.org/docs/opensearch/rest-api/cat/index/) aim to
30//! meet the needs of humans when looking at data returned from OpenSearch,
31//! formatting it as compact, column aligned text, making it easier on human eyes.
32//!
33//! # Plain text responses
34//!
35//! By default, all Cat APIs are configured to send requests with `text/plain` content-type
36//! and accept headers, returning plain text responses
37//!
38//! ```rust,no_run
39//! # use opensearch::{OpenSearch, Error, SearchParts};
40//! # use url::Url;
41//! # use opensearch::auth::Credentials;
42//! # use serde_json::{json, Value};
43//! # async fn doc() -> Result<(), Box<dyn std::error::Error>> {
44//! # let client = OpenSearch::default();
45//! let response = client
46//!     .cat()
47//!     .nodes()
48//!     .send()
49//!     .await?;
50//!
51//! let response_body = response.text().await?;
52//! # Ok(())
53//! # }
54//! ```
55//!
56//! # JSON responses
57//!
58//! JSON responses can be returned from Cat APIs either by using `.format("json")`
59//!
60//! ```rust,no_run
61//! # use opensearch::{OpenSearch, Error, SearchParts};
62//! # use url::Url;
63//! # use opensearch::auth::Credentials;
64//! # use serde_json::{json, Value};
65//! # async fn doc() -> Result<(), Box<dyn std::error::Error>> {
66//! # let client = OpenSearch::default();
67//! let response = client
68//!     .cat()
69//!     .nodes()
70//!     .format("json")
71//!     .send()
72//!     .await?;
73//!
74//! let response_body = response.json::<Value>().await?;
75//! # Ok(())
76//! # }
77//! ```
78//!
79//! Or by setting an accept header using `.headers()`
80//!
81//! ```rust,no_run
82//! # use opensearch::{OpenSearch, Error, SearchParts, http::headers::{HeaderValue, DEFAULT_ACCEPT, ACCEPT}};
83//! # use url::Url;
84//! # use serde_json::{json, Value};
85//! # async fn doc() -> Result<(), Box<dyn std::error::Error>> {
86//! # let client = OpenSearch::default();
87//! let response = client
88//!     .cat()
89//!     .nodes()
90//!     .header(ACCEPT, HeaderValue::from_static(DEFAULT_ACCEPT))
91//!     .send()
92//!     .await?;
93//!
94//! let response_body = response.json::<Value>().await?;
95//! # Ok(())
96//! # }
97//! ```
98//!
99//! # Column Headers
100//!
101//! The column headers to return can be controlled with `.h()`
102//!
103//! ```rust,no_run
104//! # use opensearch::{OpenSearch, Error, SearchParts};
105//! # use url::Url;
106//! # use serde_json::{json, Value};
107//! # async fn doc() -> Result<(), Box<dyn std::error::Error>> {
108//! # let client = OpenSearch::default();
109//! let response = client
110//!     .cat()
111//!     .nodes()
112//!     .h(&["ip", "port", "heapPercent", "name"])
113//!     .send()
114//!     .await?;
115//!
116//! let response_body = response.json::<String>().await?;
117//! # Ok(())
118//! # }
119//! ```
120//!
121
122#![allow(unused_imports)]
123use crate::{
124    client::OpenSearch,
125    error::Error,
126    http::{
127        headers::{HeaderMap, HeaderName, HeaderValue, ACCEPT, CONTENT_TYPE},
128        request::{Body, JsonBody, NdBody, PARTS_ENCODED},
129        response::Response,
130        transport::Transport,
131        Method,
132    },
133    params::*,
134};
135use percent_encoding::percent_encode;
136use serde::Serialize;
137use std::{borrow::Cow, time::Duration};
138#[derive(Debug, Clone, PartialEq)]
139#[doc = "API parts for the Cat Aliases API"]
140pub enum CatAliasesParts<'b> {
141    #[doc = "No parts"]
142    None,
143    #[doc = "Name"]
144    Name(&'b [&'b str]),
145}
146impl<'b> CatAliasesParts<'b> {
147    #[doc = "Builds a relative URL path to the Cat Aliases API"]
148    pub fn url(self) -> Cow<'static, str> {
149        match self {
150            CatAliasesParts::None => "/_cat/aliases".into(),
151            CatAliasesParts::Name(ref name) => {
152                let name_str = name.join(",");
153                let encoded_name: Cow<str> =
154                    percent_encode(name_str.as_bytes(), PARTS_ENCODED).into();
155                let mut p = String::with_capacity(14usize + encoded_name.len());
156                p.push_str("/_cat/aliases/");
157                p.push_str(encoded_name.as_ref());
158                p.into()
159            }
160        }
161    }
162}
163#[doc = "Builder for the [Cat Aliases API](https://opensearch.org/docs/)\n\nShows information about currently configured aliases to indices including filter and routing infos."]
164#[derive(Clone, Debug)]
165pub struct CatAliases<'a, 'b> {
166    transport: &'a Transport,
167    parts: CatAliasesParts<'b>,
168    error_trace: Option<bool>,
169    expand_wildcards: Option<&'b [ExpandWildcards]>,
170    filter_path: Option<&'b [&'b str]>,
171    format: Option<&'b str>,
172    h: Option<&'b [&'b str]>,
173    headers: HeaderMap,
174    help: Option<bool>,
175    human: Option<bool>,
176    local: Option<bool>,
177    pretty: Option<bool>,
178    request_timeout: Option<Duration>,
179    s: Option<&'b [&'b str]>,
180    source: Option<&'b str>,
181    v: Option<bool>,
182}
183impl<'a, 'b> CatAliases<'a, 'b> {
184    #[doc = "Creates a new instance of [CatAliases] with the specified API parts"]
185    pub fn new(transport: &'a Transport, parts: CatAliasesParts<'b>) -> Self {
186        let mut headers = HeaderMap::with_capacity(2);
187        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
188        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
189        CatAliases {
190            transport,
191            parts,
192            headers,
193            error_trace: None,
194            expand_wildcards: None,
195            filter_path: None,
196            format: None,
197            h: None,
198            help: None,
199            human: None,
200            local: None,
201            pretty: None,
202            request_timeout: None,
203            s: None,
204            source: None,
205            v: None,
206        }
207    }
208    #[doc = "Include the stack trace of returned errors."]
209    pub fn error_trace(mut self, error_trace: bool) -> Self {
210        self.error_trace = Some(error_trace);
211        self
212    }
213    #[doc = "Whether to expand wildcard expression to concrete indices that are open, closed or both."]
214    pub fn expand_wildcards(mut self, expand_wildcards: &'b [ExpandWildcards]) -> Self {
215        self.expand_wildcards = Some(expand_wildcards);
216        self
217    }
218    #[doc = "A comma-separated list of filters used to reduce the response."]
219    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
220        self.filter_path = Some(filter_path);
221        self
222    }
223    #[doc = "a short version of the Accept header, e.g. json, yaml"]
224    pub fn format(mut self, format: &'b str) -> Self {
225        self.format = Some(format);
226        self
227    }
228    #[doc = "Comma-separated list of column names to display"]
229    pub fn h(mut self, h: &'b [&'b str]) -> Self {
230        self.h = Some(h);
231        self
232    }
233    #[doc = "Adds a HTTP header"]
234    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
235        self.headers.insert(key, value);
236        self
237    }
238    #[doc = "Return help information"]
239    pub fn help(mut self, help: bool) -> Self {
240        self.help = Some(help);
241        self
242    }
243    #[doc = "Return human readable values for statistics."]
244    pub fn human(mut self, human: bool) -> Self {
245        self.human = Some(human);
246        self
247    }
248    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
249    pub fn local(mut self, local: bool) -> Self {
250        self.local = Some(local);
251        self
252    }
253    #[doc = "Pretty format the returned JSON response."]
254    pub fn pretty(mut self, pretty: bool) -> Self {
255        self.pretty = Some(pretty);
256        self
257    }
258    #[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."]
259    pub fn request_timeout(mut self, timeout: Duration) -> Self {
260        self.request_timeout = Some(timeout);
261        self
262    }
263    #[doc = "Comma-separated list of column names or column aliases to sort by"]
264    pub fn s(mut self, s: &'b [&'b str]) -> Self {
265        self.s = Some(s);
266        self
267    }
268    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
269    pub fn source(mut self, source: &'b str) -> Self {
270        self.source = Some(source);
271        self
272    }
273    #[doc = "Verbose mode. Display column headers"]
274    pub fn v(mut self, v: bool) -> Self {
275        self.v = Some(v);
276        self
277    }
278    #[doc = "Creates an asynchronous call to the Cat Aliases API that can be awaited"]
279    pub async fn send(self) -> Result<Response, Error> {
280        let path = self.parts.url();
281        let method = Method::Get;
282        let headers = self.headers;
283        let timeout = self.request_timeout;
284        let query_string = {
285            #[serde_with::skip_serializing_none]
286            #[derive(Serialize)]
287            struct QueryParams<'b> {
288                error_trace: Option<bool>,
289                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
290                expand_wildcards: Option<&'b [ExpandWildcards]>,
291                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
292                filter_path: Option<&'b [&'b str]>,
293                format: Option<&'b str>,
294                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
295                h: Option<&'b [&'b str]>,
296                help: Option<bool>,
297                human: Option<bool>,
298                local: Option<bool>,
299                pretty: Option<bool>,
300                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
301                s: Option<&'b [&'b str]>,
302                source: Option<&'b str>,
303                v: Option<bool>,
304            }
305            let query_params = QueryParams {
306                error_trace: self.error_trace,
307                expand_wildcards: self.expand_wildcards,
308                filter_path: self.filter_path,
309                format: self.format,
310                h: self.h,
311                help: self.help,
312                human: self.human,
313                local: self.local,
314                pretty: self.pretty,
315                s: self.s,
316                source: self.source,
317                v: self.v,
318            };
319            Some(query_params)
320        };
321        let body = Option::<()>::None;
322        let response = self
323            .transport
324            .send(method, &path, headers, query_string.as_ref(), body, timeout)
325            .await?;
326        Ok(response)
327    }
328}
329#[derive(Debug, Clone, PartialEq)]
330#[doc = "API parts for the Cat Allocation API"]
331pub enum CatAllocationParts<'b> {
332    #[doc = "No parts"]
333    None,
334    #[doc = "NodeId"]
335    NodeId(&'b [&'b str]),
336}
337impl<'b> CatAllocationParts<'b> {
338    #[doc = "Builds a relative URL path to the Cat Allocation API"]
339    pub fn url(self) -> Cow<'static, str> {
340        match self {
341            CatAllocationParts::None => "/_cat/allocation".into(),
342            CatAllocationParts::NodeId(ref node_id) => {
343                let node_id_str = node_id.join(",");
344                let encoded_node_id: Cow<str> =
345                    percent_encode(node_id_str.as_bytes(), PARTS_ENCODED).into();
346                let mut p = String::with_capacity(17usize + encoded_node_id.len());
347                p.push_str("/_cat/allocation/");
348                p.push_str(encoded_node_id.as_ref());
349                p.into()
350            }
351        }
352    }
353}
354#[doc = "Builder for the [Cat Allocation API](https://opensearch.org/docs/)\n\nProvides a snapshot of how many shards are allocated to each data node and how much disk space they are using."]
355#[derive(Clone, Debug)]
356pub struct CatAllocation<'a, 'b> {
357    transport: &'a Transport,
358    parts: CatAllocationParts<'b>,
359    bytes: Option<Bytes>,
360    error_trace: Option<bool>,
361    filter_path: Option<&'b [&'b str]>,
362    format: Option<&'b str>,
363    h: Option<&'b [&'b str]>,
364    headers: HeaderMap,
365    help: Option<bool>,
366    human: Option<bool>,
367    local: Option<bool>,
368    master_timeout: Option<&'b str>,
369    pretty: Option<bool>,
370    request_timeout: Option<Duration>,
371    s: Option<&'b [&'b str]>,
372    source: Option<&'b str>,
373    v: Option<bool>,
374}
375impl<'a, 'b> CatAllocation<'a, 'b> {
376    #[doc = "Creates a new instance of [CatAllocation] with the specified API parts"]
377    pub fn new(transport: &'a Transport, parts: CatAllocationParts<'b>) -> Self {
378        let mut headers = HeaderMap::with_capacity(2);
379        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
380        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
381        CatAllocation {
382            transport,
383            parts,
384            headers,
385            bytes: None,
386            error_trace: None,
387            filter_path: None,
388            format: None,
389            h: None,
390            help: None,
391            human: None,
392            local: None,
393            master_timeout: None,
394            pretty: None,
395            request_timeout: None,
396            s: None,
397            source: None,
398            v: None,
399        }
400    }
401    #[doc = "The unit in which to display byte values"]
402    pub fn bytes(mut self, bytes: Bytes) -> Self {
403        self.bytes = Some(bytes);
404        self
405    }
406    #[doc = "Include the stack trace of returned errors."]
407    pub fn error_trace(mut self, error_trace: bool) -> Self {
408        self.error_trace = Some(error_trace);
409        self
410    }
411    #[doc = "A comma-separated list of filters used to reduce the response."]
412    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
413        self.filter_path = Some(filter_path);
414        self
415    }
416    #[doc = "a short version of the Accept header, e.g. json, yaml"]
417    pub fn format(mut self, format: &'b str) -> Self {
418        self.format = Some(format);
419        self
420    }
421    #[doc = "Comma-separated list of column names to display"]
422    pub fn h(mut self, h: &'b [&'b str]) -> Self {
423        self.h = Some(h);
424        self
425    }
426    #[doc = "Adds a HTTP header"]
427    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
428        self.headers.insert(key, value);
429        self
430    }
431    #[doc = "Return help information"]
432    pub fn help(mut self, help: bool) -> Self {
433        self.help = Some(help);
434        self
435    }
436    #[doc = "Return human readable values for statistics."]
437    pub fn human(mut self, human: bool) -> Self {
438        self.human = Some(human);
439        self
440    }
441    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
442    pub fn local(mut self, local: bool) -> Self {
443        self.local = Some(local);
444        self
445    }
446    #[doc = "Explicit operation timeout for connection to master node"]
447    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
448        self.master_timeout = Some(master_timeout);
449        self
450    }
451    #[doc = "Pretty format the returned JSON response."]
452    pub fn pretty(mut self, pretty: bool) -> Self {
453        self.pretty = Some(pretty);
454        self
455    }
456    #[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."]
457    pub fn request_timeout(mut self, timeout: Duration) -> Self {
458        self.request_timeout = Some(timeout);
459        self
460    }
461    #[doc = "Comma-separated list of column names or column aliases to sort by"]
462    pub fn s(mut self, s: &'b [&'b str]) -> Self {
463        self.s = Some(s);
464        self
465    }
466    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
467    pub fn source(mut self, source: &'b str) -> Self {
468        self.source = Some(source);
469        self
470    }
471    #[doc = "Verbose mode. Display column headers"]
472    pub fn v(mut self, v: bool) -> Self {
473        self.v = Some(v);
474        self
475    }
476    #[doc = "Creates an asynchronous call to the Cat Allocation API that can be awaited"]
477    pub async fn send(self) -> Result<Response, Error> {
478        let path = self.parts.url();
479        let method = Method::Get;
480        let headers = self.headers;
481        let timeout = self.request_timeout;
482        let query_string = {
483            #[serde_with::skip_serializing_none]
484            #[derive(Serialize)]
485            struct QueryParams<'b> {
486                bytes: Option<Bytes>,
487                error_trace: Option<bool>,
488                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
489                filter_path: Option<&'b [&'b str]>,
490                format: Option<&'b str>,
491                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
492                h: Option<&'b [&'b str]>,
493                help: Option<bool>,
494                human: Option<bool>,
495                local: Option<bool>,
496                master_timeout: Option<&'b str>,
497                pretty: Option<bool>,
498                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
499                s: Option<&'b [&'b str]>,
500                source: Option<&'b str>,
501                v: Option<bool>,
502            }
503            let query_params = QueryParams {
504                bytes: self.bytes,
505                error_trace: self.error_trace,
506                filter_path: self.filter_path,
507                format: self.format,
508                h: self.h,
509                help: self.help,
510                human: self.human,
511                local: self.local,
512                master_timeout: self.master_timeout,
513                pretty: self.pretty,
514                s: self.s,
515                source: self.source,
516                v: self.v,
517            };
518            Some(query_params)
519        };
520        let body = Option::<()>::None;
521        let response = self
522            .transport
523            .send(method, &path, headers, query_string.as_ref(), body, timeout)
524            .await?;
525        Ok(response)
526    }
527}
528#[derive(Debug, Clone, PartialEq)]
529#[doc = "API parts for the Cat Count API"]
530pub enum CatCountParts<'b> {
531    #[doc = "No parts"]
532    None,
533    #[doc = "Index"]
534    Index(&'b [&'b str]),
535}
536impl<'b> CatCountParts<'b> {
537    #[doc = "Builds a relative URL path to the Cat Count API"]
538    pub fn url(self) -> Cow<'static, str> {
539        match self {
540            CatCountParts::None => "/_cat/count".into(),
541            CatCountParts::Index(ref index) => {
542                let index_str = index.join(",");
543                let encoded_index: Cow<str> =
544                    percent_encode(index_str.as_bytes(), PARTS_ENCODED).into();
545                let mut p = String::with_capacity(12usize + encoded_index.len());
546                p.push_str("/_cat/count/");
547                p.push_str(encoded_index.as_ref());
548                p.into()
549            }
550        }
551    }
552}
553#[doc = "Builder for the [Cat Count API](https://opensearch.org/docs/)\n\nProvides quick access to the document count of the entire cluster, or individual indices."]
554#[derive(Clone, Debug)]
555pub struct CatCount<'a, 'b> {
556    transport: &'a Transport,
557    parts: CatCountParts<'b>,
558    error_trace: Option<bool>,
559    filter_path: Option<&'b [&'b str]>,
560    format: Option<&'b str>,
561    h: Option<&'b [&'b str]>,
562    headers: HeaderMap,
563    help: Option<bool>,
564    human: Option<bool>,
565    pretty: Option<bool>,
566    request_timeout: Option<Duration>,
567    s: Option<&'b [&'b str]>,
568    source: Option<&'b str>,
569    v: Option<bool>,
570}
571impl<'a, 'b> CatCount<'a, 'b> {
572    #[doc = "Creates a new instance of [CatCount] with the specified API parts"]
573    pub fn new(transport: &'a Transport, parts: CatCountParts<'b>) -> Self {
574        let mut headers = HeaderMap::with_capacity(2);
575        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
576        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
577        CatCount {
578            transport,
579            parts,
580            headers,
581            error_trace: None,
582            filter_path: None,
583            format: None,
584            h: None,
585            help: None,
586            human: None,
587            pretty: None,
588            request_timeout: None,
589            s: None,
590            source: None,
591            v: None,
592        }
593    }
594    #[doc = "Include the stack trace of returned errors."]
595    pub fn error_trace(mut self, error_trace: bool) -> Self {
596        self.error_trace = Some(error_trace);
597        self
598    }
599    #[doc = "A comma-separated list of filters used to reduce the response."]
600    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
601        self.filter_path = Some(filter_path);
602        self
603    }
604    #[doc = "a short version of the Accept header, e.g. json, yaml"]
605    pub fn format(mut self, format: &'b str) -> Self {
606        self.format = Some(format);
607        self
608    }
609    #[doc = "Comma-separated list of column names to display"]
610    pub fn h(mut self, h: &'b [&'b str]) -> Self {
611        self.h = Some(h);
612        self
613    }
614    #[doc = "Adds a HTTP header"]
615    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
616        self.headers.insert(key, value);
617        self
618    }
619    #[doc = "Return help information"]
620    pub fn help(mut self, help: bool) -> Self {
621        self.help = Some(help);
622        self
623    }
624    #[doc = "Return human readable values for statistics."]
625    pub fn human(mut self, human: bool) -> Self {
626        self.human = Some(human);
627        self
628    }
629    #[doc = "Pretty format the returned JSON response."]
630    pub fn pretty(mut self, pretty: bool) -> Self {
631        self.pretty = Some(pretty);
632        self
633    }
634    #[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."]
635    pub fn request_timeout(mut self, timeout: Duration) -> Self {
636        self.request_timeout = Some(timeout);
637        self
638    }
639    #[doc = "Comma-separated list of column names or column aliases to sort by"]
640    pub fn s(mut self, s: &'b [&'b str]) -> Self {
641        self.s = Some(s);
642        self
643    }
644    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
645    pub fn source(mut self, source: &'b str) -> Self {
646        self.source = Some(source);
647        self
648    }
649    #[doc = "Verbose mode. Display column headers"]
650    pub fn v(mut self, v: bool) -> Self {
651        self.v = Some(v);
652        self
653    }
654    #[doc = "Creates an asynchronous call to the Cat Count API that can be awaited"]
655    pub async fn send(self) -> Result<Response, Error> {
656        let path = self.parts.url();
657        let method = Method::Get;
658        let headers = self.headers;
659        let timeout = self.request_timeout;
660        let query_string = {
661            #[serde_with::skip_serializing_none]
662            #[derive(Serialize)]
663            struct QueryParams<'b> {
664                error_trace: Option<bool>,
665                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
666                filter_path: Option<&'b [&'b str]>,
667                format: Option<&'b str>,
668                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
669                h: Option<&'b [&'b str]>,
670                help: Option<bool>,
671                human: Option<bool>,
672                pretty: Option<bool>,
673                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
674                s: Option<&'b [&'b str]>,
675                source: Option<&'b str>,
676                v: Option<bool>,
677            }
678            let query_params = QueryParams {
679                error_trace: self.error_trace,
680                filter_path: self.filter_path,
681                format: self.format,
682                h: self.h,
683                help: self.help,
684                human: self.human,
685                pretty: self.pretty,
686                s: self.s,
687                source: self.source,
688                v: self.v,
689            };
690            Some(query_params)
691        };
692        let body = Option::<()>::None;
693        let response = self
694            .transport
695            .send(method, &path, headers, query_string.as_ref(), body, timeout)
696            .await?;
697        Ok(response)
698    }
699}
700#[derive(Debug, Clone, PartialEq)]
701#[doc = "API parts for the Cat Fielddata API"]
702pub enum CatFielddataParts<'b> {
703    #[doc = "No parts"]
704    None,
705    #[doc = "Fields"]
706    Fields(&'b [&'b str]),
707}
708impl<'b> CatFielddataParts<'b> {
709    #[doc = "Builds a relative URL path to the Cat Fielddata API"]
710    pub fn url(self) -> Cow<'static, str> {
711        match self {
712            CatFielddataParts::None => "/_cat/fielddata".into(),
713            CatFielddataParts::Fields(ref fields) => {
714                let fields_str = fields.join(",");
715                let encoded_fields: Cow<str> =
716                    percent_encode(fields_str.as_bytes(), PARTS_ENCODED).into();
717                let mut p = String::with_capacity(16usize + encoded_fields.len());
718                p.push_str("/_cat/fielddata/");
719                p.push_str(encoded_fields.as_ref());
720                p.into()
721            }
722        }
723    }
724}
725#[doc = "Builder for the [Cat Fielddata API](https://opensearch.org/docs/)\n\nShows how much heap memory is currently being used by fielddata on every data node in the cluster."]
726#[derive(Clone, Debug)]
727pub struct CatFielddata<'a, 'b> {
728    transport: &'a Transport,
729    parts: CatFielddataParts<'b>,
730    bytes: Option<Bytes>,
731    error_trace: Option<bool>,
732    fields: Option<&'b [&'b str]>,
733    filter_path: Option<&'b [&'b str]>,
734    format: Option<&'b str>,
735    h: Option<&'b [&'b str]>,
736    headers: HeaderMap,
737    help: Option<bool>,
738    human: Option<bool>,
739    pretty: Option<bool>,
740    request_timeout: Option<Duration>,
741    s: Option<&'b [&'b str]>,
742    source: Option<&'b str>,
743    v: Option<bool>,
744}
745impl<'a, 'b> CatFielddata<'a, 'b> {
746    #[doc = "Creates a new instance of [CatFielddata] with the specified API parts"]
747    pub fn new(transport: &'a Transport, parts: CatFielddataParts<'b>) -> Self {
748        let mut headers = HeaderMap::with_capacity(2);
749        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
750        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
751        CatFielddata {
752            transport,
753            parts,
754            headers,
755            bytes: None,
756            error_trace: None,
757            fields: None,
758            filter_path: None,
759            format: None,
760            h: None,
761            help: None,
762            human: None,
763            pretty: None,
764            request_timeout: None,
765            s: None,
766            source: None,
767            v: None,
768        }
769    }
770    #[doc = "The unit in which to display byte values"]
771    pub fn bytes(mut self, bytes: Bytes) -> Self {
772        self.bytes = Some(bytes);
773        self
774    }
775    #[doc = "Include the stack trace of returned errors."]
776    pub fn error_trace(mut self, error_trace: bool) -> Self {
777        self.error_trace = Some(error_trace);
778        self
779    }
780    #[doc = "A comma-separated list of fields to return in the output"]
781    pub fn fields(mut self, fields: &'b [&'b str]) -> Self {
782        self.fields = Some(fields);
783        self
784    }
785    #[doc = "A comma-separated list of filters used to reduce the response."]
786    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
787        self.filter_path = Some(filter_path);
788        self
789    }
790    #[doc = "a short version of the Accept header, e.g. json, yaml"]
791    pub fn format(mut self, format: &'b str) -> Self {
792        self.format = Some(format);
793        self
794    }
795    #[doc = "Comma-separated list of column names to display"]
796    pub fn h(mut self, h: &'b [&'b str]) -> Self {
797        self.h = Some(h);
798        self
799    }
800    #[doc = "Adds a HTTP header"]
801    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
802        self.headers.insert(key, value);
803        self
804    }
805    #[doc = "Return help information"]
806    pub fn help(mut self, help: bool) -> Self {
807        self.help = Some(help);
808        self
809    }
810    #[doc = "Return human readable values for statistics."]
811    pub fn human(mut self, human: bool) -> Self {
812        self.human = Some(human);
813        self
814    }
815    #[doc = "Pretty format the returned JSON response."]
816    pub fn pretty(mut self, pretty: bool) -> Self {
817        self.pretty = Some(pretty);
818        self
819    }
820    #[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."]
821    pub fn request_timeout(mut self, timeout: Duration) -> Self {
822        self.request_timeout = Some(timeout);
823        self
824    }
825    #[doc = "Comma-separated list of column names or column aliases to sort by"]
826    pub fn s(mut self, s: &'b [&'b str]) -> Self {
827        self.s = Some(s);
828        self
829    }
830    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
831    pub fn source(mut self, source: &'b str) -> Self {
832        self.source = Some(source);
833        self
834    }
835    #[doc = "Verbose mode. Display column headers"]
836    pub fn v(mut self, v: bool) -> Self {
837        self.v = Some(v);
838        self
839    }
840    #[doc = "Creates an asynchronous call to the Cat Fielddata API that can be awaited"]
841    pub async fn send(self) -> Result<Response, Error> {
842        let path = self.parts.url();
843        let method = Method::Get;
844        let headers = self.headers;
845        let timeout = self.request_timeout;
846        let query_string = {
847            #[serde_with::skip_serializing_none]
848            #[derive(Serialize)]
849            struct QueryParams<'b> {
850                bytes: Option<Bytes>,
851                error_trace: Option<bool>,
852                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
853                fields: Option<&'b [&'b str]>,
854                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
855                filter_path: Option<&'b [&'b str]>,
856                format: Option<&'b str>,
857                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
858                h: Option<&'b [&'b str]>,
859                help: Option<bool>,
860                human: Option<bool>,
861                pretty: Option<bool>,
862                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
863                s: Option<&'b [&'b str]>,
864                source: Option<&'b str>,
865                v: Option<bool>,
866            }
867            let query_params = QueryParams {
868                bytes: self.bytes,
869                error_trace: self.error_trace,
870                fields: self.fields,
871                filter_path: self.filter_path,
872                format: self.format,
873                h: self.h,
874                help: self.help,
875                human: self.human,
876                pretty: self.pretty,
877                s: self.s,
878                source: self.source,
879                v: self.v,
880            };
881            Some(query_params)
882        };
883        let body = Option::<()>::None;
884        let response = self
885            .transport
886            .send(method, &path, headers, query_string.as_ref(), body, timeout)
887            .await?;
888        Ok(response)
889    }
890}
891#[derive(Debug, Clone, PartialEq)]
892#[doc = "API parts for the Cat Health API"]
893pub enum CatHealthParts {
894    #[doc = "No parts"]
895    None,
896}
897impl CatHealthParts {
898    #[doc = "Builds a relative URL path to the Cat Health API"]
899    pub fn url(self) -> Cow<'static, str> {
900        match self {
901            CatHealthParts::None => "/_cat/health".into(),
902        }
903    }
904}
905#[doc = "Builder for the [Cat Health API](https://opensearch.org/docs/)\n\nReturns a concise representation of the cluster health."]
906#[derive(Clone, Debug)]
907pub struct CatHealth<'a, 'b> {
908    transport: &'a Transport,
909    parts: CatHealthParts,
910    error_trace: Option<bool>,
911    filter_path: Option<&'b [&'b str]>,
912    format: Option<&'b str>,
913    h: Option<&'b [&'b str]>,
914    headers: HeaderMap,
915    help: Option<bool>,
916    human: Option<bool>,
917    pretty: Option<bool>,
918    request_timeout: Option<Duration>,
919    s: Option<&'b [&'b str]>,
920    source: Option<&'b str>,
921    time: Option<Time>,
922    ts: Option<bool>,
923    v: Option<bool>,
924}
925impl<'a, 'b> CatHealth<'a, 'b> {
926    #[doc = "Creates a new instance of [CatHealth]"]
927    pub fn new(transport: &'a Transport) -> Self {
928        let mut headers = HeaderMap::with_capacity(2);
929        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
930        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
931        CatHealth {
932            transport,
933            parts: CatHealthParts::None,
934            headers,
935            error_trace: None,
936            filter_path: None,
937            format: None,
938            h: None,
939            help: None,
940            human: None,
941            pretty: None,
942            request_timeout: None,
943            s: None,
944            source: None,
945            time: None,
946            ts: None,
947            v: None,
948        }
949    }
950    #[doc = "Include the stack trace of returned errors."]
951    pub fn error_trace(mut self, error_trace: bool) -> Self {
952        self.error_trace = Some(error_trace);
953        self
954    }
955    #[doc = "A comma-separated list of filters used to reduce the response."]
956    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
957        self.filter_path = Some(filter_path);
958        self
959    }
960    #[doc = "a short version of the Accept header, e.g. json, yaml"]
961    pub fn format(mut self, format: &'b str) -> Self {
962        self.format = Some(format);
963        self
964    }
965    #[doc = "Comma-separated list of column names to display"]
966    pub fn h(mut self, h: &'b [&'b str]) -> Self {
967        self.h = Some(h);
968        self
969    }
970    #[doc = "Adds a HTTP header"]
971    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
972        self.headers.insert(key, value);
973        self
974    }
975    #[doc = "Return help information"]
976    pub fn help(mut self, help: bool) -> Self {
977        self.help = Some(help);
978        self
979    }
980    #[doc = "Return human readable values for statistics."]
981    pub fn human(mut self, human: bool) -> Self {
982        self.human = Some(human);
983        self
984    }
985    #[doc = "Pretty format the returned JSON response."]
986    pub fn pretty(mut self, pretty: bool) -> Self {
987        self.pretty = Some(pretty);
988        self
989    }
990    #[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."]
991    pub fn request_timeout(mut self, timeout: Duration) -> Self {
992        self.request_timeout = Some(timeout);
993        self
994    }
995    #[doc = "Comma-separated list of column names or column aliases to sort by"]
996    pub fn s(mut self, s: &'b [&'b str]) -> Self {
997        self.s = Some(s);
998        self
999    }
1000    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1001    pub fn source(mut self, source: &'b str) -> Self {
1002        self.source = Some(source);
1003        self
1004    }
1005    #[doc = "The unit in which to display time values"]
1006    pub fn time(mut self, time: Time) -> Self {
1007        self.time = Some(time);
1008        self
1009    }
1010    #[doc = "Set to false to disable timestamping"]
1011    pub fn ts(mut self, ts: bool) -> Self {
1012        self.ts = Some(ts);
1013        self
1014    }
1015    #[doc = "Verbose mode. Display column headers"]
1016    pub fn v(mut self, v: bool) -> Self {
1017        self.v = Some(v);
1018        self
1019    }
1020    #[doc = "Creates an asynchronous call to the Cat Health API that can be awaited"]
1021    pub async fn send(self) -> Result<Response, Error> {
1022        let path = self.parts.url();
1023        let method = Method::Get;
1024        let headers = self.headers;
1025        let timeout = self.request_timeout;
1026        let query_string = {
1027            #[serde_with::skip_serializing_none]
1028            #[derive(Serialize)]
1029            struct QueryParams<'b> {
1030                error_trace: Option<bool>,
1031                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1032                filter_path: Option<&'b [&'b str]>,
1033                format: Option<&'b str>,
1034                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1035                h: Option<&'b [&'b str]>,
1036                help: Option<bool>,
1037                human: Option<bool>,
1038                pretty: Option<bool>,
1039                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1040                s: Option<&'b [&'b str]>,
1041                source: Option<&'b str>,
1042                time: Option<Time>,
1043                ts: Option<bool>,
1044                v: Option<bool>,
1045            }
1046            let query_params = QueryParams {
1047                error_trace: self.error_trace,
1048                filter_path: self.filter_path,
1049                format: self.format,
1050                h: self.h,
1051                help: self.help,
1052                human: self.human,
1053                pretty: self.pretty,
1054                s: self.s,
1055                source: self.source,
1056                time: self.time,
1057                ts: self.ts,
1058                v: self.v,
1059            };
1060            Some(query_params)
1061        };
1062        let body = Option::<()>::None;
1063        let response = self
1064            .transport
1065            .send(method, &path, headers, query_string.as_ref(), body, timeout)
1066            .await?;
1067        Ok(response)
1068    }
1069}
1070#[derive(Debug, Clone, PartialEq)]
1071#[doc = "API parts for the Cat Help API"]
1072pub enum CatHelpParts {
1073    #[doc = "No parts"]
1074    None,
1075}
1076impl CatHelpParts {
1077    #[doc = "Builds a relative URL path to the Cat Help API"]
1078    pub fn url(self) -> Cow<'static, str> {
1079        match self {
1080            CatHelpParts::None => "/_cat".into(),
1081        }
1082    }
1083}
1084#[doc = "Builder for the [Cat Help API](https://opensearch.org/docs/)\n\nReturns help for the Cat APIs."]
1085#[derive(Clone, Debug)]
1086pub struct CatHelp<'a, 'b> {
1087    transport: &'a Transport,
1088    parts: CatHelpParts,
1089    error_trace: Option<bool>,
1090    filter_path: Option<&'b [&'b str]>,
1091    headers: HeaderMap,
1092    help: Option<bool>,
1093    human: Option<bool>,
1094    pretty: Option<bool>,
1095    request_timeout: Option<Duration>,
1096    s: Option<&'b [&'b str]>,
1097    source: Option<&'b str>,
1098}
1099impl<'a, 'b> CatHelp<'a, 'b> {
1100    #[doc = "Creates a new instance of [CatHelp]"]
1101    pub fn new(transport: &'a Transport) -> Self {
1102        let mut headers = HeaderMap::with_capacity(2);
1103        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
1104        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
1105        CatHelp {
1106            transport,
1107            parts: CatHelpParts::None,
1108            headers,
1109            error_trace: None,
1110            filter_path: None,
1111            help: None,
1112            human: None,
1113            pretty: None,
1114            request_timeout: None,
1115            s: None,
1116            source: None,
1117        }
1118    }
1119    #[doc = "Include the stack trace of returned errors."]
1120    pub fn error_trace(mut self, error_trace: bool) -> Self {
1121        self.error_trace = Some(error_trace);
1122        self
1123    }
1124    #[doc = "A comma-separated list of filters used to reduce the response."]
1125    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1126        self.filter_path = Some(filter_path);
1127        self
1128    }
1129    #[doc = "Adds a HTTP header"]
1130    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1131        self.headers.insert(key, value);
1132        self
1133    }
1134    #[doc = "Return help information"]
1135    pub fn help(mut self, help: bool) -> Self {
1136        self.help = Some(help);
1137        self
1138    }
1139    #[doc = "Return human readable values for statistics."]
1140    pub fn human(mut self, human: bool) -> Self {
1141        self.human = Some(human);
1142        self
1143    }
1144    #[doc = "Pretty format the returned JSON response."]
1145    pub fn pretty(mut self, pretty: bool) -> Self {
1146        self.pretty = Some(pretty);
1147        self
1148    }
1149    #[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."]
1150    pub fn request_timeout(mut self, timeout: Duration) -> Self {
1151        self.request_timeout = Some(timeout);
1152        self
1153    }
1154    #[doc = "Comma-separated list of column names or column aliases to sort by"]
1155    pub fn s(mut self, s: &'b [&'b str]) -> Self {
1156        self.s = Some(s);
1157        self
1158    }
1159    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1160    pub fn source(mut self, source: &'b str) -> Self {
1161        self.source = Some(source);
1162        self
1163    }
1164    #[doc = "Creates an asynchronous call to the Cat Help API that can be awaited"]
1165    pub async fn send(self) -> Result<Response, Error> {
1166        let path = self.parts.url();
1167        let method = Method::Get;
1168        let headers = self.headers;
1169        let timeout = self.request_timeout;
1170        let query_string = {
1171            #[serde_with::skip_serializing_none]
1172            #[derive(Serialize)]
1173            struct QueryParams<'b> {
1174                error_trace: Option<bool>,
1175                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1176                filter_path: Option<&'b [&'b str]>,
1177                help: Option<bool>,
1178                human: Option<bool>,
1179                pretty: Option<bool>,
1180                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1181                s: Option<&'b [&'b str]>,
1182                source: Option<&'b str>,
1183            }
1184            let query_params = QueryParams {
1185                error_trace: self.error_trace,
1186                filter_path: self.filter_path,
1187                help: self.help,
1188                human: self.human,
1189                pretty: self.pretty,
1190                s: self.s,
1191                source: self.source,
1192            };
1193            Some(query_params)
1194        };
1195        let body = Option::<()>::None;
1196        let response = self
1197            .transport
1198            .send(method, &path, headers, query_string.as_ref(), body, timeout)
1199            .await?;
1200        Ok(response)
1201    }
1202}
1203#[derive(Debug, Clone, PartialEq)]
1204#[doc = "API parts for the Cat Indices API"]
1205pub enum CatIndicesParts<'b> {
1206    #[doc = "No parts"]
1207    None,
1208    #[doc = "Index"]
1209    Index(&'b [&'b str]),
1210}
1211impl<'b> CatIndicesParts<'b> {
1212    #[doc = "Builds a relative URL path to the Cat Indices API"]
1213    pub fn url(self) -> Cow<'static, str> {
1214        match self {
1215            CatIndicesParts::None => "/_cat/indices".into(),
1216            CatIndicesParts::Index(ref index) => {
1217                let index_str = index.join(",");
1218                let encoded_index: Cow<str> =
1219                    percent_encode(index_str.as_bytes(), PARTS_ENCODED).into();
1220                let mut p = String::with_capacity(14usize + encoded_index.len());
1221                p.push_str("/_cat/indices/");
1222                p.push_str(encoded_index.as_ref());
1223                p.into()
1224            }
1225        }
1226    }
1227}
1228#[doc = "Builder for the [Cat Indices API](https://opensearch.org/docs/)\n\nReturns information about indices: number of primaries and replicas, document counts, disk size, ..."]
1229#[derive(Clone, Debug)]
1230pub struct CatIndices<'a, 'b> {
1231    transport: &'a Transport,
1232    parts: CatIndicesParts<'b>,
1233    bytes: Option<Bytes>,
1234    error_trace: Option<bool>,
1235    expand_wildcards: Option<&'b [ExpandWildcards]>,
1236    filter_path: Option<&'b [&'b str]>,
1237    format: Option<&'b str>,
1238    h: Option<&'b [&'b str]>,
1239    headers: HeaderMap,
1240    health: Option<Health>,
1241    help: Option<bool>,
1242    human: Option<bool>,
1243    include_unloaded_segments: Option<bool>,
1244    local: Option<bool>,
1245    master_timeout: Option<&'b str>,
1246    pretty: Option<bool>,
1247    pri: Option<bool>,
1248    request_timeout: Option<Duration>,
1249    s: Option<&'b [&'b str]>,
1250    source: Option<&'b str>,
1251    time: Option<Time>,
1252    v: Option<bool>,
1253}
1254impl<'a, 'b> CatIndices<'a, 'b> {
1255    #[doc = "Creates a new instance of [CatIndices] with the specified API parts"]
1256    pub fn new(transport: &'a Transport, parts: CatIndicesParts<'b>) -> Self {
1257        let mut headers = HeaderMap::with_capacity(2);
1258        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
1259        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
1260        CatIndices {
1261            transport,
1262            parts,
1263            headers,
1264            bytes: None,
1265            error_trace: None,
1266            expand_wildcards: None,
1267            filter_path: None,
1268            format: None,
1269            h: None,
1270            health: None,
1271            help: None,
1272            human: None,
1273            include_unloaded_segments: None,
1274            local: None,
1275            master_timeout: None,
1276            pretty: None,
1277            pri: None,
1278            request_timeout: None,
1279            s: None,
1280            source: None,
1281            time: None,
1282            v: None,
1283        }
1284    }
1285    #[doc = "The unit in which to display byte values"]
1286    pub fn bytes(mut self, bytes: Bytes) -> Self {
1287        self.bytes = Some(bytes);
1288        self
1289    }
1290    #[doc = "Include the stack trace of returned errors."]
1291    pub fn error_trace(mut self, error_trace: bool) -> Self {
1292        self.error_trace = Some(error_trace);
1293        self
1294    }
1295    #[doc = "Whether to expand wildcard expression to concrete indices that are open, closed or both."]
1296    pub fn expand_wildcards(mut self, expand_wildcards: &'b [ExpandWildcards]) -> Self {
1297        self.expand_wildcards = Some(expand_wildcards);
1298        self
1299    }
1300    #[doc = "A comma-separated list of filters used to reduce the response."]
1301    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1302        self.filter_path = Some(filter_path);
1303        self
1304    }
1305    #[doc = "a short version of the Accept header, e.g. json, yaml"]
1306    pub fn format(mut self, format: &'b str) -> Self {
1307        self.format = Some(format);
1308        self
1309    }
1310    #[doc = "Comma-separated list of column names to display"]
1311    pub fn h(mut self, h: &'b [&'b str]) -> Self {
1312        self.h = Some(h);
1313        self
1314    }
1315    #[doc = "Adds a HTTP header"]
1316    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1317        self.headers.insert(key, value);
1318        self
1319    }
1320    #[doc = "A health status (\"green\", \"yellow\", or \"red\" to filter only indices matching the specified health status"]
1321    pub fn health(mut self, health: Health) -> Self {
1322        self.health = Some(health);
1323        self
1324    }
1325    #[doc = "Return help information"]
1326    pub fn help(mut self, help: bool) -> Self {
1327        self.help = Some(help);
1328        self
1329    }
1330    #[doc = "Return human readable values for statistics."]
1331    pub fn human(mut self, human: bool) -> Self {
1332        self.human = Some(human);
1333        self
1334    }
1335    #[doc = "If set to true segment stats will include stats for segments that are not currently loaded into memory"]
1336    pub fn include_unloaded_segments(mut self, include_unloaded_segments: bool) -> Self {
1337        self.include_unloaded_segments = Some(include_unloaded_segments);
1338        self
1339    }
1340    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
1341    pub fn local(mut self, local: bool) -> Self {
1342        self.local = Some(local);
1343        self
1344    }
1345    #[doc = "Explicit operation timeout for connection to master node"]
1346    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
1347        self.master_timeout = Some(master_timeout);
1348        self
1349    }
1350    #[doc = "Pretty format the returned JSON response."]
1351    pub fn pretty(mut self, pretty: bool) -> Self {
1352        self.pretty = Some(pretty);
1353        self
1354    }
1355    #[doc = "Set to true to return stats only for primary shards"]
1356    pub fn pri(mut self, pri: bool) -> Self {
1357        self.pri = Some(pri);
1358        self
1359    }
1360    #[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."]
1361    pub fn request_timeout(mut self, timeout: Duration) -> Self {
1362        self.request_timeout = Some(timeout);
1363        self
1364    }
1365    #[doc = "Comma-separated list of column names or column aliases to sort by"]
1366    pub fn s(mut self, s: &'b [&'b str]) -> Self {
1367        self.s = Some(s);
1368        self
1369    }
1370    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1371    pub fn source(mut self, source: &'b str) -> Self {
1372        self.source = Some(source);
1373        self
1374    }
1375    #[doc = "The unit in which to display time values"]
1376    pub fn time(mut self, time: Time) -> Self {
1377        self.time = Some(time);
1378        self
1379    }
1380    #[doc = "Verbose mode. Display column headers"]
1381    pub fn v(mut self, v: bool) -> Self {
1382        self.v = Some(v);
1383        self
1384    }
1385    #[doc = "Creates an asynchronous call to the Cat Indices API that can be awaited"]
1386    pub async fn send(self) -> Result<Response, Error> {
1387        let path = self.parts.url();
1388        let method = Method::Get;
1389        let headers = self.headers;
1390        let timeout = self.request_timeout;
1391        let query_string = {
1392            #[serde_with::skip_serializing_none]
1393            #[derive(Serialize)]
1394            struct QueryParams<'b> {
1395                bytes: Option<Bytes>,
1396                error_trace: Option<bool>,
1397                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1398                expand_wildcards: Option<&'b [ExpandWildcards]>,
1399                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1400                filter_path: Option<&'b [&'b str]>,
1401                format: Option<&'b str>,
1402                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1403                h: Option<&'b [&'b str]>,
1404                health: Option<Health>,
1405                help: Option<bool>,
1406                human: Option<bool>,
1407                include_unloaded_segments: Option<bool>,
1408                local: Option<bool>,
1409                master_timeout: Option<&'b str>,
1410                pretty: Option<bool>,
1411                pri: Option<bool>,
1412                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1413                s: Option<&'b [&'b str]>,
1414                source: Option<&'b str>,
1415                time: Option<Time>,
1416                v: Option<bool>,
1417            }
1418            let query_params = QueryParams {
1419                bytes: self.bytes,
1420                error_trace: self.error_trace,
1421                expand_wildcards: self.expand_wildcards,
1422                filter_path: self.filter_path,
1423                format: self.format,
1424                h: self.h,
1425                health: self.health,
1426                help: self.help,
1427                human: self.human,
1428                include_unloaded_segments: self.include_unloaded_segments,
1429                local: self.local,
1430                master_timeout: self.master_timeout,
1431                pretty: self.pretty,
1432                pri: self.pri,
1433                s: self.s,
1434                source: self.source,
1435                time: self.time,
1436                v: self.v,
1437            };
1438            Some(query_params)
1439        };
1440        let body = Option::<()>::None;
1441        let response = self
1442            .transport
1443            .send(method, &path, headers, query_string.as_ref(), body, timeout)
1444            .await?;
1445        Ok(response)
1446    }
1447}
1448#[derive(Debug, Clone, PartialEq)]
1449#[doc = "API parts for the Cat Master API"]
1450pub enum CatMasterParts {
1451    #[doc = "No parts"]
1452    None,
1453}
1454impl CatMasterParts {
1455    #[doc = "Builds a relative URL path to the Cat Master API"]
1456    pub fn url(self) -> Cow<'static, str> {
1457        match self {
1458            CatMasterParts::None => "/_cat/master".into(),
1459        }
1460    }
1461}
1462#[doc = "Builder for the [Cat Master API](https://opensearch.org/docs/)\n\nReturns information about the master node."]
1463#[derive(Clone, Debug)]
1464pub struct CatMaster<'a, 'b> {
1465    transport: &'a Transport,
1466    parts: CatMasterParts,
1467    error_trace: Option<bool>,
1468    filter_path: Option<&'b [&'b str]>,
1469    format: Option<&'b str>,
1470    h: Option<&'b [&'b str]>,
1471    headers: HeaderMap,
1472    help: Option<bool>,
1473    human: Option<bool>,
1474    local: Option<bool>,
1475    master_timeout: Option<&'b str>,
1476    pretty: Option<bool>,
1477    request_timeout: Option<Duration>,
1478    s: Option<&'b [&'b str]>,
1479    source: Option<&'b str>,
1480    v: Option<bool>,
1481}
1482impl<'a, 'b> CatMaster<'a, 'b> {
1483    #[doc = "Creates a new instance of [CatMaster]"]
1484    pub fn new(transport: &'a Transport) -> Self {
1485        let mut headers = HeaderMap::with_capacity(2);
1486        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
1487        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
1488        CatMaster {
1489            transport,
1490            parts: CatMasterParts::None,
1491            headers,
1492            error_trace: None,
1493            filter_path: None,
1494            format: None,
1495            h: None,
1496            help: None,
1497            human: None,
1498            local: None,
1499            master_timeout: None,
1500            pretty: None,
1501            request_timeout: None,
1502            s: None,
1503            source: None,
1504            v: None,
1505        }
1506    }
1507    #[doc = "Include the stack trace of returned errors."]
1508    pub fn error_trace(mut self, error_trace: bool) -> Self {
1509        self.error_trace = Some(error_trace);
1510        self
1511    }
1512    #[doc = "A comma-separated list of filters used to reduce the response."]
1513    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1514        self.filter_path = Some(filter_path);
1515        self
1516    }
1517    #[doc = "a short version of the Accept header, e.g. json, yaml"]
1518    pub fn format(mut self, format: &'b str) -> Self {
1519        self.format = Some(format);
1520        self
1521    }
1522    #[doc = "Comma-separated list of column names to display"]
1523    pub fn h(mut self, h: &'b [&'b str]) -> Self {
1524        self.h = Some(h);
1525        self
1526    }
1527    #[doc = "Adds a HTTP header"]
1528    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1529        self.headers.insert(key, value);
1530        self
1531    }
1532    #[doc = "Return help information"]
1533    pub fn help(mut self, help: bool) -> Self {
1534        self.help = Some(help);
1535        self
1536    }
1537    #[doc = "Return human readable values for statistics."]
1538    pub fn human(mut self, human: bool) -> Self {
1539        self.human = Some(human);
1540        self
1541    }
1542    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
1543    pub fn local(mut self, local: bool) -> Self {
1544        self.local = Some(local);
1545        self
1546    }
1547    #[doc = "Explicit operation timeout for connection to master node"]
1548    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
1549        self.master_timeout = Some(master_timeout);
1550        self
1551    }
1552    #[doc = "Pretty format the returned JSON response."]
1553    pub fn pretty(mut self, pretty: bool) -> Self {
1554        self.pretty = Some(pretty);
1555        self
1556    }
1557    #[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."]
1558    pub fn request_timeout(mut self, timeout: Duration) -> Self {
1559        self.request_timeout = Some(timeout);
1560        self
1561    }
1562    #[doc = "Comma-separated list of column names or column aliases to sort by"]
1563    pub fn s(mut self, s: &'b [&'b str]) -> Self {
1564        self.s = Some(s);
1565        self
1566    }
1567    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1568    pub fn source(mut self, source: &'b str) -> Self {
1569        self.source = Some(source);
1570        self
1571    }
1572    #[doc = "Verbose mode. Display column headers"]
1573    pub fn v(mut self, v: bool) -> Self {
1574        self.v = Some(v);
1575        self
1576    }
1577    #[doc = "Creates an asynchronous call to the Cat Master API that can be awaited"]
1578    pub async fn send(self) -> Result<Response, Error> {
1579        let path = self.parts.url();
1580        let method = Method::Get;
1581        let headers = self.headers;
1582        let timeout = self.request_timeout;
1583        let query_string = {
1584            #[serde_with::skip_serializing_none]
1585            #[derive(Serialize)]
1586            struct QueryParams<'b> {
1587                error_trace: Option<bool>,
1588                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1589                filter_path: Option<&'b [&'b str]>,
1590                format: Option<&'b str>,
1591                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1592                h: Option<&'b [&'b str]>,
1593                help: Option<bool>,
1594                human: Option<bool>,
1595                local: Option<bool>,
1596                master_timeout: Option<&'b str>,
1597                pretty: Option<bool>,
1598                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1599                s: Option<&'b [&'b str]>,
1600                source: Option<&'b str>,
1601                v: Option<bool>,
1602            }
1603            let query_params = QueryParams {
1604                error_trace: self.error_trace,
1605                filter_path: self.filter_path,
1606                format: self.format,
1607                h: self.h,
1608                help: self.help,
1609                human: self.human,
1610                local: self.local,
1611                master_timeout: self.master_timeout,
1612                pretty: self.pretty,
1613                s: self.s,
1614                source: self.source,
1615                v: self.v,
1616            };
1617            Some(query_params)
1618        };
1619        let body = Option::<()>::None;
1620        let response = self
1621            .transport
1622            .send(method, &path, headers, query_string.as_ref(), body, timeout)
1623            .await?;
1624        Ok(response)
1625    }
1626}
1627#[derive(Debug, Clone, PartialEq)]
1628#[doc = "API parts for the Cat Nodeattrs API"]
1629pub enum CatNodeattrsParts {
1630    #[doc = "No parts"]
1631    None,
1632}
1633impl CatNodeattrsParts {
1634    #[doc = "Builds a relative URL path to the Cat Nodeattrs API"]
1635    pub fn url(self) -> Cow<'static, str> {
1636        match self {
1637            CatNodeattrsParts::None => "/_cat/nodeattrs".into(),
1638        }
1639    }
1640}
1641#[doc = "Builder for the [Cat Nodeattrs API](https://opensearch.org/docs/)\n\nReturns information about custom node attributes."]
1642#[derive(Clone, Debug)]
1643pub struct CatNodeattrs<'a, 'b> {
1644    transport: &'a Transport,
1645    parts: CatNodeattrsParts,
1646    error_trace: Option<bool>,
1647    filter_path: Option<&'b [&'b str]>,
1648    format: Option<&'b str>,
1649    h: Option<&'b [&'b str]>,
1650    headers: HeaderMap,
1651    help: Option<bool>,
1652    human: Option<bool>,
1653    local: Option<bool>,
1654    master_timeout: Option<&'b str>,
1655    pretty: Option<bool>,
1656    request_timeout: Option<Duration>,
1657    s: Option<&'b [&'b str]>,
1658    source: Option<&'b str>,
1659    v: Option<bool>,
1660}
1661impl<'a, 'b> CatNodeattrs<'a, 'b> {
1662    #[doc = "Creates a new instance of [CatNodeattrs]"]
1663    pub fn new(transport: &'a Transport) -> Self {
1664        let mut headers = HeaderMap::with_capacity(2);
1665        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
1666        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
1667        CatNodeattrs {
1668            transport,
1669            parts: CatNodeattrsParts::None,
1670            headers,
1671            error_trace: None,
1672            filter_path: None,
1673            format: None,
1674            h: None,
1675            help: None,
1676            human: None,
1677            local: None,
1678            master_timeout: None,
1679            pretty: None,
1680            request_timeout: None,
1681            s: None,
1682            source: None,
1683            v: None,
1684        }
1685    }
1686    #[doc = "Include the stack trace of returned errors."]
1687    pub fn error_trace(mut self, error_trace: bool) -> Self {
1688        self.error_trace = Some(error_trace);
1689        self
1690    }
1691    #[doc = "A comma-separated list of filters used to reduce the response."]
1692    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1693        self.filter_path = Some(filter_path);
1694        self
1695    }
1696    #[doc = "a short version of the Accept header, e.g. json, yaml"]
1697    pub fn format(mut self, format: &'b str) -> Self {
1698        self.format = Some(format);
1699        self
1700    }
1701    #[doc = "Comma-separated list of column names to display"]
1702    pub fn h(mut self, h: &'b [&'b str]) -> Self {
1703        self.h = Some(h);
1704        self
1705    }
1706    #[doc = "Adds a HTTP header"]
1707    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1708        self.headers.insert(key, value);
1709        self
1710    }
1711    #[doc = "Return help information"]
1712    pub fn help(mut self, help: bool) -> Self {
1713        self.help = Some(help);
1714        self
1715    }
1716    #[doc = "Return human readable values for statistics."]
1717    pub fn human(mut self, human: bool) -> Self {
1718        self.human = Some(human);
1719        self
1720    }
1721    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
1722    pub fn local(mut self, local: bool) -> Self {
1723        self.local = Some(local);
1724        self
1725    }
1726    #[doc = "Explicit operation timeout for connection to master node"]
1727    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
1728        self.master_timeout = Some(master_timeout);
1729        self
1730    }
1731    #[doc = "Pretty format the returned JSON response."]
1732    pub fn pretty(mut self, pretty: bool) -> Self {
1733        self.pretty = Some(pretty);
1734        self
1735    }
1736    #[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."]
1737    pub fn request_timeout(mut self, timeout: Duration) -> Self {
1738        self.request_timeout = Some(timeout);
1739        self
1740    }
1741    #[doc = "Comma-separated list of column names or column aliases to sort by"]
1742    pub fn s(mut self, s: &'b [&'b str]) -> Self {
1743        self.s = Some(s);
1744        self
1745    }
1746    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1747    pub fn source(mut self, source: &'b str) -> Self {
1748        self.source = Some(source);
1749        self
1750    }
1751    #[doc = "Verbose mode. Display column headers"]
1752    pub fn v(mut self, v: bool) -> Self {
1753        self.v = Some(v);
1754        self
1755    }
1756    #[doc = "Creates an asynchronous call to the Cat Nodeattrs API that can be awaited"]
1757    pub async fn send(self) -> Result<Response, Error> {
1758        let path = self.parts.url();
1759        let method = Method::Get;
1760        let headers = self.headers;
1761        let timeout = self.request_timeout;
1762        let query_string = {
1763            #[serde_with::skip_serializing_none]
1764            #[derive(Serialize)]
1765            struct QueryParams<'b> {
1766                error_trace: Option<bool>,
1767                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1768                filter_path: Option<&'b [&'b str]>,
1769                format: Option<&'b str>,
1770                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1771                h: Option<&'b [&'b str]>,
1772                help: Option<bool>,
1773                human: Option<bool>,
1774                local: Option<bool>,
1775                master_timeout: Option<&'b str>,
1776                pretty: Option<bool>,
1777                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1778                s: Option<&'b [&'b str]>,
1779                source: Option<&'b str>,
1780                v: Option<bool>,
1781            }
1782            let query_params = QueryParams {
1783                error_trace: self.error_trace,
1784                filter_path: self.filter_path,
1785                format: self.format,
1786                h: self.h,
1787                help: self.help,
1788                human: self.human,
1789                local: self.local,
1790                master_timeout: self.master_timeout,
1791                pretty: self.pretty,
1792                s: self.s,
1793                source: self.source,
1794                v: self.v,
1795            };
1796            Some(query_params)
1797        };
1798        let body = Option::<()>::None;
1799        let response = self
1800            .transport
1801            .send(method, &path, headers, query_string.as_ref(), body, timeout)
1802            .await?;
1803        Ok(response)
1804    }
1805}
1806#[derive(Debug, Clone, PartialEq)]
1807#[doc = "API parts for the Cat Nodes API"]
1808pub enum CatNodesParts {
1809    #[doc = "No parts"]
1810    None,
1811}
1812impl CatNodesParts {
1813    #[doc = "Builds a relative URL path to the Cat Nodes API"]
1814    pub fn url(self) -> Cow<'static, str> {
1815        match self {
1816            CatNodesParts::None => "/_cat/nodes".into(),
1817        }
1818    }
1819}
1820#[doc = "Builder for the [Cat Nodes API](https://opensearch.org/docs/)\n\nReturns basic statistics about performance of cluster nodes."]
1821#[derive(Clone, Debug)]
1822pub struct CatNodes<'a, 'b> {
1823    transport: &'a Transport,
1824    parts: CatNodesParts,
1825    bytes: Option<Bytes>,
1826    error_trace: Option<bool>,
1827    filter_path: Option<&'b [&'b str]>,
1828    format: Option<&'b str>,
1829    full_id: Option<bool>,
1830    h: Option<&'b [&'b str]>,
1831    headers: HeaderMap,
1832    help: Option<bool>,
1833    human: Option<bool>,
1834    local: Option<bool>,
1835    master_timeout: Option<&'b str>,
1836    pretty: Option<bool>,
1837    request_timeout: Option<Duration>,
1838    s: Option<&'b [&'b str]>,
1839    source: Option<&'b str>,
1840    time: Option<Time>,
1841    v: Option<bool>,
1842}
1843impl<'a, 'b> CatNodes<'a, 'b> {
1844    #[doc = "Creates a new instance of [CatNodes]"]
1845    pub fn new(transport: &'a Transport) -> Self {
1846        let mut headers = HeaderMap::with_capacity(2);
1847        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
1848        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
1849        CatNodes {
1850            transport,
1851            parts: CatNodesParts::None,
1852            headers,
1853            bytes: None,
1854            error_trace: None,
1855            filter_path: None,
1856            format: None,
1857            full_id: None,
1858            h: None,
1859            help: None,
1860            human: None,
1861            local: None,
1862            master_timeout: None,
1863            pretty: None,
1864            request_timeout: None,
1865            s: None,
1866            source: None,
1867            time: None,
1868            v: None,
1869        }
1870    }
1871    #[doc = "The unit in which to display byte values"]
1872    pub fn bytes(mut self, bytes: Bytes) -> Self {
1873        self.bytes = Some(bytes);
1874        self
1875    }
1876    #[doc = "Include the stack trace of returned errors."]
1877    pub fn error_trace(mut self, error_trace: bool) -> Self {
1878        self.error_trace = Some(error_trace);
1879        self
1880    }
1881    #[doc = "A comma-separated list of filters used to reduce the response."]
1882    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1883        self.filter_path = Some(filter_path);
1884        self
1885    }
1886    #[doc = "a short version of the Accept header, e.g. json, yaml"]
1887    pub fn format(mut self, format: &'b str) -> Self {
1888        self.format = Some(format);
1889        self
1890    }
1891    #[doc = "Return the full node ID instead of the shortened version (default: false)"]
1892    pub fn full_id(mut self, full_id: bool) -> Self {
1893        self.full_id = Some(full_id);
1894        self
1895    }
1896    #[doc = "Comma-separated list of column names to display"]
1897    pub fn h(mut self, h: &'b [&'b str]) -> Self {
1898        self.h = Some(h);
1899        self
1900    }
1901    #[doc = "Adds a HTTP header"]
1902    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1903        self.headers.insert(key, value);
1904        self
1905    }
1906    #[doc = "Return help information"]
1907    pub fn help(mut self, help: bool) -> Self {
1908        self.help = Some(help);
1909        self
1910    }
1911    #[doc = "Return human readable values for statistics."]
1912    pub fn human(mut self, human: bool) -> Self {
1913        self.human = Some(human);
1914        self
1915    }
1916    #[doc = "Calculate the selected nodes using the local cluster state rather than the state from master node (default: false)"]
1917    pub fn local(mut self, local: bool) -> Self {
1918        self.local = Some(local);
1919        self
1920    }
1921    #[doc = "Explicit operation timeout for connection to master node"]
1922    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
1923        self.master_timeout = Some(master_timeout);
1924        self
1925    }
1926    #[doc = "Pretty format the returned JSON response."]
1927    pub fn pretty(mut self, pretty: bool) -> Self {
1928        self.pretty = Some(pretty);
1929        self
1930    }
1931    #[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."]
1932    pub fn request_timeout(mut self, timeout: Duration) -> Self {
1933        self.request_timeout = Some(timeout);
1934        self
1935    }
1936    #[doc = "Comma-separated list of column names or column aliases to sort by"]
1937    pub fn s(mut self, s: &'b [&'b str]) -> Self {
1938        self.s = Some(s);
1939        self
1940    }
1941    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1942    pub fn source(mut self, source: &'b str) -> Self {
1943        self.source = Some(source);
1944        self
1945    }
1946    #[doc = "The unit in which to display time values"]
1947    pub fn time(mut self, time: Time) -> Self {
1948        self.time = Some(time);
1949        self
1950    }
1951    #[doc = "Verbose mode. Display column headers"]
1952    pub fn v(mut self, v: bool) -> Self {
1953        self.v = Some(v);
1954        self
1955    }
1956    #[doc = "Creates an asynchronous call to the Cat Nodes API that can be awaited"]
1957    pub async fn send(self) -> Result<Response, Error> {
1958        let path = self.parts.url();
1959        let method = Method::Get;
1960        let headers = self.headers;
1961        let timeout = self.request_timeout;
1962        let query_string = {
1963            #[serde_with::skip_serializing_none]
1964            #[derive(Serialize)]
1965            struct QueryParams<'b> {
1966                bytes: Option<Bytes>,
1967                error_trace: Option<bool>,
1968                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1969                filter_path: Option<&'b [&'b str]>,
1970                format: Option<&'b str>,
1971                full_id: Option<bool>,
1972                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1973                h: Option<&'b [&'b str]>,
1974                help: Option<bool>,
1975                human: Option<bool>,
1976                local: Option<bool>,
1977                master_timeout: Option<&'b str>,
1978                pretty: Option<bool>,
1979                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1980                s: Option<&'b [&'b str]>,
1981                source: Option<&'b str>,
1982                time: Option<Time>,
1983                v: Option<bool>,
1984            }
1985            let query_params = QueryParams {
1986                bytes: self.bytes,
1987                error_trace: self.error_trace,
1988                filter_path: self.filter_path,
1989                format: self.format,
1990                full_id: self.full_id,
1991                h: self.h,
1992                help: self.help,
1993                human: self.human,
1994                local: self.local,
1995                master_timeout: self.master_timeout,
1996                pretty: self.pretty,
1997                s: self.s,
1998                source: self.source,
1999                time: self.time,
2000                v: self.v,
2001            };
2002            Some(query_params)
2003        };
2004        let body = Option::<()>::None;
2005        let response = self
2006            .transport
2007            .send(method, &path, headers, query_string.as_ref(), body, timeout)
2008            .await?;
2009        Ok(response)
2010    }
2011}
2012#[derive(Debug, Clone, PartialEq)]
2013#[doc = "API parts for the Cat Pending Tasks API"]
2014pub enum CatPendingTasksParts {
2015    #[doc = "No parts"]
2016    None,
2017}
2018impl CatPendingTasksParts {
2019    #[doc = "Builds a relative URL path to the Cat Pending Tasks API"]
2020    pub fn url(self) -> Cow<'static, str> {
2021        match self {
2022            CatPendingTasksParts::None => "/_cat/pending_tasks".into(),
2023        }
2024    }
2025}
2026#[doc = "Builder for the [Cat Pending Tasks API](https://opensearch.org/docs/)\n\nReturns a concise representation of the cluster pending tasks."]
2027#[derive(Clone, Debug)]
2028pub struct CatPendingTasks<'a, 'b> {
2029    transport: &'a Transport,
2030    parts: CatPendingTasksParts,
2031    error_trace: Option<bool>,
2032    filter_path: Option<&'b [&'b str]>,
2033    format: Option<&'b str>,
2034    h: Option<&'b [&'b str]>,
2035    headers: HeaderMap,
2036    help: Option<bool>,
2037    human: Option<bool>,
2038    local: Option<bool>,
2039    master_timeout: Option<&'b str>,
2040    pretty: Option<bool>,
2041    request_timeout: Option<Duration>,
2042    s: Option<&'b [&'b str]>,
2043    source: Option<&'b str>,
2044    time: Option<Time>,
2045    v: Option<bool>,
2046}
2047impl<'a, 'b> CatPendingTasks<'a, 'b> {
2048    #[doc = "Creates a new instance of [CatPendingTasks]"]
2049    pub fn new(transport: &'a Transport) -> Self {
2050        let mut headers = HeaderMap::with_capacity(2);
2051        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
2052        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
2053        CatPendingTasks {
2054            transport,
2055            parts: CatPendingTasksParts::None,
2056            headers,
2057            error_trace: None,
2058            filter_path: None,
2059            format: None,
2060            h: None,
2061            help: None,
2062            human: None,
2063            local: None,
2064            master_timeout: None,
2065            pretty: None,
2066            request_timeout: None,
2067            s: None,
2068            source: None,
2069            time: None,
2070            v: None,
2071        }
2072    }
2073    #[doc = "Include the stack trace of returned errors."]
2074    pub fn error_trace(mut self, error_trace: bool) -> Self {
2075        self.error_trace = Some(error_trace);
2076        self
2077    }
2078    #[doc = "A comma-separated list of filters used to reduce the response."]
2079    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2080        self.filter_path = Some(filter_path);
2081        self
2082    }
2083    #[doc = "a short version of the Accept header, e.g. json, yaml"]
2084    pub fn format(mut self, format: &'b str) -> Self {
2085        self.format = Some(format);
2086        self
2087    }
2088    #[doc = "Comma-separated list of column names to display"]
2089    pub fn h(mut self, h: &'b [&'b str]) -> Self {
2090        self.h = Some(h);
2091        self
2092    }
2093    #[doc = "Adds a HTTP header"]
2094    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2095        self.headers.insert(key, value);
2096        self
2097    }
2098    #[doc = "Return help information"]
2099    pub fn help(mut self, help: bool) -> Self {
2100        self.help = Some(help);
2101        self
2102    }
2103    #[doc = "Return human readable values for statistics."]
2104    pub fn human(mut self, human: bool) -> Self {
2105        self.human = Some(human);
2106        self
2107    }
2108    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
2109    pub fn local(mut self, local: bool) -> Self {
2110        self.local = Some(local);
2111        self
2112    }
2113    #[doc = "Explicit operation timeout for connection to master node"]
2114    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
2115        self.master_timeout = Some(master_timeout);
2116        self
2117    }
2118    #[doc = "Pretty format the returned JSON response."]
2119    pub fn pretty(mut self, pretty: bool) -> Self {
2120        self.pretty = Some(pretty);
2121        self
2122    }
2123    #[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."]
2124    pub fn request_timeout(mut self, timeout: Duration) -> Self {
2125        self.request_timeout = Some(timeout);
2126        self
2127    }
2128    #[doc = "Comma-separated list of column names or column aliases to sort by"]
2129    pub fn s(mut self, s: &'b [&'b str]) -> Self {
2130        self.s = Some(s);
2131        self
2132    }
2133    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2134    pub fn source(mut self, source: &'b str) -> Self {
2135        self.source = Some(source);
2136        self
2137    }
2138    #[doc = "The unit in which to display time values"]
2139    pub fn time(mut self, time: Time) -> Self {
2140        self.time = Some(time);
2141        self
2142    }
2143    #[doc = "Verbose mode. Display column headers"]
2144    pub fn v(mut self, v: bool) -> Self {
2145        self.v = Some(v);
2146        self
2147    }
2148    #[doc = "Creates an asynchronous call to the Cat Pending Tasks API that can be awaited"]
2149    pub async fn send(self) -> Result<Response, Error> {
2150        let path = self.parts.url();
2151        let method = Method::Get;
2152        let headers = self.headers;
2153        let timeout = self.request_timeout;
2154        let query_string = {
2155            #[serde_with::skip_serializing_none]
2156            #[derive(Serialize)]
2157            struct QueryParams<'b> {
2158                error_trace: Option<bool>,
2159                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2160                filter_path: Option<&'b [&'b str]>,
2161                format: Option<&'b str>,
2162                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2163                h: Option<&'b [&'b str]>,
2164                help: Option<bool>,
2165                human: Option<bool>,
2166                local: Option<bool>,
2167                master_timeout: Option<&'b str>,
2168                pretty: Option<bool>,
2169                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2170                s: Option<&'b [&'b str]>,
2171                source: Option<&'b str>,
2172                time: Option<Time>,
2173                v: Option<bool>,
2174            }
2175            let query_params = QueryParams {
2176                error_trace: self.error_trace,
2177                filter_path: self.filter_path,
2178                format: self.format,
2179                h: self.h,
2180                help: self.help,
2181                human: self.human,
2182                local: self.local,
2183                master_timeout: self.master_timeout,
2184                pretty: self.pretty,
2185                s: self.s,
2186                source: self.source,
2187                time: self.time,
2188                v: self.v,
2189            };
2190            Some(query_params)
2191        };
2192        let body = Option::<()>::None;
2193        let response = self
2194            .transport
2195            .send(method, &path, headers, query_string.as_ref(), body, timeout)
2196            .await?;
2197        Ok(response)
2198    }
2199}
2200#[derive(Debug, Clone, PartialEq)]
2201#[doc = "API parts for the Cat Plugins API"]
2202pub enum CatPluginsParts {
2203    #[doc = "No parts"]
2204    None,
2205}
2206impl CatPluginsParts {
2207    #[doc = "Builds a relative URL path to the Cat Plugins API"]
2208    pub fn url(self) -> Cow<'static, str> {
2209        match self {
2210            CatPluginsParts::None => "/_cat/plugins".into(),
2211        }
2212    }
2213}
2214#[doc = "Builder for the [Cat Plugins API](https://opensearch.org/docs/)\n\nReturns information about installed plugins across nodes node."]
2215#[derive(Clone, Debug)]
2216pub struct CatPlugins<'a, 'b> {
2217    transport: &'a Transport,
2218    parts: CatPluginsParts,
2219    error_trace: Option<bool>,
2220    filter_path: Option<&'b [&'b str]>,
2221    format: Option<&'b str>,
2222    h: Option<&'b [&'b str]>,
2223    headers: HeaderMap,
2224    help: Option<bool>,
2225    human: Option<bool>,
2226    include_bootstrap: Option<bool>,
2227    local: Option<bool>,
2228    master_timeout: Option<&'b str>,
2229    pretty: Option<bool>,
2230    request_timeout: Option<Duration>,
2231    s: Option<&'b [&'b str]>,
2232    source: Option<&'b str>,
2233    v: Option<bool>,
2234}
2235impl<'a, 'b> CatPlugins<'a, 'b> {
2236    #[doc = "Creates a new instance of [CatPlugins]"]
2237    pub fn new(transport: &'a Transport) -> Self {
2238        let mut headers = HeaderMap::with_capacity(2);
2239        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
2240        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
2241        CatPlugins {
2242            transport,
2243            parts: CatPluginsParts::None,
2244            headers,
2245            error_trace: None,
2246            filter_path: None,
2247            format: None,
2248            h: None,
2249            help: None,
2250            human: None,
2251            include_bootstrap: None,
2252            local: None,
2253            master_timeout: None,
2254            pretty: None,
2255            request_timeout: None,
2256            s: None,
2257            source: None,
2258            v: None,
2259        }
2260    }
2261    #[doc = "Include the stack trace of returned errors."]
2262    pub fn error_trace(mut self, error_trace: bool) -> Self {
2263        self.error_trace = Some(error_trace);
2264        self
2265    }
2266    #[doc = "A comma-separated list of filters used to reduce the response."]
2267    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2268        self.filter_path = Some(filter_path);
2269        self
2270    }
2271    #[doc = "a short version of the Accept header, e.g. json, yaml"]
2272    pub fn format(mut self, format: &'b str) -> Self {
2273        self.format = Some(format);
2274        self
2275    }
2276    #[doc = "Comma-separated list of column names to display"]
2277    pub fn h(mut self, h: &'b [&'b str]) -> Self {
2278        self.h = Some(h);
2279        self
2280    }
2281    #[doc = "Adds a HTTP header"]
2282    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2283        self.headers.insert(key, value);
2284        self
2285    }
2286    #[doc = "Return help information"]
2287    pub fn help(mut self, help: bool) -> Self {
2288        self.help = Some(help);
2289        self
2290    }
2291    #[doc = "Return human readable values for statistics."]
2292    pub fn human(mut self, human: bool) -> Self {
2293        self.human = Some(human);
2294        self
2295    }
2296    #[doc = "Include bootstrap plugins in the response"]
2297    pub fn include_bootstrap(mut self, include_bootstrap: bool) -> Self {
2298        self.include_bootstrap = Some(include_bootstrap);
2299        self
2300    }
2301    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
2302    pub fn local(mut self, local: bool) -> Self {
2303        self.local = Some(local);
2304        self
2305    }
2306    #[doc = "Explicit operation timeout for connection to master node"]
2307    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
2308        self.master_timeout = Some(master_timeout);
2309        self
2310    }
2311    #[doc = "Pretty format the returned JSON response."]
2312    pub fn pretty(mut self, pretty: bool) -> Self {
2313        self.pretty = Some(pretty);
2314        self
2315    }
2316    #[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."]
2317    pub fn request_timeout(mut self, timeout: Duration) -> Self {
2318        self.request_timeout = Some(timeout);
2319        self
2320    }
2321    #[doc = "Comma-separated list of column names or column aliases to sort by"]
2322    pub fn s(mut self, s: &'b [&'b str]) -> Self {
2323        self.s = Some(s);
2324        self
2325    }
2326    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2327    pub fn source(mut self, source: &'b str) -> Self {
2328        self.source = Some(source);
2329        self
2330    }
2331    #[doc = "Verbose mode. Display column headers"]
2332    pub fn v(mut self, v: bool) -> Self {
2333        self.v = Some(v);
2334        self
2335    }
2336    #[doc = "Creates an asynchronous call to the Cat Plugins API that can be awaited"]
2337    pub async fn send(self) -> Result<Response, Error> {
2338        let path = self.parts.url();
2339        let method = Method::Get;
2340        let headers = self.headers;
2341        let timeout = self.request_timeout;
2342        let query_string = {
2343            #[serde_with::skip_serializing_none]
2344            #[derive(Serialize)]
2345            struct QueryParams<'b> {
2346                error_trace: Option<bool>,
2347                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2348                filter_path: Option<&'b [&'b str]>,
2349                format: Option<&'b str>,
2350                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2351                h: Option<&'b [&'b str]>,
2352                help: Option<bool>,
2353                human: Option<bool>,
2354                include_bootstrap: Option<bool>,
2355                local: Option<bool>,
2356                master_timeout: Option<&'b str>,
2357                pretty: Option<bool>,
2358                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2359                s: Option<&'b [&'b str]>,
2360                source: Option<&'b str>,
2361                v: Option<bool>,
2362            }
2363            let query_params = QueryParams {
2364                error_trace: self.error_trace,
2365                filter_path: self.filter_path,
2366                format: self.format,
2367                h: self.h,
2368                help: self.help,
2369                human: self.human,
2370                include_bootstrap: self.include_bootstrap,
2371                local: self.local,
2372                master_timeout: self.master_timeout,
2373                pretty: self.pretty,
2374                s: self.s,
2375                source: self.source,
2376                v: self.v,
2377            };
2378            Some(query_params)
2379        };
2380        let body = Option::<()>::None;
2381        let response = self
2382            .transport
2383            .send(method, &path, headers, query_string.as_ref(), body, timeout)
2384            .await?;
2385        Ok(response)
2386    }
2387}
2388#[derive(Debug, Clone, PartialEq)]
2389#[doc = "API parts for the Cat Recovery API"]
2390pub enum CatRecoveryParts<'b> {
2391    #[doc = "No parts"]
2392    None,
2393    #[doc = "Index"]
2394    Index(&'b [&'b str]),
2395}
2396impl<'b> CatRecoveryParts<'b> {
2397    #[doc = "Builds a relative URL path to the Cat Recovery API"]
2398    pub fn url(self) -> Cow<'static, str> {
2399        match self {
2400            CatRecoveryParts::None => "/_cat/recovery".into(),
2401            CatRecoveryParts::Index(ref index) => {
2402                let index_str = index.join(",");
2403                let encoded_index: Cow<str> =
2404                    percent_encode(index_str.as_bytes(), PARTS_ENCODED).into();
2405                let mut p = String::with_capacity(15usize + encoded_index.len());
2406                p.push_str("/_cat/recovery/");
2407                p.push_str(encoded_index.as_ref());
2408                p.into()
2409            }
2410        }
2411    }
2412}
2413#[doc = "Builder for the [Cat Recovery API](https://opensearch.org/docs/)\n\nReturns information about index shard recoveries, both on-going completed."]
2414#[derive(Clone, Debug)]
2415pub struct CatRecovery<'a, 'b> {
2416    transport: &'a Transport,
2417    parts: CatRecoveryParts<'b>,
2418    active_only: Option<bool>,
2419    bytes: Option<Bytes>,
2420    detailed: Option<bool>,
2421    error_trace: Option<bool>,
2422    filter_path: Option<&'b [&'b str]>,
2423    format: Option<&'b str>,
2424    h: Option<&'b [&'b str]>,
2425    headers: HeaderMap,
2426    help: Option<bool>,
2427    human: Option<bool>,
2428    index: Option<&'b [&'b str]>,
2429    pretty: Option<bool>,
2430    request_timeout: Option<Duration>,
2431    s: Option<&'b [&'b str]>,
2432    source: Option<&'b str>,
2433    time: Option<Time>,
2434    v: Option<bool>,
2435}
2436impl<'a, 'b> CatRecovery<'a, 'b> {
2437    #[doc = "Creates a new instance of [CatRecovery] with the specified API parts"]
2438    pub fn new(transport: &'a Transport, parts: CatRecoveryParts<'b>) -> Self {
2439        let mut headers = HeaderMap::with_capacity(2);
2440        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
2441        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
2442        CatRecovery {
2443            transport,
2444            parts,
2445            headers,
2446            active_only: None,
2447            bytes: None,
2448            detailed: None,
2449            error_trace: None,
2450            filter_path: None,
2451            format: None,
2452            h: None,
2453            help: None,
2454            human: None,
2455            index: None,
2456            pretty: None,
2457            request_timeout: None,
2458            s: None,
2459            source: None,
2460            time: None,
2461            v: None,
2462        }
2463    }
2464    #[doc = "If `true`, the response only includes ongoing shard recoveries"]
2465    pub fn active_only(mut self, active_only: bool) -> Self {
2466        self.active_only = Some(active_only);
2467        self
2468    }
2469    #[doc = "The unit in which to display byte values"]
2470    pub fn bytes(mut self, bytes: Bytes) -> Self {
2471        self.bytes = Some(bytes);
2472        self
2473    }
2474    #[doc = "If `true`, the response includes detailed information about shard recoveries"]
2475    pub fn detailed(mut self, detailed: bool) -> Self {
2476        self.detailed = Some(detailed);
2477        self
2478    }
2479    #[doc = "Include the stack trace of returned errors."]
2480    pub fn error_trace(mut self, error_trace: bool) -> Self {
2481        self.error_trace = Some(error_trace);
2482        self
2483    }
2484    #[doc = "A comma-separated list of filters used to reduce the response."]
2485    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2486        self.filter_path = Some(filter_path);
2487        self
2488    }
2489    #[doc = "a short version of the Accept header, e.g. json, yaml"]
2490    pub fn format(mut self, format: &'b str) -> Self {
2491        self.format = Some(format);
2492        self
2493    }
2494    #[doc = "Comma-separated list of column names to display"]
2495    pub fn h(mut self, h: &'b [&'b str]) -> Self {
2496        self.h = Some(h);
2497        self
2498    }
2499    #[doc = "Adds a HTTP header"]
2500    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2501        self.headers.insert(key, value);
2502        self
2503    }
2504    #[doc = "Return help information"]
2505    pub fn help(mut self, help: bool) -> Self {
2506        self.help = Some(help);
2507        self
2508    }
2509    #[doc = "Return human readable values for statistics."]
2510    pub fn human(mut self, human: bool) -> Self {
2511        self.human = Some(human);
2512        self
2513    }
2514    #[doc = "Comma-separated list or wildcard expression of index names to limit the returned information"]
2515    pub fn index(mut self, index: &'b [&'b str]) -> Self {
2516        self.index = Some(index);
2517        self
2518    }
2519    #[doc = "Pretty format the returned JSON response."]
2520    pub fn pretty(mut self, pretty: bool) -> Self {
2521        self.pretty = Some(pretty);
2522        self
2523    }
2524    #[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."]
2525    pub fn request_timeout(mut self, timeout: Duration) -> Self {
2526        self.request_timeout = Some(timeout);
2527        self
2528    }
2529    #[doc = "Comma-separated list of column names or column aliases to sort by"]
2530    pub fn s(mut self, s: &'b [&'b str]) -> Self {
2531        self.s = Some(s);
2532        self
2533    }
2534    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2535    pub fn source(mut self, source: &'b str) -> Self {
2536        self.source = Some(source);
2537        self
2538    }
2539    #[doc = "The unit in which to display time values"]
2540    pub fn time(mut self, time: Time) -> Self {
2541        self.time = Some(time);
2542        self
2543    }
2544    #[doc = "Verbose mode. Display column headers"]
2545    pub fn v(mut self, v: bool) -> Self {
2546        self.v = Some(v);
2547        self
2548    }
2549    #[doc = "Creates an asynchronous call to the Cat Recovery API that can be awaited"]
2550    pub async fn send(self) -> Result<Response, Error> {
2551        let path = self.parts.url();
2552        let method = Method::Get;
2553        let headers = self.headers;
2554        let timeout = self.request_timeout;
2555        let query_string = {
2556            #[serde_with::skip_serializing_none]
2557            #[derive(Serialize)]
2558            struct QueryParams<'b> {
2559                active_only: Option<bool>,
2560                bytes: Option<Bytes>,
2561                detailed: Option<bool>,
2562                error_trace: Option<bool>,
2563                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2564                filter_path: Option<&'b [&'b str]>,
2565                format: Option<&'b str>,
2566                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2567                h: Option<&'b [&'b str]>,
2568                help: Option<bool>,
2569                human: Option<bool>,
2570                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2571                index: Option<&'b [&'b str]>,
2572                pretty: Option<bool>,
2573                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2574                s: Option<&'b [&'b str]>,
2575                source: Option<&'b str>,
2576                time: Option<Time>,
2577                v: Option<bool>,
2578            }
2579            let query_params = QueryParams {
2580                active_only: self.active_only,
2581                bytes: self.bytes,
2582                detailed: self.detailed,
2583                error_trace: self.error_trace,
2584                filter_path: self.filter_path,
2585                format: self.format,
2586                h: self.h,
2587                help: self.help,
2588                human: self.human,
2589                index: self.index,
2590                pretty: self.pretty,
2591                s: self.s,
2592                source: self.source,
2593                time: self.time,
2594                v: self.v,
2595            };
2596            Some(query_params)
2597        };
2598        let body = Option::<()>::None;
2599        let response = self
2600            .transport
2601            .send(method, &path, headers, query_string.as_ref(), body, timeout)
2602            .await?;
2603        Ok(response)
2604    }
2605}
2606#[derive(Debug, Clone, PartialEq)]
2607#[doc = "API parts for the Cat Repositories API"]
2608pub enum CatRepositoriesParts {
2609    #[doc = "No parts"]
2610    None,
2611}
2612impl CatRepositoriesParts {
2613    #[doc = "Builds a relative URL path to the Cat Repositories API"]
2614    pub fn url(self) -> Cow<'static, str> {
2615        match self {
2616            CatRepositoriesParts::None => "/_cat/repositories".into(),
2617        }
2618    }
2619}
2620#[doc = "Builder for the [Cat Repositories API](https://opensearch.org/docs/)\n\nReturns information about snapshot repositories registered in the cluster."]
2621#[derive(Clone, Debug)]
2622pub struct CatRepositories<'a, 'b> {
2623    transport: &'a Transport,
2624    parts: CatRepositoriesParts,
2625    error_trace: Option<bool>,
2626    filter_path: Option<&'b [&'b str]>,
2627    format: Option<&'b str>,
2628    h: Option<&'b [&'b str]>,
2629    headers: HeaderMap,
2630    help: Option<bool>,
2631    human: Option<bool>,
2632    local: Option<bool>,
2633    master_timeout: Option<&'b str>,
2634    pretty: Option<bool>,
2635    request_timeout: Option<Duration>,
2636    s: Option<&'b [&'b str]>,
2637    source: Option<&'b str>,
2638    v: Option<bool>,
2639}
2640impl<'a, 'b> CatRepositories<'a, 'b> {
2641    #[doc = "Creates a new instance of [CatRepositories]"]
2642    pub fn new(transport: &'a Transport) -> Self {
2643        let mut headers = HeaderMap::with_capacity(2);
2644        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
2645        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
2646        CatRepositories {
2647            transport,
2648            parts: CatRepositoriesParts::None,
2649            headers,
2650            error_trace: None,
2651            filter_path: None,
2652            format: None,
2653            h: None,
2654            help: None,
2655            human: None,
2656            local: None,
2657            master_timeout: None,
2658            pretty: None,
2659            request_timeout: None,
2660            s: None,
2661            source: None,
2662            v: None,
2663        }
2664    }
2665    #[doc = "Include the stack trace of returned errors."]
2666    pub fn error_trace(mut self, error_trace: bool) -> Self {
2667        self.error_trace = Some(error_trace);
2668        self
2669    }
2670    #[doc = "A comma-separated list of filters used to reduce the response."]
2671    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2672        self.filter_path = Some(filter_path);
2673        self
2674    }
2675    #[doc = "a short version of the Accept header, e.g. json, yaml"]
2676    pub fn format(mut self, format: &'b str) -> Self {
2677        self.format = Some(format);
2678        self
2679    }
2680    #[doc = "Comma-separated list of column names to display"]
2681    pub fn h(mut self, h: &'b [&'b str]) -> Self {
2682        self.h = Some(h);
2683        self
2684    }
2685    #[doc = "Adds a HTTP header"]
2686    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2687        self.headers.insert(key, value);
2688        self
2689    }
2690    #[doc = "Return help information"]
2691    pub fn help(mut self, help: bool) -> Self {
2692        self.help = Some(help);
2693        self
2694    }
2695    #[doc = "Return human readable values for statistics."]
2696    pub fn human(mut self, human: bool) -> Self {
2697        self.human = Some(human);
2698        self
2699    }
2700    #[doc = "Return local information, do not retrieve the state from master node"]
2701    pub fn local(mut self, local: bool) -> Self {
2702        self.local = Some(local);
2703        self
2704    }
2705    #[doc = "Explicit operation timeout for connection to master node"]
2706    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
2707        self.master_timeout = Some(master_timeout);
2708        self
2709    }
2710    #[doc = "Pretty format the returned JSON response."]
2711    pub fn pretty(mut self, pretty: bool) -> Self {
2712        self.pretty = Some(pretty);
2713        self
2714    }
2715    #[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."]
2716    pub fn request_timeout(mut self, timeout: Duration) -> Self {
2717        self.request_timeout = Some(timeout);
2718        self
2719    }
2720    #[doc = "Comma-separated list of column names or column aliases to sort by"]
2721    pub fn s(mut self, s: &'b [&'b str]) -> Self {
2722        self.s = Some(s);
2723        self
2724    }
2725    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2726    pub fn source(mut self, source: &'b str) -> Self {
2727        self.source = Some(source);
2728        self
2729    }
2730    #[doc = "Verbose mode. Display column headers"]
2731    pub fn v(mut self, v: bool) -> Self {
2732        self.v = Some(v);
2733        self
2734    }
2735    #[doc = "Creates an asynchronous call to the Cat Repositories API that can be awaited"]
2736    pub async fn send(self) -> Result<Response, Error> {
2737        let path = self.parts.url();
2738        let method = Method::Get;
2739        let headers = self.headers;
2740        let timeout = self.request_timeout;
2741        let query_string = {
2742            #[serde_with::skip_serializing_none]
2743            #[derive(Serialize)]
2744            struct QueryParams<'b> {
2745                error_trace: Option<bool>,
2746                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2747                filter_path: Option<&'b [&'b str]>,
2748                format: Option<&'b str>,
2749                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2750                h: Option<&'b [&'b str]>,
2751                help: Option<bool>,
2752                human: Option<bool>,
2753                local: Option<bool>,
2754                master_timeout: Option<&'b str>,
2755                pretty: Option<bool>,
2756                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2757                s: Option<&'b [&'b str]>,
2758                source: Option<&'b str>,
2759                v: Option<bool>,
2760            }
2761            let query_params = QueryParams {
2762                error_trace: self.error_trace,
2763                filter_path: self.filter_path,
2764                format: self.format,
2765                h: self.h,
2766                help: self.help,
2767                human: self.human,
2768                local: self.local,
2769                master_timeout: self.master_timeout,
2770                pretty: self.pretty,
2771                s: self.s,
2772                source: self.source,
2773                v: self.v,
2774            };
2775            Some(query_params)
2776        };
2777        let body = Option::<()>::None;
2778        let response = self
2779            .transport
2780            .send(method, &path, headers, query_string.as_ref(), body, timeout)
2781            .await?;
2782        Ok(response)
2783    }
2784}
2785#[derive(Debug, Clone, PartialEq)]
2786#[doc = "API parts for the Cat Segments API"]
2787pub enum CatSegmentsParts<'b> {
2788    #[doc = "No parts"]
2789    None,
2790    #[doc = "Index"]
2791    Index(&'b [&'b str]),
2792}
2793impl<'b> CatSegmentsParts<'b> {
2794    #[doc = "Builds a relative URL path to the Cat Segments API"]
2795    pub fn url(self) -> Cow<'static, str> {
2796        match self {
2797            CatSegmentsParts::None => "/_cat/segments".into(),
2798            CatSegmentsParts::Index(ref index) => {
2799                let index_str = index.join(",");
2800                let encoded_index: Cow<str> =
2801                    percent_encode(index_str.as_bytes(), PARTS_ENCODED).into();
2802                let mut p = String::with_capacity(15usize + encoded_index.len());
2803                p.push_str("/_cat/segments/");
2804                p.push_str(encoded_index.as_ref());
2805                p.into()
2806            }
2807        }
2808    }
2809}
2810#[doc = "Builder for the [Cat Segments API](https://opensearch.org/docs/)\n\nProvides low-level information about the segments in the shards of an index."]
2811#[derive(Clone, Debug)]
2812pub struct CatSegments<'a, 'b> {
2813    transport: &'a Transport,
2814    parts: CatSegmentsParts<'b>,
2815    bytes: Option<Bytes>,
2816    error_trace: Option<bool>,
2817    filter_path: Option<&'b [&'b str]>,
2818    format: Option<&'b str>,
2819    h: Option<&'b [&'b str]>,
2820    headers: HeaderMap,
2821    help: Option<bool>,
2822    human: Option<bool>,
2823    pretty: Option<bool>,
2824    request_timeout: Option<Duration>,
2825    s: Option<&'b [&'b str]>,
2826    source: Option<&'b str>,
2827    v: Option<bool>,
2828}
2829impl<'a, 'b> CatSegments<'a, 'b> {
2830    #[doc = "Creates a new instance of [CatSegments] with the specified API parts"]
2831    pub fn new(transport: &'a Transport, parts: CatSegmentsParts<'b>) -> Self {
2832        let mut headers = HeaderMap::with_capacity(2);
2833        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
2834        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
2835        CatSegments {
2836            transport,
2837            parts,
2838            headers,
2839            bytes: None,
2840            error_trace: None,
2841            filter_path: None,
2842            format: None,
2843            h: None,
2844            help: None,
2845            human: None,
2846            pretty: None,
2847            request_timeout: None,
2848            s: None,
2849            source: None,
2850            v: None,
2851        }
2852    }
2853    #[doc = "The unit in which to display byte values"]
2854    pub fn bytes(mut self, bytes: Bytes) -> Self {
2855        self.bytes = Some(bytes);
2856        self
2857    }
2858    #[doc = "Include the stack trace of returned errors."]
2859    pub fn error_trace(mut self, error_trace: bool) -> Self {
2860        self.error_trace = Some(error_trace);
2861        self
2862    }
2863    #[doc = "A comma-separated list of filters used to reduce the response."]
2864    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2865        self.filter_path = Some(filter_path);
2866        self
2867    }
2868    #[doc = "a short version of the Accept header, e.g. json, yaml"]
2869    pub fn format(mut self, format: &'b str) -> Self {
2870        self.format = Some(format);
2871        self
2872    }
2873    #[doc = "Comma-separated list of column names to display"]
2874    pub fn h(mut self, h: &'b [&'b str]) -> Self {
2875        self.h = Some(h);
2876        self
2877    }
2878    #[doc = "Adds a HTTP header"]
2879    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2880        self.headers.insert(key, value);
2881        self
2882    }
2883    #[doc = "Return help information"]
2884    pub fn help(mut self, help: bool) -> Self {
2885        self.help = Some(help);
2886        self
2887    }
2888    #[doc = "Return human readable values for statistics."]
2889    pub fn human(mut self, human: bool) -> Self {
2890        self.human = Some(human);
2891        self
2892    }
2893    #[doc = "Pretty format the returned JSON response."]
2894    pub fn pretty(mut self, pretty: bool) -> Self {
2895        self.pretty = Some(pretty);
2896        self
2897    }
2898    #[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."]
2899    pub fn request_timeout(mut self, timeout: Duration) -> Self {
2900        self.request_timeout = Some(timeout);
2901        self
2902    }
2903    #[doc = "Comma-separated list of column names or column aliases to sort by"]
2904    pub fn s(mut self, s: &'b [&'b str]) -> Self {
2905        self.s = Some(s);
2906        self
2907    }
2908    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2909    pub fn source(mut self, source: &'b str) -> Self {
2910        self.source = Some(source);
2911        self
2912    }
2913    #[doc = "Verbose mode. Display column headers"]
2914    pub fn v(mut self, v: bool) -> Self {
2915        self.v = Some(v);
2916        self
2917    }
2918    #[doc = "Creates an asynchronous call to the Cat Segments API that can be awaited"]
2919    pub async fn send(self) -> Result<Response, Error> {
2920        let path = self.parts.url();
2921        let method = Method::Get;
2922        let headers = self.headers;
2923        let timeout = self.request_timeout;
2924        let query_string = {
2925            #[serde_with::skip_serializing_none]
2926            #[derive(Serialize)]
2927            struct QueryParams<'b> {
2928                bytes: Option<Bytes>,
2929                error_trace: Option<bool>,
2930                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2931                filter_path: Option<&'b [&'b str]>,
2932                format: Option<&'b str>,
2933                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2934                h: Option<&'b [&'b str]>,
2935                help: Option<bool>,
2936                human: Option<bool>,
2937                pretty: Option<bool>,
2938                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2939                s: Option<&'b [&'b str]>,
2940                source: Option<&'b str>,
2941                v: Option<bool>,
2942            }
2943            let query_params = QueryParams {
2944                bytes: self.bytes,
2945                error_trace: self.error_trace,
2946                filter_path: self.filter_path,
2947                format: self.format,
2948                h: self.h,
2949                help: self.help,
2950                human: self.human,
2951                pretty: self.pretty,
2952                s: self.s,
2953                source: self.source,
2954                v: self.v,
2955            };
2956            Some(query_params)
2957        };
2958        let body = Option::<()>::None;
2959        let response = self
2960            .transport
2961            .send(method, &path, headers, query_string.as_ref(), body, timeout)
2962            .await?;
2963        Ok(response)
2964    }
2965}
2966#[derive(Debug, Clone, PartialEq)]
2967#[doc = "API parts for the Cat Shards API"]
2968pub enum CatShardsParts<'b> {
2969    #[doc = "No parts"]
2970    None,
2971    #[doc = "Index"]
2972    Index(&'b [&'b str]),
2973}
2974impl<'b> CatShardsParts<'b> {
2975    #[doc = "Builds a relative URL path to the Cat Shards API"]
2976    pub fn url(self) -> Cow<'static, str> {
2977        match self {
2978            CatShardsParts::None => "/_cat/shards".into(),
2979            CatShardsParts::Index(ref index) => {
2980                let index_str = index.join(",");
2981                let encoded_index: Cow<str> =
2982                    percent_encode(index_str.as_bytes(), PARTS_ENCODED).into();
2983                let mut p = String::with_capacity(13usize + encoded_index.len());
2984                p.push_str("/_cat/shards/");
2985                p.push_str(encoded_index.as_ref());
2986                p.into()
2987            }
2988        }
2989    }
2990}
2991#[doc = "Builder for the [Cat Shards API](https://opensearch.org/docs/)\n\nProvides a detailed view of shard allocation on nodes."]
2992#[derive(Clone, Debug)]
2993pub struct CatShards<'a, 'b> {
2994    transport: &'a Transport,
2995    parts: CatShardsParts<'b>,
2996    bytes: Option<Bytes>,
2997    error_trace: Option<bool>,
2998    filter_path: Option<&'b [&'b str]>,
2999    format: Option<&'b str>,
3000    h: Option<&'b [&'b str]>,
3001    headers: HeaderMap,
3002    help: Option<bool>,
3003    human: Option<bool>,
3004    local: Option<bool>,
3005    master_timeout: Option<&'b str>,
3006    pretty: Option<bool>,
3007    request_timeout: Option<Duration>,
3008    s: Option<&'b [&'b str]>,
3009    source: Option<&'b str>,
3010    time: Option<Time>,
3011    v: Option<bool>,
3012}
3013impl<'a, 'b> CatShards<'a, 'b> {
3014    #[doc = "Creates a new instance of [CatShards] with the specified API parts"]
3015    pub fn new(transport: &'a Transport, parts: CatShardsParts<'b>) -> Self {
3016        let mut headers = HeaderMap::with_capacity(2);
3017        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
3018        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
3019        CatShards {
3020            transport,
3021            parts,
3022            headers,
3023            bytes: None,
3024            error_trace: None,
3025            filter_path: None,
3026            format: None,
3027            h: None,
3028            help: None,
3029            human: None,
3030            local: None,
3031            master_timeout: None,
3032            pretty: None,
3033            request_timeout: None,
3034            s: None,
3035            source: None,
3036            time: None,
3037            v: None,
3038        }
3039    }
3040    #[doc = "The unit in which to display byte values"]
3041    pub fn bytes(mut self, bytes: Bytes) -> Self {
3042        self.bytes = Some(bytes);
3043        self
3044    }
3045    #[doc = "Include the stack trace of returned errors."]
3046    pub fn error_trace(mut self, error_trace: bool) -> Self {
3047        self.error_trace = Some(error_trace);
3048        self
3049    }
3050    #[doc = "A comma-separated list of filters used to reduce the response."]
3051    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3052        self.filter_path = Some(filter_path);
3053        self
3054    }
3055    #[doc = "a short version of the Accept header, e.g. json, yaml"]
3056    pub fn format(mut self, format: &'b str) -> Self {
3057        self.format = Some(format);
3058        self
3059    }
3060    #[doc = "Comma-separated list of column names to display"]
3061    pub fn h(mut self, h: &'b [&'b str]) -> Self {
3062        self.h = Some(h);
3063        self
3064    }
3065    #[doc = "Adds a HTTP header"]
3066    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3067        self.headers.insert(key, value);
3068        self
3069    }
3070    #[doc = "Return help information"]
3071    pub fn help(mut self, help: bool) -> Self {
3072        self.help = Some(help);
3073        self
3074    }
3075    #[doc = "Return human readable values for statistics."]
3076    pub fn human(mut self, human: bool) -> Self {
3077        self.human = Some(human);
3078        self
3079    }
3080    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
3081    pub fn local(mut self, local: bool) -> Self {
3082        self.local = Some(local);
3083        self
3084    }
3085    #[doc = "Explicit operation timeout for connection to master node"]
3086    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
3087        self.master_timeout = Some(master_timeout);
3088        self
3089    }
3090    #[doc = "Pretty format the returned JSON response."]
3091    pub fn pretty(mut self, pretty: bool) -> Self {
3092        self.pretty = Some(pretty);
3093        self
3094    }
3095    #[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."]
3096    pub fn request_timeout(mut self, timeout: Duration) -> Self {
3097        self.request_timeout = Some(timeout);
3098        self
3099    }
3100    #[doc = "Comma-separated list of column names or column aliases to sort by"]
3101    pub fn s(mut self, s: &'b [&'b str]) -> Self {
3102        self.s = Some(s);
3103        self
3104    }
3105    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3106    pub fn source(mut self, source: &'b str) -> Self {
3107        self.source = Some(source);
3108        self
3109    }
3110    #[doc = "The unit in which to display time values"]
3111    pub fn time(mut self, time: Time) -> Self {
3112        self.time = Some(time);
3113        self
3114    }
3115    #[doc = "Verbose mode. Display column headers"]
3116    pub fn v(mut self, v: bool) -> Self {
3117        self.v = Some(v);
3118        self
3119    }
3120    #[doc = "Creates an asynchronous call to the Cat Shards API that can be awaited"]
3121    pub async fn send(self) -> Result<Response, Error> {
3122        let path = self.parts.url();
3123        let method = Method::Get;
3124        let headers = self.headers;
3125        let timeout = self.request_timeout;
3126        let query_string = {
3127            #[serde_with::skip_serializing_none]
3128            #[derive(Serialize)]
3129            struct QueryParams<'b> {
3130                bytes: Option<Bytes>,
3131                error_trace: Option<bool>,
3132                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3133                filter_path: Option<&'b [&'b str]>,
3134                format: Option<&'b str>,
3135                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3136                h: Option<&'b [&'b str]>,
3137                help: Option<bool>,
3138                human: Option<bool>,
3139                local: Option<bool>,
3140                master_timeout: Option<&'b str>,
3141                pretty: Option<bool>,
3142                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3143                s: Option<&'b [&'b str]>,
3144                source: Option<&'b str>,
3145                time: Option<Time>,
3146                v: Option<bool>,
3147            }
3148            let query_params = QueryParams {
3149                bytes: self.bytes,
3150                error_trace: self.error_trace,
3151                filter_path: self.filter_path,
3152                format: self.format,
3153                h: self.h,
3154                help: self.help,
3155                human: self.human,
3156                local: self.local,
3157                master_timeout: self.master_timeout,
3158                pretty: self.pretty,
3159                s: self.s,
3160                source: self.source,
3161                time: self.time,
3162                v: self.v,
3163            };
3164            Some(query_params)
3165        };
3166        let body = Option::<()>::None;
3167        let response = self
3168            .transport
3169            .send(method, &path, headers, query_string.as_ref(), body, timeout)
3170            .await?;
3171        Ok(response)
3172    }
3173}
3174#[derive(Debug, Clone, PartialEq)]
3175#[doc = "API parts for the Cat Snapshots API"]
3176pub enum CatSnapshotsParts<'b> {
3177    #[doc = "No parts"]
3178    None,
3179    #[doc = "Repository"]
3180    Repository(&'b [&'b str]),
3181}
3182impl<'b> CatSnapshotsParts<'b> {
3183    #[doc = "Builds a relative URL path to the Cat Snapshots API"]
3184    pub fn url(self) -> Cow<'static, str> {
3185        match self {
3186            CatSnapshotsParts::None => "/_cat/snapshots".into(),
3187            CatSnapshotsParts::Repository(ref repository) => {
3188                let repository_str = repository.join(",");
3189                let encoded_repository: Cow<str> =
3190                    percent_encode(repository_str.as_bytes(), PARTS_ENCODED).into();
3191                let mut p = String::with_capacity(16usize + encoded_repository.len());
3192                p.push_str("/_cat/snapshots/");
3193                p.push_str(encoded_repository.as_ref());
3194                p.into()
3195            }
3196        }
3197    }
3198}
3199#[doc = "Builder for the [Cat Snapshots API](https://opensearch.org/docs/)\n\nReturns all snapshots in a specific repository."]
3200#[derive(Clone, Debug)]
3201pub struct CatSnapshots<'a, 'b> {
3202    transport: &'a Transport,
3203    parts: CatSnapshotsParts<'b>,
3204    error_trace: Option<bool>,
3205    filter_path: Option<&'b [&'b str]>,
3206    format: Option<&'b str>,
3207    h: Option<&'b [&'b str]>,
3208    headers: HeaderMap,
3209    help: Option<bool>,
3210    human: Option<bool>,
3211    ignore_unavailable: Option<bool>,
3212    master_timeout: Option<&'b str>,
3213    pretty: Option<bool>,
3214    request_timeout: Option<Duration>,
3215    s: Option<&'b [&'b str]>,
3216    source: Option<&'b str>,
3217    time: Option<Time>,
3218    v: Option<bool>,
3219}
3220impl<'a, 'b> CatSnapshots<'a, 'b> {
3221    #[doc = "Creates a new instance of [CatSnapshots] with the specified API parts"]
3222    pub fn new(transport: &'a Transport, parts: CatSnapshotsParts<'b>) -> Self {
3223        let mut headers = HeaderMap::with_capacity(2);
3224        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
3225        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
3226        CatSnapshots {
3227            transport,
3228            parts,
3229            headers,
3230            error_trace: None,
3231            filter_path: None,
3232            format: None,
3233            h: None,
3234            help: None,
3235            human: None,
3236            ignore_unavailable: None,
3237            master_timeout: None,
3238            pretty: None,
3239            request_timeout: None,
3240            s: None,
3241            source: None,
3242            time: None,
3243            v: None,
3244        }
3245    }
3246    #[doc = "Include the stack trace of returned errors."]
3247    pub fn error_trace(mut self, error_trace: bool) -> Self {
3248        self.error_trace = Some(error_trace);
3249        self
3250    }
3251    #[doc = "A comma-separated list of filters used to reduce the response."]
3252    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3253        self.filter_path = Some(filter_path);
3254        self
3255    }
3256    #[doc = "a short version of the Accept header, e.g. json, yaml"]
3257    pub fn format(mut self, format: &'b str) -> Self {
3258        self.format = Some(format);
3259        self
3260    }
3261    #[doc = "Comma-separated list of column names to display"]
3262    pub fn h(mut self, h: &'b [&'b str]) -> Self {
3263        self.h = Some(h);
3264        self
3265    }
3266    #[doc = "Adds a HTTP header"]
3267    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3268        self.headers.insert(key, value);
3269        self
3270    }
3271    #[doc = "Return help information"]
3272    pub fn help(mut self, help: bool) -> Self {
3273        self.help = Some(help);
3274        self
3275    }
3276    #[doc = "Return human readable values for statistics."]
3277    pub fn human(mut self, human: bool) -> Self {
3278        self.human = Some(human);
3279        self
3280    }
3281    #[doc = "Set to true to ignore unavailable snapshots"]
3282    pub fn ignore_unavailable(mut self, ignore_unavailable: bool) -> Self {
3283        self.ignore_unavailable = Some(ignore_unavailable);
3284        self
3285    }
3286    #[doc = "Explicit operation timeout for connection to master node"]
3287    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
3288        self.master_timeout = Some(master_timeout);
3289        self
3290    }
3291    #[doc = "Pretty format the returned JSON response."]
3292    pub fn pretty(mut self, pretty: bool) -> Self {
3293        self.pretty = Some(pretty);
3294        self
3295    }
3296    #[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."]
3297    pub fn request_timeout(mut self, timeout: Duration) -> Self {
3298        self.request_timeout = Some(timeout);
3299        self
3300    }
3301    #[doc = "Comma-separated list of column names or column aliases to sort by"]
3302    pub fn s(mut self, s: &'b [&'b str]) -> Self {
3303        self.s = Some(s);
3304        self
3305    }
3306    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3307    pub fn source(mut self, source: &'b str) -> Self {
3308        self.source = Some(source);
3309        self
3310    }
3311    #[doc = "The unit in which to display time values"]
3312    pub fn time(mut self, time: Time) -> Self {
3313        self.time = Some(time);
3314        self
3315    }
3316    #[doc = "Verbose mode. Display column headers"]
3317    pub fn v(mut self, v: bool) -> Self {
3318        self.v = Some(v);
3319        self
3320    }
3321    #[doc = "Creates an asynchronous call to the Cat Snapshots API that can be awaited"]
3322    pub async fn send(self) -> Result<Response, Error> {
3323        let path = self.parts.url();
3324        let method = Method::Get;
3325        let headers = self.headers;
3326        let timeout = self.request_timeout;
3327        let query_string = {
3328            #[serde_with::skip_serializing_none]
3329            #[derive(Serialize)]
3330            struct QueryParams<'b> {
3331                error_trace: Option<bool>,
3332                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3333                filter_path: Option<&'b [&'b str]>,
3334                format: Option<&'b str>,
3335                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3336                h: Option<&'b [&'b str]>,
3337                help: Option<bool>,
3338                human: Option<bool>,
3339                ignore_unavailable: Option<bool>,
3340                master_timeout: Option<&'b str>,
3341                pretty: Option<bool>,
3342                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3343                s: Option<&'b [&'b str]>,
3344                source: Option<&'b str>,
3345                time: Option<Time>,
3346                v: Option<bool>,
3347            }
3348            let query_params = QueryParams {
3349                error_trace: self.error_trace,
3350                filter_path: self.filter_path,
3351                format: self.format,
3352                h: self.h,
3353                help: self.help,
3354                human: self.human,
3355                ignore_unavailable: self.ignore_unavailable,
3356                master_timeout: self.master_timeout,
3357                pretty: self.pretty,
3358                s: self.s,
3359                source: self.source,
3360                time: self.time,
3361                v: self.v,
3362            };
3363            Some(query_params)
3364        };
3365        let body = Option::<()>::None;
3366        let response = self
3367            .transport
3368            .send(method, &path, headers, query_string.as_ref(), body, timeout)
3369            .await?;
3370        Ok(response)
3371    }
3372}
3373#[derive(Debug, Clone, PartialEq)]
3374#[doc = "API parts for the Cat Tasks API"]
3375pub enum CatTasksParts {
3376    #[doc = "No parts"]
3377    None,
3378}
3379impl CatTasksParts {
3380    #[doc = "Builds a relative URL path to the Cat Tasks API"]
3381    pub fn url(self) -> Cow<'static, str> {
3382        match self {
3383            CatTasksParts::None => "/_cat/tasks".into(),
3384        }
3385    }
3386}
3387#[doc = "Builder for the [Cat Tasks API](https://opensearch.org/docs/)\n\nReturns information about the tasks currently executing on one or more nodes in the cluster."]
3388#[derive(Clone, Debug)]
3389pub struct CatTasks<'a, 'b> {
3390    transport: &'a Transport,
3391    parts: CatTasksParts,
3392    actions: Option<&'b [&'b str]>,
3393    detailed: Option<bool>,
3394    error_trace: Option<bool>,
3395    filter_path: Option<&'b [&'b str]>,
3396    format: Option<&'b str>,
3397    h: Option<&'b [&'b str]>,
3398    headers: HeaderMap,
3399    help: Option<bool>,
3400    human: Option<bool>,
3401    nodes: Option<&'b [&'b str]>,
3402    parent_task_id: Option<&'b str>,
3403    pretty: Option<bool>,
3404    request_timeout: Option<Duration>,
3405    s: Option<&'b [&'b str]>,
3406    source: Option<&'b str>,
3407    time: Option<Time>,
3408    v: Option<bool>,
3409}
3410impl<'a, 'b> CatTasks<'a, 'b> {
3411    #[doc = "Creates a new instance of [CatTasks]"]
3412    pub fn new(transport: &'a Transport) -> Self {
3413        let mut headers = HeaderMap::with_capacity(2);
3414        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
3415        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
3416        CatTasks {
3417            transport,
3418            parts: CatTasksParts::None,
3419            headers,
3420            actions: None,
3421            detailed: None,
3422            error_trace: None,
3423            filter_path: None,
3424            format: None,
3425            h: None,
3426            help: None,
3427            human: None,
3428            nodes: None,
3429            parent_task_id: None,
3430            pretty: None,
3431            request_timeout: None,
3432            s: None,
3433            source: None,
3434            time: None,
3435            v: None,
3436        }
3437    }
3438    #[doc = "A comma-separated list of actions that should be returned. Leave empty to return all."]
3439    pub fn actions(mut self, actions: &'b [&'b str]) -> Self {
3440        self.actions = Some(actions);
3441        self
3442    }
3443    #[doc = "Return detailed task information (default: false)"]
3444    pub fn detailed(mut self, detailed: bool) -> Self {
3445        self.detailed = Some(detailed);
3446        self
3447    }
3448    #[doc = "Include the stack trace of returned errors."]
3449    pub fn error_trace(mut self, error_trace: bool) -> Self {
3450        self.error_trace = Some(error_trace);
3451        self
3452    }
3453    #[doc = "A comma-separated list of filters used to reduce the response."]
3454    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3455        self.filter_path = Some(filter_path);
3456        self
3457    }
3458    #[doc = "a short version of the Accept header, e.g. json, yaml"]
3459    pub fn format(mut self, format: &'b str) -> Self {
3460        self.format = Some(format);
3461        self
3462    }
3463    #[doc = "Comma-separated list of column names to display"]
3464    pub fn h(mut self, h: &'b [&'b str]) -> Self {
3465        self.h = Some(h);
3466        self
3467    }
3468    #[doc = "Adds a HTTP header"]
3469    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3470        self.headers.insert(key, value);
3471        self
3472    }
3473    #[doc = "Return help information"]
3474    pub fn help(mut self, help: bool) -> Self {
3475        self.help = Some(help);
3476        self
3477    }
3478    #[doc = "Return human readable values for statistics."]
3479    pub fn human(mut self, human: bool) -> Self {
3480        self.human = Some(human);
3481        self
3482    }
3483    #[doc = "A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes"]
3484    pub fn nodes(mut self, nodes: &'b [&'b str]) -> Self {
3485        self.nodes = Some(nodes);
3486        self
3487    }
3488    #[doc = "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all."]
3489    pub fn parent_task_id(mut self, parent_task_id: &'b str) -> Self {
3490        self.parent_task_id = Some(parent_task_id);
3491        self
3492    }
3493    #[doc = "Pretty format the returned JSON response."]
3494    pub fn pretty(mut self, pretty: bool) -> Self {
3495        self.pretty = Some(pretty);
3496        self
3497    }
3498    #[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."]
3499    pub fn request_timeout(mut self, timeout: Duration) -> Self {
3500        self.request_timeout = Some(timeout);
3501        self
3502    }
3503    #[doc = "Comma-separated list of column names or column aliases to sort by"]
3504    pub fn s(mut self, s: &'b [&'b str]) -> Self {
3505        self.s = Some(s);
3506        self
3507    }
3508    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3509    pub fn source(mut self, source: &'b str) -> Self {
3510        self.source = Some(source);
3511        self
3512    }
3513    #[doc = "The unit in which to display time values"]
3514    pub fn time(mut self, time: Time) -> Self {
3515        self.time = Some(time);
3516        self
3517    }
3518    #[doc = "Verbose mode. Display column headers"]
3519    pub fn v(mut self, v: bool) -> Self {
3520        self.v = Some(v);
3521        self
3522    }
3523    #[doc = "Creates an asynchronous call to the Cat Tasks API that can be awaited"]
3524    pub async fn send(self) -> Result<Response, Error> {
3525        let path = self.parts.url();
3526        let method = Method::Get;
3527        let headers = self.headers;
3528        let timeout = self.request_timeout;
3529        let query_string = {
3530            #[serde_with::skip_serializing_none]
3531            #[derive(Serialize)]
3532            struct QueryParams<'b> {
3533                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3534                actions: Option<&'b [&'b str]>,
3535                detailed: Option<bool>,
3536                error_trace: Option<bool>,
3537                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3538                filter_path: Option<&'b [&'b str]>,
3539                format: Option<&'b str>,
3540                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3541                h: Option<&'b [&'b str]>,
3542                help: Option<bool>,
3543                human: Option<bool>,
3544                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3545                nodes: Option<&'b [&'b str]>,
3546                parent_task_id: Option<&'b str>,
3547                pretty: Option<bool>,
3548                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3549                s: Option<&'b [&'b str]>,
3550                source: Option<&'b str>,
3551                time: Option<Time>,
3552                v: Option<bool>,
3553            }
3554            let query_params = QueryParams {
3555                actions: self.actions,
3556                detailed: self.detailed,
3557                error_trace: self.error_trace,
3558                filter_path: self.filter_path,
3559                format: self.format,
3560                h: self.h,
3561                help: self.help,
3562                human: self.human,
3563                nodes: self.nodes,
3564                parent_task_id: self.parent_task_id,
3565                pretty: self.pretty,
3566                s: self.s,
3567                source: self.source,
3568                time: self.time,
3569                v: self.v,
3570            };
3571            Some(query_params)
3572        };
3573        let body = Option::<()>::None;
3574        let response = self
3575            .transport
3576            .send(method, &path, headers, query_string.as_ref(), body, timeout)
3577            .await?;
3578        Ok(response)
3579    }
3580}
3581#[derive(Debug, Clone, PartialEq)]
3582#[doc = "API parts for the Cat Templates API"]
3583pub enum CatTemplatesParts<'b> {
3584    #[doc = "No parts"]
3585    None,
3586    #[doc = "Name"]
3587    Name(&'b str),
3588}
3589impl<'b> CatTemplatesParts<'b> {
3590    #[doc = "Builds a relative URL path to the Cat Templates API"]
3591    pub fn url(self) -> Cow<'static, str> {
3592        match self {
3593            CatTemplatesParts::None => "/_cat/templates".into(),
3594            CatTemplatesParts::Name(ref name) => {
3595                let encoded_name: Cow<str> = percent_encode(name.as_bytes(), PARTS_ENCODED).into();
3596                let mut p = String::with_capacity(16usize + encoded_name.len());
3597                p.push_str("/_cat/templates/");
3598                p.push_str(encoded_name.as_ref());
3599                p.into()
3600            }
3601        }
3602    }
3603}
3604#[doc = "Builder for the [Cat Templates API](https://opensearch.org/docs/)\n\nReturns information about existing templates."]
3605#[derive(Clone, Debug)]
3606pub struct CatTemplates<'a, 'b> {
3607    transport: &'a Transport,
3608    parts: CatTemplatesParts<'b>,
3609    error_trace: Option<bool>,
3610    filter_path: Option<&'b [&'b str]>,
3611    format: Option<&'b str>,
3612    h: Option<&'b [&'b str]>,
3613    headers: HeaderMap,
3614    help: Option<bool>,
3615    human: Option<bool>,
3616    local: Option<bool>,
3617    master_timeout: Option<&'b str>,
3618    pretty: Option<bool>,
3619    request_timeout: Option<Duration>,
3620    s: Option<&'b [&'b str]>,
3621    source: Option<&'b str>,
3622    v: Option<bool>,
3623}
3624impl<'a, 'b> CatTemplates<'a, 'b> {
3625    #[doc = "Creates a new instance of [CatTemplates] with the specified API parts"]
3626    pub fn new(transport: &'a Transport, parts: CatTemplatesParts<'b>) -> Self {
3627        let mut headers = HeaderMap::with_capacity(2);
3628        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
3629        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
3630        CatTemplates {
3631            transport,
3632            parts,
3633            headers,
3634            error_trace: None,
3635            filter_path: None,
3636            format: None,
3637            h: None,
3638            help: None,
3639            human: None,
3640            local: None,
3641            master_timeout: None,
3642            pretty: None,
3643            request_timeout: None,
3644            s: None,
3645            source: None,
3646            v: None,
3647        }
3648    }
3649    #[doc = "Include the stack trace of returned errors."]
3650    pub fn error_trace(mut self, error_trace: bool) -> Self {
3651        self.error_trace = Some(error_trace);
3652        self
3653    }
3654    #[doc = "A comma-separated list of filters used to reduce the response."]
3655    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3656        self.filter_path = Some(filter_path);
3657        self
3658    }
3659    #[doc = "a short version of the Accept header, e.g. json, yaml"]
3660    pub fn format(mut self, format: &'b str) -> Self {
3661        self.format = Some(format);
3662        self
3663    }
3664    #[doc = "Comma-separated list of column names to display"]
3665    pub fn h(mut self, h: &'b [&'b str]) -> Self {
3666        self.h = Some(h);
3667        self
3668    }
3669    #[doc = "Adds a HTTP header"]
3670    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3671        self.headers.insert(key, value);
3672        self
3673    }
3674    #[doc = "Return help information"]
3675    pub fn help(mut self, help: bool) -> Self {
3676        self.help = Some(help);
3677        self
3678    }
3679    #[doc = "Return human readable values for statistics."]
3680    pub fn human(mut self, human: bool) -> Self {
3681        self.human = Some(human);
3682        self
3683    }
3684    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
3685    pub fn local(mut self, local: bool) -> Self {
3686        self.local = Some(local);
3687        self
3688    }
3689    #[doc = "Explicit operation timeout for connection to master node"]
3690    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
3691        self.master_timeout = Some(master_timeout);
3692        self
3693    }
3694    #[doc = "Pretty format the returned JSON response."]
3695    pub fn pretty(mut self, pretty: bool) -> Self {
3696        self.pretty = Some(pretty);
3697        self
3698    }
3699    #[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."]
3700    pub fn request_timeout(mut self, timeout: Duration) -> Self {
3701        self.request_timeout = Some(timeout);
3702        self
3703    }
3704    #[doc = "Comma-separated list of column names or column aliases to sort by"]
3705    pub fn s(mut self, s: &'b [&'b str]) -> Self {
3706        self.s = Some(s);
3707        self
3708    }
3709    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3710    pub fn source(mut self, source: &'b str) -> Self {
3711        self.source = Some(source);
3712        self
3713    }
3714    #[doc = "Verbose mode. Display column headers"]
3715    pub fn v(mut self, v: bool) -> Self {
3716        self.v = Some(v);
3717        self
3718    }
3719    #[doc = "Creates an asynchronous call to the Cat Templates API that can be awaited"]
3720    pub async fn send(self) -> Result<Response, Error> {
3721        let path = self.parts.url();
3722        let method = Method::Get;
3723        let headers = self.headers;
3724        let timeout = self.request_timeout;
3725        let query_string = {
3726            #[serde_with::skip_serializing_none]
3727            #[derive(Serialize)]
3728            struct QueryParams<'b> {
3729                error_trace: Option<bool>,
3730                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3731                filter_path: Option<&'b [&'b str]>,
3732                format: Option<&'b str>,
3733                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3734                h: Option<&'b [&'b str]>,
3735                help: Option<bool>,
3736                human: Option<bool>,
3737                local: Option<bool>,
3738                master_timeout: Option<&'b str>,
3739                pretty: Option<bool>,
3740                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3741                s: Option<&'b [&'b str]>,
3742                source: Option<&'b str>,
3743                v: Option<bool>,
3744            }
3745            let query_params = QueryParams {
3746                error_trace: self.error_trace,
3747                filter_path: self.filter_path,
3748                format: self.format,
3749                h: self.h,
3750                help: self.help,
3751                human: self.human,
3752                local: self.local,
3753                master_timeout: self.master_timeout,
3754                pretty: self.pretty,
3755                s: self.s,
3756                source: self.source,
3757                v: self.v,
3758            };
3759            Some(query_params)
3760        };
3761        let body = Option::<()>::None;
3762        let response = self
3763            .transport
3764            .send(method, &path, headers, query_string.as_ref(), body, timeout)
3765            .await?;
3766        Ok(response)
3767    }
3768}
3769#[derive(Debug, Clone, PartialEq)]
3770#[doc = "API parts for the Cat Thread Pool API"]
3771pub enum CatThreadPoolParts<'b> {
3772    #[doc = "No parts"]
3773    None,
3774    #[doc = "ThreadPoolPatterns"]
3775    ThreadPoolPatterns(&'b [&'b str]),
3776}
3777impl<'b> CatThreadPoolParts<'b> {
3778    #[doc = "Builds a relative URL path to the Cat Thread Pool API"]
3779    pub fn url(self) -> Cow<'static, str> {
3780        match self {
3781            CatThreadPoolParts::None => "/_cat/thread_pool".into(),
3782            CatThreadPoolParts::ThreadPoolPatterns(ref thread_pool_patterns) => {
3783                let thread_pool_patterns_str = thread_pool_patterns.join(",");
3784                let encoded_thread_pool_patterns: Cow<str> =
3785                    percent_encode(thread_pool_patterns_str.as_bytes(), PARTS_ENCODED).into();
3786                let mut p = String::with_capacity(18usize + encoded_thread_pool_patterns.len());
3787                p.push_str("/_cat/thread_pool/");
3788                p.push_str(encoded_thread_pool_patterns.as_ref());
3789                p.into()
3790            }
3791        }
3792    }
3793}
3794#[doc = "Builder for the [Cat Thread Pool API](https://opensearch.org/docs/)\n\nReturns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools."]
3795#[derive(Clone, Debug)]
3796pub struct CatThreadPool<'a, 'b> {
3797    transport: &'a Transport,
3798    parts: CatThreadPoolParts<'b>,
3799    error_trace: Option<bool>,
3800    filter_path: Option<&'b [&'b str]>,
3801    format: Option<&'b str>,
3802    h: Option<&'b [&'b str]>,
3803    headers: HeaderMap,
3804    help: Option<bool>,
3805    human: Option<bool>,
3806    local: Option<bool>,
3807    master_timeout: Option<&'b str>,
3808    pretty: Option<bool>,
3809    request_timeout: Option<Duration>,
3810    s: Option<&'b [&'b str]>,
3811    size: Option<Size>,
3812    source: Option<&'b str>,
3813    v: Option<bool>,
3814}
3815impl<'a, 'b> CatThreadPool<'a, 'b> {
3816    #[doc = "Creates a new instance of [CatThreadPool] with the specified API parts"]
3817    pub fn new(transport: &'a Transport, parts: CatThreadPoolParts<'b>) -> Self {
3818        let mut headers = HeaderMap::with_capacity(2);
3819        headers.insert(CONTENT_TYPE, HeaderValue::from_static("text/plain"));
3820        headers.insert(ACCEPT, HeaderValue::from_static("text/plain"));
3821        CatThreadPool {
3822            transport,
3823            parts,
3824            headers,
3825            error_trace: None,
3826            filter_path: None,
3827            format: None,
3828            h: None,
3829            help: None,
3830            human: None,
3831            local: None,
3832            master_timeout: None,
3833            pretty: None,
3834            request_timeout: None,
3835            s: None,
3836            size: None,
3837            source: None,
3838            v: None,
3839        }
3840    }
3841    #[doc = "Include the stack trace of returned errors."]
3842    pub fn error_trace(mut self, error_trace: bool) -> Self {
3843        self.error_trace = Some(error_trace);
3844        self
3845    }
3846    #[doc = "A comma-separated list of filters used to reduce the response."]
3847    pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3848        self.filter_path = Some(filter_path);
3849        self
3850    }
3851    #[doc = "a short version of the Accept header, e.g. json, yaml"]
3852    pub fn format(mut self, format: &'b str) -> Self {
3853        self.format = Some(format);
3854        self
3855    }
3856    #[doc = "Comma-separated list of column names to display"]
3857    pub fn h(mut self, h: &'b [&'b str]) -> Self {
3858        self.h = Some(h);
3859        self
3860    }
3861    #[doc = "Adds a HTTP header"]
3862    pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3863        self.headers.insert(key, value);
3864        self
3865    }
3866    #[doc = "Return help information"]
3867    pub fn help(mut self, help: bool) -> Self {
3868        self.help = Some(help);
3869        self
3870    }
3871    #[doc = "Return human readable values for statistics."]
3872    pub fn human(mut self, human: bool) -> Self {
3873        self.human = Some(human);
3874        self
3875    }
3876    #[doc = "Return local information, do not retrieve the state from master node (default: false)"]
3877    pub fn local(mut self, local: bool) -> Self {
3878        self.local = Some(local);
3879        self
3880    }
3881    #[doc = "Explicit operation timeout for connection to master node"]
3882    pub fn master_timeout(mut self, master_timeout: &'b str) -> Self {
3883        self.master_timeout = Some(master_timeout);
3884        self
3885    }
3886    #[doc = "Pretty format the returned JSON response."]
3887    pub fn pretty(mut self, pretty: bool) -> Self {
3888        self.pretty = Some(pretty);
3889        self
3890    }
3891    #[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."]
3892    pub fn request_timeout(mut self, timeout: Duration) -> Self {
3893        self.request_timeout = Some(timeout);
3894        self
3895    }
3896    #[doc = "Comma-separated list of column names or column aliases to sort by"]
3897    pub fn s(mut self, s: &'b [&'b str]) -> Self {
3898        self.s = Some(s);
3899        self
3900    }
3901    #[doc = "The multiplier in which to display values"]
3902    pub fn size(mut self, size: Size) -> Self {
3903        self.size = Some(size);
3904        self
3905    }
3906    #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3907    pub fn source(mut self, source: &'b str) -> Self {
3908        self.source = Some(source);
3909        self
3910    }
3911    #[doc = "Verbose mode. Display column headers"]
3912    pub fn v(mut self, v: bool) -> Self {
3913        self.v = Some(v);
3914        self
3915    }
3916    #[doc = "Creates an asynchronous call to the Cat Thread Pool API that can be awaited"]
3917    pub async fn send(self) -> Result<Response, Error> {
3918        let path = self.parts.url();
3919        let method = Method::Get;
3920        let headers = self.headers;
3921        let timeout = self.request_timeout;
3922        let query_string = {
3923            #[serde_with::skip_serializing_none]
3924            #[derive(Serialize)]
3925            struct QueryParams<'b> {
3926                error_trace: Option<bool>,
3927                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3928                filter_path: Option<&'b [&'b str]>,
3929                format: Option<&'b str>,
3930                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3931                h: Option<&'b [&'b str]>,
3932                help: Option<bool>,
3933                human: Option<bool>,
3934                local: Option<bool>,
3935                master_timeout: Option<&'b str>,
3936                pretty: Option<bool>,
3937                #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3938                s: Option<&'b [&'b str]>,
3939                size: Option<Size>,
3940                source: Option<&'b str>,
3941                v: Option<bool>,
3942            }
3943            let query_params = QueryParams {
3944                error_trace: self.error_trace,
3945                filter_path: self.filter_path,
3946                format: self.format,
3947                h: self.h,
3948                help: self.help,
3949                human: self.human,
3950                local: self.local,
3951                master_timeout: self.master_timeout,
3952                pretty: self.pretty,
3953                s: self.s,
3954                size: self.size,
3955                source: self.source,
3956                v: self.v,
3957            };
3958            Some(query_params)
3959        };
3960        let body = Option::<()>::None;
3961        let response = self
3962            .transport
3963            .send(method, &path, headers, query_string.as_ref(), body, timeout)
3964            .await?;
3965        Ok(response)
3966    }
3967}
3968#[doc = "Namespace client for Cat APIs"]
3969pub struct Cat<'a> {
3970    transport: &'a Transport,
3971}
3972impl<'a> Cat<'a> {
3973    #[doc = "Creates a new instance of [Cat]"]
3974    pub fn new(transport: &'a Transport) -> Self {
3975        Self { transport }
3976    }
3977    pub fn transport(&self) -> &Transport {
3978        self.transport
3979    }
3980    #[doc = "[Cat Aliases API](https://opensearch.org/docs/)\n\nShows information about currently configured aliases to indices including filter and routing infos."]
3981    pub fn aliases<'b>(&'a self, parts: CatAliasesParts<'b>) -> CatAliases<'a, 'b> {
3982        CatAliases::new(self.transport(), parts)
3983    }
3984    #[doc = "[Cat Allocation API](https://opensearch.org/docs/)\n\nProvides a snapshot of how many shards are allocated to each data node and how much disk space they are using."]
3985    pub fn allocation<'b>(&'a self, parts: CatAllocationParts<'b>) -> CatAllocation<'a, 'b> {
3986        CatAllocation::new(self.transport(), parts)
3987    }
3988    #[doc = "[Cat Count API](https://opensearch.org/docs/)\n\nProvides quick access to the document count of the entire cluster, or individual indices."]
3989    pub fn count<'b>(&'a self, parts: CatCountParts<'b>) -> CatCount<'a, 'b> {
3990        CatCount::new(self.transport(), parts)
3991    }
3992    #[doc = "[Cat Fielddata API](https://opensearch.org/docs/)\n\nShows how much heap memory is currently being used by fielddata on every data node in the cluster."]
3993    pub fn fielddata<'b>(&'a self, parts: CatFielddataParts<'b>) -> CatFielddata<'a, 'b> {
3994        CatFielddata::new(self.transport(), parts)
3995    }
3996    #[doc = "[Cat Health API](https://opensearch.org/docs/)\n\nReturns a concise representation of the cluster health."]
3997    pub fn health<'b>(&'a self) -> CatHealth<'a, 'b> {
3998        CatHealth::new(self.transport())
3999    }
4000    #[doc = "[Cat Help API](https://opensearch.org/docs/)\n\nReturns help for the Cat APIs."]
4001    pub fn help<'b>(&'a self) -> CatHelp<'a, 'b> {
4002        CatHelp::new(self.transport())
4003    }
4004    #[doc = "[Cat Indices API](https://opensearch.org/docs/)\n\nReturns information about indices: number of primaries and replicas, document counts, disk size, ..."]
4005    pub fn indices<'b>(&'a self, parts: CatIndicesParts<'b>) -> CatIndices<'a, 'b> {
4006        CatIndices::new(self.transport(), parts)
4007    }
4008    #[doc = "[Cat Master API](https://opensearch.org/docs/)\n\nReturns information about the master node."]
4009    pub fn master<'b>(&'a self) -> CatMaster<'a, 'b> {
4010        CatMaster::new(self.transport())
4011    }
4012    #[doc = "[Cat Nodeattrs API](https://opensearch.org/docs/)\n\nReturns information about custom node attributes."]
4013    pub fn nodeattrs<'b>(&'a self) -> CatNodeattrs<'a, 'b> {
4014        CatNodeattrs::new(self.transport())
4015    }
4016    #[doc = "[Cat Nodes API](https://opensearch.org/docs/)\n\nReturns basic statistics about performance of cluster nodes."]
4017    pub fn nodes<'b>(&'a self) -> CatNodes<'a, 'b> {
4018        CatNodes::new(self.transport())
4019    }
4020    #[doc = "[Cat Pending Tasks API](https://opensearch.org/docs/)\n\nReturns a concise representation of the cluster pending tasks."]
4021    pub fn pending_tasks<'b>(&'a self) -> CatPendingTasks<'a, 'b> {
4022        CatPendingTasks::new(self.transport())
4023    }
4024    #[doc = "[Cat Plugins API](https://opensearch.org/docs/)\n\nReturns information about installed plugins across nodes node."]
4025    pub fn plugins<'b>(&'a self) -> CatPlugins<'a, 'b> {
4026        CatPlugins::new(self.transport())
4027    }
4028    #[doc = "[Cat Recovery API](https://opensearch.org/docs/)\n\nReturns information about index shard recoveries, both on-going completed."]
4029    pub fn recovery<'b>(&'a self, parts: CatRecoveryParts<'b>) -> CatRecovery<'a, 'b> {
4030        CatRecovery::new(self.transport(), parts)
4031    }
4032    #[doc = "[Cat Repositories API](https://opensearch.org/docs/)\n\nReturns information about snapshot repositories registered in the cluster."]
4033    pub fn repositories<'b>(&'a self) -> CatRepositories<'a, 'b> {
4034        CatRepositories::new(self.transport())
4035    }
4036    #[doc = "[Cat Segments API](https://opensearch.org/docs/)\n\nProvides low-level information about the segments in the shards of an index."]
4037    pub fn segments<'b>(&'a self, parts: CatSegmentsParts<'b>) -> CatSegments<'a, 'b> {
4038        CatSegments::new(self.transport(), parts)
4039    }
4040    #[doc = "[Cat Shards API](https://opensearch.org/docs/)\n\nProvides a detailed view of shard allocation on nodes."]
4041    pub fn shards<'b>(&'a self, parts: CatShardsParts<'b>) -> CatShards<'a, 'b> {
4042        CatShards::new(self.transport(), parts)
4043    }
4044    #[doc = "[Cat Snapshots API](https://opensearch.org/docs/)\n\nReturns all snapshots in a specific repository."]
4045    pub fn snapshots<'b>(&'a self, parts: CatSnapshotsParts<'b>) -> CatSnapshots<'a, 'b> {
4046        CatSnapshots::new(self.transport(), parts)
4047    }
4048    #[doc = "[Cat Tasks API](https://opensearch.org/docs/)\n\nReturns information about the tasks currently executing on one or more nodes in the cluster."]
4049    pub fn tasks<'b>(&'a self) -> CatTasks<'a, 'b> {
4050        CatTasks::new(self.transport())
4051    }
4052    #[doc = "[Cat Templates API](https://opensearch.org/docs/)\n\nReturns information about existing templates."]
4053    pub fn templates<'b>(&'a self, parts: CatTemplatesParts<'b>) -> CatTemplates<'a, 'b> {
4054        CatTemplates::new(self.transport(), parts)
4055    }
4056    #[doc = "[Cat Thread Pool API](https://opensearch.org/docs/)\n\nReturns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools."]
4057    pub fn thread_pool<'b>(&'a self, parts: CatThreadPoolParts<'b>) -> CatThreadPool<'a, 'b> {
4058        CatThreadPool::new(self.transport(), parts)
4059    }
4060}
4061impl OpenSearch {
4062    #[doc = "Creates a namespace client for Cat APIs"]
4063    pub fn cat(&self) -> Cat {
4064        Cat::new(self.transport())
4065    }
4066}