@@ -526,6 +526,194 @@ impl<'a, 'b> CatAllocation<'a, 'b> {
526
526
}
527
527
}
528
528
#[ derive( Debug , Clone , PartialEq ) ]
529
+ #[ doc = "API parts for the Cat Component Templates API" ]
530
+ pub enum CatComponentTemplatesParts < ' b > {
531
+ #[ doc = "No parts" ]
532
+ None ,
533
+ #[ doc = "Name" ]
534
+ Name ( & ' b str ) ,
535
+ }
536
+ impl < ' b > CatComponentTemplatesParts < ' b > {
537
+ #[ doc = "Builds a relative URL path to the Cat Component Templates API" ]
538
+ pub fn url ( self ) -> Cow < ' static , str > {
539
+ match self {
540
+ CatComponentTemplatesParts :: None => "/_cat/component_templates" . into ( ) ,
541
+ CatComponentTemplatesParts :: Name ( ref name) => {
542
+ let encoded_name: Cow < str > = percent_encode ( name. as_bytes ( ) , PARTS_ENCODED ) . into ( ) ;
543
+ let mut p = String :: with_capacity ( 26usize + encoded_name. len ( ) ) ;
544
+ p. push_str ( "/_cat/component_templates/" ) ;
545
+ p. push_str ( encoded_name. as_ref ( ) ) ;
546
+ p. into ( )
547
+ }
548
+ }
549
+ }
550
+ }
551
+ #[ doc = "Builder for the [Cat Component Templates API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-compoentn-templates.html)\n \n Returns information about existing component_templates templates." ]
552
+ #[ derive( Clone , Debug ) ]
553
+ pub struct CatComponentTemplates < ' a , ' b > {
554
+ transport : & ' a Transport ,
555
+ parts : CatComponentTemplatesParts < ' b > ,
556
+ error_trace : Option < bool > ,
557
+ filter_path : Option < & ' b [ & ' b str ] > ,
558
+ format : Option < & ' b str > ,
559
+ h : Option < & ' b [ & ' b str ] > ,
560
+ headers : HeaderMap ,
561
+ help : Option < bool > ,
562
+ human : Option < bool > ,
563
+ local : Option < bool > ,
564
+ master_timeout : Option < & ' b str > ,
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
+ }
571
+ impl < ' a , ' b > CatComponentTemplates < ' a , ' b > {
572
+ #[ doc = "Creates a new instance of [CatComponentTemplates] with the specified API parts" ]
573
+ pub fn new ( transport : & ' a Transport , parts : CatComponentTemplatesParts < ' 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
+ CatComponentTemplates {
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
+ local : None ,
588
+ master_timeout : None ,
589
+ pretty : None ,
590
+ request_timeout : None ,
591
+ s : None ,
592
+ source : None ,
593
+ v : None ,
594
+ }
595
+ }
596
+ #[ doc = "Include the stack trace of returned errors." ]
597
+ pub fn error_trace ( mut self , error_trace : bool ) -> Self {
598
+ self . error_trace = Some ( error_trace) ;
599
+ self
600
+ }
601
+ #[ doc = "A comma-separated list of filters used to reduce the response." ]
602
+ pub fn filter_path ( mut self , filter_path : & ' b [ & ' b str ] ) -> Self {
603
+ self . filter_path = Some ( filter_path) ;
604
+ self
605
+ }
606
+ #[ doc = "a short version of the Accept header, e.g. json, yaml" ]
607
+ pub fn format ( mut self , format : & ' b str ) -> Self {
608
+ self . format = Some ( format) ;
609
+ self
610
+ }
611
+ #[ doc = "Comma-separated list of column names to display" ]
612
+ pub fn h ( mut self , h : & ' b [ & ' b str ] ) -> Self {
613
+ self . h = Some ( h) ;
614
+ self
615
+ }
616
+ #[ doc = "Adds a HTTP header" ]
617
+ pub fn header ( mut self , key : HeaderName , value : HeaderValue ) -> Self {
618
+ self . headers . insert ( key, value) ;
619
+ self
620
+ }
621
+ #[ doc = "Return help information" ]
622
+ pub fn help ( mut self , help : bool ) -> Self {
623
+ self . help = Some ( help) ;
624
+ self
625
+ }
626
+ #[ doc = "Return human readable values for statistics." ]
627
+ pub fn human ( mut self , human : bool ) -> Self {
628
+ self . human = Some ( human) ;
629
+ self
630
+ }
631
+ #[ doc = "Return local information, do not retrieve the state from master node (default: false)" ]
632
+ pub fn local ( mut self , local : bool ) -> Self {
633
+ self . local = Some ( local) ;
634
+ self
635
+ }
636
+ #[ doc = "Explicit operation timeout for connection to master node" ]
637
+ pub fn master_timeout ( mut self , master_timeout : & ' b str ) -> Self {
638
+ self . master_timeout = Some ( master_timeout) ;
639
+ self
640
+ }
641
+ #[ doc = "Pretty format the returned JSON response." ]
642
+ pub fn pretty ( mut self , pretty : bool ) -> Self {
643
+ self . pretty = Some ( pretty) ;
644
+ self
645
+ }
646
+ #[ doc = "Sets a request timeout for this API call.\n \n The timeout is applied from when the request starts connecting until the response body has finished." ]
647
+ pub fn request_timeout ( mut self , timeout : Duration ) -> Self {
648
+ self . request_timeout = Some ( timeout) ;
649
+ self
650
+ }
651
+ #[ doc = "Comma-separated list of column names or column aliases to sort by" ]
652
+ pub fn s ( mut self , s : & ' b [ & ' b str ] ) -> Self {
653
+ self . s = Some ( s) ;
654
+ self
655
+ }
656
+ #[ doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests." ]
657
+ pub fn source ( mut self , source : & ' b str ) -> Self {
658
+ self . source = Some ( source) ;
659
+ self
660
+ }
661
+ #[ doc = "Verbose mode. Display column headers" ]
662
+ pub fn v ( mut self , v : bool ) -> Self {
663
+ self . v = Some ( v) ;
664
+ self
665
+ }
666
+ #[ doc = "Creates an asynchronous call to the Cat Component Templates API that can be awaited" ]
667
+ pub async fn send ( self ) -> Result < Response , Error > {
668
+ let path = self . parts . url ( ) ;
669
+ let method = Method :: Get ;
670
+ let headers = self . headers ;
671
+ let timeout = self . request_timeout ;
672
+ let query_string = {
673
+ #[ serde_with:: skip_serializing_none]
674
+ #[ derive( Serialize ) ]
675
+ struct QueryParams < ' b > {
676
+ error_trace : Option < bool > ,
677
+ #[ serde( serialize_with = "crate::client::serialize_coll_qs" ) ]
678
+ filter_path : Option < & ' b [ & ' b str ] > ,
679
+ format : Option < & ' b str > ,
680
+ #[ serde( serialize_with = "crate::client::serialize_coll_qs" ) ]
681
+ h : Option < & ' b [ & ' b str ] > ,
682
+ help : Option < bool > ,
683
+ human : Option < bool > ,
684
+ local : Option < bool > ,
685
+ master_timeout : Option < & ' b str > ,
686
+ pretty : Option < bool > ,
687
+ #[ serde( serialize_with = "crate::client::serialize_coll_qs" ) ]
688
+ s : Option < & ' b [ & ' b str ] > ,
689
+ source : Option < & ' b str > ,
690
+ v : Option < bool > ,
691
+ }
692
+ let query_params = QueryParams {
693
+ error_trace : self . error_trace ,
694
+ filter_path : self . filter_path ,
695
+ format : self . format ,
696
+ h : self . h ,
697
+ help : self . help ,
698
+ human : self . human ,
699
+ local : self . local ,
700
+ master_timeout : self . master_timeout ,
701
+ pretty : self . pretty ,
702
+ s : self . s ,
703
+ source : self . source ,
704
+ v : self . v ,
705
+ } ;
706
+ Some ( query_params)
707
+ } ;
708
+ let body = Option :: < ( ) > :: None ;
709
+ let response = self
710
+ . transport
711
+ . send ( method, & path, headers, query_string. as_ref ( ) , body, timeout)
712
+ . await ?;
713
+ Ok ( response)
714
+ }
715
+ }
716
+ #[ derive( Debug , Clone , PartialEq ) ]
529
717
#[ doc = "API parts for the Cat Count API" ]
530
718
pub enum CatCountParts < ' b > {
531
719
#[ doc = "No parts" ]
@@ -1841,7 +2029,6 @@ impl<'b> CatMlDatafeedsParts<'b> {
1841
2029
pub struct CatMlDatafeeds < ' a , ' b > {
1842
2030
transport : & ' a Transport ,
1843
2031
parts : CatMlDatafeedsParts < ' b > ,
1844
- allow_no_datafeeds : Option < bool > ,
1845
2032
allow_no_match : Option < bool > ,
1846
2033
error_trace : Option < bool > ,
1847
2034
filter_path : Option < & ' b [ & ' b str ] > ,
@@ -1867,7 +2054,6 @@ impl<'a, 'b> CatMlDatafeeds<'a, 'b> {
1867
2054
transport,
1868
2055
parts,
1869
2056
headers,
1870
- allow_no_datafeeds : None ,
1871
2057
allow_no_match : None ,
1872
2058
error_trace : None ,
1873
2059
filter_path : None ,
@@ -1884,11 +2070,6 @@ impl<'a, 'b> CatMlDatafeeds<'a, 'b> {
1884
2070
}
1885
2071
}
1886
2072
#[ doc = "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" ]
1887
- pub fn allow_no_datafeeds ( mut self , allow_no_datafeeds : bool ) -> Self {
1888
- self . allow_no_datafeeds = Some ( allow_no_datafeeds) ;
1889
- self
1890
- }
1891
- #[ doc = "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" ]
1892
2073
pub fn allow_no_match ( mut self , allow_no_match : bool ) -> Self {
1893
2074
self . allow_no_match = Some ( allow_no_match) ;
1894
2075
self
@@ -1968,7 +2149,6 @@ impl<'a, 'b> CatMlDatafeeds<'a, 'b> {
1968
2149
#[ serde_with:: skip_serializing_none]
1969
2150
#[ derive( Serialize ) ]
1970
2151
struct QueryParams < ' b > {
1971
- allow_no_datafeeds : Option < bool > ,
1972
2152
allow_no_match : Option < bool > ,
1973
2153
error_trace : Option < bool > ,
1974
2154
#[ serde( serialize_with = "crate::client::serialize_coll_qs" ) ]
@@ -1986,7 +2166,6 @@ impl<'a, 'b> CatMlDatafeeds<'a, 'b> {
1986
2166
v : Option < bool > ,
1987
2167
}
1988
2168
let query_params = QueryParams {
1989
- allow_no_datafeeds : self . allow_no_datafeeds ,
1990
2169
allow_no_match : self . allow_no_match ,
1991
2170
error_trace : self . error_trace ,
1992
2171
filter_path : self . filter_path ,
@@ -2039,7 +2218,6 @@ impl<'b> CatMlJobsParts<'b> {
2039
2218
pub struct CatMlJobs < ' a , ' b > {
2040
2219
transport : & ' a Transport ,
2041
2220
parts : CatMlJobsParts < ' b > ,
2042
- allow_no_jobs : Option < bool > ,
2043
2221
allow_no_match : Option < bool > ,
2044
2222
bytes : Option < Bytes > ,
2045
2223
error_trace : Option < bool > ,
@@ -2066,7 +2244,6 @@ impl<'a, 'b> CatMlJobs<'a, 'b> {
2066
2244
transport,
2067
2245
parts,
2068
2246
headers,
2069
- allow_no_jobs : None ,
2070
2247
allow_no_match : None ,
2071
2248
bytes : None ,
2072
2249
error_trace : None ,
@@ -2084,11 +2261,6 @@ impl<'a, 'b> CatMlJobs<'a, 'b> {
2084
2261
}
2085
2262
}
2086
2263
#[ doc = "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" ]
2087
- pub fn allow_no_jobs ( mut self , allow_no_jobs : bool ) -> Self {
2088
- self . allow_no_jobs = Some ( allow_no_jobs) ;
2089
- self
2090
- }
2091
- #[ doc = "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" ]
2092
2264
pub fn allow_no_match ( mut self , allow_no_match : bool ) -> Self {
2093
2265
self . allow_no_match = Some ( allow_no_match) ;
2094
2266
self
@@ -2173,7 +2345,6 @@ impl<'a, 'b> CatMlJobs<'a, 'b> {
2173
2345
#[ serde_with:: skip_serializing_none]
2174
2346
#[ derive( Serialize ) ]
2175
2347
struct QueryParams < ' b > {
2176
- allow_no_jobs : Option < bool > ,
2177
2348
allow_no_match : Option < bool > ,
2178
2349
bytes : Option < Bytes > ,
2179
2350
error_trace : Option < bool > ,
@@ -2192,7 +2363,6 @@ impl<'a, 'b> CatMlJobs<'a, 'b> {
2192
2363
v : Option < bool > ,
2193
2364
}
2194
2365
let query_params = QueryParams {
2195
- allow_no_jobs : self . allow_no_jobs ,
2196
2366
allow_no_match : self . allow_no_match ,
2197
2367
bytes : self . bytes ,
2198
2368
error_trace : self . error_trace ,
@@ -4997,6 +5167,13 @@ impl<'a> Cat<'a> {
4997
5167
pub fn allocation < ' b > ( & ' a self , parts : CatAllocationParts < ' b > ) -> CatAllocation < ' a , ' b > {
4998
5168
CatAllocation :: new ( self . transport ( ) , parts)
4999
5169
}
5170
+ #[ doc = "[Cat Component Templates API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-compoentn-templates.html)\n \n Returns information about existing component_templates templates." ]
5171
+ pub fn component_templates < ' b > (
5172
+ & ' a self ,
5173
+ parts : CatComponentTemplatesParts < ' b > ,
5174
+ ) -> CatComponentTemplates < ' a , ' b > {
5175
+ CatComponentTemplates :: new ( self . transport ( ) , parts)
5176
+ }
5000
5177
#[ doc = "[Cat Count API](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-count.html)\n \n Provides quick access to the document count of the entire cluster, or individual indices." ]
5001
5178
pub fn count < ' b > ( & ' a self , parts : CatCountParts < ' b > ) -> CatCount < ' a , ' b > {
5002
5179
CatCount :: new ( self . transport ( ) , parts)
0 commit comments