1#![cfg(feature = "experimental-apis")]
39#![doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
40#![allow(unused_imports)]
41use crate::{
42 client::Elasticsearch,
43 error::Error,
44 http::{
45 self,
46 headers::{HeaderMap, HeaderName, HeaderValue, ACCEPT, CONTENT_TYPE},
47 request::{Body, JsonBody, NdBody, PARTS_ENCODED},
48 response::Response,
49 transport::Transport,
50 },
51 params::*,
52};
53use percent_encoding::percent_encode;
54use serde::Serialize;
55use std::{borrow::Cow, time::Duration};
56#[cfg(feature = "experimental-apis")]
57#[derive(Debug, Clone, PartialEq, Eq)]
58#[doc = "API parts for the Connector Check In API"]
59pub enum ConnectorCheckInParts<'b> {
60 #[doc = "ConnectorId"]
61 ConnectorId(&'b str),
62}
63#[cfg(feature = "experimental-apis")]
64impl<'b> ConnectorCheckInParts<'b> {
65 #[doc = "Builds a relative URL path to the Connector Check In API"]
66 pub fn url(self) -> Cow<'static, str> {
67 match self {
68 ConnectorCheckInParts::ConnectorId(connector_id) => {
69 let encoded_connector_id: Cow<str> =
70 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
71 let mut p = String::with_capacity(22usize + encoded_connector_id.len());
72 p.push_str("/_connector/");
73 p.push_str(encoded_connector_id.as_ref());
74 p.push_str("/_check_in");
75 p.into()
76 }
77 }
78 }
79}
80#[doc = "Builder for the [Connector Check In API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/check-in-connector-api.html)\n\nUpdates the last_seen timestamp in the connector document."]
81#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
82#[cfg(feature = "experimental-apis")]
83#[derive(Clone, Debug)]
84pub struct ConnectorCheckIn<'a, 'b, B> {
85 transport: &'a Transport,
86 parts: ConnectorCheckInParts<'b>,
87 body: Option<B>,
88 error_trace: Option<bool>,
89 filter_path: Option<&'b [&'b str]>,
90 headers: HeaderMap,
91 human: Option<bool>,
92 pretty: Option<bool>,
93 request_timeout: Option<Duration>,
94 source: Option<&'b str>,
95}
96#[cfg(feature = "experimental-apis")]
97impl<'a, 'b, B> ConnectorCheckIn<'a, 'b, B>
98where
99 B: Body,
100{
101 #[doc = "Creates a new instance of [ConnectorCheckIn] with the specified API parts"]
102 pub fn new(transport: &'a Transport, parts: ConnectorCheckInParts<'b>) -> Self {
103 let headers = HeaderMap::new();
104 ConnectorCheckIn {
105 transport,
106 parts,
107 headers,
108 body: None,
109 error_trace: None,
110 filter_path: None,
111 human: None,
112 pretty: None,
113 request_timeout: None,
114 source: None,
115 }
116 }
117 #[doc = "The body for the API call"]
118 pub fn body<T>(self, body: T) -> ConnectorCheckIn<'a, 'b, JsonBody<T>>
119 where
120 T: Serialize,
121 {
122 ConnectorCheckIn {
123 transport: self.transport,
124 parts: self.parts,
125 body: Some(body.into()),
126 error_trace: self.error_trace,
127 filter_path: self.filter_path,
128 headers: self.headers,
129 human: self.human,
130 pretty: self.pretty,
131 request_timeout: self.request_timeout,
132 source: self.source,
133 }
134 }
135 #[doc = "Include the stack trace of returned errors."]
136 pub fn error_trace(mut self, error_trace: bool) -> Self {
137 self.error_trace = Some(error_trace);
138 self
139 }
140 #[doc = "A comma-separated list of filters used to reduce the response."]
141 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
142 self.filter_path = Some(filter_path);
143 self
144 }
145 #[doc = "Adds a HTTP header"]
146 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
147 self.headers.insert(key, value);
148 self
149 }
150 #[doc = "Return human readable values for statistics."]
151 pub fn human(mut self, human: bool) -> Self {
152 self.human = Some(human);
153 self
154 }
155 #[doc = "Pretty format the returned JSON response."]
156 pub fn pretty(mut self, pretty: bool) -> Self {
157 self.pretty = Some(pretty);
158 self
159 }
160 #[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."]
161 pub fn request_timeout(mut self, timeout: Duration) -> Self {
162 self.request_timeout = Some(timeout);
163 self
164 }
165 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
166 pub fn source(mut self, source: &'b str) -> Self {
167 self.source = Some(source);
168 self
169 }
170 #[doc = "Creates an asynchronous call to the Connector Check In API that can be awaited"]
171 pub async fn send(self) -> Result<Response, Error> {
172 let path = self.parts.url();
173 let method = http::Method::Put;
174 let headers = self.headers;
175 let timeout = self.request_timeout;
176 let query_string = {
177 #[serde_with::skip_serializing_none]
178 #[derive(Serialize)]
179 struct QueryParams<'b> {
180 error_trace: Option<bool>,
181 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
182 filter_path: Option<&'b [&'b str]>,
183 human: Option<bool>,
184 pretty: Option<bool>,
185 source: Option<&'b str>,
186 }
187 let query_params = QueryParams {
188 error_trace: self.error_trace,
189 filter_path: self.filter_path,
190 human: self.human,
191 pretty: self.pretty,
192 source: self.source,
193 };
194 Some(query_params)
195 };
196 let body = self.body;
197 let response = self
198 .transport
199 .send(method, &path, headers, query_string.as_ref(), body, timeout)
200 .await?;
201 Ok(response)
202 }
203}
204#[cfg(feature = "experimental-apis")]
205#[derive(Debug, Clone, PartialEq, Eq)]
206#[doc = "API parts for the Connector Delete API"]
207pub enum ConnectorDeleteParts<'b> {
208 #[doc = "ConnectorId"]
209 ConnectorId(&'b str),
210}
211#[cfg(feature = "experimental-apis")]
212impl<'b> ConnectorDeleteParts<'b> {
213 #[doc = "Builds a relative URL path to the Connector Delete API"]
214 pub fn url(self) -> Cow<'static, str> {
215 match self {
216 ConnectorDeleteParts::ConnectorId(connector_id) => {
217 let encoded_connector_id: Cow<str> =
218 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
219 let mut p = String::with_capacity(12usize + encoded_connector_id.len());
220 p.push_str("/_connector/");
221 p.push_str(encoded_connector_id.as_ref());
222 p.into()
223 }
224 }
225 }
226}
227#[doc = "Builder for the [Connector Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/delete-connector-api.html)\n\nDeletes a connector."]
228#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
229#[cfg(feature = "experimental-apis")]
230#[derive(Clone, Debug)]
231pub struct ConnectorDelete<'a, 'b> {
232 transport: &'a Transport,
233 parts: ConnectorDeleteParts<'b>,
234 delete_sync_jobs: Option<bool>,
235 error_trace: Option<bool>,
236 filter_path: Option<&'b [&'b str]>,
237 hard: Option<bool>,
238 headers: HeaderMap,
239 human: Option<bool>,
240 pretty: Option<bool>,
241 request_timeout: Option<Duration>,
242 source: Option<&'b str>,
243}
244#[cfg(feature = "experimental-apis")]
245impl<'a, 'b> ConnectorDelete<'a, 'b> {
246 #[doc = "Creates a new instance of [ConnectorDelete] with the specified API parts"]
247 pub fn new(transport: &'a Transport, parts: ConnectorDeleteParts<'b>) -> Self {
248 let headers = HeaderMap::new();
249 ConnectorDelete {
250 transport,
251 parts,
252 headers,
253 delete_sync_jobs: None,
254 error_trace: None,
255 filter_path: None,
256 hard: None,
257 human: None,
258 pretty: None,
259 request_timeout: None,
260 source: None,
261 }
262 }
263 #[doc = "Determines whether associated sync jobs are also deleted."]
264 pub fn delete_sync_jobs(mut self, delete_sync_jobs: bool) -> Self {
265 self.delete_sync_jobs = Some(delete_sync_jobs);
266 self
267 }
268 #[doc = "Include the stack trace of returned errors."]
269 pub fn error_trace(mut self, error_trace: bool) -> Self {
270 self.error_trace = Some(error_trace);
271 self
272 }
273 #[doc = "A comma-separated list of filters used to reduce the response."]
274 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
275 self.filter_path = Some(filter_path);
276 self
277 }
278 #[doc = "If true, the connector doc is deleted. If false, connector doc is marked as deleted (soft-deleted)."]
279 pub fn hard(mut self, hard: bool) -> Self {
280 self.hard = Some(hard);
281 self
282 }
283 #[doc = "Adds a HTTP header"]
284 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
285 self.headers.insert(key, value);
286 self
287 }
288 #[doc = "Return human readable values for statistics."]
289 pub fn human(mut self, human: bool) -> Self {
290 self.human = Some(human);
291 self
292 }
293 #[doc = "Pretty format the returned JSON response."]
294 pub fn pretty(mut self, pretty: bool) -> Self {
295 self.pretty = Some(pretty);
296 self
297 }
298 #[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."]
299 pub fn request_timeout(mut self, timeout: Duration) -> Self {
300 self.request_timeout = Some(timeout);
301 self
302 }
303 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
304 pub fn source(mut self, source: &'b str) -> Self {
305 self.source = Some(source);
306 self
307 }
308 #[doc = "Creates an asynchronous call to the Connector Delete API that can be awaited"]
309 pub async fn send(self) -> Result<Response, Error> {
310 let path = self.parts.url();
311 let method = http::Method::Delete;
312 let headers = self.headers;
313 let timeout = self.request_timeout;
314 let query_string = {
315 #[serde_with::skip_serializing_none]
316 #[derive(Serialize)]
317 struct QueryParams<'b> {
318 delete_sync_jobs: Option<bool>,
319 error_trace: Option<bool>,
320 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
321 filter_path: Option<&'b [&'b str]>,
322 hard: Option<bool>,
323 human: Option<bool>,
324 pretty: Option<bool>,
325 source: Option<&'b str>,
326 }
327 let query_params = QueryParams {
328 delete_sync_jobs: self.delete_sync_jobs,
329 error_trace: self.error_trace,
330 filter_path: self.filter_path,
331 hard: self.hard,
332 human: self.human,
333 pretty: self.pretty,
334 source: self.source,
335 };
336 Some(query_params)
337 };
338 let body = Option::<()>::None;
339 let response = self
340 .transport
341 .send(method, &path, headers, query_string.as_ref(), body, timeout)
342 .await?;
343 Ok(response)
344 }
345}
346#[cfg(feature = "experimental-apis")]
347#[derive(Debug, Clone, PartialEq, Eq)]
348#[doc = "API parts for the Connector Get API"]
349pub enum ConnectorGetParts<'b> {
350 #[doc = "ConnectorId"]
351 ConnectorId(&'b str),
352}
353#[cfg(feature = "experimental-apis")]
354impl<'b> ConnectorGetParts<'b> {
355 #[doc = "Builds a relative URL path to the Connector Get API"]
356 pub fn url(self) -> Cow<'static, str> {
357 match self {
358 ConnectorGetParts::ConnectorId(connector_id) => {
359 let encoded_connector_id: Cow<str> =
360 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
361 let mut p = String::with_capacity(12usize + encoded_connector_id.len());
362 p.push_str("/_connector/");
363 p.push_str(encoded_connector_id.as_ref());
364 p.into()
365 }
366 }
367 }
368}
369#[doc = "Builder for the [Connector Get API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/get-connector-api.html)\n\nReturns the details about a connector."]
370#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
371#[cfg(feature = "experimental-apis")]
372#[derive(Clone, Debug)]
373pub struct ConnectorGet<'a, 'b> {
374 transport: &'a Transport,
375 parts: ConnectorGetParts<'b>,
376 error_trace: Option<bool>,
377 filter_path: Option<&'b [&'b str]>,
378 headers: HeaderMap,
379 human: Option<bool>,
380 include_deleted: Option<bool>,
381 pretty: Option<bool>,
382 request_timeout: Option<Duration>,
383 source: Option<&'b str>,
384}
385#[cfg(feature = "experimental-apis")]
386impl<'a, 'b> ConnectorGet<'a, 'b> {
387 #[doc = "Creates a new instance of [ConnectorGet] with the specified API parts"]
388 pub fn new(transport: &'a Transport, parts: ConnectorGetParts<'b>) -> Self {
389 let headers = HeaderMap::new();
390 ConnectorGet {
391 transport,
392 parts,
393 headers,
394 error_trace: None,
395 filter_path: None,
396 human: None,
397 include_deleted: None,
398 pretty: None,
399 request_timeout: None,
400 source: None,
401 }
402 }
403 #[doc = "Include the stack trace of returned errors."]
404 pub fn error_trace(mut self, error_trace: bool) -> Self {
405 self.error_trace = Some(error_trace);
406 self
407 }
408 #[doc = "A comma-separated list of filters used to reduce the response."]
409 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
410 self.filter_path = Some(filter_path);
411 self
412 }
413 #[doc = "Adds a HTTP header"]
414 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
415 self.headers.insert(key, value);
416 self
417 }
418 #[doc = "Return human readable values for statistics."]
419 pub fn human(mut self, human: bool) -> Self {
420 self.human = Some(human);
421 self
422 }
423 #[doc = "A flag indicating whether to return connectors that have been soft-deleted."]
424 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
425 self.include_deleted = Some(include_deleted);
426 self
427 }
428 #[doc = "Pretty format the returned JSON response."]
429 pub fn pretty(mut self, pretty: bool) -> Self {
430 self.pretty = Some(pretty);
431 self
432 }
433 #[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."]
434 pub fn request_timeout(mut self, timeout: Duration) -> Self {
435 self.request_timeout = Some(timeout);
436 self
437 }
438 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
439 pub fn source(mut self, source: &'b str) -> Self {
440 self.source = Some(source);
441 self
442 }
443 #[doc = "Creates an asynchronous call to the Connector Get API that can be awaited"]
444 pub async fn send(self) -> Result<Response, Error> {
445 let path = self.parts.url();
446 let method = http::Method::Get;
447 let headers = self.headers;
448 let timeout = self.request_timeout;
449 let query_string = {
450 #[serde_with::skip_serializing_none]
451 #[derive(Serialize)]
452 struct QueryParams<'b> {
453 error_trace: Option<bool>,
454 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
455 filter_path: Option<&'b [&'b str]>,
456 human: Option<bool>,
457 include_deleted: Option<bool>,
458 pretty: Option<bool>,
459 source: Option<&'b str>,
460 }
461 let query_params = QueryParams {
462 error_trace: self.error_trace,
463 filter_path: self.filter_path,
464 human: self.human,
465 include_deleted: self.include_deleted,
466 pretty: self.pretty,
467 source: self.source,
468 };
469 Some(query_params)
470 };
471 let body = Option::<()>::None;
472 let response = self
473 .transport
474 .send(method, &path, headers, query_string.as_ref(), body, timeout)
475 .await?;
476 Ok(response)
477 }
478}
479#[cfg(feature = "experimental-apis")]
480#[derive(Debug, Clone, PartialEq, Eq)]
481#[doc = "API parts for the Connector Last Sync API"]
482pub enum ConnectorLastSyncParts<'b> {
483 #[doc = "ConnectorId"]
484 ConnectorId(&'b str),
485}
486#[cfg(feature = "experimental-apis")]
487impl<'b> ConnectorLastSyncParts<'b> {
488 #[doc = "Builds a relative URL path to the Connector Last Sync API"]
489 pub fn url(self) -> Cow<'static, str> {
490 match self {
491 ConnectorLastSyncParts::ConnectorId(connector_id) => {
492 let encoded_connector_id: Cow<str> =
493 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
494 let mut p = String::with_capacity(23usize + encoded_connector_id.len());
495 p.push_str("/_connector/");
496 p.push_str(encoded_connector_id.as_ref());
497 p.push_str("/_last_sync");
498 p.into()
499 }
500 }
501 }
502}
503#[doc = "Builder for the [Connector Last Sync API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-last-sync-api.html)\n\nUpdates the stats of last sync in the connector document."]
504#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
505#[cfg(feature = "experimental-apis")]
506#[derive(Clone, Debug)]
507pub struct ConnectorLastSync<'a, 'b, B> {
508 transport: &'a Transport,
509 parts: ConnectorLastSyncParts<'b>,
510 body: Option<B>,
511 error_trace: Option<bool>,
512 filter_path: Option<&'b [&'b str]>,
513 headers: HeaderMap,
514 human: Option<bool>,
515 pretty: Option<bool>,
516 request_timeout: Option<Duration>,
517 source: Option<&'b str>,
518}
519#[cfg(feature = "experimental-apis")]
520impl<'a, 'b, B> ConnectorLastSync<'a, 'b, B>
521where
522 B: Body,
523{
524 #[doc = "Creates a new instance of [ConnectorLastSync] with the specified API parts"]
525 pub fn new(transport: &'a Transport, parts: ConnectorLastSyncParts<'b>) -> Self {
526 let headers = HeaderMap::new();
527 ConnectorLastSync {
528 transport,
529 parts,
530 headers,
531 body: None,
532 error_trace: None,
533 filter_path: None,
534 human: None,
535 pretty: None,
536 request_timeout: None,
537 source: None,
538 }
539 }
540 #[doc = "The body for the API call"]
541 pub fn body<T>(self, body: T) -> ConnectorLastSync<'a, 'b, JsonBody<T>>
542 where
543 T: Serialize,
544 {
545 ConnectorLastSync {
546 transport: self.transport,
547 parts: self.parts,
548 body: Some(body.into()),
549 error_trace: self.error_trace,
550 filter_path: self.filter_path,
551 headers: self.headers,
552 human: self.human,
553 pretty: self.pretty,
554 request_timeout: self.request_timeout,
555 source: self.source,
556 }
557 }
558 #[doc = "Include the stack trace of returned errors."]
559 pub fn error_trace(mut self, error_trace: bool) -> Self {
560 self.error_trace = Some(error_trace);
561 self
562 }
563 #[doc = "A comma-separated list of filters used to reduce the response."]
564 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
565 self.filter_path = Some(filter_path);
566 self
567 }
568 #[doc = "Adds a HTTP header"]
569 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
570 self.headers.insert(key, value);
571 self
572 }
573 #[doc = "Return human readable values for statistics."]
574 pub fn human(mut self, human: bool) -> Self {
575 self.human = Some(human);
576 self
577 }
578 #[doc = "Pretty format the returned JSON response."]
579 pub fn pretty(mut self, pretty: bool) -> Self {
580 self.pretty = Some(pretty);
581 self
582 }
583 #[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."]
584 pub fn request_timeout(mut self, timeout: Duration) -> Self {
585 self.request_timeout = Some(timeout);
586 self
587 }
588 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
589 pub fn source(mut self, source: &'b str) -> Self {
590 self.source = Some(source);
591 self
592 }
593 #[doc = "Creates an asynchronous call to the Connector Last Sync API that can be awaited"]
594 pub async fn send(self) -> Result<Response, Error> {
595 let path = self.parts.url();
596 let method = http::Method::Put;
597 let headers = self.headers;
598 let timeout = self.request_timeout;
599 let query_string = {
600 #[serde_with::skip_serializing_none]
601 #[derive(Serialize)]
602 struct QueryParams<'b> {
603 error_trace: Option<bool>,
604 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
605 filter_path: Option<&'b [&'b str]>,
606 human: Option<bool>,
607 pretty: Option<bool>,
608 source: Option<&'b str>,
609 }
610 let query_params = QueryParams {
611 error_trace: self.error_trace,
612 filter_path: self.filter_path,
613 human: self.human,
614 pretty: self.pretty,
615 source: self.source,
616 };
617 Some(query_params)
618 };
619 let body = self.body;
620 let response = self
621 .transport
622 .send(method, &path, headers, query_string.as_ref(), body, timeout)
623 .await?;
624 Ok(response)
625 }
626}
627#[cfg(feature = "experimental-apis")]
628#[derive(Debug, Clone, PartialEq, Eq)]
629#[doc = "API parts for the Connector List API"]
630pub enum ConnectorListParts {
631 #[doc = "No parts"]
632 None,
633}
634#[cfg(feature = "experimental-apis")]
635impl ConnectorListParts {
636 #[doc = "Builds a relative URL path to the Connector List API"]
637 pub fn url(self) -> Cow<'static, str> {
638 match self {
639 ConnectorListParts::None => "/_connector".into(),
640 }
641 }
642}
643#[doc = "Builder for the [Connector List API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/list-connector-api.html)\n\nLists all connectors."]
644#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
645#[cfg(feature = "experimental-apis")]
646#[derive(Clone, Debug)]
647pub struct ConnectorList<'a, 'b> {
648 transport: &'a Transport,
649 parts: ConnectorListParts,
650 connector_name: Option<&'b [&'b str]>,
651 error_trace: Option<bool>,
652 filter_path: Option<&'b [&'b str]>,
653 from: Option<i32>,
654 headers: HeaderMap,
655 human: Option<bool>,
656 include_deleted: Option<bool>,
657 index_name: Option<&'b [&'b str]>,
658 pretty: Option<bool>,
659 query: Option<&'b str>,
660 request_timeout: Option<Duration>,
661 service_type: Option<&'b [&'b str]>,
662 size: Option<i32>,
663 source: Option<&'b str>,
664}
665#[cfg(feature = "experimental-apis")]
666impl<'a, 'b> ConnectorList<'a, 'b> {
667 #[doc = "Creates a new instance of [ConnectorList]"]
668 pub fn new(transport: &'a Transport) -> Self {
669 let headers = HeaderMap::new();
670 ConnectorList {
671 transport,
672 parts: ConnectorListParts::None,
673 headers,
674 connector_name: None,
675 error_trace: None,
676 filter_path: None,
677 from: None,
678 human: None,
679 include_deleted: None,
680 index_name: None,
681 pretty: None,
682 query: None,
683 request_timeout: None,
684 service_type: None,
685 size: None,
686 source: None,
687 }
688 }
689 #[doc = "A comma-separated list of connector names to fetch connector documents for"]
690 pub fn connector_name(mut self, connector_name: &'b [&'b str]) -> Self {
691 self.connector_name = Some(connector_name);
692 self
693 }
694 #[doc = "Include the stack trace of returned errors."]
695 pub fn error_trace(mut self, error_trace: bool) -> Self {
696 self.error_trace = Some(error_trace);
697 self
698 }
699 #[doc = "A comma-separated list of filters used to reduce the response."]
700 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
701 self.filter_path = Some(filter_path);
702 self
703 }
704 #[doc = "Starting offset (default: 0)"]
705 pub fn from(mut self, from: i32) -> Self {
706 self.from = Some(from);
707 self
708 }
709 #[doc = "Adds a HTTP header"]
710 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
711 self.headers.insert(key, value);
712 self
713 }
714 #[doc = "Return human readable values for statistics."]
715 pub fn human(mut self, human: bool) -> Self {
716 self.human = Some(human);
717 self
718 }
719 #[doc = "A flag indicating whether to return connectors that have been soft-deleted."]
720 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
721 self.include_deleted = Some(include_deleted);
722 self
723 }
724 #[doc = "A comma-separated list of connector index names to fetch connector documents for"]
725 pub fn index_name(mut self, index_name: &'b [&'b str]) -> Self {
726 self.index_name = Some(index_name);
727 self
728 }
729 #[doc = "Pretty format the returned JSON response."]
730 pub fn pretty(mut self, pretty: bool) -> Self {
731 self.pretty = Some(pretty);
732 self
733 }
734 #[doc = "A search string for querying connectors, filtering results by matching against connector names, descriptions, and index names"]
735 pub fn query(mut self, query: &'b str) -> Self {
736 self.query = Some(query);
737 self
738 }
739 #[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."]
740 pub fn request_timeout(mut self, timeout: Duration) -> Self {
741 self.request_timeout = Some(timeout);
742 self
743 }
744 #[doc = "A comma-separated list of connector service types to fetch connector documents for"]
745 pub fn service_type(mut self, service_type: &'b [&'b str]) -> Self {
746 self.service_type = Some(service_type);
747 self
748 }
749 #[doc = "Specifies a max number of results to get (default: 100)"]
750 pub fn size(mut self, size: i32) -> Self {
751 self.size = Some(size);
752 self
753 }
754 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
755 pub fn source(mut self, source: &'b str) -> Self {
756 self.source = Some(source);
757 self
758 }
759 #[doc = "Creates an asynchronous call to the Connector List API that can be awaited"]
760 pub async fn send(self) -> Result<Response, Error> {
761 let path = self.parts.url();
762 let method = http::Method::Get;
763 let headers = self.headers;
764 let timeout = self.request_timeout;
765 let query_string = {
766 #[serde_with::skip_serializing_none]
767 #[derive(Serialize)]
768 struct QueryParams<'b> {
769 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
770 connector_name: Option<&'b [&'b str]>,
771 error_trace: Option<bool>,
772 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
773 filter_path: Option<&'b [&'b str]>,
774 from: Option<i32>,
775 human: Option<bool>,
776 include_deleted: Option<bool>,
777 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
778 index_name: Option<&'b [&'b str]>,
779 pretty: Option<bool>,
780 query: Option<&'b str>,
781 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
782 service_type: Option<&'b [&'b str]>,
783 size: Option<i32>,
784 source: Option<&'b str>,
785 }
786 let query_params = QueryParams {
787 connector_name: self.connector_name,
788 error_trace: self.error_trace,
789 filter_path: self.filter_path,
790 from: self.from,
791 human: self.human,
792 include_deleted: self.include_deleted,
793 index_name: self.index_name,
794 pretty: self.pretty,
795 query: self.query,
796 service_type: self.service_type,
797 size: self.size,
798 source: self.source,
799 };
800 Some(query_params)
801 };
802 let body = Option::<()>::None;
803 let response = self
804 .transport
805 .send(method, &path, headers, query_string.as_ref(), body, timeout)
806 .await?;
807 Ok(response)
808 }
809}
810#[cfg(feature = "experimental-apis")]
811#[derive(Debug, Clone, PartialEq, Eq)]
812#[doc = "API parts for the Connector Post API"]
813pub enum ConnectorPostParts {
814 #[doc = "No parts"]
815 None,
816}
817#[cfg(feature = "experimental-apis")]
818impl ConnectorPostParts {
819 #[doc = "Builds a relative URL path to the Connector Post API"]
820 pub fn url(self) -> Cow<'static, str> {
821 match self {
822 ConnectorPostParts::None => "/_connector".into(),
823 }
824 }
825}
826#[doc = "Builder for the [Connector Post API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/create-connector-api.html)\n\nCreates a connector."]
827#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
828#[cfg(feature = "experimental-apis")]
829#[derive(Clone, Debug)]
830pub struct ConnectorPost<'a, 'b, B> {
831 transport: &'a Transport,
832 parts: ConnectorPostParts,
833 body: Option<B>,
834 error_trace: Option<bool>,
835 filter_path: Option<&'b [&'b str]>,
836 headers: HeaderMap,
837 human: Option<bool>,
838 pretty: Option<bool>,
839 request_timeout: Option<Duration>,
840 source: Option<&'b str>,
841}
842#[cfg(feature = "experimental-apis")]
843impl<'a, 'b, B> ConnectorPost<'a, 'b, B>
844where
845 B: Body,
846{
847 #[doc = "Creates a new instance of [ConnectorPost]"]
848 pub fn new(transport: &'a Transport) -> Self {
849 let headers = HeaderMap::new();
850 ConnectorPost {
851 transport,
852 parts: ConnectorPostParts::None,
853 headers,
854 body: None,
855 error_trace: None,
856 filter_path: None,
857 human: None,
858 pretty: None,
859 request_timeout: None,
860 source: None,
861 }
862 }
863 #[doc = "The body for the API call"]
864 pub fn body<T>(self, body: T) -> ConnectorPost<'a, 'b, JsonBody<T>>
865 where
866 T: Serialize,
867 {
868 ConnectorPost {
869 transport: self.transport,
870 parts: self.parts,
871 body: Some(body.into()),
872 error_trace: self.error_trace,
873 filter_path: self.filter_path,
874 headers: self.headers,
875 human: self.human,
876 pretty: self.pretty,
877 request_timeout: self.request_timeout,
878 source: self.source,
879 }
880 }
881 #[doc = "Include the stack trace of returned errors."]
882 pub fn error_trace(mut self, error_trace: bool) -> Self {
883 self.error_trace = Some(error_trace);
884 self
885 }
886 #[doc = "A comma-separated list of filters used to reduce the response."]
887 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
888 self.filter_path = Some(filter_path);
889 self
890 }
891 #[doc = "Adds a HTTP header"]
892 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
893 self.headers.insert(key, value);
894 self
895 }
896 #[doc = "Return human readable values for statistics."]
897 pub fn human(mut self, human: bool) -> Self {
898 self.human = Some(human);
899 self
900 }
901 #[doc = "Pretty format the returned JSON response."]
902 pub fn pretty(mut self, pretty: bool) -> Self {
903 self.pretty = Some(pretty);
904 self
905 }
906 #[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."]
907 pub fn request_timeout(mut self, timeout: Duration) -> Self {
908 self.request_timeout = Some(timeout);
909 self
910 }
911 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
912 pub fn source(mut self, source: &'b str) -> Self {
913 self.source = Some(source);
914 self
915 }
916 #[doc = "Creates an asynchronous call to the Connector Post API that can be awaited"]
917 pub async fn send(self) -> Result<Response, Error> {
918 let path = self.parts.url();
919 let method = http::Method::Post;
920 let headers = self.headers;
921 let timeout = self.request_timeout;
922 let query_string = {
923 #[serde_with::skip_serializing_none]
924 #[derive(Serialize)]
925 struct QueryParams<'b> {
926 error_trace: Option<bool>,
927 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
928 filter_path: Option<&'b [&'b str]>,
929 human: Option<bool>,
930 pretty: Option<bool>,
931 source: Option<&'b str>,
932 }
933 let query_params = QueryParams {
934 error_trace: self.error_trace,
935 filter_path: self.filter_path,
936 human: self.human,
937 pretty: self.pretty,
938 source: self.source,
939 };
940 Some(query_params)
941 };
942 let body = self.body;
943 let response = self
944 .transport
945 .send(method, &path, headers, query_string.as_ref(), body, timeout)
946 .await?;
947 Ok(response)
948 }
949}
950#[cfg(feature = "experimental-apis")]
951#[derive(Debug, Clone, PartialEq, Eq)]
952#[doc = "API parts for the Connector Put API"]
953pub enum ConnectorPutParts<'b> {
954 #[doc = "ConnectorId"]
955 ConnectorId(&'b str),
956 #[doc = "No parts"]
957 None,
958}
959#[cfg(feature = "experimental-apis")]
960impl<'b> ConnectorPutParts<'b> {
961 #[doc = "Builds a relative URL path to the Connector Put API"]
962 pub fn url(self) -> Cow<'static, str> {
963 match self {
964 ConnectorPutParts::ConnectorId(connector_id) => {
965 let encoded_connector_id: Cow<str> =
966 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
967 let mut p = String::with_capacity(12usize + encoded_connector_id.len());
968 p.push_str("/_connector/");
969 p.push_str(encoded_connector_id.as_ref());
970 p.into()
971 }
972 ConnectorPutParts::None => "/_connector".into(),
973 }
974 }
975}
976#[doc = "Builder for the [Connector Put API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/create-connector-api.html)\n\nCreates or updates a connector."]
977#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
978#[cfg(feature = "experimental-apis")]
979#[derive(Clone, Debug)]
980pub struct ConnectorPut<'a, 'b, B> {
981 transport: &'a Transport,
982 parts: ConnectorPutParts<'b>,
983 body: Option<B>,
984 error_trace: Option<bool>,
985 filter_path: Option<&'b [&'b str]>,
986 headers: HeaderMap,
987 human: Option<bool>,
988 pretty: Option<bool>,
989 request_timeout: Option<Duration>,
990 source: Option<&'b str>,
991}
992#[cfg(feature = "experimental-apis")]
993impl<'a, 'b, B> ConnectorPut<'a, 'b, B>
994where
995 B: Body,
996{
997 #[doc = "Creates a new instance of [ConnectorPut] with the specified API parts"]
998 pub fn new(transport: &'a Transport, parts: ConnectorPutParts<'b>) -> Self {
999 let headers = HeaderMap::new();
1000 ConnectorPut {
1001 transport,
1002 parts,
1003 headers,
1004 body: None,
1005 error_trace: None,
1006 filter_path: None,
1007 human: None,
1008 pretty: None,
1009 request_timeout: None,
1010 source: None,
1011 }
1012 }
1013 #[doc = "The body for the API call"]
1014 pub fn body<T>(self, body: T) -> ConnectorPut<'a, 'b, JsonBody<T>>
1015 where
1016 T: Serialize,
1017 {
1018 ConnectorPut {
1019 transport: self.transport,
1020 parts: self.parts,
1021 body: Some(body.into()),
1022 error_trace: self.error_trace,
1023 filter_path: self.filter_path,
1024 headers: self.headers,
1025 human: self.human,
1026 pretty: self.pretty,
1027 request_timeout: self.request_timeout,
1028 source: self.source,
1029 }
1030 }
1031 #[doc = "Include the stack trace of returned errors."]
1032 pub fn error_trace(mut self, error_trace: bool) -> Self {
1033 self.error_trace = Some(error_trace);
1034 self
1035 }
1036 #[doc = "A comma-separated list of filters used to reduce the response."]
1037 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1038 self.filter_path = Some(filter_path);
1039 self
1040 }
1041 #[doc = "Adds a HTTP header"]
1042 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1043 self.headers.insert(key, value);
1044 self
1045 }
1046 #[doc = "Return human readable values for statistics."]
1047 pub fn human(mut self, human: bool) -> Self {
1048 self.human = Some(human);
1049 self
1050 }
1051 #[doc = "Pretty format the returned JSON response."]
1052 pub fn pretty(mut self, pretty: bool) -> Self {
1053 self.pretty = Some(pretty);
1054 self
1055 }
1056 #[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."]
1057 pub fn request_timeout(mut self, timeout: Duration) -> Self {
1058 self.request_timeout = Some(timeout);
1059 self
1060 }
1061 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1062 pub fn source(mut self, source: &'b str) -> Self {
1063 self.source = Some(source);
1064 self
1065 }
1066 #[doc = "Creates an asynchronous call to the Connector Put API that can be awaited"]
1067 pub async fn send(self) -> Result<Response, Error> {
1068 let path = self.parts.url();
1069 let method = http::Method::Put;
1070 let headers = self.headers;
1071 let timeout = self.request_timeout;
1072 let query_string = {
1073 #[serde_with::skip_serializing_none]
1074 #[derive(Serialize)]
1075 struct QueryParams<'b> {
1076 error_trace: Option<bool>,
1077 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1078 filter_path: Option<&'b [&'b str]>,
1079 human: Option<bool>,
1080 pretty: Option<bool>,
1081 source: Option<&'b str>,
1082 }
1083 let query_params = QueryParams {
1084 error_trace: self.error_trace,
1085 filter_path: self.filter_path,
1086 human: self.human,
1087 pretty: self.pretty,
1088 source: self.source,
1089 };
1090 Some(query_params)
1091 };
1092 let body = self.body;
1093 let response = self
1094 .transport
1095 .send(method, &path, headers, query_string.as_ref(), body, timeout)
1096 .await?;
1097 Ok(response)
1098 }
1099}
1100#[cfg(feature = "experimental-apis")]
1101#[derive(Debug, Clone, PartialEq, Eq)]
1102#[doc = "API parts for the Connector Secret Delete API"]
1103pub enum ConnectorSecretDeleteParts<'b> {
1104 #[doc = "Id"]
1105 Id(&'b str),
1106}
1107#[cfg(feature = "experimental-apis")]
1108impl<'b> ConnectorSecretDeleteParts<'b> {
1109 #[doc = "Builds a relative URL path to the Connector Secret Delete API"]
1110 pub fn url(self) -> Cow<'static, str> {
1111 match self {
1112 ConnectorSecretDeleteParts::Id(id) => {
1113 let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
1114 let mut p = String::with_capacity(20usize + encoded_id.len());
1115 p.push_str("/_connector/_secret/");
1116 p.push_str(encoded_id.as_ref());
1117 p.into()
1118 }
1119 }
1120 }
1121}
1122#[doc = "Builder for the Connector Secret Delete API\n\nDeletes a connector secret."]
1123#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
1124#[cfg(feature = "experimental-apis")]
1125#[derive(Clone, Debug)]
1126pub struct ConnectorSecretDelete<'a, 'b> {
1127 transport: &'a Transport,
1128 parts: ConnectorSecretDeleteParts<'b>,
1129 error_trace: Option<bool>,
1130 filter_path: Option<&'b [&'b str]>,
1131 headers: HeaderMap,
1132 human: Option<bool>,
1133 pretty: Option<bool>,
1134 request_timeout: Option<Duration>,
1135 source: Option<&'b str>,
1136}
1137#[cfg(feature = "experimental-apis")]
1138impl<'a, 'b> ConnectorSecretDelete<'a, 'b> {
1139 #[doc = "Creates a new instance of [ConnectorSecretDelete] with the specified API parts"]
1140 pub fn new(transport: &'a Transport, parts: ConnectorSecretDeleteParts<'b>) -> Self {
1141 let headers = HeaderMap::new();
1142 ConnectorSecretDelete {
1143 transport,
1144 parts,
1145 headers,
1146 error_trace: None,
1147 filter_path: None,
1148 human: None,
1149 pretty: None,
1150 request_timeout: None,
1151 source: None,
1152 }
1153 }
1154 #[doc = "Include the stack trace of returned errors."]
1155 pub fn error_trace(mut self, error_trace: bool) -> Self {
1156 self.error_trace = Some(error_trace);
1157 self
1158 }
1159 #[doc = "A comma-separated list of filters used to reduce the response."]
1160 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1161 self.filter_path = Some(filter_path);
1162 self
1163 }
1164 #[doc = "Adds a HTTP header"]
1165 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1166 self.headers.insert(key, value);
1167 self
1168 }
1169 #[doc = "Return human readable values for statistics."]
1170 pub fn human(mut self, human: bool) -> Self {
1171 self.human = Some(human);
1172 self
1173 }
1174 #[doc = "Pretty format the returned JSON response."]
1175 pub fn pretty(mut self, pretty: bool) -> Self {
1176 self.pretty = Some(pretty);
1177 self
1178 }
1179 #[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."]
1180 pub fn request_timeout(mut self, timeout: Duration) -> Self {
1181 self.request_timeout = Some(timeout);
1182 self
1183 }
1184 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1185 pub fn source(mut self, source: &'b str) -> Self {
1186 self.source = Some(source);
1187 self
1188 }
1189 #[doc = "Creates an asynchronous call to the Connector Secret Delete API that can be awaited"]
1190 pub async fn send(self) -> Result<Response, Error> {
1191 let path = self.parts.url();
1192 let method = http::Method::Delete;
1193 let headers = self.headers;
1194 let timeout = self.request_timeout;
1195 let query_string = {
1196 #[serde_with::skip_serializing_none]
1197 #[derive(Serialize)]
1198 struct QueryParams<'b> {
1199 error_trace: Option<bool>,
1200 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1201 filter_path: Option<&'b [&'b str]>,
1202 human: Option<bool>,
1203 pretty: Option<bool>,
1204 source: Option<&'b str>,
1205 }
1206 let query_params = QueryParams {
1207 error_trace: self.error_trace,
1208 filter_path: self.filter_path,
1209 human: self.human,
1210 pretty: self.pretty,
1211 source: self.source,
1212 };
1213 Some(query_params)
1214 };
1215 let body = Option::<()>::None;
1216 let response = self
1217 .transport
1218 .send(method, &path, headers, query_string.as_ref(), body, timeout)
1219 .await?;
1220 Ok(response)
1221 }
1222}
1223#[cfg(feature = "experimental-apis")]
1224#[derive(Debug, Clone, PartialEq, Eq)]
1225#[doc = "API parts for the Connector Secret Get API"]
1226pub enum ConnectorSecretGetParts<'b> {
1227 #[doc = "Id"]
1228 Id(&'b str),
1229}
1230#[cfg(feature = "experimental-apis")]
1231impl<'b> ConnectorSecretGetParts<'b> {
1232 #[doc = "Builds a relative URL path to the Connector Secret Get API"]
1233 pub fn url(self) -> Cow<'static, str> {
1234 match self {
1235 ConnectorSecretGetParts::Id(id) => {
1236 let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
1237 let mut p = String::with_capacity(20usize + encoded_id.len());
1238 p.push_str("/_connector/_secret/");
1239 p.push_str(encoded_id.as_ref());
1240 p.into()
1241 }
1242 }
1243 }
1244}
1245#[doc = "Builder for the Connector Secret Get API\n\nRetrieves a secret stored by Connectors."]
1246#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
1247#[cfg(feature = "experimental-apis")]
1248#[derive(Clone, Debug)]
1249pub struct ConnectorSecretGet<'a, 'b> {
1250 transport: &'a Transport,
1251 parts: ConnectorSecretGetParts<'b>,
1252 error_trace: Option<bool>,
1253 filter_path: Option<&'b [&'b str]>,
1254 headers: HeaderMap,
1255 human: Option<bool>,
1256 pretty: Option<bool>,
1257 request_timeout: Option<Duration>,
1258 source: Option<&'b str>,
1259}
1260#[cfg(feature = "experimental-apis")]
1261impl<'a, 'b> ConnectorSecretGet<'a, 'b> {
1262 #[doc = "Creates a new instance of [ConnectorSecretGet] with the specified API parts"]
1263 pub fn new(transport: &'a Transport, parts: ConnectorSecretGetParts<'b>) -> Self {
1264 let headers = HeaderMap::new();
1265 ConnectorSecretGet {
1266 transport,
1267 parts,
1268 headers,
1269 error_trace: None,
1270 filter_path: None,
1271 human: None,
1272 pretty: None,
1273 request_timeout: None,
1274 source: None,
1275 }
1276 }
1277 #[doc = "Include the stack trace of returned errors."]
1278 pub fn error_trace(mut self, error_trace: bool) -> Self {
1279 self.error_trace = Some(error_trace);
1280 self
1281 }
1282 #[doc = "A comma-separated list of filters used to reduce the response."]
1283 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1284 self.filter_path = Some(filter_path);
1285 self
1286 }
1287 #[doc = "Adds a HTTP header"]
1288 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1289 self.headers.insert(key, value);
1290 self
1291 }
1292 #[doc = "Return human readable values for statistics."]
1293 pub fn human(mut self, human: bool) -> Self {
1294 self.human = Some(human);
1295 self
1296 }
1297 #[doc = "Pretty format the returned JSON response."]
1298 pub fn pretty(mut self, pretty: bool) -> Self {
1299 self.pretty = Some(pretty);
1300 self
1301 }
1302 #[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."]
1303 pub fn request_timeout(mut self, timeout: Duration) -> Self {
1304 self.request_timeout = Some(timeout);
1305 self
1306 }
1307 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1308 pub fn source(mut self, source: &'b str) -> Self {
1309 self.source = Some(source);
1310 self
1311 }
1312 #[doc = "Creates an asynchronous call to the Connector Secret Get API that can be awaited"]
1313 pub async fn send(self) -> Result<Response, Error> {
1314 let path = self.parts.url();
1315 let method = http::Method::Get;
1316 let headers = self.headers;
1317 let timeout = self.request_timeout;
1318 let query_string = {
1319 #[serde_with::skip_serializing_none]
1320 #[derive(Serialize)]
1321 struct QueryParams<'b> {
1322 error_trace: Option<bool>,
1323 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1324 filter_path: Option<&'b [&'b str]>,
1325 human: Option<bool>,
1326 pretty: Option<bool>,
1327 source: Option<&'b str>,
1328 }
1329 let query_params = QueryParams {
1330 error_trace: self.error_trace,
1331 filter_path: self.filter_path,
1332 human: self.human,
1333 pretty: self.pretty,
1334 source: self.source,
1335 };
1336 Some(query_params)
1337 };
1338 let body = Option::<()>::None;
1339 let response = self
1340 .transport
1341 .send(method, &path, headers, query_string.as_ref(), body, timeout)
1342 .await?;
1343 Ok(response)
1344 }
1345}
1346#[cfg(feature = "experimental-apis")]
1347#[derive(Debug, Clone, PartialEq, Eq)]
1348#[doc = "API parts for the Connector Secret Post API"]
1349pub enum ConnectorSecretPostParts {
1350 #[doc = "No parts"]
1351 None,
1352}
1353#[cfg(feature = "experimental-apis")]
1354impl ConnectorSecretPostParts {
1355 #[doc = "Builds a relative URL path to the Connector Secret Post API"]
1356 pub fn url(self) -> Cow<'static, str> {
1357 match self {
1358 ConnectorSecretPostParts::None => "/_connector/_secret".into(),
1359 }
1360 }
1361}
1362#[doc = "Builder for the Connector Secret Post API\n\nCreates a secret for a Connector."]
1363#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
1364#[cfg(feature = "experimental-apis")]
1365#[derive(Clone, Debug)]
1366pub struct ConnectorSecretPost<'a, 'b, B> {
1367 transport: &'a Transport,
1368 parts: ConnectorSecretPostParts,
1369 body: Option<B>,
1370 error_trace: Option<bool>,
1371 filter_path: Option<&'b [&'b str]>,
1372 headers: HeaderMap,
1373 human: Option<bool>,
1374 pretty: Option<bool>,
1375 request_timeout: Option<Duration>,
1376 source: Option<&'b str>,
1377}
1378#[cfg(feature = "experimental-apis")]
1379impl<'a, 'b, B> ConnectorSecretPost<'a, 'b, B>
1380where
1381 B: Body,
1382{
1383 #[doc = "Creates a new instance of [ConnectorSecretPost]"]
1384 pub fn new(transport: &'a Transport) -> Self {
1385 let headers = HeaderMap::new();
1386 ConnectorSecretPost {
1387 transport,
1388 parts: ConnectorSecretPostParts::None,
1389 headers,
1390 body: None,
1391 error_trace: None,
1392 filter_path: None,
1393 human: None,
1394 pretty: None,
1395 request_timeout: None,
1396 source: None,
1397 }
1398 }
1399 #[doc = "The body for the API call"]
1400 pub fn body<T>(self, body: T) -> ConnectorSecretPost<'a, 'b, JsonBody<T>>
1401 where
1402 T: Serialize,
1403 {
1404 ConnectorSecretPost {
1405 transport: self.transport,
1406 parts: self.parts,
1407 body: Some(body.into()),
1408 error_trace: self.error_trace,
1409 filter_path: self.filter_path,
1410 headers: self.headers,
1411 human: self.human,
1412 pretty: self.pretty,
1413 request_timeout: self.request_timeout,
1414 source: self.source,
1415 }
1416 }
1417 #[doc = "Include the stack trace of returned errors."]
1418 pub fn error_trace(mut self, error_trace: bool) -> Self {
1419 self.error_trace = Some(error_trace);
1420 self
1421 }
1422 #[doc = "A comma-separated list of filters used to reduce the response."]
1423 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1424 self.filter_path = Some(filter_path);
1425 self
1426 }
1427 #[doc = "Adds a HTTP header"]
1428 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1429 self.headers.insert(key, value);
1430 self
1431 }
1432 #[doc = "Return human readable values for statistics."]
1433 pub fn human(mut self, human: bool) -> Self {
1434 self.human = Some(human);
1435 self
1436 }
1437 #[doc = "Pretty format the returned JSON response."]
1438 pub fn pretty(mut self, pretty: bool) -> Self {
1439 self.pretty = Some(pretty);
1440 self
1441 }
1442 #[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."]
1443 pub fn request_timeout(mut self, timeout: Duration) -> Self {
1444 self.request_timeout = Some(timeout);
1445 self
1446 }
1447 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1448 pub fn source(mut self, source: &'b str) -> Self {
1449 self.source = Some(source);
1450 self
1451 }
1452 #[doc = "Creates an asynchronous call to the Connector Secret Post API that can be awaited"]
1453 pub async fn send(self) -> Result<Response, Error> {
1454 let path = self.parts.url();
1455 let method = http::Method::Post;
1456 let headers = self.headers;
1457 let timeout = self.request_timeout;
1458 let query_string = {
1459 #[serde_with::skip_serializing_none]
1460 #[derive(Serialize)]
1461 struct QueryParams<'b> {
1462 error_trace: Option<bool>,
1463 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1464 filter_path: Option<&'b [&'b str]>,
1465 human: Option<bool>,
1466 pretty: Option<bool>,
1467 source: Option<&'b str>,
1468 }
1469 let query_params = QueryParams {
1470 error_trace: self.error_trace,
1471 filter_path: self.filter_path,
1472 human: self.human,
1473 pretty: self.pretty,
1474 source: self.source,
1475 };
1476 Some(query_params)
1477 };
1478 let body = self.body;
1479 let response = self
1480 .transport
1481 .send(method, &path, headers, query_string.as_ref(), body, timeout)
1482 .await?;
1483 Ok(response)
1484 }
1485}
1486#[cfg(feature = "experimental-apis")]
1487#[derive(Debug, Clone, PartialEq, Eq)]
1488#[doc = "API parts for the Connector Secret Put API"]
1489pub enum ConnectorSecretPutParts<'b> {
1490 #[doc = "Id"]
1491 Id(&'b str),
1492}
1493#[cfg(feature = "experimental-apis")]
1494impl<'b> ConnectorSecretPutParts<'b> {
1495 #[doc = "Builds a relative URL path to the Connector Secret Put API"]
1496 pub fn url(self) -> Cow<'static, str> {
1497 match self {
1498 ConnectorSecretPutParts::Id(id) => {
1499 let encoded_id: Cow<str> = percent_encode(id.as_bytes(), PARTS_ENCODED).into();
1500 let mut p = String::with_capacity(20usize + encoded_id.len());
1501 p.push_str("/_connector/_secret/");
1502 p.push_str(encoded_id.as_ref());
1503 p.into()
1504 }
1505 }
1506 }
1507}
1508#[doc = "Builder for the Connector Secret Put API\n\nCreates or updates a secret for a Connector."]
1509#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
1510#[cfg(feature = "experimental-apis")]
1511#[derive(Clone, Debug)]
1512pub struct ConnectorSecretPut<'a, 'b, B> {
1513 transport: &'a Transport,
1514 parts: ConnectorSecretPutParts<'b>,
1515 body: Option<B>,
1516 error_trace: Option<bool>,
1517 filter_path: Option<&'b [&'b str]>,
1518 headers: HeaderMap,
1519 human: Option<bool>,
1520 pretty: Option<bool>,
1521 request_timeout: Option<Duration>,
1522 source: Option<&'b str>,
1523}
1524#[cfg(feature = "experimental-apis")]
1525impl<'a, 'b, B> ConnectorSecretPut<'a, 'b, B>
1526where
1527 B: Body,
1528{
1529 #[doc = "Creates a new instance of [ConnectorSecretPut] with the specified API parts"]
1530 pub fn new(transport: &'a Transport, parts: ConnectorSecretPutParts<'b>) -> Self {
1531 let headers = HeaderMap::new();
1532 ConnectorSecretPut {
1533 transport,
1534 parts,
1535 headers,
1536 body: None,
1537 error_trace: None,
1538 filter_path: None,
1539 human: None,
1540 pretty: None,
1541 request_timeout: None,
1542 source: None,
1543 }
1544 }
1545 #[doc = "The body for the API call"]
1546 pub fn body<T>(self, body: T) -> ConnectorSecretPut<'a, 'b, JsonBody<T>>
1547 where
1548 T: Serialize,
1549 {
1550 ConnectorSecretPut {
1551 transport: self.transport,
1552 parts: self.parts,
1553 body: Some(body.into()),
1554 error_trace: self.error_trace,
1555 filter_path: self.filter_path,
1556 headers: self.headers,
1557 human: self.human,
1558 pretty: self.pretty,
1559 request_timeout: self.request_timeout,
1560 source: self.source,
1561 }
1562 }
1563 #[doc = "Include the stack trace of returned errors."]
1564 pub fn error_trace(mut self, error_trace: bool) -> Self {
1565 self.error_trace = Some(error_trace);
1566 self
1567 }
1568 #[doc = "A comma-separated list of filters used to reduce the response."]
1569 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1570 self.filter_path = Some(filter_path);
1571 self
1572 }
1573 #[doc = "Adds a HTTP header"]
1574 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1575 self.headers.insert(key, value);
1576 self
1577 }
1578 #[doc = "Return human readable values for statistics."]
1579 pub fn human(mut self, human: bool) -> Self {
1580 self.human = Some(human);
1581 self
1582 }
1583 #[doc = "Pretty format the returned JSON response."]
1584 pub fn pretty(mut self, pretty: bool) -> Self {
1585 self.pretty = Some(pretty);
1586 self
1587 }
1588 #[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."]
1589 pub fn request_timeout(mut self, timeout: Duration) -> Self {
1590 self.request_timeout = Some(timeout);
1591 self
1592 }
1593 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1594 pub fn source(mut self, source: &'b str) -> Self {
1595 self.source = Some(source);
1596 self
1597 }
1598 #[doc = "Creates an asynchronous call to the Connector Secret Put API that can be awaited"]
1599 pub async fn send(self) -> Result<Response, Error> {
1600 let path = self.parts.url();
1601 let method = http::Method::Put;
1602 let headers = self.headers;
1603 let timeout = self.request_timeout;
1604 let query_string = {
1605 #[serde_with::skip_serializing_none]
1606 #[derive(Serialize)]
1607 struct QueryParams<'b> {
1608 error_trace: Option<bool>,
1609 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1610 filter_path: Option<&'b [&'b str]>,
1611 human: Option<bool>,
1612 pretty: Option<bool>,
1613 source: Option<&'b str>,
1614 }
1615 let query_params = QueryParams {
1616 error_trace: self.error_trace,
1617 filter_path: self.filter_path,
1618 human: self.human,
1619 pretty: self.pretty,
1620 source: self.source,
1621 };
1622 Some(query_params)
1623 };
1624 let body = self.body;
1625 let response = self
1626 .transport
1627 .send(method, &path, headers, query_string.as_ref(), body, timeout)
1628 .await?;
1629 Ok(response)
1630 }
1631}
1632#[cfg(feature = "experimental-apis")]
1633#[derive(Debug, Clone, PartialEq, Eq)]
1634#[doc = "API parts for the Connector Sync Job Cancel API"]
1635pub enum ConnectorSyncJobCancelParts<'b> {
1636 #[doc = "ConnectorSyncJobId"]
1637 ConnectorSyncJobId(&'b str),
1638}
1639#[cfg(feature = "experimental-apis")]
1640impl<'b> ConnectorSyncJobCancelParts<'b> {
1641 #[doc = "Builds a relative URL path to the Connector Sync Job Cancel API"]
1642 pub fn url(self) -> Cow<'static, str> {
1643 match self {
1644 ConnectorSyncJobCancelParts::ConnectorSyncJobId(connector_sync_job_id) => {
1645 let encoded_connector_sync_job_id: Cow<str> =
1646 percent_encode(connector_sync_job_id.as_bytes(), PARTS_ENCODED).into();
1647 let mut p = String::with_capacity(30usize + encoded_connector_sync_job_id.len());
1648 p.push_str("/_connector/_sync_job/");
1649 p.push_str(encoded_connector_sync_job_id.as_ref());
1650 p.push_str("/_cancel");
1651 p.into()
1652 }
1653 }
1654 }
1655}
1656#[doc = "Builder for the [Connector Sync Job Cancel API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/cancel-connector-sync-job-api.html)\n\nCancels a connector sync job."]
1657#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
1658#[cfg(feature = "experimental-apis")]
1659#[derive(Clone, Debug)]
1660pub struct ConnectorSyncJobCancel<'a, 'b, B> {
1661 transport: &'a Transport,
1662 parts: ConnectorSyncJobCancelParts<'b>,
1663 body: Option<B>,
1664 error_trace: Option<bool>,
1665 filter_path: Option<&'b [&'b str]>,
1666 headers: HeaderMap,
1667 human: Option<bool>,
1668 pretty: Option<bool>,
1669 request_timeout: Option<Duration>,
1670 source: Option<&'b str>,
1671}
1672#[cfg(feature = "experimental-apis")]
1673impl<'a, 'b, B> ConnectorSyncJobCancel<'a, 'b, B>
1674where
1675 B: Body,
1676{
1677 #[doc = "Creates a new instance of [ConnectorSyncJobCancel] with the specified API parts"]
1678 pub fn new(transport: &'a Transport, parts: ConnectorSyncJobCancelParts<'b>) -> Self {
1679 let headers = HeaderMap::new();
1680 ConnectorSyncJobCancel {
1681 transport,
1682 parts,
1683 headers,
1684 body: None,
1685 error_trace: None,
1686 filter_path: None,
1687 human: None,
1688 pretty: None,
1689 request_timeout: None,
1690 source: None,
1691 }
1692 }
1693 #[doc = "The body for the API call"]
1694 pub fn body<T>(self, body: T) -> ConnectorSyncJobCancel<'a, 'b, JsonBody<T>>
1695 where
1696 T: Serialize,
1697 {
1698 ConnectorSyncJobCancel {
1699 transport: self.transport,
1700 parts: self.parts,
1701 body: Some(body.into()),
1702 error_trace: self.error_trace,
1703 filter_path: self.filter_path,
1704 headers: self.headers,
1705 human: self.human,
1706 pretty: self.pretty,
1707 request_timeout: self.request_timeout,
1708 source: self.source,
1709 }
1710 }
1711 #[doc = "Include the stack trace of returned errors."]
1712 pub fn error_trace(mut self, error_trace: bool) -> Self {
1713 self.error_trace = Some(error_trace);
1714 self
1715 }
1716 #[doc = "A comma-separated list of filters used to reduce the response."]
1717 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1718 self.filter_path = Some(filter_path);
1719 self
1720 }
1721 #[doc = "Adds a HTTP header"]
1722 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1723 self.headers.insert(key, value);
1724 self
1725 }
1726 #[doc = "Return human readable values for statistics."]
1727 pub fn human(mut self, human: bool) -> Self {
1728 self.human = Some(human);
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 = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1742 pub fn source(mut self, source: &'b str) -> Self {
1743 self.source = Some(source);
1744 self
1745 }
1746 #[doc = "Creates an asynchronous call to the Connector Sync Job Cancel API that can be awaited"]
1747 pub async fn send(self) -> Result<Response, Error> {
1748 let path = self.parts.url();
1749 let method = http::Method::Put;
1750 let headers = self.headers;
1751 let timeout = self.request_timeout;
1752 let query_string = {
1753 #[serde_with::skip_serializing_none]
1754 #[derive(Serialize)]
1755 struct QueryParams<'b> {
1756 error_trace: Option<bool>,
1757 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1758 filter_path: Option<&'b [&'b str]>,
1759 human: Option<bool>,
1760 pretty: Option<bool>,
1761 source: Option<&'b str>,
1762 }
1763 let query_params = QueryParams {
1764 error_trace: self.error_trace,
1765 filter_path: self.filter_path,
1766 human: self.human,
1767 pretty: self.pretty,
1768 source: self.source,
1769 };
1770 Some(query_params)
1771 };
1772 let body = self.body;
1773 let response = self
1774 .transport
1775 .send(method, &path, headers, query_string.as_ref(), body, timeout)
1776 .await?;
1777 Ok(response)
1778 }
1779}
1780#[cfg(feature = "experimental-apis")]
1781#[derive(Debug, Clone, PartialEq, Eq)]
1782#[doc = "API parts for the Connector Sync Job Check In API"]
1783pub enum ConnectorSyncJobCheckInParts<'b> {
1784 #[doc = "ConnectorSyncJobId"]
1785 ConnectorSyncJobId(&'b str),
1786}
1787#[cfg(feature = "experimental-apis")]
1788impl<'b> ConnectorSyncJobCheckInParts<'b> {
1789 #[doc = "Builds a relative URL path to the Connector Sync Job Check In API"]
1790 pub fn url(self) -> Cow<'static, str> {
1791 match self {
1792 ConnectorSyncJobCheckInParts::ConnectorSyncJobId(connector_sync_job_id) => {
1793 let encoded_connector_sync_job_id: Cow<str> =
1794 percent_encode(connector_sync_job_id.as_bytes(), PARTS_ENCODED).into();
1795 let mut p = String::with_capacity(32usize + encoded_connector_sync_job_id.len());
1796 p.push_str("/_connector/_sync_job/");
1797 p.push_str(encoded_connector_sync_job_id.as_ref());
1798 p.push_str("/_check_in");
1799 p.into()
1800 }
1801 }
1802 }
1803}
1804#[doc = "Builder for the [Connector Sync Job Check In API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/check-in-connector-sync-job-api.html)\n\nChecks in a connector sync job (refreshes 'last_seen')."]
1805#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
1806#[cfg(feature = "experimental-apis")]
1807#[derive(Clone, Debug)]
1808pub struct ConnectorSyncJobCheckIn<'a, 'b, B> {
1809 transport: &'a Transport,
1810 parts: ConnectorSyncJobCheckInParts<'b>,
1811 body: Option<B>,
1812 error_trace: Option<bool>,
1813 filter_path: Option<&'b [&'b str]>,
1814 headers: HeaderMap,
1815 human: Option<bool>,
1816 pretty: Option<bool>,
1817 request_timeout: Option<Duration>,
1818 source: Option<&'b str>,
1819}
1820#[cfg(feature = "experimental-apis")]
1821impl<'a, 'b, B> ConnectorSyncJobCheckIn<'a, 'b, B>
1822where
1823 B: Body,
1824{
1825 #[doc = "Creates a new instance of [ConnectorSyncJobCheckIn] with the specified API parts"]
1826 pub fn new(transport: &'a Transport, parts: ConnectorSyncJobCheckInParts<'b>) -> Self {
1827 let headers = HeaderMap::new();
1828 ConnectorSyncJobCheckIn {
1829 transport,
1830 parts,
1831 headers,
1832 body: None,
1833 error_trace: None,
1834 filter_path: None,
1835 human: None,
1836 pretty: None,
1837 request_timeout: None,
1838 source: None,
1839 }
1840 }
1841 #[doc = "The body for the API call"]
1842 pub fn body<T>(self, body: T) -> ConnectorSyncJobCheckIn<'a, 'b, JsonBody<T>>
1843 where
1844 T: Serialize,
1845 {
1846 ConnectorSyncJobCheckIn {
1847 transport: self.transport,
1848 parts: self.parts,
1849 body: Some(body.into()),
1850 error_trace: self.error_trace,
1851 filter_path: self.filter_path,
1852 headers: self.headers,
1853 human: self.human,
1854 pretty: self.pretty,
1855 request_timeout: self.request_timeout,
1856 source: self.source,
1857 }
1858 }
1859 #[doc = "Include the stack trace of returned errors."]
1860 pub fn error_trace(mut self, error_trace: bool) -> Self {
1861 self.error_trace = Some(error_trace);
1862 self
1863 }
1864 #[doc = "A comma-separated list of filters used to reduce the response."]
1865 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
1866 self.filter_path = Some(filter_path);
1867 self
1868 }
1869 #[doc = "Adds a HTTP header"]
1870 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
1871 self.headers.insert(key, value);
1872 self
1873 }
1874 #[doc = "Return human readable values for statistics."]
1875 pub fn human(mut self, human: bool) -> Self {
1876 self.human = Some(human);
1877 self
1878 }
1879 #[doc = "Pretty format the returned JSON response."]
1880 pub fn pretty(mut self, pretty: bool) -> Self {
1881 self.pretty = Some(pretty);
1882 self
1883 }
1884 #[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."]
1885 pub fn request_timeout(mut self, timeout: Duration) -> Self {
1886 self.request_timeout = Some(timeout);
1887 self
1888 }
1889 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
1890 pub fn source(mut self, source: &'b str) -> Self {
1891 self.source = Some(source);
1892 self
1893 }
1894 #[doc = "Creates an asynchronous call to the Connector Sync Job Check In API that can be awaited"]
1895 pub async fn send(self) -> Result<Response, Error> {
1896 let path = self.parts.url();
1897 let method = http::Method::Put;
1898 let headers = self.headers;
1899 let timeout = self.request_timeout;
1900 let query_string = {
1901 #[serde_with::skip_serializing_none]
1902 #[derive(Serialize)]
1903 struct QueryParams<'b> {
1904 error_trace: Option<bool>,
1905 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
1906 filter_path: Option<&'b [&'b str]>,
1907 human: Option<bool>,
1908 pretty: Option<bool>,
1909 source: Option<&'b str>,
1910 }
1911 let query_params = QueryParams {
1912 error_trace: self.error_trace,
1913 filter_path: self.filter_path,
1914 human: self.human,
1915 pretty: self.pretty,
1916 source: self.source,
1917 };
1918 Some(query_params)
1919 };
1920 let body = self.body;
1921 let response = self
1922 .transport
1923 .send(method, &path, headers, query_string.as_ref(), body, timeout)
1924 .await?;
1925 Ok(response)
1926 }
1927}
1928#[cfg(feature = "experimental-apis")]
1929#[derive(Debug, Clone, PartialEq, Eq)]
1930#[doc = "API parts for the Connector Sync Job Claim API"]
1931pub enum ConnectorSyncJobClaimParts<'b> {
1932 #[doc = "ConnectorSyncJobId"]
1933 ConnectorSyncJobId(&'b str),
1934}
1935#[cfg(feature = "experimental-apis")]
1936impl<'b> ConnectorSyncJobClaimParts<'b> {
1937 #[doc = "Builds a relative URL path to the Connector Sync Job Claim API"]
1938 pub fn url(self) -> Cow<'static, str> {
1939 match self {
1940 ConnectorSyncJobClaimParts::ConnectorSyncJobId(connector_sync_job_id) => {
1941 let encoded_connector_sync_job_id: Cow<str> =
1942 percent_encode(connector_sync_job_id.as_bytes(), PARTS_ENCODED).into();
1943 let mut p = String::with_capacity(29usize + encoded_connector_sync_job_id.len());
1944 p.push_str("/_connector/_sync_job/");
1945 p.push_str(encoded_connector_sync_job_id.as_ref());
1946 p.push_str("/_claim");
1947 p.into()
1948 }
1949 }
1950 }
1951}
1952#[doc = "Builder for the [Connector Sync Job Claim API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/claim-connector-sync-job-api.html)\n\nClaims a connector sync job."]
1953#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
1954#[cfg(feature = "experimental-apis")]
1955#[derive(Clone, Debug)]
1956pub struct ConnectorSyncJobClaim<'a, 'b, B> {
1957 transport: &'a Transport,
1958 parts: ConnectorSyncJobClaimParts<'b>,
1959 body: Option<B>,
1960 error_trace: Option<bool>,
1961 filter_path: Option<&'b [&'b str]>,
1962 headers: HeaderMap,
1963 human: Option<bool>,
1964 pretty: Option<bool>,
1965 request_timeout: Option<Duration>,
1966 source: Option<&'b str>,
1967}
1968#[cfg(feature = "experimental-apis")]
1969impl<'a, 'b, B> ConnectorSyncJobClaim<'a, 'b, B>
1970where
1971 B: Body,
1972{
1973 #[doc = "Creates a new instance of [ConnectorSyncJobClaim] with the specified API parts"]
1974 pub fn new(transport: &'a Transport, parts: ConnectorSyncJobClaimParts<'b>) -> Self {
1975 let headers = HeaderMap::new();
1976 ConnectorSyncJobClaim {
1977 transport,
1978 parts,
1979 headers,
1980 body: None,
1981 error_trace: None,
1982 filter_path: None,
1983 human: None,
1984 pretty: None,
1985 request_timeout: None,
1986 source: None,
1987 }
1988 }
1989 #[doc = "The body for the API call"]
1990 pub fn body<T>(self, body: T) -> ConnectorSyncJobClaim<'a, 'b, JsonBody<T>>
1991 where
1992 T: Serialize,
1993 {
1994 ConnectorSyncJobClaim {
1995 transport: self.transport,
1996 parts: self.parts,
1997 body: Some(body.into()),
1998 error_trace: self.error_trace,
1999 filter_path: self.filter_path,
2000 headers: self.headers,
2001 human: self.human,
2002 pretty: self.pretty,
2003 request_timeout: self.request_timeout,
2004 source: self.source,
2005 }
2006 }
2007 #[doc = "Include the stack trace of returned errors."]
2008 pub fn error_trace(mut self, error_trace: bool) -> Self {
2009 self.error_trace = Some(error_trace);
2010 self
2011 }
2012 #[doc = "A comma-separated list of filters used to reduce the response."]
2013 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2014 self.filter_path = Some(filter_path);
2015 self
2016 }
2017 #[doc = "Adds a HTTP header"]
2018 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2019 self.headers.insert(key, value);
2020 self
2021 }
2022 #[doc = "Return human readable values for statistics."]
2023 pub fn human(mut self, human: bool) -> Self {
2024 self.human = Some(human);
2025 self
2026 }
2027 #[doc = "Pretty format the returned JSON response."]
2028 pub fn pretty(mut self, pretty: bool) -> Self {
2029 self.pretty = Some(pretty);
2030 self
2031 }
2032 #[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."]
2033 pub fn request_timeout(mut self, timeout: Duration) -> Self {
2034 self.request_timeout = Some(timeout);
2035 self
2036 }
2037 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2038 pub fn source(mut self, source: &'b str) -> Self {
2039 self.source = Some(source);
2040 self
2041 }
2042 #[doc = "Creates an asynchronous call to the Connector Sync Job Claim API that can be awaited"]
2043 pub async fn send(self) -> Result<Response, Error> {
2044 let path = self.parts.url();
2045 let method = http::Method::Put;
2046 let headers = self.headers;
2047 let timeout = self.request_timeout;
2048 let query_string = {
2049 #[serde_with::skip_serializing_none]
2050 #[derive(Serialize)]
2051 struct QueryParams<'b> {
2052 error_trace: Option<bool>,
2053 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2054 filter_path: Option<&'b [&'b str]>,
2055 human: Option<bool>,
2056 pretty: Option<bool>,
2057 source: Option<&'b str>,
2058 }
2059 let query_params = QueryParams {
2060 error_trace: self.error_trace,
2061 filter_path: self.filter_path,
2062 human: self.human,
2063 pretty: self.pretty,
2064 source: self.source,
2065 };
2066 Some(query_params)
2067 };
2068 let body = self.body;
2069 let response = self
2070 .transport
2071 .send(method, &path, headers, query_string.as_ref(), body, timeout)
2072 .await?;
2073 Ok(response)
2074 }
2075}
2076#[cfg(feature = "experimental-apis")]
2077#[derive(Debug, Clone, PartialEq, Eq)]
2078#[doc = "API parts for the Connector Sync Job Delete API"]
2079pub enum ConnectorSyncJobDeleteParts<'b> {
2080 #[doc = "ConnectorSyncJobId"]
2081 ConnectorSyncJobId(&'b str),
2082}
2083#[cfg(feature = "experimental-apis")]
2084impl<'b> ConnectorSyncJobDeleteParts<'b> {
2085 #[doc = "Builds a relative URL path to the Connector Sync Job Delete API"]
2086 pub fn url(self) -> Cow<'static, str> {
2087 match self {
2088 ConnectorSyncJobDeleteParts::ConnectorSyncJobId(connector_sync_job_id) => {
2089 let encoded_connector_sync_job_id: Cow<str> =
2090 percent_encode(connector_sync_job_id.as_bytes(), PARTS_ENCODED).into();
2091 let mut p = String::with_capacity(22usize + encoded_connector_sync_job_id.len());
2092 p.push_str("/_connector/_sync_job/");
2093 p.push_str(encoded_connector_sync_job_id.as_ref());
2094 p.into()
2095 }
2096 }
2097 }
2098}
2099#[doc = "Builder for the [Connector Sync Job Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/delete-connector-sync-job-api.html)\n\nDeletes a connector sync job."]
2100#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
2101#[cfg(feature = "experimental-apis")]
2102#[derive(Clone, Debug)]
2103pub struct ConnectorSyncJobDelete<'a, 'b> {
2104 transport: &'a Transport,
2105 parts: ConnectorSyncJobDeleteParts<'b>,
2106 error_trace: Option<bool>,
2107 filter_path: Option<&'b [&'b str]>,
2108 headers: HeaderMap,
2109 human: Option<bool>,
2110 pretty: Option<bool>,
2111 request_timeout: Option<Duration>,
2112 source: Option<&'b str>,
2113}
2114#[cfg(feature = "experimental-apis")]
2115impl<'a, 'b> ConnectorSyncJobDelete<'a, 'b> {
2116 #[doc = "Creates a new instance of [ConnectorSyncJobDelete] with the specified API parts"]
2117 pub fn new(transport: &'a Transport, parts: ConnectorSyncJobDeleteParts<'b>) -> Self {
2118 let headers = HeaderMap::new();
2119 ConnectorSyncJobDelete {
2120 transport,
2121 parts,
2122 headers,
2123 error_trace: None,
2124 filter_path: None,
2125 human: None,
2126 pretty: None,
2127 request_timeout: None,
2128 source: None,
2129 }
2130 }
2131 #[doc = "Include the stack trace of returned errors."]
2132 pub fn error_trace(mut self, error_trace: bool) -> Self {
2133 self.error_trace = Some(error_trace);
2134 self
2135 }
2136 #[doc = "A comma-separated list of filters used to reduce the response."]
2137 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2138 self.filter_path = Some(filter_path);
2139 self
2140 }
2141 #[doc = "Adds a HTTP header"]
2142 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2143 self.headers.insert(key, value);
2144 self
2145 }
2146 #[doc = "Return human readable values for statistics."]
2147 pub fn human(mut self, human: bool) -> Self {
2148 self.human = Some(human);
2149 self
2150 }
2151 #[doc = "Pretty format the returned JSON response."]
2152 pub fn pretty(mut self, pretty: bool) -> Self {
2153 self.pretty = Some(pretty);
2154 self
2155 }
2156 #[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."]
2157 pub fn request_timeout(mut self, timeout: Duration) -> Self {
2158 self.request_timeout = Some(timeout);
2159 self
2160 }
2161 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2162 pub fn source(mut self, source: &'b str) -> Self {
2163 self.source = Some(source);
2164 self
2165 }
2166 #[doc = "Creates an asynchronous call to the Connector Sync Job Delete API that can be awaited"]
2167 pub async fn send(self) -> Result<Response, Error> {
2168 let path = self.parts.url();
2169 let method = http::Method::Delete;
2170 let headers = self.headers;
2171 let timeout = self.request_timeout;
2172 let query_string = {
2173 #[serde_with::skip_serializing_none]
2174 #[derive(Serialize)]
2175 struct QueryParams<'b> {
2176 error_trace: Option<bool>,
2177 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2178 filter_path: Option<&'b [&'b str]>,
2179 human: Option<bool>,
2180 pretty: Option<bool>,
2181 source: Option<&'b str>,
2182 }
2183 let query_params = QueryParams {
2184 error_trace: self.error_trace,
2185 filter_path: self.filter_path,
2186 human: self.human,
2187 pretty: self.pretty,
2188 source: self.source,
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#[cfg(feature = "experimental-apis")]
2201#[derive(Debug, Clone, PartialEq, Eq)]
2202#[doc = "API parts for the Connector Sync Job Error API"]
2203pub enum ConnectorSyncJobErrorParts<'b> {
2204 #[doc = "ConnectorSyncJobId"]
2205 ConnectorSyncJobId(&'b str),
2206}
2207#[cfg(feature = "experimental-apis")]
2208impl<'b> ConnectorSyncJobErrorParts<'b> {
2209 #[doc = "Builds a relative URL path to the Connector Sync Job Error API"]
2210 pub fn url(self) -> Cow<'static, str> {
2211 match self {
2212 ConnectorSyncJobErrorParts::ConnectorSyncJobId(connector_sync_job_id) => {
2213 let encoded_connector_sync_job_id: Cow<str> =
2214 percent_encode(connector_sync_job_id.as_bytes(), PARTS_ENCODED).into();
2215 let mut p = String::with_capacity(29usize + encoded_connector_sync_job_id.len());
2216 p.push_str("/_connector/_sync_job/");
2217 p.push_str(encoded_connector_sync_job_id.as_ref());
2218 p.push_str("/_error");
2219 p.into()
2220 }
2221 }
2222 }
2223}
2224#[doc = "Builder for the [Connector Sync Job Error API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/set-connector-sync-job-error-api.html)\n\nSets an error for a connector sync job."]
2225#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
2226#[cfg(feature = "experimental-apis")]
2227#[derive(Clone, Debug)]
2228pub struct ConnectorSyncJobError<'a, 'b, B> {
2229 transport: &'a Transport,
2230 parts: ConnectorSyncJobErrorParts<'b>,
2231 body: Option<B>,
2232 error_trace: Option<bool>,
2233 filter_path: Option<&'b [&'b str]>,
2234 headers: HeaderMap,
2235 human: Option<bool>,
2236 pretty: Option<bool>,
2237 request_timeout: Option<Duration>,
2238 source: Option<&'b str>,
2239}
2240#[cfg(feature = "experimental-apis")]
2241impl<'a, 'b, B> ConnectorSyncJobError<'a, 'b, B>
2242where
2243 B: Body,
2244{
2245 #[doc = "Creates a new instance of [ConnectorSyncJobError] with the specified API parts"]
2246 pub fn new(transport: &'a Transport, parts: ConnectorSyncJobErrorParts<'b>) -> Self {
2247 let headers = HeaderMap::new();
2248 ConnectorSyncJobError {
2249 transport,
2250 parts,
2251 headers,
2252 body: None,
2253 error_trace: None,
2254 filter_path: None,
2255 human: None,
2256 pretty: None,
2257 request_timeout: None,
2258 source: None,
2259 }
2260 }
2261 #[doc = "The body for the API call"]
2262 pub fn body<T>(self, body: T) -> ConnectorSyncJobError<'a, 'b, JsonBody<T>>
2263 where
2264 T: Serialize,
2265 {
2266 ConnectorSyncJobError {
2267 transport: self.transport,
2268 parts: self.parts,
2269 body: Some(body.into()),
2270 error_trace: self.error_trace,
2271 filter_path: self.filter_path,
2272 headers: self.headers,
2273 human: self.human,
2274 pretty: self.pretty,
2275 request_timeout: self.request_timeout,
2276 source: self.source,
2277 }
2278 }
2279 #[doc = "Include the stack trace of returned errors."]
2280 pub fn error_trace(mut self, error_trace: bool) -> Self {
2281 self.error_trace = Some(error_trace);
2282 self
2283 }
2284 #[doc = "A comma-separated list of filters used to reduce the response."]
2285 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2286 self.filter_path = Some(filter_path);
2287 self
2288 }
2289 #[doc = "Adds a HTTP header"]
2290 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2291 self.headers.insert(key, value);
2292 self
2293 }
2294 #[doc = "Return human readable values for statistics."]
2295 pub fn human(mut self, human: bool) -> Self {
2296 self.human = Some(human);
2297 self
2298 }
2299 #[doc = "Pretty format the returned JSON response."]
2300 pub fn pretty(mut self, pretty: bool) -> Self {
2301 self.pretty = Some(pretty);
2302 self
2303 }
2304 #[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."]
2305 pub fn request_timeout(mut self, timeout: Duration) -> Self {
2306 self.request_timeout = Some(timeout);
2307 self
2308 }
2309 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2310 pub fn source(mut self, source: &'b str) -> Self {
2311 self.source = Some(source);
2312 self
2313 }
2314 #[doc = "Creates an asynchronous call to the Connector Sync Job Error API that can be awaited"]
2315 pub async fn send(self) -> Result<Response, Error> {
2316 let path = self.parts.url();
2317 let method = http::Method::Put;
2318 let headers = self.headers;
2319 let timeout = self.request_timeout;
2320 let query_string = {
2321 #[serde_with::skip_serializing_none]
2322 #[derive(Serialize)]
2323 struct QueryParams<'b> {
2324 error_trace: Option<bool>,
2325 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2326 filter_path: Option<&'b [&'b str]>,
2327 human: Option<bool>,
2328 pretty: Option<bool>,
2329 source: Option<&'b str>,
2330 }
2331 let query_params = QueryParams {
2332 error_trace: self.error_trace,
2333 filter_path: self.filter_path,
2334 human: self.human,
2335 pretty: self.pretty,
2336 source: self.source,
2337 };
2338 Some(query_params)
2339 };
2340 let body = self.body;
2341 let response = self
2342 .transport
2343 .send(method, &path, headers, query_string.as_ref(), body, timeout)
2344 .await?;
2345 Ok(response)
2346 }
2347}
2348#[cfg(feature = "experimental-apis")]
2349#[derive(Debug, Clone, PartialEq, Eq)]
2350#[doc = "API parts for the Connector Sync Job Get API"]
2351pub enum ConnectorSyncJobGetParts<'b> {
2352 #[doc = "ConnectorSyncJobId"]
2353 ConnectorSyncJobId(&'b str),
2354}
2355#[cfg(feature = "experimental-apis")]
2356impl<'b> ConnectorSyncJobGetParts<'b> {
2357 #[doc = "Builds a relative URL path to the Connector Sync Job Get API"]
2358 pub fn url(self) -> Cow<'static, str> {
2359 match self {
2360 ConnectorSyncJobGetParts::ConnectorSyncJobId(connector_sync_job_id) => {
2361 let encoded_connector_sync_job_id: Cow<str> =
2362 percent_encode(connector_sync_job_id.as_bytes(), PARTS_ENCODED).into();
2363 let mut p = String::with_capacity(22usize + encoded_connector_sync_job_id.len());
2364 p.push_str("/_connector/_sync_job/");
2365 p.push_str(encoded_connector_sync_job_id.as_ref());
2366 p.into()
2367 }
2368 }
2369 }
2370}
2371#[doc = "Builder for the [Connector Sync Job Get API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/get-connector-sync-job-api.html)\n\nReturns the details about a connector sync job."]
2372#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
2373#[cfg(feature = "experimental-apis")]
2374#[derive(Clone, Debug)]
2375pub struct ConnectorSyncJobGet<'a, 'b> {
2376 transport: &'a Transport,
2377 parts: ConnectorSyncJobGetParts<'b>,
2378 error_trace: Option<bool>,
2379 filter_path: Option<&'b [&'b str]>,
2380 headers: HeaderMap,
2381 human: Option<bool>,
2382 pretty: Option<bool>,
2383 request_timeout: Option<Duration>,
2384 source: Option<&'b str>,
2385}
2386#[cfg(feature = "experimental-apis")]
2387impl<'a, 'b> ConnectorSyncJobGet<'a, 'b> {
2388 #[doc = "Creates a new instance of [ConnectorSyncJobGet] with the specified API parts"]
2389 pub fn new(transport: &'a Transport, parts: ConnectorSyncJobGetParts<'b>) -> Self {
2390 let headers = HeaderMap::new();
2391 ConnectorSyncJobGet {
2392 transport,
2393 parts,
2394 headers,
2395 error_trace: None,
2396 filter_path: None,
2397 human: None,
2398 pretty: None,
2399 request_timeout: None,
2400 source: None,
2401 }
2402 }
2403 #[doc = "Include the stack trace of returned errors."]
2404 pub fn error_trace(mut self, error_trace: bool) -> Self {
2405 self.error_trace = Some(error_trace);
2406 self
2407 }
2408 #[doc = "A comma-separated list of filters used to reduce the response."]
2409 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2410 self.filter_path = Some(filter_path);
2411 self
2412 }
2413 #[doc = "Adds a HTTP header"]
2414 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2415 self.headers.insert(key, value);
2416 self
2417 }
2418 #[doc = "Return human readable values for statistics."]
2419 pub fn human(mut self, human: bool) -> Self {
2420 self.human = Some(human);
2421 self
2422 }
2423 #[doc = "Pretty format the returned JSON response."]
2424 pub fn pretty(mut self, pretty: bool) -> Self {
2425 self.pretty = Some(pretty);
2426 self
2427 }
2428 #[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."]
2429 pub fn request_timeout(mut self, timeout: Duration) -> Self {
2430 self.request_timeout = Some(timeout);
2431 self
2432 }
2433 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2434 pub fn source(mut self, source: &'b str) -> Self {
2435 self.source = Some(source);
2436 self
2437 }
2438 #[doc = "Creates an asynchronous call to the Connector Sync Job Get API that can be awaited"]
2439 pub async fn send(self) -> Result<Response, Error> {
2440 let path = self.parts.url();
2441 let method = http::Method::Get;
2442 let headers = self.headers;
2443 let timeout = self.request_timeout;
2444 let query_string = {
2445 #[serde_with::skip_serializing_none]
2446 #[derive(Serialize)]
2447 struct QueryParams<'b> {
2448 error_trace: Option<bool>,
2449 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2450 filter_path: Option<&'b [&'b str]>,
2451 human: Option<bool>,
2452 pretty: Option<bool>,
2453 source: Option<&'b str>,
2454 }
2455 let query_params = QueryParams {
2456 error_trace: self.error_trace,
2457 filter_path: self.filter_path,
2458 human: self.human,
2459 pretty: self.pretty,
2460 source: self.source,
2461 };
2462 Some(query_params)
2463 };
2464 let body = Option::<()>::None;
2465 let response = self
2466 .transport
2467 .send(method, &path, headers, query_string.as_ref(), body, timeout)
2468 .await?;
2469 Ok(response)
2470 }
2471}
2472#[cfg(feature = "experimental-apis")]
2473#[derive(Debug, Clone, PartialEq, Eq)]
2474#[doc = "API parts for the Connector Sync Job List API"]
2475pub enum ConnectorSyncJobListParts {
2476 #[doc = "No parts"]
2477 None,
2478}
2479#[cfg(feature = "experimental-apis")]
2480impl ConnectorSyncJobListParts {
2481 #[doc = "Builds a relative URL path to the Connector Sync Job List API"]
2482 pub fn url(self) -> Cow<'static, str> {
2483 match self {
2484 ConnectorSyncJobListParts::None => "/_connector/_sync_job".into(),
2485 }
2486 }
2487}
2488#[doc = "Builder for the [Connector Sync Job List API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/list-connector-sync-jobs-api.html)\n\nLists all connector sync jobs."]
2489#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
2490#[cfg(feature = "experimental-apis")]
2491#[derive(Clone, Debug)]
2492pub struct ConnectorSyncJobList<'a, 'b> {
2493 transport: &'a Transport,
2494 parts: ConnectorSyncJobListParts,
2495 connector_id: Option<&'b str>,
2496 error_trace: Option<bool>,
2497 filter_path: Option<&'b [&'b str]>,
2498 from: Option<i32>,
2499 headers: HeaderMap,
2500 human: Option<bool>,
2501 job_type: Option<&'b [&'b str]>,
2502 pretty: Option<bool>,
2503 request_timeout: Option<Duration>,
2504 size: Option<i32>,
2505 source: Option<&'b str>,
2506 status: Option<&'b str>,
2507}
2508#[cfg(feature = "experimental-apis")]
2509impl<'a, 'b> ConnectorSyncJobList<'a, 'b> {
2510 #[doc = "Creates a new instance of [ConnectorSyncJobList]"]
2511 pub fn new(transport: &'a Transport) -> Self {
2512 let headers = HeaderMap::new();
2513 ConnectorSyncJobList {
2514 transport,
2515 parts: ConnectorSyncJobListParts::None,
2516 headers,
2517 connector_id: None,
2518 error_trace: None,
2519 filter_path: None,
2520 from: None,
2521 human: None,
2522 job_type: None,
2523 pretty: None,
2524 request_timeout: None,
2525 size: None,
2526 source: None,
2527 status: None,
2528 }
2529 }
2530 #[doc = "Id of the connector to fetch the sync jobs for"]
2531 pub fn connector_id(mut self, connector_id: &'b str) -> Self {
2532 self.connector_id = Some(connector_id);
2533 self
2534 }
2535 #[doc = "Include the stack trace of returned errors."]
2536 pub fn error_trace(mut self, error_trace: bool) -> Self {
2537 self.error_trace = Some(error_trace);
2538 self
2539 }
2540 #[doc = "A comma-separated list of filters used to reduce the response."]
2541 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2542 self.filter_path = Some(filter_path);
2543 self
2544 }
2545 #[doc = "Starting offset (default: 0)"]
2546 pub fn from(mut self, from: i32) -> Self {
2547 self.from = Some(from);
2548 self
2549 }
2550 #[doc = "Adds a HTTP header"]
2551 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2552 self.headers.insert(key, value);
2553 self
2554 }
2555 #[doc = "Return human readable values for statistics."]
2556 pub fn human(mut self, human: bool) -> Self {
2557 self.human = Some(human);
2558 self
2559 }
2560 #[doc = "A comma-separated list of job types"]
2561 pub fn job_type(mut self, job_type: &'b [&'b str]) -> Self {
2562 self.job_type = Some(job_type);
2563 self
2564 }
2565 #[doc = "Pretty format the returned JSON response."]
2566 pub fn pretty(mut self, pretty: bool) -> Self {
2567 self.pretty = Some(pretty);
2568 self
2569 }
2570 #[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."]
2571 pub fn request_timeout(mut self, timeout: Duration) -> Self {
2572 self.request_timeout = Some(timeout);
2573 self
2574 }
2575 #[doc = "specifies a max number of results to get (default: 100)"]
2576 pub fn size(mut self, size: i32) -> Self {
2577 self.size = Some(size);
2578 self
2579 }
2580 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2581 pub fn source(mut self, source: &'b str) -> Self {
2582 self.source = Some(source);
2583 self
2584 }
2585 #[doc = "Sync job status, which sync jobs are fetched for"]
2586 pub fn status(mut self, status: &'b str) -> Self {
2587 self.status = Some(status);
2588 self
2589 }
2590 #[doc = "Creates an asynchronous call to the Connector Sync Job List API that can be awaited"]
2591 pub async fn send(self) -> Result<Response, Error> {
2592 let path = self.parts.url();
2593 let method = http::Method::Get;
2594 let headers = self.headers;
2595 let timeout = self.request_timeout;
2596 let query_string = {
2597 #[serde_with::skip_serializing_none]
2598 #[derive(Serialize)]
2599 struct QueryParams<'b> {
2600 connector_id: Option<&'b str>,
2601 error_trace: Option<bool>,
2602 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2603 filter_path: Option<&'b [&'b str]>,
2604 from: Option<i32>,
2605 human: Option<bool>,
2606 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2607 job_type: Option<&'b [&'b str]>,
2608 pretty: Option<bool>,
2609 size: Option<i32>,
2610 source: Option<&'b str>,
2611 status: Option<&'b str>,
2612 }
2613 let query_params = QueryParams {
2614 connector_id: self.connector_id,
2615 error_trace: self.error_trace,
2616 filter_path: self.filter_path,
2617 from: self.from,
2618 human: self.human,
2619 job_type: self.job_type,
2620 pretty: self.pretty,
2621 size: self.size,
2622 source: self.source,
2623 status: self.status,
2624 };
2625 Some(query_params)
2626 };
2627 let body = Option::<()>::None;
2628 let response = self
2629 .transport
2630 .send(method, &path, headers, query_string.as_ref(), body, timeout)
2631 .await?;
2632 Ok(response)
2633 }
2634}
2635#[cfg(feature = "experimental-apis")]
2636#[derive(Debug, Clone, PartialEq, Eq)]
2637#[doc = "API parts for the Connector Sync Job Post API"]
2638pub enum ConnectorSyncJobPostParts {
2639 #[doc = "No parts"]
2640 None,
2641}
2642#[cfg(feature = "experimental-apis")]
2643impl ConnectorSyncJobPostParts {
2644 #[doc = "Builds a relative URL path to the Connector Sync Job Post API"]
2645 pub fn url(self) -> Cow<'static, str> {
2646 match self {
2647 ConnectorSyncJobPostParts::None => "/_connector/_sync_job".into(),
2648 }
2649 }
2650}
2651#[doc = "Builder for the [Connector Sync Job Post API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/create-connector-sync-job-api.html)\n\nCreates a connector sync job."]
2652#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
2653#[cfg(feature = "experimental-apis")]
2654#[derive(Clone, Debug)]
2655pub struct ConnectorSyncJobPost<'a, 'b, B> {
2656 transport: &'a Transport,
2657 parts: ConnectorSyncJobPostParts,
2658 body: Option<B>,
2659 error_trace: Option<bool>,
2660 filter_path: Option<&'b [&'b str]>,
2661 headers: HeaderMap,
2662 human: Option<bool>,
2663 pretty: Option<bool>,
2664 request_timeout: Option<Duration>,
2665 source: Option<&'b str>,
2666}
2667#[cfg(feature = "experimental-apis")]
2668impl<'a, 'b, B> ConnectorSyncJobPost<'a, 'b, B>
2669where
2670 B: Body,
2671{
2672 #[doc = "Creates a new instance of [ConnectorSyncJobPost]"]
2673 pub fn new(transport: &'a Transport) -> Self {
2674 let headers = HeaderMap::new();
2675 ConnectorSyncJobPost {
2676 transport,
2677 parts: ConnectorSyncJobPostParts::None,
2678 headers,
2679 body: None,
2680 error_trace: None,
2681 filter_path: None,
2682 human: None,
2683 pretty: None,
2684 request_timeout: None,
2685 source: None,
2686 }
2687 }
2688 #[doc = "The body for the API call"]
2689 pub fn body<T>(self, body: T) -> ConnectorSyncJobPost<'a, 'b, JsonBody<T>>
2690 where
2691 T: Serialize,
2692 {
2693 ConnectorSyncJobPost {
2694 transport: self.transport,
2695 parts: self.parts,
2696 body: Some(body.into()),
2697 error_trace: self.error_trace,
2698 filter_path: self.filter_path,
2699 headers: self.headers,
2700 human: self.human,
2701 pretty: self.pretty,
2702 request_timeout: self.request_timeout,
2703 source: self.source,
2704 }
2705 }
2706 #[doc = "Include the stack trace of returned errors."]
2707 pub fn error_trace(mut self, error_trace: bool) -> Self {
2708 self.error_trace = Some(error_trace);
2709 self
2710 }
2711 #[doc = "A comma-separated list of filters used to reduce the response."]
2712 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2713 self.filter_path = Some(filter_path);
2714 self
2715 }
2716 #[doc = "Adds a HTTP header"]
2717 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2718 self.headers.insert(key, value);
2719 self
2720 }
2721 #[doc = "Return human readable values for statistics."]
2722 pub fn human(mut self, human: bool) -> Self {
2723 self.human = Some(human);
2724 self
2725 }
2726 #[doc = "Pretty format the returned JSON response."]
2727 pub fn pretty(mut self, pretty: bool) -> Self {
2728 self.pretty = Some(pretty);
2729 self
2730 }
2731 #[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."]
2732 pub fn request_timeout(mut self, timeout: Duration) -> Self {
2733 self.request_timeout = Some(timeout);
2734 self
2735 }
2736 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2737 pub fn source(mut self, source: &'b str) -> Self {
2738 self.source = Some(source);
2739 self
2740 }
2741 #[doc = "Creates an asynchronous call to the Connector Sync Job Post API that can be awaited"]
2742 pub async fn send(self) -> Result<Response, Error> {
2743 let path = self.parts.url();
2744 let method = http::Method::Post;
2745 let headers = self.headers;
2746 let timeout = self.request_timeout;
2747 let query_string = {
2748 #[serde_with::skip_serializing_none]
2749 #[derive(Serialize)]
2750 struct QueryParams<'b> {
2751 error_trace: Option<bool>,
2752 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2753 filter_path: Option<&'b [&'b str]>,
2754 human: Option<bool>,
2755 pretty: Option<bool>,
2756 source: Option<&'b str>,
2757 }
2758 let query_params = QueryParams {
2759 error_trace: self.error_trace,
2760 filter_path: self.filter_path,
2761 human: self.human,
2762 pretty: self.pretty,
2763 source: self.source,
2764 };
2765 Some(query_params)
2766 };
2767 let body = self.body;
2768 let response = self
2769 .transport
2770 .send(method, &path, headers, query_string.as_ref(), body, timeout)
2771 .await?;
2772 Ok(response)
2773 }
2774}
2775#[cfg(feature = "experimental-apis")]
2776#[derive(Debug, Clone, PartialEq, Eq)]
2777#[doc = "API parts for the Connector Sync Job Update Stats API"]
2778pub enum ConnectorSyncJobUpdateStatsParts<'b> {
2779 #[doc = "ConnectorSyncJobId"]
2780 ConnectorSyncJobId(&'b str),
2781}
2782#[cfg(feature = "experimental-apis")]
2783impl<'b> ConnectorSyncJobUpdateStatsParts<'b> {
2784 #[doc = "Builds a relative URL path to the Connector Sync Job Update Stats API"]
2785 pub fn url(self) -> Cow<'static, str> {
2786 match self {
2787 ConnectorSyncJobUpdateStatsParts::ConnectorSyncJobId(connector_sync_job_id) => {
2788 let encoded_connector_sync_job_id: Cow<str> =
2789 percent_encode(connector_sync_job_id.as_bytes(), PARTS_ENCODED).into();
2790 let mut p = String::with_capacity(29usize + encoded_connector_sync_job_id.len());
2791 p.push_str("/_connector/_sync_job/");
2792 p.push_str(encoded_connector_sync_job_id.as_ref());
2793 p.push_str("/_stats");
2794 p.into()
2795 }
2796 }
2797 }
2798}
2799#[doc = "Builder for the [Connector Sync Job Update Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/set-connector-sync-job-stats-api.html)\n\nUpdates the stats fields in the connector sync job document."]
2800#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
2801#[cfg(feature = "experimental-apis")]
2802#[derive(Clone, Debug)]
2803pub struct ConnectorSyncJobUpdateStats<'a, 'b, B> {
2804 transport: &'a Transport,
2805 parts: ConnectorSyncJobUpdateStatsParts<'b>,
2806 body: Option<B>,
2807 error_trace: Option<bool>,
2808 filter_path: Option<&'b [&'b str]>,
2809 headers: HeaderMap,
2810 human: Option<bool>,
2811 pretty: Option<bool>,
2812 request_timeout: Option<Duration>,
2813 source: Option<&'b str>,
2814}
2815#[cfg(feature = "experimental-apis")]
2816impl<'a, 'b, B> ConnectorSyncJobUpdateStats<'a, 'b, B>
2817where
2818 B: Body,
2819{
2820 #[doc = "Creates a new instance of [ConnectorSyncJobUpdateStats] with the specified API parts"]
2821 pub fn new(transport: &'a Transport, parts: ConnectorSyncJobUpdateStatsParts<'b>) -> Self {
2822 let headers = HeaderMap::new();
2823 ConnectorSyncJobUpdateStats {
2824 transport,
2825 parts,
2826 headers,
2827 body: None,
2828 error_trace: None,
2829 filter_path: None,
2830 human: None,
2831 pretty: None,
2832 request_timeout: None,
2833 source: None,
2834 }
2835 }
2836 #[doc = "The body for the API call"]
2837 pub fn body<T>(self, body: T) -> ConnectorSyncJobUpdateStats<'a, 'b, JsonBody<T>>
2838 where
2839 T: Serialize,
2840 {
2841 ConnectorSyncJobUpdateStats {
2842 transport: self.transport,
2843 parts: self.parts,
2844 body: Some(body.into()),
2845 error_trace: self.error_trace,
2846 filter_path: self.filter_path,
2847 headers: self.headers,
2848 human: self.human,
2849 pretty: self.pretty,
2850 request_timeout: self.request_timeout,
2851 source: self.source,
2852 }
2853 }
2854 #[doc = "Include the stack trace of returned errors."]
2855 pub fn error_trace(mut self, error_trace: bool) -> Self {
2856 self.error_trace = Some(error_trace);
2857 self
2858 }
2859 #[doc = "A comma-separated list of filters used to reduce the response."]
2860 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
2861 self.filter_path = Some(filter_path);
2862 self
2863 }
2864 #[doc = "Adds a HTTP header"]
2865 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
2866 self.headers.insert(key, value);
2867 self
2868 }
2869 #[doc = "Return human readable values for statistics."]
2870 pub fn human(mut self, human: bool) -> Self {
2871 self.human = Some(human);
2872 self
2873 }
2874 #[doc = "Pretty format the returned JSON response."]
2875 pub fn pretty(mut self, pretty: bool) -> Self {
2876 self.pretty = Some(pretty);
2877 self
2878 }
2879 #[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."]
2880 pub fn request_timeout(mut self, timeout: Duration) -> Self {
2881 self.request_timeout = Some(timeout);
2882 self
2883 }
2884 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
2885 pub fn source(mut self, source: &'b str) -> Self {
2886 self.source = Some(source);
2887 self
2888 }
2889 #[doc = "Creates an asynchronous call to the Connector Sync Job Update Stats API that can be awaited"]
2890 pub async fn send(self) -> Result<Response, Error> {
2891 let path = self.parts.url();
2892 let method = http::Method::Put;
2893 let headers = self.headers;
2894 let timeout = self.request_timeout;
2895 let query_string = {
2896 #[serde_with::skip_serializing_none]
2897 #[derive(Serialize)]
2898 struct QueryParams<'b> {
2899 error_trace: Option<bool>,
2900 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
2901 filter_path: Option<&'b [&'b str]>,
2902 human: Option<bool>,
2903 pretty: Option<bool>,
2904 source: Option<&'b str>,
2905 }
2906 let query_params = QueryParams {
2907 error_trace: self.error_trace,
2908 filter_path: self.filter_path,
2909 human: self.human,
2910 pretty: self.pretty,
2911 source: self.source,
2912 };
2913 Some(query_params)
2914 };
2915 let body = self.body;
2916 let response = self
2917 .transport
2918 .send(method, &path, headers, query_string.as_ref(), body, timeout)
2919 .await?;
2920 Ok(response)
2921 }
2922}
2923#[cfg(feature = "experimental-apis")]
2924#[derive(Debug, Clone, PartialEq, Eq)]
2925#[doc = "API parts for the Connector Update Active Filtering API"]
2926pub enum ConnectorUpdateActiveFilteringParts<'b> {
2927 #[doc = "ConnectorId"]
2928 ConnectorId(&'b str),
2929}
2930#[cfg(feature = "experimental-apis")]
2931impl<'b> ConnectorUpdateActiveFilteringParts<'b> {
2932 #[doc = "Builds a relative URL path to the Connector Update Active Filtering API"]
2933 pub fn url(self) -> Cow<'static, str> {
2934 match self {
2935 ConnectorUpdateActiveFilteringParts::ConnectorId(connector_id) => {
2936 let encoded_connector_id: Cow<str> =
2937 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
2938 let mut p = String::with_capacity(33usize + encoded_connector_id.len());
2939 p.push_str("/_connector/");
2940 p.push_str(encoded_connector_id.as_ref());
2941 p.push_str("/_filtering/_activate");
2942 p.into()
2943 }
2944 }
2945 }
2946}
2947#[doc = "Builder for the [Connector Update Active Filtering API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-filtering-api.html)\n\nActivates the draft filtering rules if they are in a validated state."]
2948#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
2949#[cfg(feature = "experimental-apis")]
2950#[derive(Clone, Debug)]
2951pub struct ConnectorUpdateActiveFiltering<'a, 'b, B> {
2952 transport: &'a Transport,
2953 parts: ConnectorUpdateActiveFilteringParts<'b>,
2954 body: Option<B>,
2955 error_trace: Option<bool>,
2956 filter_path: Option<&'b [&'b str]>,
2957 headers: HeaderMap,
2958 human: Option<bool>,
2959 pretty: Option<bool>,
2960 request_timeout: Option<Duration>,
2961 source: Option<&'b str>,
2962}
2963#[cfg(feature = "experimental-apis")]
2964impl<'a, 'b, B> ConnectorUpdateActiveFiltering<'a, 'b, B>
2965where
2966 B: Body,
2967{
2968 #[doc = "Creates a new instance of [ConnectorUpdateActiveFiltering] with the specified API parts"]
2969 pub fn new(transport: &'a Transport, parts: ConnectorUpdateActiveFilteringParts<'b>) -> Self {
2970 let headers = HeaderMap::new();
2971 ConnectorUpdateActiveFiltering {
2972 transport,
2973 parts,
2974 headers,
2975 body: None,
2976 error_trace: None,
2977 filter_path: None,
2978 human: None,
2979 pretty: None,
2980 request_timeout: None,
2981 source: None,
2982 }
2983 }
2984 #[doc = "The body for the API call"]
2985 pub fn body<T>(self, body: T) -> ConnectorUpdateActiveFiltering<'a, 'b, JsonBody<T>>
2986 where
2987 T: Serialize,
2988 {
2989 ConnectorUpdateActiveFiltering {
2990 transport: self.transport,
2991 parts: self.parts,
2992 body: Some(body.into()),
2993 error_trace: self.error_trace,
2994 filter_path: self.filter_path,
2995 headers: self.headers,
2996 human: self.human,
2997 pretty: self.pretty,
2998 request_timeout: self.request_timeout,
2999 source: self.source,
3000 }
3001 }
3002 #[doc = "Include the stack trace of returned errors."]
3003 pub fn error_trace(mut self, error_trace: bool) -> Self {
3004 self.error_trace = Some(error_trace);
3005 self
3006 }
3007 #[doc = "A comma-separated list of filters used to reduce the response."]
3008 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3009 self.filter_path = Some(filter_path);
3010 self
3011 }
3012 #[doc = "Adds a HTTP header"]
3013 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3014 self.headers.insert(key, value);
3015 self
3016 }
3017 #[doc = "Return human readable values for statistics."]
3018 pub fn human(mut self, human: bool) -> Self {
3019 self.human = Some(human);
3020 self
3021 }
3022 #[doc = "Pretty format the returned JSON response."]
3023 pub fn pretty(mut self, pretty: bool) -> Self {
3024 self.pretty = Some(pretty);
3025 self
3026 }
3027 #[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."]
3028 pub fn request_timeout(mut self, timeout: Duration) -> Self {
3029 self.request_timeout = Some(timeout);
3030 self
3031 }
3032 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3033 pub fn source(mut self, source: &'b str) -> Self {
3034 self.source = Some(source);
3035 self
3036 }
3037 #[doc = "Creates an asynchronous call to the Connector Update Active Filtering API that can be awaited"]
3038 pub async fn send(self) -> Result<Response, Error> {
3039 let path = self.parts.url();
3040 let method = http::Method::Put;
3041 let headers = self.headers;
3042 let timeout = self.request_timeout;
3043 let query_string = {
3044 #[serde_with::skip_serializing_none]
3045 #[derive(Serialize)]
3046 struct QueryParams<'b> {
3047 error_trace: Option<bool>,
3048 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3049 filter_path: Option<&'b [&'b str]>,
3050 human: Option<bool>,
3051 pretty: Option<bool>,
3052 source: Option<&'b str>,
3053 }
3054 let query_params = QueryParams {
3055 error_trace: self.error_trace,
3056 filter_path: self.filter_path,
3057 human: self.human,
3058 pretty: self.pretty,
3059 source: self.source,
3060 };
3061 Some(query_params)
3062 };
3063 let body = self.body;
3064 let response = self
3065 .transport
3066 .send(method, &path, headers, query_string.as_ref(), body, timeout)
3067 .await?;
3068 Ok(response)
3069 }
3070}
3071#[cfg(feature = "experimental-apis")]
3072#[derive(Debug, Clone, PartialEq, Eq)]
3073#[doc = "API parts for the Connector Update Api Key Id API"]
3074pub enum ConnectorUpdateApiKeyIdParts<'b> {
3075 #[doc = "ConnectorId"]
3076 ConnectorId(&'b str),
3077}
3078#[cfg(feature = "experimental-apis")]
3079impl<'b> ConnectorUpdateApiKeyIdParts<'b> {
3080 #[doc = "Builds a relative URL path to the Connector Update Api Key Id API"]
3081 pub fn url(self) -> Cow<'static, str> {
3082 match self {
3083 ConnectorUpdateApiKeyIdParts::ConnectorId(connector_id) => {
3084 let encoded_connector_id: Cow<str> =
3085 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
3086 let mut p = String::with_capacity(24usize + encoded_connector_id.len());
3087 p.push_str("/_connector/");
3088 p.push_str(encoded_connector_id.as_ref());
3089 p.push_str("/_api_key_id");
3090 p.into()
3091 }
3092 }
3093 }
3094}
3095#[doc = "Builder for the [Connector Update Api Key Id API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-api-key-id-api.html)\n\nUpdates the API key id and/or API key secret id fields in the connector document."]
3096#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
3097#[cfg(feature = "experimental-apis")]
3098#[derive(Clone, Debug)]
3099pub struct ConnectorUpdateApiKeyId<'a, 'b, B> {
3100 transport: &'a Transport,
3101 parts: ConnectorUpdateApiKeyIdParts<'b>,
3102 body: Option<B>,
3103 error_trace: Option<bool>,
3104 filter_path: Option<&'b [&'b str]>,
3105 headers: HeaderMap,
3106 human: Option<bool>,
3107 pretty: Option<bool>,
3108 request_timeout: Option<Duration>,
3109 source: Option<&'b str>,
3110}
3111#[cfg(feature = "experimental-apis")]
3112impl<'a, 'b, B> ConnectorUpdateApiKeyId<'a, 'b, B>
3113where
3114 B: Body,
3115{
3116 #[doc = "Creates a new instance of [ConnectorUpdateApiKeyId] with the specified API parts"]
3117 pub fn new(transport: &'a Transport, parts: ConnectorUpdateApiKeyIdParts<'b>) -> Self {
3118 let headers = HeaderMap::new();
3119 ConnectorUpdateApiKeyId {
3120 transport,
3121 parts,
3122 headers,
3123 body: None,
3124 error_trace: None,
3125 filter_path: None,
3126 human: None,
3127 pretty: None,
3128 request_timeout: None,
3129 source: None,
3130 }
3131 }
3132 #[doc = "The body for the API call"]
3133 pub fn body<T>(self, body: T) -> ConnectorUpdateApiKeyId<'a, 'b, JsonBody<T>>
3134 where
3135 T: Serialize,
3136 {
3137 ConnectorUpdateApiKeyId {
3138 transport: self.transport,
3139 parts: self.parts,
3140 body: Some(body.into()),
3141 error_trace: self.error_trace,
3142 filter_path: self.filter_path,
3143 headers: self.headers,
3144 human: self.human,
3145 pretty: self.pretty,
3146 request_timeout: self.request_timeout,
3147 source: self.source,
3148 }
3149 }
3150 #[doc = "Include the stack trace of returned errors."]
3151 pub fn error_trace(mut self, error_trace: bool) -> Self {
3152 self.error_trace = Some(error_trace);
3153 self
3154 }
3155 #[doc = "A comma-separated list of filters used to reduce the response."]
3156 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3157 self.filter_path = Some(filter_path);
3158 self
3159 }
3160 #[doc = "Adds a HTTP header"]
3161 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3162 self.headers.insert(key, value);
3163 self
3164 }
3165 #[doc = "Return human readable values for statistics."]
3166 pub fn human(mut self, human: bool) -> Self {
3167 self.human = Some(human);
3168 self
3169 }
3170 #[doc = "Pretty format the returned JSON response."]
3171 pub fn pretty(mut self, pretty: bool) -> Self {
3172 self.pretty = Some(pretty);
3173 self
3174 }
3175 #[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."]
3176 pub fn request_timeout(mut self, timeout: Duration) -> Self {
3177 self.request_timeout = Some(timeout);
3178 self
3179 }
3180 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3181 pub fn source(mut self, source: &'b str) -> Self {
3182 self.source = Some(source);
3183 self
3184 }
3185 #[doc = "Creates an asynchronous call to the Connector Update Api Key Id API that can be awaited"]
3186 pub async fn send(self) -> Result<Response, Error> {
3187 let path = self.parts.url();
3188 let method = http::Method::Put;
3189 let headers = self.headers;
3190 let timeout = self.request_timeout;
3191 let query_string = {
3192 #[serde_with::skip_serializing_none]
3193 #[derive(Serialize)]
3194 struct QueryParams<'b> {
3195 error_trace: Option<bool>,
3196 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3197 filter_path: Option<&'b [&'b str]>,
3198 human: Option<bool>,
3199 pretty: Option<bool>,
3200 source: Option<&'b str>,
3201 }
3202 let query_params = QueryParams {
3203 error_trace: self.error_trace,
3204 filter_path: self.filter_path,
3205 human: self.human,
3206 pretty: self.pretty,
3207 source: self.source,
3208 };
3209 Some(query_params)
3210 };
3211 let body = self.body;
3212 let response = self
3213 .transport
3214 .send(method, &path, headers, query_string.as_ref(), body, timeout)
3215 .await?;
3216 Ok(response)
3217 }
3218}
3219#[cfg(feature = "experimental-apis")]
3220#[derive(Debug, Clone, PartialEq, Eq)]
3221#[doc = "API parts for the Connector Update Configuration API"]
3222pub enum ConnectorUpdateConfigurationParts<'b> {
3223 #[doc = "ConnectorId"]
3224 ConnectorId(&'b str),
3225}
3226#[cfg(feature = "experimental-apis")]
3227impl<'b> ConnectorUpdateConfigurationParts<'b> {
3228 #[doc = "Builds a relative URL path to the Connector Update Configuration API"]
3229 pub fn url(self) -> Cow<'static, str> {
3230 match self {
3231 ConnectorUpdateConfigurationParts::ConnectorId(connector_id) => {
3232 let encoded_connector_id: Cow<str> =
3233 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
3234 let mut p = String::with_capacity(27usize + encoded_connector_id.len());
3235 p.push_str("/_connector/");
3236 p.push_str(encoded_connector_id.as_ref());
3237 p.push_str("/_configuration");
3238 p.into()
3239 }
3240 }
3241 }
3242}
3243#[doc = "Builder for the [Connector Update Configuration API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-configuration-api.html)\n\nUpdates the connector configuration."]
3244#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
3245#[cfg(feature = "experimental-apis")]
3246#[derive(Clone, Debug)]
3247pub struct ConnectorUpdateConfiguration<'a, 'b, B> {
3248 transport: &'a Transport,
3249 parts: ConnectorUpdateConfigurationParts<'b>,
3250 body: Option<B>,
3251 error_trace: Option<bool>,
3252 filter_path: Option<&'b [&'b str]>,
3253 headers: HeaderMap,
3254 human: Option<bool>,
3255 pretty: Option<bool>,
3256 request_timeout: Option<Duration>,
3257 source: Option<&'b str>,
3258}
3259#[cfg(feature = "experimental-apis")]
3260impl<'a, 'b, B> ConnectorUpdateConfiguration<'a, 'b, B>
3261where
3262 B: Body,
3263{
3264 #[doc = "Creates a new instance of [ConnectorUpdateConfiguration] with the specified API parts"]
3265 pub fn new(transport: &'a Transport, parts: ConnectorUpdateConfigurationParts<'b>) -> Self {
3266 let headers = HeaderMap::new();
3267 ConnectorUpdateConfiguration {
3268 transport,
3269 parts,
3270 headers,
3271 body: None,
3272 error_trace: None,
3273 filter_path: None,
3274 human: None,
3275 pretty: None,
3276 request_timeout: None,
3277 source: None,
3278 }
3279 }
3280 #[doc = "The body for the API call"]
3281 pub fn body<T>(self, body: T) -> ConnectorUpdateConfiguration<'a, 'b, JsonBody<T>>
3282 where
3283 T: Serialize,
3284 {
3285 ConnectorUpdateConfiguration {
3286 transport: self.transport,
3287 parts: self.parts,
3288 body: Some(body.into()),
3289 error_trace: self.error_trace,
3290 filter_path: self.filter_path,
3291 headers: self.headers,
3292 human: self.human,
3293 pretty: self.pretty,
3294 request_timeout: self.request_timeout,
3295 source: self.source,
3296 }
3297 }
3298 #[doc = "Include the stack trace of returned errors."]
3299 pub fn error_trace(mut self, error_trace: bool) -> Self {
3300 self.error_trace = Some(error_trace);
3301 self
3302 }
3303 #[doc = "A comma-separated list of filters used to reduce the response."]
3304 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3305 self.filter_path = Some(filter_path);
3306 self
3307 }
3308 #[doc = "Adds a HTTP header"]
3309 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3310 self.headers.insert(key, value);
3311 self
3312 }
3313 #[doc = "Return human readable values for statistics."]
3314 pub fn human(mut self, human: bool) -> Self {
3315 self.human = Some(human);
3316 self
3317 }
3318 #[doc = "Pretty format the returned JSON response."]
3319 pub fn pretty(mut self, pretty: bool) -> Self {
3320 self.pretty = Some(pretty);
3321 self
3322 }
3323 #[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."]
3324 pub fn request_timeout(mut self, timeout: Duration) -> Self {
3325 self.request_timeout = Some(timeout);
3326 self
3327 }
3328 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3329 pub fn source(mut self, source: &'b str) -> Self {
3330 self.source = Some(source);
3331 self
3332 }
3333 #[doc = "Creates an asynchronous call to the Connector Update Configuration API that can be awaited"]
3334 pub async fn send(self) -> Result<Response, Error> {
3335 let path = self.parts.url();
3336 let method = http::Method::Put;
3337 let headers = self.headers;
3338 let timeout = self.request_timeout;
3339 let query_string = {
3340 #[serde_with::skip_serializing_none]
3341 #[derive(Serialize)]
3342 struct QueryParams<'b> {
3343 error_trace: Option<bool>,
3344 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3345 filter_path: Option<&'b [&'b str]>,
3346 human: Option<bool>,
3347 pretty: Option<bool>,
3348 source: Option<&'b str>,
3349 }
3350 let query_params = QueryParams {
3351 error_trace: self.error_trace,
3352 filter_path: self.filter_path,
3353 human: self.human,
3354 pretty: self.pretty,
3355 source: self.source,
3356 };
3357 Some(query_params)
3358 };
3359 let body = self.body;
3360 let response = self
3361 .transport
3362 .send(method, &path, headers, query_string.as_ref(), body, timeout)
3363 .await?;
3364 Ok(response)
3365 }
3366}
3367#[cfg(feature = "experimental-apis")]
3368#[derive(Debug, Clone, PartialEq, Eq)]
3369#[doc = "API parts for the Connector Update Error API"]
3370pub enum ConnectorUpdateErrorParts<'b> {
3371 #[doc = "ConnectorId"]
3372 ConnectorId(&'b str),
3373}
3374#[cfg(feature = "experimental-apis")]
3375impl<'b> ConnectorUpdateErrorParts<'b> {
3376 #[doc = "Builds a relative URL path to the Connector Update Error API"]
3377 pub fn url(self) -> Cow<'static, str> {
3378 match self {
3379 ConnectorUpdateErrorParts::ConnectorId(connector_id) => {
3380 let encoded_connector_id: Cow<str> =
3381 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
3382 let mut p = String::with_capacity(19usize + encoded_connector_id.len());
3383 p.push_str("/_connector/");
3384 p.push_str(encoded_connector_id.as_ref());
3385 p.push_str("/_error");
3386 p.into()
3387 }
3388 }
3389 }
3390}
3391#[doc = "Builder for the [Connector Update Error API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-error-api.html)\n\nUpdates the error field in the connector document."]
3392#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
3393#[cfg(feature = "experimental-apis")]
3394#[derive(Clone, Debug)]
3395pub struct ConnectorUpdateError<'a, 'b, B> {
3396 transport: &'a Transport,
3397 parts: ConnectorUpdateErrorParts<'b>,
3398 body: Option<B>,
3399 error_trace: Option<bool>,
3400 filter_path: Option<&'b [&'b str]>,
3401 headers: HeaderMap,
3402 human: Option<bool>,
3403 pretty: Option<bool>,
3404 request_timeout: Option<Duration>,
3405 source: Option<&'b str>,
3406}
3407#[cfg(feature = "experimental-apis")]
3408impl<'a, 'b, B> ConnectorUpdateError<'a, 'b, B>
3409where
3410 B: Body,
3411{
3412 #[doc = "Creates a new instance of [ConnectorUpdateError] with the specified API parts"]
3413 pub fn new(transport: &'a Transport, parts: ConnectorUpdateErrorParts<'b>) -> Self {
3414 let headers = HeaderMap::new();
3415 ConnectorUpdateError {
3416 transport,
3417 parts,
3418 headers,
3419 body: None,
3420 error_trace: None,
3421 filter_path: None,
3422 human: None,
3423 pretty: None,
3424 request_timeout: None,
3425 source: None,
3426 }
3427 }
3428 #[doc = "The body for the API call"]
3429 pub fn body<T>(self, body: T) -> ConnectorUpdateError<'a, 'b, JsonBody<T>>
3430 where
3431 T: Serialize,
3432 {
3433 ConnectorUpdateError {
3434 transport: self.transport,
3435 parts: self.parts,
3436 body: Some(body.into()),
3437 error_trace: self.error_trace,
3438 filter_path: self.filter_path,
3439 headers: self.headers,
3440 human: self.human,
3441 pretty: self.pretty,
3442 request_timeout: self.request_timeout,
3443 source: self.source,
3444 }
3445 }
3446 #[doc = "Include the stack trace of returned errors."]
3447 pub fn error_trace(mut self, error_trace: bool) -> Self {
3448 self.error_trace = Some(error_trace);
3449 self
3450 }
3451 #[doc = "A comma-separated list of filters used to reduce the response."]
3452 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3453 self.filter_path = Some(filter_path);
3454 self
3455 }
3456 #[doc = "Adds a HTTP header"]
3457 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3458 self.headers.insert(key, value);
3459 self
3460 }
3461 #[doc = "Return human readable values for statistics."]
3462 pub fn human(mut self, human: bool) -> Self {
3463 self.human = Some(human);
3464 self
3465 }
3466 #[doc = "Pretty format the returned JSON response."]
3467 pub fn pretty(mut self, pretty: bool) -> Self {
3468 self.pretty = Some(pretty);
3469 self
3470 }
3471 #[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."]
3472 pub fn request_timeout(mut self, timeout: Duration) -> Self {
3473 self.request_timeout = Some(timeout);
3474 self
3475 }
3476 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3477 pub fn source(mut self, source: &'b str) -> Self {
3478 self.source = Some(source);
3479 self
3480 }
3481 #[doc = "Creates an asynchronous call to the Connector Update Error API that can be awaited"]
3482 pub async fn send(self) -> Result<Response, Error> {
3483 let path = self.parts.url();
3484 let method = http::Method::Put;
3485 let headers = self.headers;
3486 let timeout = self.request_timeout;
3487 let query_string = {
3488 #[serde_with::skip_serializing_none]
3489 #[derive(Serialize)]
3490 struct QueryParams<'b> {
3491 error_trace: Option<bool>,
3492 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3493 filter_path: Option<&'b [&'b str]>,
3494 human: Option<bool>,
3495 pretty: Option<bool>,
3496 source: Option<&'b str>,
3497 }
3498 let query_params = QueryParams {
3499 error_trace: self.error_trace,
3500 filter_path: self.filter_path,
3501 human: self.human,
3502 pretty: self.pretty,
3503 source: self.source,
3504 };
3505 Some(query_params)
3506 };
3507 let body = self.body;
3508 let response = self
3509 .transport
3510 .send(method, &path, headers, query_string.as_ref(), body, timeout)
3511 .await?;
3512 Ok(response)
3513 }
3514}
3515#[cfg(feature = "experimental-apis")]
3516#[derive(Debug, Clone, PartialEq, Eq)]
3517#[doc = "API parts for the Connector Update Features API"]
3518pub enum ConnectorUpdateFeaturesParts<'b> {
3519 #[doc = "ConnectorId"]
3520 ConnectorId(&'b str),
3521}
3522#[cfg(feature = "experimental-apis")]
3523impl<'b> ConnectorUpdateFeaturesParts<'b> {
3524 #[doc = "Builds a relative URL path to the Connector Update Features API"]
3525 pub fn url(self) -> Cow<'static, str> {
3526 match self {
3527 ConnectorUpdateFeaturesParts::ConnectorId(connector_id) => {
3528 let encoded_connector_id: Cow<str> =
3529 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
3530 let mut p = String::with_capacity(22usize + encoded_connector_id.len());
3531 p.push_str("/_connector/");
3532 p.push_str(encoded_connector_id.as_ref());
3533 p.push_str("/_features");
3534 p.into()
3535 }
3536 }
3537 }
3538}
3539#[doc = "Builder for the [Connector Update Features API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-features-api.html)\n\nUpdates the connector features in the connector document."]
3540#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
3541#[cfg(feature = "experimental-apis")]
3542#[derive(Clone, Debug)]
3543pub struct ConnectorUpdateFeatures<'a, 'b, B> {
3544 transport: &'a Transport,
3545 parts: ConnectorUpdateFeaturesParts<'b>,
3546 body: Option<B>,
3547 error_trace: Option<bool>,
3548 filter_path: Option<&'b [&'b str]>,
3549 headers: HeaderMap,
3550 human: Option<bool>,
3551 pretty: Option<bool>,
3552 request_timeout: Option<Duration>,
3553 source: Option<&'b str>,
3554}
3555#[cfg(feature = "experimental-apis")]
3556impl<'a, 'b, B> ConnectorUpdateFeatures<'a, 'b, B>
3557where
3558 B: Body,
3559{
3560 #[doc = "Creates a new instance of [ConnectorUpdateFeatures] with the specified API parts"]
3561 pub fn new(transport: &'a Transport, parts: ConnectorUpdateFeaturesParts<'b>) -> Self {
3562 let headers = HeaderMap::new();
3563 ConnectorUpdateFeatures {
3564 transport,
3565 parts,
3566 headers,
3567 body: None,
3568 error_trace: None,
3569 filter_path: None,
3570 human: None,
3571 pretty: None,
3572 request_timeout: None,
3573 source: None,
3574 }
3575 }
3576 #[doc = "The body for the API call"]
3577 pub fn body<T>(self, body: T) -> ConnectorUpdateFeatures<'a, 'b, JsonBody<T>>
3578 where
3579 T: Serialize,
3580 {
3581 ConnectorUpdateFeatures {
3582 transport: self.transport,
3583 parts: self.parts,
3584 body: Some(body.into()),
3585 error_trace: self.error_trace,
3586 filter_path: self.filter_path,
3587 headers: self.headers,
3588 human: self.human,
3589 pretty: self.pretty,
3590 request_timeout: self.request_timeout,
3591 source: self.source,
3592 }
3593 }
3594 #[doc = "Include the stack trace of returned errors."]
3595 pub fn error_trace(mut self, error_trace: bool) -> Self {
3596 self.error_trace = Some(error_trace);
3597 self
3598 }
3599 #[doc = "A comma-separated list of filters used to reduce the response."]
3600 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3601 self.filter_path = Some(filter_path);
3602 self
3603 }
3604 #[doc = "Adds a HTTP header"]
3605 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3606 self.headers.insert(key, value);
3607 self
3608 }
3609 #[doc = "Return human readable values for statistics."]
3610 pub fn human(mut self, human: bool) -> Self {
3611 self.human = Some(human);
3612 self
3613 }
3614 #[doc = "Pretty format the returned JSON response."]
3615 pub fn pretty(mut self, pretty: bool) -> Self {
3616 self.pretty = Some(pretty);
3617 self
3618 }
3619 #[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."]
3620 pub fn request_timeout(mut self, timeout: Duration) -> Self {
3621 self.request_timeout = Some(timeout);
3622 self
3623 }
3624 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3625 pub fn source(mut self, source: &'b str) -> Self {
3626 self.source = Some(source);
3627 self
3628 }
3629 #[doc = "Creates an asynchronous call to the Connector Update Features API that can be awaited"]
3630 pub async fn send(self) -> Result<Response, Error> {
3631 let path = self.parts.url();
3632 let method = http::Method::Put;
3633 let headers = self.headers;
3634 let timeout = self.request_timeout;
3635 let query_string = {
3636 #[serde_with::skip_serializing_none]
3637 #[derive(Serialize)]
3638 struct QueryParams<'b> {
3639 error_trace: Option<bool>,
3640 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3641 filter_path: Option<&'b [&'b str]>,
3642 human: Option<bool>,
3643 pretty: Option<bool>,
3644 source: Option<&'b str>,
3645 }
3646 let query_params = QueryParams {
3647 error_trace: self.error_trace,
3648 filter_path: self.filter_path,
3649 human: self.human,
3650 pretty: self.pretty,
3651 source: self.source,
3652 };
3653 Some(query_params)
3654 };
3655 let body = self.body;
3656 let response = self
3657 .transport
3658 .send(method, &path, headers, query_string.as_ref(), body, timeout)
3659 .await?;
3660 Ok(response)
3661 }
3662}
3663#[cfg(feature = "experimental-apis")]
3664#[derive(Debug, Clone, PartialEq, Eq)]
3665#[doc = "API parts for the Connector Update Filtering API"]
3666pub enum ConnectorUpdateFilteringParts<'b> {
3667 #[doc = "ConnectorId"]
3668 ConnectorId(&'b str),
3669}
3670#[cfg(feature = "experimental-apis")]
3671impl<'b> ConnectorUpdateFilteringParts<'b> {
3672 #[doc = "Builds a relative URL path to the Connector Update Filtering API"]
3673 pub fn url(self) -> Cow<'static, str> {
3674 match self {
3675 ConnectorUpdateFilteringParts::ConnectorId(connector_id) => {
3676 let encoded_connector_id: Cow<str> =
3677 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
3678 let mut p = String::with_capacity(23usize + encoded_connector_id.len());
3679 p.push_str("/_connector/");
3680 p.push_str(encoded_connector_id.as_ref());
3681 p.push_str("/_filtering");
3682 p.into()
3683 }
3684 }
3685 }
3686}
3687#[doc = "Builder for the [Connector Update Filtering API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-filtering-api.html)\n\nUpdates the filtering field in the connector document."]
3688#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
3689#[cfg(feature = "experimental-apis")]
3690#[derive(Clone, Debug)]
3691pub struct ConnectorUpdateFiltering<'a, 'b, B> {
3692 transport: &'a Transport,
3693 parts: ConnectorUpdateFilteringParts<'b>,
3694 body: Option<B>,
3695 error_trace: Option<bool>,
3696 filter_path: Option<&'b [&'b str]>,
3697 headers: HeaderMap,
3698 human: Option<bool>,
3699 pretty: Option<bool>,
3700 request_timeout: Option<Duration>,
3701 source: Option<&'b str>,
3702}
3703#[cfg(feature = "experimental-apis")]
3704impl<'a, 'b, B> ConnectorUpdateFiltering<'a, 'b, B>
3705where
3706 B: Body,
3707{
3708 #[doc = "Creates a new instance of [ConnectorUpdateFiltering] with the specified API parts"]
3709 pub fn new(transport: &'a Transport, parts: ConnectorUpdateFilteringParts<'b>) -> Self {
3710 let headers = HeaderMap::new();
3711 ConnectorUpdateFiltering {
3712 transport,
3713 parts,
3714 headers,
3715 body: None,
3716 error_trace: None,
3717 filter_path: None,
3718 human: None,
3719 pretty: None,
3720 request_timeout: None,
3721 source: None,
3722 }
3723 }
3724 #[doc = "The body for the API call"]
3725 pub fn body<T>(self, body: T) -> ConnectorUpdateFiltering<'a, 'b, JsonBody<T>>
3726 where
3727 T: Serialize,
3728 {
3729 ConnectorUpdateFiltering {
3730 transport: self.transport,
3731 parts: self.parts,
3732 body: Some(body.into()),
3733 error_trace: self.error_trace,
3734 filter_path: self.filter_path,
3735 headers: self.headers,
3736 human: self.human,
3737 pretty: self.pretty,
3738 request_timeout: self.request_timeout,
3739 source: self.source,
3740 }
3741 }
3742 #[doc = "Include the stack trace of returned errors."]
3743 pub fn error_trace(mut self, error_trace: bool) -> Self {
3744 self.error_trace = Some(error_trace);
3745 self
3746 }
3747 #[doc = "A comma-separated list of filters used to reduce the response."]
3748 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3749 self.filter_path = Some(filter_path);
3750 self
3751 }
3752 #[doc = "Adds a HTTP header"]
3753 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3754 self.headers.insert(key, value);
3755 self
3756 }
3757 #[doc = "Return human readable values for statistics."]
3758 pub fn human(mut self, human: bool) -> Self {
3759 self.human = Some(human);
3760 self
3761 }
3762 #[doc = "Pretty format the returned JSON response."]
3763 pub fn pretty(mut self, pretty: bool) -> Self {
3764 self.pretty = Some(pretty);
3765 self
3766 }
3767 #[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."]
3768 pub fn request_timeout(mut self, timeout: Duration) -> Self {
3769 self.request_timeout = Some(timeout);
3770 self
3771 }
3772 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3773 pub fn source(mut self, source: &'b str) -> Self {
3774 self.source = Some(source);
3775 self
3776 }
3777 #[doc = "Creates an asynchronous call to the Connector Update Filtering API that can be awaited"]
3778 pub async fn send(self) -> Result<Response, Error> {
3779 let path = self.parts.url();
3780 let method = http::Method::Put;
3781 let headers = self.headers;
3782 let timeout = self.request_timeout;
3783 let query_string = {
3784 #[serde_with::skip_serializing_none]
3785 #[derive(Serialize)]
3786 struct QueryParams<'b> {
3787 error_trace: Option<bool>,
3788 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3789 filter_path: Option<&'b [&'b str]>,
3790 human: Option<bool>,
3791 pretty: Option<bool>,
3792 source: Option<&'b str>,
3793 }
3794 let query_params = QueryParams {
3795 error_trace: self.error_trace,
3796 filter_path: self.filter_path,
3797 human: self.human,
3798 pretty: self.pretty,
3799 source: self.source,
3800 };
3801 Some(query_params)
3802 };
3803 let body = self.body;
3804 let response = self
3805 .transport
3806 .send(method, &path, headers, query_string.as_ref(), body, timeout)
3807 .await?;
3808 Ok(response)
3809 }
3810}
3811#[cfg(feature = "experimental-apis")]
3812#[derive(Debug, Clone, PartialEq, Eq)]
3813#[doc = "API parts for the Connector Update Filtering Validation API"]
3814pub enum ConnectorUpdateFilteringValidationParts<'b> {
3815 #[doc = "ConnectorId"]
3816 ConnectorId(&'b str),
3817}
3818#[cfg(feature = "experimental-apis")]
3819impl<'b> ConnectorUpdateFilteringValidationParts<'b> {
3820 #[doc = "Builds a relative URL path to the Connector Update Filtering Validation API"]
3821 pub fn url(self) -> Cow<'static, str> {
3822 match self {
3823 ConnectorUpdateFilteringValidationParts::ConnectorId(connector_id) => {
3824 let encoded_connector_id: Cow<str> =
3825 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
3826 let mut p = String::with_capacity(35usize + encoded_connector_id.len());
3827 p.push_str("/_connector/");
3828 p.push_str(encoded_connector_id.as_ref());
3829 p.push_str("/_filtering/_validation");
3830 p.into()
3831 }
3832 }
3833 }
3834}
3835#[doc = "Builder for the [Connector Update Filtering Validation API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-filtering-api.html)\n\nUpdates the validation info of the draft filtering rules."]
3836#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
3837#[cfg(feature = "experimental-apis")]
3838#[derive(Clone, Debug)]
3839pub struct ConnectorUpdateFilteringValidation<'a, 'b, B> {
3840 transport: &'a Transport,
3841 parts: ConnectorUpdateFilteringValidationParts<'b>,
3842 body: Option<B>,
3843 error_trace: Option<bool>,
3844 filter_path: Option<&'b [&'b str]>,
3845 headers: HeaderMap,
3846 human: Option<bool>,
3847 pretty: Option<bool>,
3848 request_timeout: Option<Duration>,
3849 source: Option<&'b str>,
3850}
3851#[cfg(feature = "experimental-apis")]
3852impl<'a, 'b, B> ConnectorUpdateFilteringValidation<'a, 'b, B>
3853where
3854 B: Body,
3855{
3856 #[doc = "Creates a new instance of [ConnectorUpdateFilteringValidation] with the specified API parts"]
3857 pub fn new(
3858 transport: &'a Transport,
3859 parts: ConnectorUpdateFilteringValidationParts<'b>,
3860 ) -> Self {
3861 let headers = HeaderMap::new();
3862 ConnectorUpdateFilteringValidation {
3863 transport,
3864 parts,
3865 headers,
3866 body: None,
3867 error_trace: None,
3868 filter_path: None,
3869 human: None,
3870 pretty: None,
3871 request_timeout: None,
3872 source: None,
3873 }
3874 }
3875 #[doc = "The body for the API call"]
3876 pub fn body<T>(self, body: T) -> ConnectorUpdateFilteringValidation<'a, 'b, JsonBody<T>>
3877 where
3878 T: Serialize,
3879 {
3880 ConnectorUpdateFilteringValidation {
3881 transport: self.transport,
3882 parts: self.parts,
3883 body: Some(body.into()),
3884 error_trace: self.error_trace,
3885 filter_path: self.filter_path,
3886 headers: self.headers,
3887 human: self.human,
3888 pretty: self.pretty,
3889 request_timeout: self.request_timeout,
3890 source: self.source,
3891 }
3892 }
3893 #[doc = "Include the stack trace of returned errors."]
3894 pub fn error_trace(mut self, error_trace: bool) -> Self {
3895 self.error_trace = Some(error_trace);
3896 self
3897 }
3898 #[doc = "A comma-separated list of filters used to reduce the response."]
3899 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
3900 self.filter_path = Some(filter_path);
3901 self
3902 }
3903 #[doc = "Adds a HTTP header"]
3904 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
3905 self.headers.insert(key, value);
3906 self
3907 }
3908 #[doc = "Return human readable values for statistics."]
3909 pub fn human(mut self, human: bool) -> Self {
3910 self.human = Some(human);
3911 self
3912 }
3913 #[doc = "Pretty format the returned JSON response."]
3914 pub fn pretty(mut self, pretty: bool) -> Self {
3915 self.pretty = Some(pretty);
3916 self
3917 }
3918 #[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."]
3919 pub fn request_timeout(mut self, timeout: Duration) -> Self {
3920 self.request_timeout = Some(timeout);
3921 self
3922 }
3923 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
3924 pub fn source(mut self, source: &'b str) -> Self {
3925 self.source = Some(source);
3926 self
3927 }
3928 #[doc = "Creates an asynchronous call to the Connector Update Filtering Validation API that can be awaited"]
3929 pub async fn send(self) -> Result<Response, Error> {
3930 let path = self.parts.url();
3931 let method = http::Method::Put;
3932 let headers = self.headers;
3933 let timeout = self.request_timeout;
3934 let query_string = {
3935 #[serde_with::skip_serializing_none]
3936 #[derive(Serialize)]
3937 struct QueryParams<'b> {
3938 error_trace: Option<bool>,
3939 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
3940 filter_path: Option<&'b [&'b str]>,
3941 human: Option<bool>,
3942 pretty: Option<bool>,
3943 source: Option<&'b str>,
3944 }
3945 let query_params = QueryParams {
3946 error_trace: self.error_trace,
3947 filter_path: self.filter_path,
3948 human: self.human,
3949 pretty: self.pretty,
3950 source: self.source,
3951 };
3952 Some(query_params)
3953 };
3954 let body = self.body;
3955 let response = self
3956 .transport
3957 .send(method, &path, headers, query_string.as_ref(), body, timeout)
3958 .await?;
3959 Ok(response)
3960 }
3961}
3962#[cfg(feature = "experimental-apis")]
3963#[derive(Debug, Clone, PartialEq, Eq)]
3964#[doc = "API parts for the Connector Update Index Name API"]
3965pub enum ConnectorUpdateIndexNameParts<'b> {
3966 #[doc = "ConnectorId"]
3967 ConnectorId(&'b str),
3968}
3969#[cfg(feature = "experimental-apis")]
3970impl<'b> ConnectorUpdateIndexNameParts<'b> {
3971 #[doc = "Builds a relative URL path to the Connector Update Index Name API"]
3972 pub fn url(self) -> Cow<'static, str> {
3973 match self {
3974 ConnectorUpdateIndexNameParts::ConnectorId(connector_id) => {
3975 let encoded_connector_id: Cow<str> =
3976 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
3977 let mut p = String::with_capacity(24usize + encoded_connector_id.len());
3978 p.push_str("/_connector/");
3979 p.push_str(encoded_connector_id.as_ref());
3980 p.push_str("/_index_name");
3981 p.into()
3982 }
3983 }
3984 }
3985}
3986#[doc = "Builder for the [Connector Update Index Name API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-index-name-api.html)\n\nUpdates the index name of the connector."]
3987#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
3988#[cfg(feature = "experimental-apis")]
3989#[derive(Clone, Debug)]
3990pub struct ConnectorUpdateIndexName<'a, 'b, B> {
3991 transport: &'a Transport,
3992 parts: ConnectorUpdateIndexNameParts<'b>,
3993 body: Option<B>,
3994 error_trace: Option<bool>,
3995 filter_path: Option<&'b [&'b str]>,
3996 headers: HeaderMap,
3997 human: Option<bool>,
3998 pretty: Option<bool>,
3999 request_timeout: Option<Duration>,
4000 source: Option<&'b str>,
4001}
4002#[cfg(feature = "experimental-apis")]
4003impl<'a, 'b, B> ConnectorUpdateIndexName<'a, 'b, B>
4004where
4005 B: Body,
4006{
4007 #[doc = "Creates a new instance of [ConnectorUpdateIndexName] with the specified API parts"]
4008 pub fn new(transport: &'a Transport, parts: ConnectorUpdateIndexNameParts<'b>) -> Self {
4009 let headers = HeaderMap::new();
4010 ConnectorUpdateIndexName {
4011 transport,
4012 parts,
4013 headers,
4014 body: None,
4015 error_trace: None,
4016 filter_path: None,
4017 human: None,
4018 pretty: None,
4019 request_timeout: None,
4020 source: None,
4021 }
4022 }
4023 #[doc = "The body for the API call"]
4024 pub fn body<T>(self, body: T) -> ConnectorUpdateIndexName<'a, 'b, JsonBody<T>>
4025 where
4026 T: Serialize,
4027 {
4028 ConnectorUpdateIndexName {
4029 transport: self.transport,
4030 parts: self.parts,
4031 body: Some(body.into()),
4032 error_trace: self.error_trace,
4033 filter_path: self.filter_path,
4034 headers: self.headers,
4035 human: self.human,
4036 pretty: self.pretty,
4037 request_timeout: self.request_timeout,
4038 source: self.source,
4039 }
4040 }
4041 #[doc = "Include the stack trace of returned errors."]
4042 pub fn error_trace(mut self, error_trace: bool) -> Self {
4043 self.error_trace = Some(error_trace);
4044 self
4045 }
4046 #[doc = "A comma-separated list of filters used to reduce the response."]
4047 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
4048 self.filter_path = Some(filter_path);
4049 self
4050 }
4051 #[doc = "Adds a HTTP header"]
4052 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
4053 self.headers.insert(key, value);
4054 self
4055 }
4056 #[doc = "Return human readable values for statistics."]
4057 pub fn human(mut self, human: bool) -> Self {
4058 self.human = Some(human);
4059 self
4060 }
4061 #[doc = "Pretty format the returned JSON response."]
4062 pub fn pretty(mut self, pretty: bool) -> Self {
4063 self.pretty = Some(pretty);
4064 self
4065 }
4066 #[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."]
4067 pub fn request_timeout(mut self, timeout: Duration) -> Self {
4068 self.request_timeout = Some(timeout);
4069 self
4070 }
4071 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
4072 pub fn source(mut self, source: &'b str) -> Self {
4073 self.source = Some(source);
4074 self
4075 }
4076 #[doc = "Creates an asynchronous call to the Connector Update Index Name API that can be awaited"]
4077 pub async fn send(self) -> Result<Response, Error> {
4078 let path = self.parts.url();
4079 let method = http::Method::Put;
4080 let headers = self.headers;
4081 let timeout = self.request_timeout;
4082 let query_string = {
4083 #[serde_with::skip_serializing_none]
4084 #[derive(Serialize)]
4085 struct QueryParams<'b> {
4086 error_trace: Option<bool>,
4087 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
4088 filter_path: Option<&'b [&'b str]>,
4089 human: Option<bool>,
4090 pretty: Option<bool>,
4091 source: Option<&'b str>,
4092 }
4093 let query_params = QueryParams {
4094 error_trace: self.error_trace,
4095 filter_path: self.filter_path,
4096 human: self.human,
4097 pretty: self.pretty,
4098 source: self.source,
4099 };
4100 Some(query_params)
4101 };
4102 let body = self.body;
4103 let response = self
4104 .transport
4105 .send(method, &path, headers, query_string.as_ref(), body, timeout)
4106 .await?;
4107 Ok(response)
4108 }
4109}
4110#[cfg(feature = "experimental-apis")]
4111#[derive(Debug, Clone, PartialEq, Eq)]
4112#[doc = "API parts for the Connector Update Name API"]
4113pub enum ConnectorUpdateNameParts<'b> {
4114 #[doc = "ConnectorId"]
4115 ConnectorId(&'b str),
4116}
4117#[cfg(feature = "experimental-apis")]
4118impl<'b> ConnectorUpdateNameParts<'b> {
4119 #[doc = "Builds a relative URL path to the Connector Update Name API"]
4120 pub fn url(self) -> Cow<'static, str> {
4121 match self {
4122 ConnectorUpdateNameParts::ConnectorId(connector_id) => {
4123 let encoded_connector_id: Cow<str> =
4124 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
4125 let mut p = String::with_capacity(18usize + encoded_connector_id.len());
4126 p.push_str("/_connector/");
4127 p.push_str(encoded_connector_id.as_ref());
4128 p.push_str("/_name");
4129 p.into()
4130 }
4131 }
4132 }
4133}
4134#[doc = "Builder for the [Connector Update Name API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-name-description-api.html)\n\nUpdates the name and/or description fields in the connector document."]
4135#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
4136#[cfg(feature = "experimental-apis")]
4137#[derive(Clone, Debug)]
4138pub struct ConnectorUpdateName<'a, 'b, B> {
4139 transport: &'a Transport,
4140 parts: ConnectorUpdateNameParts<'b>,
4141 body: Option<B>,
4142 error_trace: Option<bool>,
4143 filter_path: Option<&'b [&'b str]>,
4144 headers: HeaderMap,
4145 human: Option<bool>,
4146 pretty: Option<bool>,
4147 request_timeout: Option<Duration>,
4148 source: Option<&'b str>,
4149}
4150#[cfg(feature = "experimental-apis")]
4151impl<'a, 'b, B> ConnectorUpdateName<'a, 'b, B>
4152where
4153 B: Body,
4154{
4155 #[doc = "Creates a new instance of [ConnectorUpdateName] with the specified API parts"]
4156 pub fn new(transport: &'a Transport, parts: ConnectorUpdateNameParts<'b>) -> Self {
4157 let headers = HeaderMap::new();
4158 ConnectorUpdateName {
4159 transport,
4160 parts,
4161 headers,
4162 body: None,
4163 error_trace: None,
4164 filter_path: None,
4165 human: None,
4166 pretty: None,
4167 request_timeout: None,
4168 source: None,
4169 }
4170 }
4171 #[doc = "The body for the API call"]
4172 pub fn body<T>(self, body: T) -> ConnectorUpdateName<'a, 'b, JsonBody<T>>
4173 where
4174 T: Serialize,
4175 {
4176 ConnectorUpdateName {
4177 transport: self.transport,
4178 parts: self.parts,
4179 body: Some(body.into()),
4180 error_trace: self.error_trace,
4181 filter_path: self.filter_path,
4182 headers: self.headers,
4183 human: self.human,
4184 pretty: self.pretty,
4185 request_timeout: self.request_timeout,
4186 source: self.source,
4187 }
4188 }
4189 #[doc = "Include the stack trace of returned errors."]
4190 pub fn error_trace(mut self, error_trace: bool) -> Self {
4191 self.error_trace = Some(error_trace);
4192 self
4193 }
4194 #[doc = "A comma-separated list of filters used to reduce the response."]
4195 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
4196 self.filter_path = Some(filter_path);
4197 self
4198 }
4199 #[doc = "Adds a HTTP header"]
4200 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
4201 self.headers.insert(key, value);
4202 self
4203 }
4204 #[doc = "Return human readable values for statistics."]
4205 pub fn human(mut self, human: bool) -> Self {
4206 self.human = Some(human);
4207 self
4208 }
4209 #[doc = "Pretty format the returned JSON response."]
4210 pub fn pretty(mut self, pretty: bool) -> Self {
4211 self.pretty = Some(pretty);
4212 self
4213 }
4214 #[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."]
4215 pub fn request_timeout(mut self, timeout: Duration) -> Self {
4216 self.request_timeout = Some(timeout);
4217 self
4218 }
4219 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
4220 pub fn source(mut self, source: &'b str) -> Self {
4221 self.source = Some(source);
4222 self
4223 }
4224 #[doc = "Creates an asynchronous call to the Connector Update Name API that can be awaited"]
4225 pub async fn send(self) -> Result<Response, Error> {
4226 let path = self.parts.url();
4227 let method = http::Method::Put;
4228 let headers = self.headers;
4229 let timeout = self.request_timeout;
4230 let query_string = {
4231 #[serde_with::skip_serializing_none]
4232 #[derive(Serialize)]
4233 struct QueryParams<'b> {
4234 error_trace: Option<bool>,
4235 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
4236 filter_path: Option<&'b [&'b str]>,
4237 human: Option<bool>,
4238 pretty: Option<bool>,
4239 source: Option<&'b str>,
4240 }
4241 let query_params = QueryParams {
4242 error_trace: self.error_trace,
4243 filter_path: self.filter_path,
4244 human: self.human,
4245 pretty: self.pretty,
4246 source: self.source,
4247 };
4248 Some(query_params)
4249 };
4250 let body = self.body;
4251 let response = self
4252 .transport
4253 .send(method, &path, headers, query_string.as_ref(), body, timeout)
4254 .await?;
4255 Ok(response)
4256 }
4257}
4258#[cfg(feature = "experimental-apis")]
4259#[derive(Debug, Clone, PartialEq, Eq)]
4260#[doc = "API parts for the Connector Update Native API"]
4261pub enum ConnectorUpdateNativeParts<'b> {
4262 #[doc = "ConnectorId"]
4263 ConnectorId(&'b str),
4264}
4265#[cfg(feature = "experimental-apis")]
4266impl<'b> ConnectorUpdateNativeParts<'b> {
4267 #[doc = "Builds a relative URL path to the Connector Update Native API"]
4268 pub fn url(self) -> Cow<'static, str> {
4269 match self {
4270 ConnectorUpdateNativeParts::ConnectorId(connector_id) => {
4271 let encoded_connector_id: Cow<str> =
4272 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
4273 let mut p = String::with_capacity(20usize + encoded_connector_id.len());
4274 p.push_str("/_connector/");
4275 p.push_str(encoded_connector_id.as_ref());
4276 p.push_str("/_native");
4277 p.into()
4278 }
4279 }
4280 }
4281}
4282#[doc = "Builder for the [Connector Update Native API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/connector-apis.html)\n\nUpdates the is_native flag of the connector."]
4283#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
4284#[cfg(feature = "experimental-apis")]
4285#[derive(Clone, Debug)]
4286pub struct ConnectorUpdateNative<'a, 'b, B> {
4287 transport: &'a Transport,
4288 parts: ConnectorUpdateNativeParts<'b>,
4289 body: Option<B>,
4290 error_trace: Option<bool>,
4291 filter_path: Option<&'b [&'b str]>,
4292 headers: HeaderMap,
4293 human: Option<bool>,
4294 pretty: Option<bool>,
4295 request_timeout: Option<Duration>,
4296 source: Option<&'b str>,
4297}
4298#[cfg(feature = "experimental-apis")]
4299impl<'a, 'b, B> ConnectorUpdateNative<'a, 'b, B>
4300where
4301 B: Body,
4302{
4303 #[doc = "Creates a new instance of [ConnectorUpdateNative] with the specified API parts"]
4304 pub fn new(transport: &'a Transport, parts: ConnectorUpdateNativeParts<'b>) -> Self {
4305 let headers = HeaderMap::new();
4306 ConnectorUpdateNative {
4307 transport,
4308 parts,
4309 headers,
4310 body: None,
4311 error_trace: None,
4312 filter_path: None,
4313 human: None,
4314 pretty: None,
4315 request_timeout: None,
4316 source: None,
4317 }
4318 }
4319 #[doc = "The body for the API call"]
4320 pub fn body<T>(self, body: T) -> ConnectorUpdateNative<'a, 'b, JsonBody<T>>
4321 where
4322 T: Serialize,
4323 {
4324 ConnectorUpdateNative {
4325 transport: self.transport,
4326 parts: self.parts,
4327 body: Some(body.into()),
4328 error_trace: self.error_trace,
4329 filter_path: self.filter_path,
4330 headers: self.headers,
4331 human: self.human,
4332 pretty: self.pretty,
4333 request_timeout: self.request_timeout,
4334 source: self.source,
4335 }
4336 }
4337 #[doc = "Include the stack trace of returned errors."]
4338 pub fn error_trace(mut self, error_trace: bool) -> Self {
4339 self.error_trace = Some(error_trace);
4340 self
4341 }
4342 #[doc = "A comma-separated list of filters used to reduce the response."]
4343 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
4344 self.filter_path = Some(filter_path);
4345 self
4346 }
4347 #[doc = "Adds a HTTP header"]
4348 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
4349 self.headers.insert(key, value);
4350 self
4351 }
4352 #[doc = "Return human readable values for statistics."]
4353 pub fn human(mut self, human: bool) -> Self {
4354 self.human = Some(human);
4355 self
4356 }
4357 #[doc = "Pretty format the returned JSON response."]
4358 pub fn pretty(mut self, pretty: bool) -> Self {
4359 self.pretty = Some(pretty);
4360 self
4361 }
4362 #[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."]
4363 pub fn request_timeout(mut self, timeout: Duration) -> Self {
4364 self.request_timeout = Some(timeout);
4365 self
4366 }
4367 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
4368 pub fn source(mut self, source: &'b str) -> Self {
4369 self.source = Some(source);
4370 self
4371 }
4372 #[doc = "Creates an asynchronous call to the Connector Update Native API that can be awaited"]
4373 pub async fn send(self) -> Result<Response, Error> {
4374 let path = self.parts.url();
4375 let method = http::Method::Put;
4376 let headers = self.headers;
4377 let timeout = self.request_timeout;
4378 let query_string = {
4379 #[serde_with::skip_serializing_none]
4380 #[derive(Serialize)]
4381 struct QueryParams<'b> {
4382 error_trace: Option<bool>,
4383 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
4384 filter_path: Option<&'b [&'b str]>,
4385 human: Option<bool>,
4386 pretty: Option<bool>,
4387 source: Option<&'b str>,
4388 }
4389 let query_params = QueryParams {
4390 error_trace: self.error_trace,
4391 filter_path: self.filter_path,
4392 human: self.human,
4393 pretty: self.pretty,
4394 source: self.source,
4395 };
4396 Some(query_params)
4397 };
4398 let body = self.body;
4399 let response = self
4400 .transport
4401 .send(method, &path, headers, query_string.as_ref(), body, timeout)
4402 .await?;
4403 Ok(response)
4404 }
4405}
4406#[cfg(feature = "experimental-apis")]
4407#[derive(Debug, Clone, PartialEq, Eq)]
4408#[doc = "API parts for the Connector Update Pipeline API"]
4409pub enum ConnectorUpdatePipelineParts<'b> {
4410 #[doc = "ConnectorId"]
4411 ConnectorId(&'b str),
4412}
4413#[cfg(feature = "experimental-apis")]
4414impl<'b> ConnectorUpdatePipelineParts<'b> {
4415 #[doc = "Builds a relative URL path to the Connector Update Pipeline API"]
4416 pub fn url(self) -> Cow<'static, str> {
4417 match self {
4418 ConnectorUpdatePipelineParts::ConnectorId(connector_id) => {
4419 let encoded_connector_id: Cow<str> =
4420 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
4421 let mut p = String::with_capacity(22usize + encoded_connector_id.len());
4422 p.push_str("/_connector/");
4423 p.push_str(encoded_connector_id.as_ref());
4424 p.push_str("/_pipeline");
4425 p.into()
4426 }
4427 }
4428 }
4429}
4430#[doc = "Builder for the [Connector Update Pipeline API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-pipeline-api.html)\n\nUpdates the pipeline field in the connector document."]
4431#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
4432#[cfg(feature = "experimental-apis")]
4433#[derive(Clone, Debug)]
4434pub struct ConnectorUpdatePipeline<'a, 'b, B> {
4435 transport: &'a Transport,
4436 parts: ConnectorUpdatePipelineParts<'b>,
4437 body: Option<B>,
4438 error_trace: Option<bool>,
4439 filter_path: Option<&'b [&'b str]>,
4440 headers: HeaderMap,
4441 human: Option<bool>,
4442 pretty: Option<bool>,
4443 request_timeout: Option<Duration>,
4444 source: Option<&'b str>,
4445}
4446#[cfg(feature = "experimental-apis")]
4447impl<'a, 'b, B> ConnectorUpdatePipeline<'a, 'b, B>
4448where
4449 B: Body,
4450{
4451 #[doc = "Creates a new instance of [ConnectorUpdatePipeline] with the specified API parts"]
4452 pub fn new(transport: &'a Transport, parts: ConnectorUpdatePipelineParts<'b>) -> Self {
4453 let headers = HeaderMap::new();
4454 ConnectorUpdatePipeline {
4455 transport,
4456 parts,
4457 headers,
4458 body: None,
4459 error_trace: None,
4460 filter_path: None,
4461 human: None,
4462 pretty: None,
4463 request_timeout: None,
4464 source: None,
4465 }
4466 }
4467 #[doc = "The body for the API call"]
4468 pub fn body<T>(self, body: T) -> ConnectorUpdatePipeline<'a, 'b, JsonBody<T>>
4469 where
4470 T: Serialize,
4471 {
4472 ConnectorUpdatePipeline {
4473 transport: self.transport,
4474 parts: self.parts,
4475 body: Some(body.into()),
4476 error_trace: self.error_trace,
4477 filter_path: self.filter_path,
4478 headers: self.headers,
4479 human: self.human,
4480 pretty: self.pretty,
4481 request_timeout: self.request_timeout,
4482 source: self.source,
4483 }
4484 }
4485 #[doc = "Include the stack trace of returned errors."]
4486 pub fn error_trace(mut self, error_trace: bool) -> Self {
4487 self.error_trace = Some(error_trace);
4488 self
4489 }
4490 #[doc = "A comma-separated list of filters used to reduce the response."]
4491 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
4492 self.filter_path = Some(filter_path);
4493 self
4494 }
4495 #[doc = "Adds a HTTP header"]
4496 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
4497 self.headers.insert(key, value);
4498 self
4499 }
4500 #[doc = "Return human readable values for statistics."]
4501 pub fn human(mut self, human: bool) -> Self {
4502 self.human = Some(human);
4503 self
4504 }
4505 #[doc = "Pretty format the returned JSON response."]
4506 pub fn pretty(mut self, pretty: bool) -> Self {
4507 self.pretty = Some(pretty);
4508 self
4509 }
4510 #[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."]
4511 pub fn request_timeout(mut self, timeout: Duration) -> Self {
4512 self.request_timeout = Some(timeout);
4513 self
4514 }
4515 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
4516 pub fn source(mut self, source: &'b str) -> Self {
4517 self.source = Some(source);
4518 self
4519 }
4520 #[doc = "Creates an asynchronous call to the Connector Update Pipeline API that can be awaited"]
4521 pub async fn send(self) -> Result<Response, Error> {
4522 let path = self.parts.url();
4523 let method = http::Method::Put;
4524 let headers = self.headers;
4525 let timeout = self.request_timeout;
4526 let query_string = {
4527 #[serde_with::skip_serializing_none]
4528 #[derive(Serialize)]
4529 struct QueryParams<'b> {
4530 error_trace: Option<bool>,
4531 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
4532 filter_path: Option<&'b [&'b str]>,
4533 human: Option<bool>,
4534 pretty: Option<bool>,
4535 source: Option<&'b str>,
4536 }
4537 let query_params = QueryParams {
4538 error_trace: self.error_trace,
4539 filter_path: self.filter_path,
4540 human: self.human,
4541 pretty: self.pretty,
4542 source: self.source,
4543 };
4544 Some(query_params)
4545 };
4546 let body = self.body;
4547 let response = self
4548 .transport
4549 .send(method, &path, headers, query_string.as_ref(), body, timeout)
4550 .await?;
4551 Ok(response)
4552 }
4553}
4554#[cfg(feature = "experimental-apis")]
4555#[derive(Debug, Clone, PartialEq, Eq)]
4556#[doc = "API parts for the Connector Update Scheduling API"]
4557pub enum ConnectorUpdateSchedulingParts<'b> {
4558 #[doc = "ConnectorId"]
4559 ConnectorId(&'b str),
4560}
4561#[cfg(feature = "experimental-apis")]
4562impl<'b> ConnectorUpdateSchedulingParts<'b> {
4563 #[doc = "Builds a relative URL path to the Connector Update Scheduling API"]
4564 pub fn url(self) -> Cow<'static, str> {
4565 match self {
4566 ConnectorUpdateSchedulingParts::ConnectorId(connector_id) => {
4567 let encoded_connector_id: Cow<str> =
4568 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
4569 let mut p = String::with_capacity(24usize + encoded_connector_id.len());
4570 p.push_str("/_connector/");
4571 p.push_str(encoded_connector_id.as_ref());
4572 p.push_str("/_scheduling");
4573 p.into()
4574 }
4575 }
4576 }
4577}
4578#[doc = "Builder for the [Connector Update Scheduling API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-scheduling-api.html)\n\nUpdates the scheduling field in the connector document."]
4579#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
4580#[cfg(feature = "experimental-apis")]
4581#[derive(Clone, Debug)]
4582pub struct ConnectorUpdateScheduling<'a, 'b, B> {
4583 transport: &'a Transport,
4584 parts: ConnectorUpdateSchedulingParts<'b>,
4585 body: Option<B>,
4586 error_trace: Option<bool>,
4587 filter_path: Option<&'b [&'b str]>,
4588 headers: HeaderMap,
4589 human: Option<bool>,
4590 pretty: Option<bool>,
4591 request_timeout: Option<Duration>,
4592 source: Option<&'b str>,
4593}
4594#[cfg(feature = "experimental-apis")]
4595impl<'a, 'b, B> ConnectorUpdateScheduling<'a, 'b, B>
4596where
4597 B: Body,
4598{
4599 #[doc = "Creates a new instance of [ConnectorUpdateScheduling] with the specified API parts"]
4600 pub fn new(transport: &'a Transport, parts: ConnectorUpdateSchedulingParts<'b>) -> Self {
4601 let headers = HeaderMap::new();
4602 ConnectorUpdateScheduling {
4603 transport,
4604 parts,
4605 headers,
4606 body: None,
4607 error_trace: None,
4608 filter_path: None,
4609 human: None,
4610 pretty: None,
4611 request_timeout: None,
4612 source: None,
4613 }
4614 }
4615 #[doc = "The body for the API call"]
4616 pub fn body<T>(self, body: T) -> ConnectorUpdateScheduling<'a, 'b, JsonBody<T>>
4617 where
4618 T: Serialize,
4619 {
4620 ConnectorUpdateScheduling {
4621 transport: self.transport,
4622 parts: self.parts,
4623 body: Some(body.into()),
4624 error_trace: self.error_trace,
4625 filter_path: self.filter_path,
4626 headers: self.headers,
4627 human: self.human,
4628 pretty: self.pretty,
4629 request_timeout: self.request_timeout,
4630 source: self.source,
4631 }
4632 }
4633 #[doc = "Include the stack trace of returned errors."]
4634 pub fn error_trace(mut self, error_trace: bool) -> Self {
4635 self.error_trace = Some(error_trace);
4636 self
4637 }
4638 #[doc = "A comma-separated list of filters used to reduce the response."]
4639 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
4640 self.filter_path = Some(filter_path);
4641 self
4642 }
4643 #[doc = "Adds a HTTP header"]
4644 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
4645 self.headers.insert(key, value);
4646 self
4647 }
4648 #[doc = "Return human readable values for statistics."]
4649 pub fn human(mut self, human: bool) -> Self {
4650 self.human = Some(human);
4651 self
4652 }
4653 #[doc = "Pretty format the returned JSON response."]
4654 pub fn pretty(mut self, pretty: bool) -> Self {
4655 self.pretty = Some(pretty);
4656 self
4657 }
4658 #[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."]
4659 pub fn request_timeout(mut self, timeout: Duration) -> Self {
4660 self.request_timeout = Some(timeout);
4661 self
4662 }
4663 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
4664 pub fn source(mut self, source: &'b str) -> Self {
4665 self.source = Some(source);
4666 self
4667 }
4668 #[doc = "Creates an asynchronous call to the Connector Update Scheduling API that can be awaited"]
4669 pub async fn send(self) -> Result<Response, Error> {
4670 let path = self.parts.url();
4671 let method = http::Method::Put;
4672 let headers = self.headers;
4673 let timeout = self.request_timeout;
4674 let query_string = {
4675 #[serde_with::skip_serializing_none]
4676 #[derive(Serialize)]
4677 struct QueryParams<'b> {
4678 error_trace: Option<bool>,
4679 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
4680 filter_path: Option<&'b [&'b str]>,
4681 human: Option<bool>,
4682 pretty: Option<bool>,
4683 source: Option<&'b str>,
4684 }
4685 let query_params = QueryParams {
4686 error_trace: self.error_trace,
4687 filter_path: self.filter_path,
4688 human: self.human,
4689 pretty: self.pretty,
4690 source: self.source,
4691 };
4692 Some(query_params)
4693 };
4694 let body = self.body;
4695 let response = self
4696 .transport
4697 .send(method, &path, headers, query_string.as_ref(), body, timeout)
4698 .await?;
4699 Ok(response)
4700 }
4701}
4702#[cfg(feature = "experimental-apis")]
4703#[derive(Debug, Clone, PartialEq, Eq)]
4704#[doc = "API parts for the Connector Update Service Type API"]
4705pub enum ConnectorUpdateServiceTypeParts<'b> {
4706 #[doc = "ConnectorId"]
4707 ConnectorId(&'b str),
4708}
4709#[cfg(feature = "experimental-apis")]
4710impl<'b> ConnectorUpdateServiceTypeParts<'b> {
4711 #[doc = "Builds a relative URL path to the Connector Update Service Type API"]
4712 pub fn url(self) -> Cow<'static, str> {
4713 match self {
4714 ConnectorUpdateServiceTypeParts::ConnectorId(connector_id) => {
4715 let encoded_connector_id: Cow<str> =
4716 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
4717 let mut p = String::with_capacity(26usize + encoded_connector_id.len());
4718 p.push_str("/_connector/");
4719 p.push_str(encoded_connector_id.as_ref());
4720 p.push_str("/_service_type");
4721 p.into()
4722 }
4723 }
4724 }
4725}
4726#[doc = "Builder for the [Connector Update Service Type API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-service-type-api.html)\n\nUpdates the service type of the connector."]
4727#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
4728#[cfg(feature = "experimental-apis")]
4729#[derive(Clone, Debug)]
4730pub struct ConnectorUpdateServiceType<'a, 'b, B> {
4731 transport: &'a Transport,
4732 parts: ConnectorUpdateServiceTypeParts<'b>,
4733 body: Option<B>,
4734 error_trace: Option<bool>,
4735 filter_path: Option<&'b [&'b str]>,
4736 headers: HeaderMap,
4737 human: Option<bool>,
4738 pretty: Option<bool>,
4739 request_timeout: Option<Duration>,
4740 source: Option<&'b str>,
4741}
4742#[cfg(feature = "experimental-apis")]
4743impl<'a, 'b, B> ConnectorUpdateServiceType<'a, 'b, B>
4744where
4745 B: Body,
4746{
4747 #[doc = "Creates a new instance of [ConnectorUpdateServiceType] with the specified API parts"]
4748 pub fn new(transport: &'a Transport, parts: ConnectorUpdateServiceTypeParts<'b>) -> Self {
4749 let headers = HeaderMap::new();
4750 ConnectorUpdateServiceType {
4751 transport,
4752 parts,
4753 headers,
4754 body: None,
4755 error_trace: None,
4756 filter_path: None,
4757 human: None,
4758 pretty: None,
4759 request_timeout: None,
4760 source: None,
4761 }
4762 }
4763 #[doc = "The body for the API call"]
4764 pub fn body<T>(self, body: T) -> ConnectorUpdateServiceType<'a, 'b, JsonBody<T>>
4765 where
4766 T: Serialize,
4767 {
4768 ConnectorUpdateServiceType {
4769 transport: self.transport,
4770 parts: self.parts,
4771 body: Some(body.into()),
4772 error_trace: self.error_trace,
4773 filter_path: self.filter_path,
4774 headers: self.headers,
4775 human: self.human,
4776 pretty: self.pretty,
4777 request_timeout: self.request_timeout,
4778 source: self.source,
4779 }
4780 }
4781 #[doc = "Include the stack trace of returned errors."]
4782 pub fn error_trace(mut self, error_trace: bool) -> Self {
4783 self.error_trace = Some(error_trace);
4784 self
4785 }
4786 #[doc = "A comma-separated list of filters used to reduce the response."]
4787 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
4788 self.filter_path = Some(filter_path);
4789 self
4790 }
4791 #[doc = "Adds a HTTP header"]
4792 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
4793 self.headers.insert(key, value);
4794 self
4795 }
4796 #[doc = "Return human readable values for statistics."]
4797 pub fn human(mut self, human: bool) -> Self {
4798 self.human = Some(human);
4799 self
4800 }
4801 #[doc = "Pretty format the returned JSON response."]
4802 pub fn pretty(mut self, pretty: bool) -> Self {
4803 self.pretty = Some(pretty);
4804 self
4805 }
4806 #[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."]
4807 pub fn request_timeout(mut self, timeout: Duration) -> Self {
4808 self.request_timeout = Some(timeout);
4809 self
4810 }
4811 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
4812 pub fn source(mut self, source: &'b str) -> Self {
4813 self.source = Some(source);
4814 self
4815 }
4816 #[doc = "Creates an asynchronous call to the Connector Update Service Type API that can be awaited"]
4817 pub async fn send(self) -> Result<Response, Error> {
4818 let path = self.parts.url();
4819 let method = http::Method::Put;
4820 let headers = self.headers;
4821 let timeout = self.request_timeout;
4822 let query_string = {
4823 #[serde_with::skip_serializing_none]
4824 #[derive(Serialize)]
4825 struct QueryParams<'b> {
4826 error_trace: Option<bool>,
4827 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
4828 filter_path: Option<&'b [&'b str]>,
4829 human: Option<bool>,
4830 pretty: Option<bool>,
4831 source: Option<&'b str>,
4832 }
4833 let query_params = QueryParams {
4834 error_trace: self.error_trace,
4835 filter_path: self.filter_path,
4836 human: self.human,
4837 pretty: self.pretty,
4838 source: self.source,
4839 };
4840 Some(query_params)
4841 };
4842 let body = self.body;
4843 let response = self
4844 .transport
4845 .send(method, &path, headers, query_string.as_ref(), body, timeout)
4846 .await?;
4847 Ok(response)
4848 }
4849}
4850#[cfg(feature = "experimental-apis")]
4851#[derive(Debug, Clone, PartialEq, Eq)]
4852#[doc = "API parts for the Connector Update Status API"]
4853pub enum ConnectorUpdateStatusParts<'b> {
4854 #[doc = "ConnectorId"]
4855 ConnectorId(&'b str),
4856}
4857#[cfg(feature = "experimental-apis")]
4858impl<'b> ConnectorUpdateStatusParts<'b> {
4859 #[doc = "Builds a relative URL path to the Connector Update Status API"]
4860 pub fn url(self) -> Cow<'static, str> {
4861 match self {
4862 ConnectorUpdateStatusParts::ConnectorId(connector_id) => {
4863 let encoded_connector_id: Cow<str> =
4864 percent_encode(connector_id.as_bytes(), PARTS_ENCODED).into();
4865 let mut p = String::with_capacity(20usize + encoded_connector_id.len());
4866 p.push_str("/_connector/");
4867 p.push_str(encoded_connector_id.as_ref());
4868 p.push_str("/_status");
4869 p.into()
4870 }
4871 }
4872 }
4873}
4874#[doc = "Builder for the [Connector Update Status API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-status-api.html)\n\nUpdates the status of the connector."]
4875#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
4876#[cfg(feature = "experimental-apis")]
4877#[derive(Clone, Debug)]
4878pub struct ConnectorUpdateStatus<'a, 'b, B> {
4879 transport: &'a Transport,
4880 parts: ConnectorUpdateStatusParts<'b>,
4881 body: Option<B>,
4882 error_trace: Option<bool>,
4883 filter_path: Option<&'b [&'b str]>,
4884 headers: HeaderMap,
4885 human: Option<bool>,
4886 pretty: Option<bool>,
4887 request_timeout: Option<Duration>,
4888 source: Option<&'b str>,
4889}
4890#[cfg(feature = "experimental-apis")]
4891impl<'a, 'b, B> ConnectorUpdateStatus<'a, 'b, B>
4892where
4893 B: Body,
4894{
4895 #[doc = "Creates a new instance of [ConnectorUpdateStatus] with the specified API parts"]
4896 pub fn new(transport: &'a Transport, parts: ConnectorUpdateStatusParts<'b>) -> Self {
4897 let headers = HeaderMap::new();
4898 ConnectorUpdateStatus {
4899 transport,
4900 parts,
4901 headers,
4902 body: None,
4903 error_trace: None,
4904 filter_path: None,
4905 human: None,
4906 pretty: None,
4907 request_timeout: None,
4908 source: None,
4909 }
4910 }
4911 #[doc = "The body for the API call"]
4912 pub fn body<T>(self, body: T) -> ConnectorUpdateStatus<'a, 'b, JsonBody<T>>
4913 where
4914 T: Serialize,
4915 {
4916 ConnectorUpdateStatus {
4917 transport: self.transport,
4918 parts: self.parts,
4919 body: Some(body.into()),
4920 error_trace: self.error_trace,
4921 filter_path: self.filter_path,
4922 headers: self.headers,
4923 human: self.human,
4924 pretty: self.pretty,
4925 request_timeout: self.request_timeout,
4926 source: self.source,
4927 }
4928 }
4929 #[doc = "Include the stack trace of returned errors."]
4930 pub fn error_trace(mut self, error_trace: bool) -> Self {
4931 self.error_trace = Some(error_trace);
4932 self
4933 }
4934 #[doc = "A comma-separated list of filters used to reduce the response."]
4935 pub fn filter_path(mut self, filter_path: &'b [&'b str]) -> Self {
4936 self.filter_path = Some(filter_path);
4937 self
4938 }
4939 #[doc = "Adds a HTTP header"]
4940 pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
4941 self.headers.insert(key, value);
4942 self
4943 }
4944 #[doc = "Return human readable values for statistics."]
4945 pub fn human(mut self, human: bool) -> Self {
4946 self.human = Some(human);
4947 self
4948 }
4949 #[doc = "Pretty format the returned JSON response."]
4950 pub fn pretty(mut self, pretty: bool) -> Self {
4951 self.pretty = Some(pretty);
4952 self
4953 }
4954 #[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."]
4955 pub fn request_timeout(mut self, timeout: Duration) -> Self {
4956 self.request_timeout = Some(timeout);
4957 self
4958 }
4959 #[doc = "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests."]
4960 pub fn source(mut self, source: &'b str) -> Self {
4961 self.source = Some(source);
4962 self
4963 }
4964 #[doc = "Creates an asynchronous call to the Connector Update Status API that can be awaited"]
4965 pub async fn send(self) -> Result<Response, Error> {
4966 let path = self.parts.url();
4967 let method = http::Method::Put;
4968 let headers = self.headers;
4969 let timeout = self.request_timeout;
4970 let query_string = {
4971 #[serde_with::skip_serializing_none]
4972 #[derive(Serialize)]
4973 struct QueryParams<'b> {
4974 error_trace: Option<bool>,
4975 #[serde(serialize_with = "crate::client::serialize_coll_qs")]
4976 filter_path: Option<&'b [&'b str]>,
4977 human: Option<bool>,
4978 pretty: Option<bool>,
4979 source: Option<&'b str>,
4980 }
4981 let query_params = QueryParams {
4982 error_trace: self.error_trace,
4983 filter_path: self.filter_path,
4984 human: self.human,
4985 pretty: self.pretty,
4986 source: self.source,
4987 };
4988 Some(query_params)
4989 };
4990 let body = self.body;
4991 let response = self
4992 .transport
4993 .send(method, &path, headers, query_string.as_ref(), body, timeout)
4994 .await?;
4995 Ok(response)
4996 }
4997}
4998#[doc = "Namespace client for Connector APIs"]
4999#[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5000#[cfg(feature = "experimental-apis")]
5001pub struct Connector<'a> {
5002 transport: &'a Transport,
5003}
5004#[cfg(feature = "experimental-apis")]
5005impl<'a> Connector<'a> {
5006 #[doc = "Creates a new instance of [Connector]"]
5007 pub fn new(transport: &'a Transport) -> Self {
5008 Self { transport }
5009 }
5010 pub fn transport(&self) -> &Transport {
5011 self.transport
5012 }
5013 #[doc = "[Connector Check In API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/check-in-connector-api.html)\n\nUpdates the last_seen timestamp in the connector document."]
5014 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5015 #[cfg(feature = "experimental-apis")]
5016 pub fn check_in<'b>(
5017 &'a self,
5018 parts: ConnectorCheckInParts<'b>,
5019 ) -> ConnectorCheckIn<'a, 'b, ()> {
5020 ConnectorCheckIn::new(self.transport(), parts)
5021 }
5022 #[doc = "[Connector Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/delete-connector-api.html)\n\nDeletes a connector."]
5023 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5024 #[cfg(feature = "experimental-apis")]
5025 pub fn delete<'b>(&'a self, parts: ConnectorDeleteParts<'b>) -> ConnectorDelete<'a, 'b> {
5026 ConnectorDelete::new(self.transport(), parts)
5027 }
5028 #[doc = "[Connector Get API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/get-connector-api.html)\n\nReturns the details about a connector."]
5029 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5030 #[cfg(feature = "experimental-apis")]
5031 pub fn get<'b>(&'a self, parts: ConnectorGetParts<'b>) -> ConnectorGet<'a, 'b> {
5032 ConnectorGet::new(self.transport(), parts)
5033 }
5034 #[doc = "[Connector Last Sync API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-last-sync-api.html)\n\nUpdates the stats of last sync in the connector document."]
5035 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5036 #[cfg(feature = "experimental-apis")]
5037 pub fn last_sync<'b>(
5038 &'a self,
5039 parts: ConnectorLastSyncParts<'b>,
5040 ) -> ConnectorLastSync<'a, 'b, ()> {
5041 ConnectorLastSync::new(self.transport(), parts)
5042 }
5043 #[doc = "[Connector List API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/list-connector-api.html)\n\nLists all connectors."]
5044 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5045 #[cfg(feature = "experimental-apis")]
5046 pub fn list<'b>(&'a self) -> ConnectorList<'a, 'b> {
5047 ConnectorList::new(self.transport())
5048 }
5049 #[doc = "[Connector Post API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/create-connector-api.html)\n\nCreates a connector."]
5050 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5051 #[cfg(feature = "experimental-apis")]
5052 pub fn post<'b>(&'a self) -> ConnectorPost<'a, 'b, ()> {
5053 ConnectorPost::new(self.transport())
5054 }
5055 #[doc = "[Connector Put API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/create-connector-api.html)\n\nCreates or updates a connector."]
5056 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5057 #[cfg(feature = "experimental-apis")]
5058 pub fn put<'b>(&'a self, parts: ConnectorPutParts<'b>) -> ConnectorPut<'a, 'b, ()> {
5059 ConnectorPut::new(self.transport(), parts)
5060 }
5061 #[doc = "Connector Secret Delete API\n\nDeletes a connector secret."]
5062 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5063 #[cfg(feature = "experimental-apis")]
5064 pub fn secret_delete<'b>(
5065 &'a self,
5066 parts: ConnectorSecretDeleteParts<'b>,
5067 ) -> ConnectorSecretDelete<'a, 'b> {
5068 ConnectorSecretDelete::new(self.transport(), parts)
5069 }
5070 #[doc = "Connector Secret Get API\n\nRetrieves a secret stored by Connectors."]
5071 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5072 #[cfg(feature = "experimental-apis")]
5073 pub fn secret_get<'b>(
5074 &'a self,
5075 parts: ConnectorSecretGetParts<'b>,
5076 ) -> ConnectorSecretGet<'a, 'b> {
5077 ConnectorSecretGet::new(self.transport(), parts)
5078 }
5079 #[doc = "Connector Secret Post API\n\nCreates a secret for a Connector."]
5080 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5081 #[cfg(feature = "experimental-apis")]
5082 pub fn secret_post<'b>(&'a self) -> ConnectorSecretPost<'a, 'b, ()> {
5083 ConnectorSecretPost::new(self.transport())
5084 }
5085 #[doc = "Connector Secret Put API\n\nCreates or updates a secret for a Connector."]
5086 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5087 #[cfg(feature = "experimental-apis")]
5088 pub fn secret_put<'b>(
5089 &'a self,
5090 parts: ConnectorSecretPutParts<'b>,
5091 ) -> ConnectorSecretPut<'a, 'b, ()> {
5092 ConnectorSecretPut::new(self.transport(), parts)
5093 }
5094 #[doc = "[Connector Sync Job Cancel API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/cancel-connector-sync-job-api.html)\n\nCancels a connector sync job."]
5095 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5096 #[cfg(feature = "experimental-apis")]
5097 pub fn sync_job_cancel<'b>(
5098 &'a self,
5099 parts: ConnectorSyncJobCancelParts<'b>,
5100 ) -> ConnectorSyncJobCancel<'a, 'b, ()> {
5101 ConnectorSyncJobCancel::new(self.transport(), parts)
5102 }
5103 #[doc = "[Connector Sync Job Check In API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/check-in-connector-sync-job-api.html)\n\nChecks in a connector sync job (refreshes 'last_seen')."]
5104 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5105 #[cfg(feature = "experimental-apis")]
5106 pub fn sync_job_check_in<'b>(
5107 &'a self,
5108 parts: ConnectorSyncJobCheckInParts<'b>,
5109 ) -> ConnectorSyncJobCheckIn<'a, 'b, ()> {
5110 ConnectorSyncJobCheckIn::new(self.transport(), parts)
5111 }
5112 #[doc = "[Connector Sync Job Claim API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/claim-connector-sync-job-api.html)\n\nClaims a connector sync job."]
5113 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5114 #[cfg(feature = "experimental-apis")]
5115 pub fn sync_job_claim<'b>(
5116 &'a self,
5117 parts: ConnectorSyncJobClaimParts<'b>,
5118 ) -> ConnectorSyncJobClaim<'a, 'b, ()> {
5119 ConnectorSyncJobClaim::new(self.transport(), parts)
5120 }
5121 #[doc = "[Connector Sync Job Delete API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/delete-connector-sync-job-api.html)\n\nDeletes a connector sync job."]
5122 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5123 #[cfg(feature = "experimental-apis")]
5124 pub fn sync_job_delete<'b>(
5125 &'a self,
5126 parts: ConnectorSyncJobDeleteParts<'b>,
5127 ) -> ConnectorSyncJobDelete<'a, 'b> {
5128 ConnectorSyncJobDelete::new(self.transport(), parts)
5129 }
5130 #[doc = "[Connector Sync Job Error API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/set-connector-sync-job-error-api.html)\n\nSets an error for a connector sync job."]
5131 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5132 #[cfg(feature = "experimental-apis")]
5133 pub fn sync_job_error<'b>(
5134 &'a self,
5135 parts: ConnectorSyncJobErrorParts<'b>,
5136 ) -> ConnectorSyncJobError<'a, 'b, ()> {
5137 ConnectorSyncJobError::new(self.transport(), parts)
5138 }
5139 #[doc = "[Connector Sync Job Get API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/get-connector-sync-job-api.html)\n\nReturns the details about a connector sync job."]
5140 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5141 #[cfg(feature = "experimental-apis")]
5142 pub fn sync_job_get<'b>(
5143 &'a self,
5144 parts: ConnectorSyncJobGetParts<'b>,
5145 ) -> ConnectorSyncJobGet<'a, 'b> {
5146 ConnectorSyncJobGet::new(self.transport(), parts)
5147 }
5148 #[doc = "[Connector Sync Job List API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/list-connector-sync-jobs-api.html)\n\nLists all connector sync jobs."]
5149 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5150 #[cfg(feature = "experimental-apis")]
5151 pub fn sync_job_list<'b>(&'a self) -> ConnectorSyncJobList<'a, 'b> {
5152 ConnectorSyncJobList::new(self.transport())
5153 }
5154 #[doc = "[Connector Sync Job Post API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/create-connector-sync-job-api.html)\n\nCreates a connector sync job."]
5155 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5156 #[cfg(feature = "experimental-apis")]
5157 pub fn sync_job_post<'b>(&'a self) -> ConnectorSyncJobPost<'a, 'b, ()> {
5158 ConnectorSyncJobPost::new(self.transport())
5159 }
5160 #[doc = "[Connector Sync Job Update Stats API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/set-connector-sync-job-stats-api.html)\n\nUpdates the stats fields in the connector sync job document."]
5161 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5162 #[cfg(feature = "experimental-apis")]
5163 pub fn sync_job_update_stats<'b>(
5164 &'a self,
5165 parts: ConnectorSyncJobUpdateStatsParts<'b>,
5166 ) -> ConnectorSyncJobUpdateStats<'a, 'b, ()> {
5167 ConnectorSyncJobUpdateStats::new(self.transport(), parts)
5168 }
5169 #[doc = "[Connector Update Active Filtering API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-filtering-api.html)\n\nActivates the draft filtering rules if they are in a validated state."]
5170 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5171 #[cfg(feature = "experimental-apis")]
5172 pub fn update_active_filtering<'b>(
5173 &'a self,
5174 parts: ConnectorUpdateActiveFilteringParts<'b>,
5175 ) -> ConnectorUpdateActiveFiltering<'a, 'b, ()> {
5176 ConnectorUpdateActiveFiltering::new(self.transport(), parts)
5177 }
5178 #[doc = "[Connector Update Api Key Id API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-api-key-id-api.html)\n\nUpdates the API key id and/or API key secret id fields in the connector document."]
5179 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5180 #[cfg(feature = "experimental-apis")]
5181 pub fn update_api_key_id<'b>(
5182 &'a self,
5183 parts: ConnectorUpdateApiKeyIdParts<'b>,
5184 ) -> ConnectorUpdateApiKeyId<'a, 'b, ()> {
5185 ConnectorUpdateApiKeyId::new(self.transport(), parts)
5186 }
5187 #[doc = "[Connector Update Configuration API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-configuration-api.html)\n\nUpdates the connector configuration."]
5188 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5189 #[cfg(feature = "experimental-apis")]
5190 pub fn update_configuration<'b>(
5191 &'a self,
5192 parts: ConnectorUpdateConfigurationParts<'b>,
5193 ) -> ConnectorUpdateConfiguration<'a, 'b, ()> {
5194 ConnectorUpdateConfiguration::new(self.transport(), parts)
5195 }
5196 #[doc = "[Connector Update Error API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-error-api.html)\n\nUpdates the error field in the connector document."]
5197 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5198 #[cfg(feature = "experimental-apis")]
5199 pub fn update_error<'b>(
5200 &'a self,
5201 parts: ConnectorUpdateErrorParts<'b>,
5202 ) -> ConnectorUpdateError<'a, 'b, ()> {
5203 ConnectorUpdateError::new(self.transport(), parts)
5204 }
5205 #[doc = "[Connector Update Features API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-features-api.html)\n\nUpdates the connector features in the connector document."]
5206 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5207 #[cfg(feature = "experimental-apis")]
5208 pub fn update_features<'b>(
5209 &'a self,
5210 parts: ConnectorUpdateFeaturesParts<'b>,
5211 ) -> ConnectorUpdateFeatures<'a, 'b, ()> {
5212 ConnectorUpdateFeatures::new(self.transport(), parts)
5213 }
5214 #[doc = "[Connector Update Filtering API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-filtering-api.html)\n\nUpdates the filtering field in the connector document."]
5215 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5216 #[cfg(feature = "experimental-apis")]
5217 pub fn update_filtering<'b>(
5218 &'a self,
5219 parts: ConnectorUpdateFilteringParts<'b>,
5220 ) -> ConnectorUpdateFiltering<'a, 'b, ()> {
5221 ConnectorUpdateFiltering::new(self.transport(), parts)
5222 }
5223 #[doc = "[Connector Update Filtering Validation API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-filtering-api.html)\n\nUpdates the validation info of the draft filtering rules."]
5224 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5225 #[cfg(feature = "experimental-apis")]
5226 pub fn update_filtering_validation<'b>(
5227 &'a self,
5228 parts: ConnectorUpdateFilteringValidationParts<'b>,
5229 ) -> ConnectorUpdateFilteringValidation<'a, 'b, ()> {
5230 ConnectorUpdateFilteringValidation::new(self.transport(), parts)
5231 }
5232 #[doc = "[Connector Update Index Name API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-index-name-api.html)\n\nUpdates the index name of the connector."]
5233 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5234 #[cfg(feature = "experimental-apis")]
5235 pub fn update_index_name<'b>(
5236 &'a self,
5237 parts: ConnectorUpdateIndexNameParts<'b>,
5238 ) -> ConnectorUpdateIndexName<'a, 'b, ()> {
5239 ConnectorUpdateIndexName::new(self.transport(), parts)
5240 }
5241 #[doc = "[Connector Update Name API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-name-description-api.html)\n\nUpdates the name and/or description fields in the connector document."]
5242 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5243 #[cfg(feature = "experimental-apis")]
5244 pub fn update_name<'b>(
5245 &'a self,
5246 parts: ConnectorUpdateNameParts<'b>,
5247 ) -> ConnectorUpdateName<'a, 'b, ()> {
5248 ConnectorUpdateName::new(self.transport(), parts)
5249 }
5250 #[doc = "[Connector Update Native API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/connector-apis.html)\n\nUpdates the is_native flag of the connector."]
5251 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5252 #[cfg(feature = "experimental-apis")]
5253 pub fn update_native<'b>(
5254 &'a self,
5255 parts: ConnectorUpdateNativeParts<'b>,
5256 ) -> ConnectorUpdateNative<'a, 'b, ()> {
5257 ConnectorUpdateNative::new(self.transport(), parts)
5258 }
5259 #[doc = "[Connector Update Pipeline API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-pipeline-api.html)\n\nUpdates the pipeline field in the connector document."]
5260 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5261 #[cfg(feature = "experimental-apis")]
5262 pub fn update_pipeline<'b>(
5263 &'a self,
5264 parts: ConnectorUpdatePipelineParts<'b>,
5265 ) -> ConnectorUpdatePipeline<'a, 'b, ()> {
5266 ConnectorUpdatePipeline::new(self.transport(), parts)
5267 }
5268 #[doc = "[Connector Update Scheduling API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-scheduling-api.html)\n\nUpdates the scheduling field in the connector document."]
5269 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5270 #[cfg(feature = "experimental-apis")]
5271 pub fn update_scheduling<'b>(
5272 &'a self,
5273 parts: ConnectorUpdateSchedulingParts<'b>,
5274 ) -> ConnectorUpdateScheduling<'a, 'b, ()> {
5275 ConnectorUpdateScheduling::new(self.transport(), parts)
5276 }
5277 #[doc = "[Connector Update Service Type API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-service-type-api.html)\n\nUpdates the service type of the connector."]
5278 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5279 #[cfg(feature = "experimental-apis")]
5280 pub fn update_service_type<'b>(
5281 &'a self,
5282 parts: ConnectorUpdateServiceTypeParts<'b>,
5283 ) -> ConnectorUpdateServiceType<'a, 'b, ()> {
5284 ConnectorUpdateServiceType::new(self.transport(), parts)
5285 }
5286 #[doc = "[Connector Update Status API](https://www.elastic.co/guide/en/elasticsearch/reference/9.0/update-connector-status-api.html)\n\nUpdates the status of the connector."]
5287 #[doc = " \n# Optional, experimental\nThis requires the `experimental-apis` feature. Can have breaking changes in future\nversions or might even be removed entirely.\n "]
5288 #[cfg(feature = "experimental-apis")]
5289 pub fn update_status<'b>(
5290 &'a self,
5291 parts: ConnectorUpdateStatusParts<'b>,
5292 ) -> ConnectorUpdateStatus<'a, 'b, ()> {
5293 ConnectorUpdateStatus::new(self.transport(), parts)
5294 }
5295}
5296#[cfg(feature = "experimental-apis")]
5297impl Elasticsearch {
5298 #[doc = "Creates a namespace client for Connector APIs"]
5299 pub fn connector(&self) -> Connector {
5300 Connector::new(self.transport())
5301 }
5302}