Skip to main content

google_cloud_ces_v1/
builder.rs

1// Copyright 2026 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [AgentService][crate::client::AgentService].
18pub mod agent_service {
19    use crate::Result;
20
21    /// A builder for [AgentService][crate::client::AgentService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_ces_v1::*;
26    /// # use builder::agent_service::ClientBuilder;
27    /// # use client::AgentService;
28    /// let builder : ClientBuilder = AgentService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://ces.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::AgentService;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = AgentService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::AgentService] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [AgentService::list_apps][crate::client::AgentService::list_apps] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_ces_v1::builder::agent_service::ListApps;
79    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListApps {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListApps(RequestBuilder<crate::model::ListAppsRequest>);
96
97    impl ListApps {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListAppsRequest>>(mut self, v: V) -> Self {
106            self.0.request = v.into();
107            self
108        }
109
110        /// Sets all the options, replacing any prior values.
111        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112            self.0.options = v.into();
113            self
114        }
115
116        /// Sends the request.
117        pub async fn send(self) -> Result<crate::model::ListAppsResponse> {
118            (*self.0.stub)
119                .list_apps(self.0.request, self.0.options)
120                .await
121                .map(crate::Response::into_body)
122        }
123
124        /// Streams each page in the collection.
125        pub fn by_page(
126            self,
127        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAppsResponse, crate::Error>
128        {
129            use std::clone::Clone;
130            let token = self.0.request.page_token.clone();
131            let execute = move |token: String| {
132                let mut builder = self.clone();
133                builder.0.request = builder.0.request.set_page_token(token);
134                builder.send()
135            };
136            google_cloud_gax::paginator::internal::new_paginator(token, execute)
137        }
138
139        /// Streams each item in the collection.
140        pub fn by_item(
141            self,
142        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListAppsResponse, crate::Error>
143        {
144            use google_cloud_gax::paginator::Paginator;
145            self.by_page().items()
146        }
147
148        /// Sets the value of [parent][crate::model::ListAppsRequest::parent].
149        ///
150        /// This is a **required** field for requests.
151        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152            self.0.request.parent = v.into();
153            self
154        }
155
156        /// Sets the value of [page_size][crate::model::ListAppsRequest::page_size].
157        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158            self.0.request.page_size = v.into();
159            self
160        }
161
162        /// Sets the value of [page_token][crate::model::ListAppsRequest::page_token].
163        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164            self.0.request.page_token = v.into();
165            self
166        }
167
168        /// Sets the value of [filter][crate::model::ListAppsRequest::filter].
169        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170            self.0.request.filter = v.into();
171            self
172        }
173
174        /// Sets the value of [order_by][crate::model::ListAppsRequest::order_by].
175        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176            self.0.request.order_by = v.into();
177            self
178        }
179    }
180
181    #[doc(hidden)]
182    impl crate::RequestBuilder for ListApps {
183        fn request_options(&mut self) -> &mut crate::RequestOptions {
184            &mut self.0.options
185        }
186    }
187
188    /// The request builder for [AgentService::get_app][crate::client::AgentService::get_app] calls.
189    ///
190    /// # Example
191    /// ```
192    /// # use google_cloud_ces_v1::builder::agent_service::GetApp;
193    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
194    ///
195    /// let builder = prepare_request_builder();
196    /// let response = builder.send().await?;
197    /// # Ok(()) }
198    ///
199    /// fn prepare_request_builder() -> GetApp {
200    ///   # panic!();
201    ///   // ... details omitted ...
202    /// }
203    /// ```
204    #[derive(Clone, Debug)]
205    pub struct GetApp(RequestBuilder<crate::model::GetAppRequest>);
206
207    impl GetApp {
208        pub(crate) fn new(
209            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
210        ) -> Self {
211            Self(RequestBuilder::new(stub))
212        }
213
214        /// Sets the full request, replacing any prior values.
215        pub fn with_request<V: Into<crate::model::GetAppRequest>>(mut self, v: V) -> Self {
216            self.0.request = v.into();
217            self
218        }
219
220        /// Sets all the options, replacing any prior values.
221        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
222            self.0.options = v.into();
223            self
224        }
225
226        /// Sends the request.
227        pub async fn send(self) -> Result<crate::model::App> {
228            (*self.0.stub)
229                .get_app(self.0.request, self.0.options)
230                .await
231                .map(crate::Response::into_body)
232        }
233
234        /// Sets the value of [name][crate::model::GetAppRequest::name].
235        ///
236        /// This is a **required** field for requests.
237        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238            self.0.request.name = v.into();
239            self
240        }
241    }
242
243    #[doc(hidden)]
244    impl crate::RequestBuilder for GetApp {
245        fn request_options(&mut self) -> &mut crate::RequestOptions {
246            &mut self.0.options
247        }
248    }
249
250    /// The request builder for [AgentService::create_app][crate::client::AgentService::create_app] calls.
251    ///
252    /// # Example
253    /// ```
254    /// # use google_cloud_ces_v1::builder::agent_service::CreateApp;
255    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
256    /// use google_cloud_lro::Poller;
257    ///
258    /// let builder = prepare_request_builder();
259    /// let response = builder.poller().until_done().await?;
260    /// # Ok(()) }
261    ///
262    /// fn prepare_request_builder() -> CreateApp {
263    ///   # panic!();
264    ///   // ... details omitted ...
265    /// }
266    /// ```
267    #[derive(Clone, Debug)]
268    pub struct CreateApp(RequestBuilder<crate::model::CreateAppRequest>);
269
270    impl CreateApp {
271        pub(crate) fn new(
272            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
273        ) -> Self {
274            Self(RequestBuilder::new(stub))
275        }
276
277        /// Sets the full request, replacing any prior values.
278        pub fn with_request<V: Into<crate::model::CreateAppRequest>>(mut self, v: V) -> Self {
279            self.0.request = v.into();
280            self
281        }
282
283        /// Sets all the options, replacing any prior values.
284        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
285            self.0.options = v.into();
286            self
287        }
288
289        /// Sends the request.
290        ///
291        /// # Long running operations
292        ///
293        /// This starts, but does not poll, a longrunning operation. More information
294        /// on [create_app][crate::client::AgentService::create_app].
295        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
296            (*self.0.stub)
297                .create_app(self.0.request, self.0.options)
298                .await
299                .map(crate::Response::into_body)
300        }
301
302        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_app`.
303        pub fn poller(
304            self,
305        ) -> impl google_cloud_lro::Poller<crate::model::App, crate::model::OperationMetadata>
306        {
307            type Operation = google_cloud_lro::internal::Operation<
308                crate::model::App,
309                crate::model::OperationMetadata,
310            >;
311            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
312            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
313            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
314            if let Some(ref mut details) = poller_options.tracing {
315                details.method_name =
316                    "google_cloud_ces_v1::client::AgentService::create_app::until_done";
317            }
318
319            let stub = self.0.stub.clone();
320            let mut options = self.0.options.clone();
321            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
322            let query = move |name| {
323                let stub = stub.clone();
324                let options = options.clone();
325                async {
326                    let op = GetOperation::new(stub)
327                        .set_name(name)
328                        .with_options(options)
329                        .send()
330                        .await?;
331                    Ok(Operation::new(op))
332                }
333            };
334
335            let start = move || async {
336                let op = self.send().await?;
337                Ok(Operation::new(op))
338            };
339
340            use google_cloud_lro::internal::PollerExt;
341            {
342                google_cloud_lro::internal::new_poller(
343                    polling_error_policy,
344                    polling_backoff_policy,
345                    start,
346                    query,
347                )
348            }
349            .with_options(poller_options)
350        }
351
352        /// Sets the value of [parent][crate::model::CreateAppRequest::parent].
353        ///
354        /// This is a **required** field for requests.
355        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
356            self.0.request.parent = v.into();
357            self
358        }
359
360        /// Sets the value of [app_id][crate::model::CreateAppRequest::app_id].
361        pub fn set_app_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
362            self.0.request.app_id = v.into();
363            self
364        }
365
366        /// Sets the value of [app][crate::model::CreateAppRequest::app].
367        ///
368        /// This is a **required** field for requests.
369        pub fn set_app<T>(mut self, v: T) -> Self
370        where
371            T: std::convert::Into<crate::model::App>,
372        {
373            self.0.request.app = std::option::Option::Some(v.into());
374            self
375        }
376
377        /// Sets or clears the value of [app][crate::model::CreateAppRequest::app].
378        ///
379        /// This is a **required** field for requests.
380        pub fn set_or_clear_app<T>(mut self, v: std::option::Option<T>) -> Self
381        where
382            T: std::convert::Into<crate::model::App>,
383        {
384            self.0.request.app = v.map(|x| x.into());
385            self
386        }
387    }
388
389    #[doc(hidden)]
390    impl crate::RequestBuilder for CreateApp {
391        fn request_options(&mut self) -> &mut crate::RequestOptions {
392            &mut self.0.options
393        }
394    }
395
396    /// The request builder for [AgentService::update_app][crate::client::AgentService::update_app] calls.
397    ///
398    /// # Example
399    /// ```
400    /// # use google_cloud_ces_v1::builder::agent_service::UpdateApp;
401    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
402    ///
403    /// let builder = prepare_request_builder();
404    /// let response = builder.send().await?;
405    /// # Ok(()) }
406    ///
407    /// fn prepare_request_builder() -> UpdateApp {
408    ///   # panic!();
409    ///   // ... details omitted ...
410    /// }
411    /// ```
412    #[derive(Clone, Debug)]
413    pub struct UpdateApp(RequestBuilder<crate::model::UpdateAppRequest>);
414
415    impl UpdateApp {
416        pub(crate) fn new(
417            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
418        ) -> Self {
419            Self(RequestBuilder::new(stub))
420        }
421
422        /// Sets the full request, replacing any prior values.
423        pub fn with_request<V: Into<crate::model::UpdateAppRequest>>(mut self, v: V) -> Self {
424            self.0.request = v.into();
425            self
426        }
427
428        /// Sets all the options, replacing any prior values.
429        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
430            self.0.options = v.into();
431            self
432        }
433
434        /// Sends the request.
435        pub async fn send(self) -> Result<crate::model::App> {
436            (*self.0.stub)
437                .update_app(self.0.request, self.0.options)
438                .await
439                .map(crate::Response::into_body)
440        }
441
442        /// Sets the value of [app][crate::model::UpdateAppRequest::app].
443        ///
444        /// This is a **required** field for requests.
445        pub fn set_app<T>(mut self, v: T) -> Self
446        where
447            T: std::convert::Into<crate::model::App>,
448        {
449            self.0.request.app = std::option::Option::Some(v.into());
450            self
451        }
452
453        /// Sets or clears the value of [app][crate::model::UpdateAppRequest::app].
454        ///
455        /// This is a **required** field for requests.
456        pub fn set_or_clear_app<T>(mut self, v: std::option::Option<T>) -> Self
457        where
458            T: std::convert::Into<crate::model::App>,
459        {
460            self.0.request.app = v.map(|x| x.into());
461            self
462        }
463
464        /// Sets the value of [update_mask][crate::model::UpdateAppRequest::update_mask].
465        pub fn set_update_mask<T>(mut self, v: T) -> Self
466        where
467            T: std::convert::Into<wkt::FieldMask>,
468        {
469            self.0.request.update_mask = std::option::Option::Some(v.into());
470            self
471        }
472
473        /// Sets or clears the value of [update_mask][crate::model::UpdateAppRequest::update_mask].
474        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
475        where
476            T: std::convert::Into<wkt::FieldMask>,
477        {
478            self.0.request.update_mask = v.map(|x| x.into());
479            self
480        }
481    }
482
483    #[doc(hidden)]
484    impl crate::RequestBuilder for UpdateApp {
485        fn request_options(&mut self) -> &mut crate::RequestOptions {
486            &mut self.0.options
487        }
488    }
489
490    /// The request builder for [AgentService::delete_app][crate::client::AgentService::delete_app] calls.
491    ///
492    /// # Example
493    /// ```
494    /// # use google_cloud_ces_v1::builder::agent_service::DeleteApp;
495    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
496    /// use google_cloud_lro::Poller;
497    ///
498    /// let builder = prepare_request_builder();
499    /// let response = builder.poller().until_done().await?;
500    /// # Ok(()) }
501    ///
502    /// fn prepare_request_builder() -> DeleteApp {
503    ///   # panic!();
504    ///   // ... details omitted ...
505    /// }
506    /// ```
507    #[derive(Clone, Debug)]
508    pub struct DeleteApp(RequestBuilder<crate::model::DeleteAppRequest>);
509
510    impl DeleteApp {
511        pub(crate) fn new(
512            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
513        ) -> Self {
514            Self(RequestBuilder::new(stub))
515        }
516
517        /// Sets the full request, replacing any prior values.
518        pub fn with_request<V: Into<crate::model::DeleteAppRequest>>(mut self, v: V) -> Self {
519            self.0.request = v.into();
520            self
521        }
522
523        /// Sets all the options, replacing any prior values.
524        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
525            self.0.options = v.into();
526            self
527        }
528
529        /// Sends the request.
530        ///
531        /// # Long running operations
532        ///
533        /// This starts, but does not poll, a longrunning operation. More information
534        /// on [delete_app][crate::client::AgentService::delete_app].
535        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
536            (*self.0.stub)
537                .delete_app(self.0.request, self.0.options)
538                .await
539                .map(crate::Response::into_body)
540        }
541
542        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_app`.
543        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
544            type Operation =
545                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
546            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
547            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
548            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
549            if let Some(ref mut details) = poller_options.tracing {
550                details.method_name =
551                    "google_cloud_ces_v1::client::AgentService::delete_app::until_done";
552            }
553
554            let stub = self.0.stub.clone();
555            let mut options = self.0.options.clone();
556            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
557            let query = move |name| {
558                let stub = stub.clone();
559                let options = options.clone();
560                async {
561                    let op = GetOperation::new(stub)
562                        .set_name(name)
563                        .with_options(options)
564                        .send()
565                        .await?;
566                    Ok(Operation::new(op))
567                }
568            };
569
570            let start = move || async {
571                let op = self.send().await?;
572                Ok(Operation::new(op))
573            };
574
575            use google_cloud_lro::internal::PollerExt;
576            {
577                google_cloud_lro::internal::new_unit_response_poller(
578                    polling_error_policy,
579                    polling_backoff_policy,
580                    start,
581                    query,
582                )
583            }
584            .with_options(poller_options)
585        }
586
587        /// Sets the value of [name][crate::model::DeleteAppRequest::name].
588        ///
589        /// This is a **required** field for requests.
590        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
591            self.0.request.name = v.into();
592            self
593        }
594
595        /// Sets the value of [etag][crate::model::DeleteAppRequest::etag].
596        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
597            self.0.request.etag = v.into();
598            self
599        }
600    }
601
602    #[doc(hidden)]
603    impl crate::RequestBuilder for DeleteApp {
604        fn request_options(&mut self) -> &mut crate::RequestOptions {
605            &mut self.0.options
606        }
607    }
608
609    /// The request builder for [AgentService::export_app][crate::client::AgentService::export_app] calls.
610    ///
611    /// # Example
612    /// ```
613    /// # use google_cloud_ces_v1::builder::agent_service::ExportApp;
614    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
615    /// use google_cloud_lro::Poller;
616    ///
617    /// let builder = prepare_request_builder();
618    /// let response = builder.poller().until_done().await?;
619    /// # Ok(()) }
620    ///
621    /// fn prepare_request_builder() -> ExportApp {
622    ///   # panic!();
623    ///   // ... details omitted ...
624    /// }
625    /// ```
626    #[derive(Clone, Debug)]
627    pub struct ExportApp(RequestBuilder<crate::model::ExportAppRequest>);
628
629    impl ExportApp {
630        pub(crate) fn new(
631            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
632        ) -> Self {
633            Self(RequestBuilder::new(stub))
634        }
635
636        /// Sets the full request, replacing any prior values.
637        pub fn with_request<V: Into<crate::model::ExportAppRequest>>(mut self, v: V) -> Self {
638            self.0.request = v.into();
639            self
640        }
641
642        /// Sets all the options, replacing any prior values.
643        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
644            self.0.options = v.into();
645            self
646        }
647
648        /// Sends the request.
649        ///
650        /// # Long running operations
651        ///
652        /// This starts, but does not poll, a longrunning operation. More information
653        /// on [export_app][crate::client::AgentService::export_app].
654        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
655            (*self.0.stub)
656                .export_app(self.0.request, self.0.options)
657                .await
658                .map(crate::Response::into_body)
659        }
660
661        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_app`.
662        pub fn poller(
663            self,
664        ) -> impl google_cloud_lro::Poller<
665            crate::model::ExportAppResponse,
666            crate::model::OperationMetadata,
667        > {
668            type Operation = google_cloud_lro::internal::Operation<
669                crate::model::ExportAppResponse,
670                crate::model::OperationMetadata,
671            >;
672            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
673            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
674            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
675            if let Some(ref mut details) = poller_options.tracing {
676                details.method_name =
677                    "google_cloud_ces_v1::client::AgentService::export_app::until_done";
678            }
679
680            let stub = self.0.stub.clone();
681            let mut options = self.0.options.clone();
682            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
683            let query = move |name| {
684                let stub = stub.clone();
685                let options = options.clone();
686                async {
687                    let op = GetOperation::new(stub)
688                        .set_name(name)
689                        .with_options(options)
690                        .send()
691                        .await?;
692                    Ok(Operation::new(op))
693                }
694            };
695
696            let start = move || async {
697                let op = self.send().await?;
698                Ok(Operation::new(op))
699            };
700
701            use google_cloud_lro::internal::PollerExt;
702            {
703                google_cloud_lro::internal::new_poller(
704                    polling_error_policy,
705                    polling_backoff_policy,
706                    start,
707                    query,
708                )
709            }
710            .with_options(poller_options)
711        }
712
713        /// Sets the value of [name][crate::model::ExportAppRequest::name].
714        ///
715        /// This is a **required** field for requests.
716        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
717            self.0.request.name = v.into();
718            self
719        }
720
721        /// Sets the value of [export_format][crate::model::ExportAppRequest::export_format].
722        ///
723        /// This is a **required** field for requests.
724        pub fn set_export_format<T: Into<crate::model::export_app_request::ExportFormat>>(
725            mut self,
726            v: T,
727        ) -> Self {
728            self.0.request.export_format = v.into();
729            self
730        }
731
732        /// Sets the value of [gcs_uri][crate::model::ExportAppRequest::gcs_uri].
733        pub fn set_gcs_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
734            self.0.request.gcs_uri = v.into();
735            self
736        }
737
738        /// Sets the value of [app_version][crate::model::ExportAppRequest::app_version].
739        pub fn set_app_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
740            self.0.request.app_version = v.into();
741            self
742        }
743    }
744
745    #[doc(hidden)]
746    impl crate::RequestBuilder for ExportApp {
747        fn request_options(&mut self) -> &mut crate::RequestOptions {
748            &mut self.0.options
749        }
750    }
751
752    /// The request builder for [AgentService::import_app][crate::client::AgentService::import_app] calls.
753    ///
754    /// # Example
755    /// ```
756    /// # use google_cloud_ces_v1::builder::agent_service::ImportApp;
757    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
758    /// use google_cloud_lro::Poller;
759    ///
760    /// let builder = prepare_request_builder();
761    /// let response = builder.poller().until_done().await?;
762    /// # Ok(()) }
763    ///
764    /// fn prepare_request_builder() -> ImportApp {
765    ///   # panic!();
766    ///   // ... details omitted ...
767    /// }
768    /// ```
769    #[derive(Clone, Debug)]
770    pub struct ImportApp(RequestBuilder<crate::model::ImportAppRequest>);
771
772    impl ImportApp {
773        pub(crate) fn new(
774            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
775        ) -> Self {
776            Self(RequestBuilder::new(stub))
777        }
778
779        /// Sets the full request, replacing any prior values.
780        pub fn with_request<V: Into<crate::model::ImportAppRequest>>(mut self, v: V) -> Self {
781            self.0.request = v.into();
782            self
783        }
784
785        /// Sets all the options, replacing any prior values.
786        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
787            self.0.options = v.into();
788            self
789        }
790
791        /// Sends the request.
792        ///
793        /// # Long running operations
794        ///
795        /// This starts, but does not poll, a longrunning operation. More information
796        /// on [import_app][crate::client::AgentService::import_app].
797        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
798            (*self.0.stub)
799                .import_app(self.0.request, self.0.options)
800                .await
801                .map(crate::Response::into_body)
802        }
803
804        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_app`.
805        pub fn poller(
806            self,
807        ) -> impl google_cloud_lro::Poller<
808            crate::model::ImportAppResponse,
809            crate::model::OperationMetadata,
810        > {
811            type Operation = google_cloud_lro::internal::Operation<
812                crate::model::ImportAppResponse,
813                crate::model::OperationMetadata,
814            >;
815            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
816            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
817            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
818            if let Some(ref mut details) = poller_options.tracing {
819                details.method_name =
820                    "google_cloud_ces_v1::client::AgentService::import_app::until_done";
821            }
822
823            let stub = self.0.stub.clone();
824            let mut options = self.0.options.clone();
825            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
826            let query = move |name| {
827                let stub = stub.clone();
828                let options = options.clone();
829                async {
830                    let op = GetOperation::new(stub)
831                        .set_name(name)
832                        .with_options(options)
833                        .send()
834                        .await?;
835                    Ok(Operation::new(op))
836                }
837            };
838
839            let start = move || async {
840                let op = self.send().await?;
841                Ok(Operation::new(op))
842            };
843
844            use google_cloud_lro::internal::PollerExt;
845            {
846                google_cloud_lro::internal::new_poller(
847                    polling_error_policy,
848                    polling_backoff_policy,
849                    start,
850                    query,
851                )
852            }
853            .with_options(poller_options)
854        }
855
856        /// Sets the value of [parent][crate::model::ImportAppRequest::parent].
857        ///
858        /// This is a **required** field for requests.
859        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
860            self.0.request.parent = v.into();
861            self
862        }
863
864        /// Sets the value of [display_name][crate::model::ImportAppRequest::display_name].
865        pub fn set_display_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
866            self.0.request.display_name = v.into();
867            self
868        }
869
870        /// Sets the value of [app_id][crate::model::ImportAppRequest::app_id].
871        pub fn set_app_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
872            self.0.request.app_id = v.into();
873            self
874        }
875
876        /// Sets the value of [import_options][crate::model::ImportAppRequest::import_options].
877        pub fn set_import_options<T>(mut self, v: T) -> Self
878        where
879            T: std::convert::Into<crate::model::import_app_request::ImportOptions>,
880        {
881            self.0.request.import_options = std::option::Option::Some(v.into());
882            self
883        }
884
885        /// Sets or clears the value of [import_options][crate::model::ImportAppRequest::import_options].
886        pub fn set_or_clear_import_options<T>(mut self, v: std::option::Option<T>) -> Self
887        where
888            T: std::convert::Into<crate::model::import_app_request::ImportOptions>,
889        {
890            self.0.request.import_options = v.map(|x| x.into());
891            self
892        }
893
894        /// Sets the value of [ignore_app_lock][crate::model::ImportAppRequest::ignore_app_lock].
895        pub fn set_ignore_app_lock<T: Into<bool>>(mut self, v: T) -> Self {
896            self.0.request.ignore_app_lock = v.into();
897            self
898        }
899
900        /// Sets the value of [app][crate::model::ImportAppRequest::app].
901        ///
902        /// Note that all the setters affecting `app` are
903        /// mutually exclusive.
904        pub fn set_app<T: Into<Option<crate::model::import_app_request::App>>>(
905            mut self,
906            v: T,
907        ) -> Self {
908            self.0.request.app = v.into();
909            self
910        }
911
912        /// Sets the value of [app][crate::model::ImportAppRequest::app]
913        /// to hold a `GcsUri`.
914        ///
915        /// Note that all the setters affecting `app` are
916        /// mutually exclusive.
917        pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
918            self.0.request = self.0.request.set_gcs_uri(v);
919            self
920        }
921
922        /// Sets the value of [app][crate::model::ImportAppRequest::app]
923        /// to hold a `AppContent`.
924        ///
925        /// Note that all the setters affecting `app` are
926        /// mutually exclusive.
927        pub fn set_app_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
928            self.0.request = self.0.request.set_app_content(v);
929            self
930        }
931    }
932
933    #[doc(hidden)]
934    impl crate::RequestBuilder for ImportApp {
935        fn request_options(&mut self) -> &mut crate::RequestOptions {
936            &mut self.0.options
937        }
938    }
939
940    /// The request builder for [AgentService::list_agents][crate::client::AgentService::list_agents] calls.
941    ///
942    /// # Example
943    /// ```
944    /// # use google_cloud_ces_v1::builder::agent_service::ListAgents;
945    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
946    /// use google_cloud_gax::paginator::ItemPaginator;
947    ///
948    /// let builder = prepare_request_builder();
949    /// let mut items = builder.by_item();
950    /// while let Some(result) = items.next().await {
951    ///   let item = result?;
952    /// }
953    /// # Ok(()) }
954    ///
955    /// fn prepare_request_builder() -> ListAgents {
956    ///   # panic!();
957    ///   // ... details omitted ...
958    /// }
959    /// ```
960    #[derive(Clone, Debug)]
961    pub struct ListAgents(RequestBuilder<crate::model::ListAgentsRequest>);
962
963    impl ListAgents {
964        pub(crate) fn new(
965            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
966        ) -> Self {
967            Self(RequestBuilder::new(stub))
968        }
969
970        /// Sets the full request, replacing any prior values.
971        pub fn with_request<V: Into<crate::model::ListAgentsRequest>>(mut self, v: V) -> Self {
972            self.0.request = v.into();
973            self
974        }
975
976        /// Sets all the options, replacing any prior values.
977        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
978            self.0.options = v.into();
979            self
980        }
981
982        /// Sends the request.
983        pub async fn send(self) -> Result<crate::model::ListAgentsResponse> {
984            (*self.0.stub)
985                .list_agents(self.0.request, self.0.options)
986                .await
987                .map(crate::Response::into_body)
988        }
989
990        /// Streams each page in the collection.
991        pub fn by_page(
992            self,
993        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAgentsResponse, crate::Error>
994        {
995            use std::clone::Clone;
996            let token = self.0.request.page_token.clone();
997            let execute = move |token: String| {
998                let mut builder = self.clone();
999                builder.0.request = builder.0.request.set_page_token(token);
1000                builder.send()
1001            };
1002            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1003        }
1004
1005        /// Streams each item in the collection.
1006        pub fn by_item(
1007            self,
1008        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1009            crate::model::ListAgentsResponse,
1010            crate::Error,
1011        > {
1012            use google_cloud_gax::paginator::Paginator;
1013            self.by_page().items()
1014        }
1015
1016        /// Sets the value of [parent][crate::model::ListAgentsRequest::parent].
1017        ///
1018        /// This is a **required** field for requests.
1019        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1020            self.0.request.parent = v.into();
1021            self
1022        }
1023
1024        /// Sets the value of [page_size][crate::model::ListAgentsRequest::page_size].
1025        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1026            self.0.request.page_size = v.into();
1027            self
1028        }
1029
1030        /// Sets the value of [page_token][crate::model::ListAgentsRequest::page_token].
1031        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032            self.0.request.page_token = v.into();
1033            self
1034        }
1035
1036        /// Sets the value of [filter][crate::model::ListAgentsRequest::filter].
1037        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1038            self.0.request.filter = v.into();
1039            self
1040        }
1041
1042        /// Sets the value of [order_by][crate::model::ListAgentsRequest::order_by].
1043        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1044            self.0.request.order_by = v.into();
1045            self
1046        }
1047    }
1048
1049    #[doc(hidden)]
1050    impl crate::RequestBuilder for ListAgents {
1051        fn request_options(&mut self) -> &mut crate::RequestOptions {
1052            &mut self.0.options
1053        }
1054    }
1055
1056    /// The request builder for [AgentService::get_agent][crate::client::AgentService::get_agent] calls.
1057    ///
1058    /// # Example
1059    /// ```
1060    /// # use google_cloud_ces_v1::builder::agent_service::GetAgent;
1061    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1062    ///
1063    /// let builder = prepare_request_builder();
1064    /// let response = builder.send().await?;
1065    /// # Ok(()) }
1066    ///
1067    /// fn prepare_request_builder() -> GetAgent {
1068    ///   # panic!();
1069    ///   // ... details omitted ...
1070    /// }
1071    /// ```
1072    #[derive(Clone, Debug)]
1073    pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
1074
1075    impl GetAgent {
1076        pub(crate) fn new(
1077            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1078        ) -> Self {
1079            Self(RequestBuilder::new(stub))
1080        }
1081
1082        /// Sets the full request, replacing any prior values.
1083        pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
1084            self.0.request = v.into();
1085            self
1086        }
1087
1088        /// Sets all the options, replacing any prior values.
1089        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1090            self.0.options = v.into();
1091            self
1092        }
1093
1094        /// Sends the request.
1095        pub async fn send(self) -> Result<crate::model::Agent> {
1096            (*self.0.stub)
1097                .get_agent(self.0.request, self.0.options)
1098                .await
1099                .map(crate::Response::into_body)
1100        }
1101
1102        /// Sets the value of [name][crate::model::GetAgentRequest::name].
1103        ///
1104        /// This is a **required** field for requests.
1105        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1106            self.0.request.name = v.into();
1107            self
1108        }
1109    }
1110
1111    #[doc(hidden)]
1112    impl crate::RequestBuilder for GetAgent {
1113        fn request_options(&mut self) -> &mut crate::RequestOptions {
1114            &mut self.0.options
1115        }
1116    }
1117
1118    /// The request builder for [AgentService::create_agent][crate::client::AgentService::create_agent] calls.
1119    ///
1120    /// # Example
1121    /// ```
1122    /// # use google_cloud_ces_v1::builder::agent_service::CreateAgent;
1123    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1124    ///
1125    /// let builder = prepare_request_builder();
1126    /// let response = builder.send().await?;
1127    /// # Ok(()) }
1128    ///
1129    /// fn prepare_request_builder() -> CreateAgent {
1130    ///   # panic!();
1131    ///   // ... details omitted ...
1132    /// }
1133    /// ```
1134    #[derive(Clone, Debug)]
1135    pub struct CreateAgent(RequestBuilder<crate::model::CreateAgentRequest>);
1136
1137    impl CreateAgent {
1138        pub(crate) fn new(
1139            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1140        ) -> Self {
1141            Self(RequestBuilder::new(stub))
1142        }
1143
1144        /// Sets the full request, replacing any prior values.
1145        pub fn with_request<V: Into<crate::model::CreateAgentRequest>>(mut self, v: V) -> Self {
1146            self.0.request = v.into();
1147            self
1148        }
1149
1150        /// Sets all the options, replacing any prior values.
1151        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1152            self.0.options = v.into();
1153            self
1154        }
1155
1156        /// Sends the request.
1157        pub async fn send(self) -> Result<crate::model::Agent> {
1158            (*self.0.stub)
1159                .create_agent(self.0.request, self.0.options)
1160                .await
1161                .map(crate::Response::into_body)
1162        }
1163
1164        /// Sets the value of [parent][crate::model::CreateAgentRequest::parent].
1165        ///
1166        /// This is a **required** field for requests.
1167        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1168            self.0.request.parent = v.into();
1169            self
1170        }
1171
1172        /// Sets the value of [agent_id][crate::model::CreateAgentRequest::agent_id].
1173        pub fn set_agent_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1174            self.0.request.agent_id = v.into();
1175            self
1176        }
1177
1178        /// Sets the value of [agent][crate::model::CreateAgentRequest::agent].
1179        ///
1180        /// This is a **required** field for requests.
1181        pub fn set_agent<T>(mut self, v: T) -> Self
1182        where
1183            T: std::convert::Into<crate::model::Agent>,
1184        {
1185            self.0.request.agent = std::option::Option::Some(v.into());
1186            self
1187        }
1188
1189        /// Sets or clears the value of [agent][crate::model::CreateAgentRequest::agent].
1190        ///
1191        /// This is a **required** field for requests.
1192        pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
1193        where
1194            T: std::convert::Into<crate::model::Agent>,
1195        {
1196            self.0.request.agent = v.map(|x| x.into());
1197            self
1198        }
1199    }
1200
1201    #[doc(hidden)]
1202    impl crate::RequestBuilder for CreateAgent {
1203        fn request_options(&mut self) -> &mut crate::RequestOptions {
1204            &mut self.0.options
1205        }
1206    }
1207
1208    /// The request builder for [AgentService::update_agent][crate::client::AgentService::update_agent] calls.
1209    ///
1210    /// # Example
1211    /// ```
1212    /// # use google_cloud_ces_v1::builder::agent_service::UpdateAgent;
1213    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1214    ///
1215    /// let builder = prepare_request_builder();
1216    /// let response = builder.send().await?;
1217    /// # Ok(()) }
1218    ///
1219    /// fn prepare_request_builder() -> UpdateAgent {
1220    ///   # panic!();
1221    ///   // ... details omitted ...
1222    /// }
1223    /// ```
1224    #[derive(Clone, Debug)]
1225    pub struct UpdateAgent(RequestBuilder<crate::model::UpdateAgentRequest>);
1226
1227    impl UpdateAgent {
1228        pub(crate) fn new(
1229            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1230        ) -> Self {
1231            Self(RequestBuilder::new(stub))
1232        }
1233
1234        /// Sets the full request, replacing any prior values.
1235        pub fn with_request<V: Into<crate::model::UpdateAgentRequest>>(mut self, v: V) -> Self {
1236            self.0.request = v.into();
1237            self
1238        }
1239
1240        /// Sets all the options, replacing any prior values.
1241        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1242            self.0.options = v.into();
1243            self
1244        }
1245
1246        /// Sends the request.
1247        pub async fn send(self) -> Result<crate::model::Agent> {
1248            (*self.0.stub)
1249                .update_agent(self.0.request, self.0.options)
1250                .await
1251                .map(crate::Response::into_body)
1252        }
1253
1254        /// Sets the value of [agent][crate::model::UpdateAgentRequest::agent].
1255        ///
1256        /// This is a **required** field for requests.
1257        pub fn set_agent<T>(mut self, v: T) -> Self
1258        where
1259            T: std::convert::Into<crate::model::Agent>,
1260        {
1261            self.0.request.agent = std::option::Option::Some(v.into());
1262            self
1263        }
1264
1265        /// Sets or clears the value of [agent][crate::model::UpdateAgentRequest::agent].
1266        ///
1267        /// This is a **required** field for requests.
1268        pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
1269        where
1270            T: std::convert::Into<crate::model::Agent>,
1271        {
1272            self.0.request.agent = v.map(|x| x.into());
1273            self
1274        }
1275
1276        /// Sets the value of [update_mask][crate::model::UpdateAgentRequest::update_mask].
1277        pub fn set_update_mask<T>(mut self, v: T) -> Self
1278        where
1279            T: std::convert::Into<wkt::FieldMask>,
1280        {
1281            self.0.request.update_mask = std::option::Option::Some(v.into());
1282            self
1283        }
1284
1285        /// Sets or clears the value of [update_mask][crate::model::UpdateAgentRequest::update_mask].
1286        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1287        where
1288            T: std::convert::Into<wkt::FieldMask>,
1289        {
1290            self.0.request.update_mask = v.map(|x| x.into());
1291            self
1292        }
1293    }
1294
1295    #[doc(hidden)]
1296    impl crate::RequestBuilder for UpdateAgent {
1297        fn request_options(&mut self) -> &mut crate::RequestOptions {
1298            &mut self.0.options
1299        }
1300    }
1301
1302    /// The request builder for [AgentService::delete_agent][crate::client::AgentService::delete_agent] calls.
1303    ///
1304    /// # Example
1305    /// ```
1306    /// # use google_cloud_ces_v1::builder::agent_service::DeleteAgent;
1307    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1308    ///
1309    /// let builder = prepare_request_builder();
1310    /// let response = builder.send().await?;
1311    /// # Ok(()) }
1312    ///
1313    /// fn prepare_request_builder() -> DeleteAgent {
1314    ///   # panic!();
1315    ///   // ... details omitted ...
1316    /// }
1317    /// ```
1318    #[derive(Clone, Debug)]
1319    pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
1320
1321    impl DeleteAgent {
1322        pub(crate) fn new(
1323            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1324        ) -> Self {
1325            Self(RequestBuilder::new(stub))
1326        }
1327
1328        /// Sets the full request, replacing any prior values.
1329        pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
1330            self.0.request = v.into();
1331            self
1332        }
1333
1334        /// Sets all the options, replacing any prior values.
1335        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1336            self.0.options = v.into();
1337            self
1338        }
1339
1340        /// Sends the request.
1341        pub async fn send(self) -> Result<()> {
1342            (*self.0.stub)
1343                .delete_agent(self.0.request, self.0.options)
1344                .await
1345                .map(crate::Response::into_body)
1346        }
1347
1348        /// Sets the value of [name][crate::model::DeleteAgentRequest::name].
1349        ///
1350        /// This is a **required** field for requests.
1351        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1352            self.0.request.name = v.into();
1353            self
1354        }
1355
1356        /// Sets the value of [force][crate::model::DeleteAgentRequest::force].
1357        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1358            self.0.request.force = v.into();
1359            self
1360        }
1361
1362        /// Sets the value of [etag][crate::model::DeleteAgentRequest::etag].
1363        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1364            self.0.request.etag = v.into();
1365            self
1366        }
1367    }
1368
1369    #[doc(hidden)]
1370    impl crate::RequestBuilder for DeleteAgent {
1371        fn request_options(&mut self) -> &mut crate::RequestOptions {
1372            &mut self.0.options
1373        }
1374    }
1375
1376    /// The request builder for [AgentService::list_examples][crate::client::AgentService::list_examples] calls.
1377    ///
1378    /// # Example
1379    /// ```
1380    /// # use google_cloud_ces_v1::builder::agent_service::ListExamples;
1381    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1382    /// use google_cloud_gax::paginator::ItemPaginator;
1383    ///
1384    /// let builder = prepare_request_builder();
1385    /// let mut items = builder.by_item();
1386    /// while let Some(result) = items.next().await {
1387    ///   let item = result?;
1388    /// }
1389    /// # Ok(()) }
1390    ///
1391    /// fn prepare_request_builder() -> ListExamples {
1392    ///   # panic!();
1393    ///   // ... details omitted ...
1394    /// }
1395    /// ```
1396    #[derive(Clone, Debug)]
1397    pub struct ListExamples(RequestBuilder<crate::model::ListExamplesRequest>);
1398
1399    impl ListExamples {
1400        pub(crate) fn new(
1401            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1402        ) -> Self {
1403            Self(RequestBuilder::new(stub))
1404        }
1405
1406        /// Sets the full request, replacing any prior values.
1407        pub fn with_request<V: Into<crate::model::ListExamplesRequest>>(mut self, v: V) -> Self {
1408            self.0.request = v.into();
1409            self
1410        }
1411
1412        /// Sets all the options, replacing any prior values.
1413        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1414            self.0.options = v.into();
1415            self
1416        }
1417
1418        /// Sends the request.
1419        pub async fn send(self) -> Result<crate::model::ListExamplesResponse> {
1420            (*self.0.stub)
1421                .list_examples(self.0.request, self.0.options)
1422                .await
1423                .map(crate::Response::into_body)
1424        }
1425
1426        /// Streams each page in the collection.
1427        pub fn by_page(
1428            self,
1429        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListExamplesResponse, crate::Error>
1430        {
1431            use std::clone::Clone;
1432            let token = self.0.request.page_token.clone();
1433            let execute = move |token: String| {
1434                let mut builder = self.clone();
1435                builder.0.request = builder.0.request.set_page_token(token);
1436                builder.send()
1437            };
1438            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1439        }
1440
1441        /// Streams each item in the collection.
1442        pub fn by_item(
1443            self,
1444        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1445            crate::model::ListExamplesResponse,
1446            crate::Error,
1447        > {
1448            use google_cloud_gax::paginator::Paginator;
1449            self.by_page().items()
1450        }
1451
1452        /// Sets the value of [parent][crate::model::ListExamplesRequest::parent].
1453        ///
1454        /// This is a **required** field for requests.
1455        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1456            self.0.request.parent = v.into();
1457            self
1458        }
1459
1460        /// Sets the value of [page_size][crate::model::ListExamplesRequest::page_size].
1461        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1462            self.0.request.page_size = v.into();
1463            self
1464        }
1465
1466        /// Sets the value of [page_token][crate::model::ListExamplesRequest::page_token].
1467        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1468            self.0.request.page_token = v.into();
1469            self
1470        }
1471
1472        /// Sets the value of [filter][crate::model::ListExamplesRequest::filter].
1473        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1474            self.0.request.filter = v.into();
1475            self
1476        }
1477
1478        /// Sets the value of [order_by][crate::model::ListExamplesRequest::order_by].
1479        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1480            self.0.request.order_by = v.into();
1481            self
1482        }
1483    }
1484
1485    #[doc(hidden)]
1486    impl crate::RequestBuilder for ListExamples {
1487        fn request_options(&mut self) -> &mut crate::RequestOptions {
1488            &mut self.0.options
1489        }
1490    }
1491
1492    /// The request builder for [AgentService::get_example][crate::client::AgentService::get_example] calls.
1493    ///
1494    /// # Example
1495    /// ```
1496    /// # use google_cloud_ces_v1::builder::agent_service::GetExample;
1497    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1498    ///
1499    /// let builder = prepare_request_builder();
1500    /// let response = builder.send().await?;
1501    /// # Ok(()) }
1502    ///
1503    /// fn prepare_request_builder() -> GetExample {
1504    ///   # panic!();
1505    ///   // ... details omitted ...
1506    /// }
1507    /// ```
1508    #[derive(Clone, Debug)]
1509    pub struct GetExample(RequestBuilder<crate::model::GetExampleRequest>);
1510
1511    impl GetExample {
1512        pub(crate) fn new(
1513            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1514        ) -> Self {
1515            Self(RequestBuilder::new(stub))
1516        }
1517
1518        /// Sets the full request, replacing any prior values.
1519        pub fn with_request<V: Into<crate::model::GetExampleRequest>>(mut self, v: V) -> Self {
1520            self.0.request = v.into();
1521            self
1522        }
1523
1524        /// Sets all the options, replacing any prior values.
1525        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1526            self.0.options = v.into();
1527            self
1528        }
1529
1530        /// Sends the request.
1531        pub async fn send(self) -> Result<crate::model::Example> {
1532            (*self.0.stub)
1533                .get_example(self.0.request, self.0.options)
1534                .await
1535                .map(crate::Response::into_body)
1536        }
1537
1538        /// Sets the value of [name][crate::model::GetExampleRequest::name].
1539        ///
1540        /// This is a **required** field for requests.
1541        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1542            self.0.request.name = v.into();
1543            self
1544        }
1545    }
1546
1547    #[doc(hidden)]
1548    impl crate::RequestBuilder for GetExample {
1549        fn request_options(&mut self) -> &mut crate::RequestOptions {
1550            &mut self.0.options
1551        }
1552    }
1553
1554    /// The request builder for [AgentService::create_example][crate::client::AgentService::create_example] calls.
1555    ///
1556    /// # Example
1557    /// ```
1558    /// # use google_cloud_ces_v1::builder::agent_service::CreateExample;
1559    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1560    ///
1561    /// let builder = prepare_request_builder();
1562    /// let response = builder.send().await?;
1563    /// # Ok(()) }
1564    ///
1565    /// fn prepare_request_builder() -> CreateExample {
1566    ///   # panic!();
1567    ///   // ... details omitted ...
1568    /// }
1569    /// ```
1570    #[derive(Clone, Debug)]
1571    pub struct CreateExample(RequestBuilder<crate::model::CreateExampleRequest>);
1572
1573    impl CreateExample {
1574        pub(crate) fn new(
1575            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1576        ) -> Self {
1577            Self(RequestBuilder::new(stub))
1578        }
1579
1580        /// Sets the full request, replacing any prior values.
1581        pub fn with_request<V: Into<crate::model::CreateExampleRequest>>(mut self, v: V) -> Self {
1582            self.0.request = v.into();
1583            self
1584        }
1585
1586        /// Sets all the options, replacing any prior values.
1587        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1588            self.0.options = v.into();
1589            self
1590        }
1591
1592        /// Sends the request.
1593        pub async fn send(self) -> Result<crate::model::Example> {
1594            (*self.0.stub)
1595                .create_example(self.0.request, self.0.options)
1596                .await
1597                .map(crate::Response::into_body)
1598        }
1599
1600        /// Sets the value of [parent][crate::model::CreateExampleRequest::parent].
1601        ///
1602        /// This is a **required** field for requests.
1603        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1604            self.0.request.parent = v.into();
1605            self
1606        }
1607
1608        /// Sets the value of [example_id][crate::model::CreateExampleRequest::example_id].
1609        pub fn set_example_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1610            self.0.request.example_id = v.into();
1611            self
1612        }
1613
1614        /// Sets the value of [example][crate::model::CreateExampleRequest::example].
1615        ///
1616        /// This is a **required** field for requests.
1617        pub fn set_example<T>(mut self, v: T) -> Self
1618        where
1619            T: std::convert::Into<crate::model::Example>,
1620        {
1621            self.0.request.example = std::option::Option::Some(v.into());
1622            self
1623        }
1624
1625        /// Sets or clears the value of [example][crate::model::CreateExampleRequest::example].
1626        ///
1627        /// This is a **required** field for requests.
1628        pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
1629        where
1630            T: std::convert::Into<crate::model::Example>,
1631        {
1632            self.0.request.example = v.map(|x| x.into());
1633            self
1634        }
1635    }
1636
1637    #[doc(hidden)]
1638    impl crate::RequestBuilder for CreateExample {
1639        fn request_options(&mut self) -> &mut crate::RequestOptions {
1640            &mut self.0.options
1641        }
1642    }
1643
1644    /// The request builder for [AgentService::update_example][crate::client::AgentService::update_example] calls.
1645    ///
1646    /// # Example
1647    /// ```
1648    /// # use google_cloud_ces_v1::builder::agent_service::UpdateExample;
1649    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1650    ///
1651    /// let builder = prepare_request_builder();
1652    /// let response = builder.send().await?;
1653    /// # Ok(()) }
1654    ///
1655    /// fn prepare_request_builder() -> UpdateExample {
1656    ///   # panic!();
1657    ///   // ... details omitted ...
1658    /// }
1659    /// ```
1660    #[derive(Clone, Debug)]
1661    pub struct UpdateExample(RequestBuilder<crate::model::UpdateExampleRequest>);
1662
1663    impl UpdateExample {
1664        pub(crate) fn new(
1665            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1666        ) -> Self {
1667            Self(RequestBuilder::new(stub))
1668        }
1669
1670        /// Sets the full request, replacing any prior values.
1671        pub fn with_request<V: Into<crate::model::UpdateExampleRequest>>(mut self, v: V) -> Self {
1672            self.0.request = v.into();
1673            self
1674        }
1675
1676        /// Sets all the options, replacing any prior values.
1677        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1678            self.0.options = v.into();
1679            self
1680        }
1681
1682        /// Sends the request.
1683        pub async fn send(self) -> Result<crate::model::Example> {
1684            (*self.0.stub)
1685                .update_example(self.0.request, self.0.options)
1686                .await
1687                .map(crate::Response::into_body)
1688        }
1689
1690        /// Sets the value of [example][crate::model::UpdateExampleRequest::example].
1691        ///
1692        /// This is a **required** field for requests.
1693        pub fn set_example<T>(mut self, v: T) -> Self
1694        where
1695            T: std::convert::Into<crate::model::Example>,
1696        {
1697            self.0.request.example = std::option::Option::Some(v.into());
1698            self
1699        }
1700
1701        /// Sets or clears the value of [example][crate::model::UpdateExampleRequest::example].
1702        ///
1703        /// This is a **required** field for requests.
1704        pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
1705        where
1706            T: std::convert::Into<crate::model::Example>,
1707        {
1708            self.0.request.example = v.map(|x| x.into());
1709            self
1710        }
1711
1712        /// Sets the value of [update_mask][crate::model::UpdateExampleRequest::update_mask].
1713        pub fn set_update_mask<T>(mut self, v: T) -> Self
1714        where
1715            T: std::convert::Into<wkt::FieldMask>,
1716        {
1717            self.0.request.update_mask = std::option::Option::Some(v.into());
1718            self
1719        }
1720
1721        /// Sets or clears the value of [update_mask][crate::model::UpdateExampleRequest::update_mask].
1722        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1723        where
1724            T: std::convert::Into<wkt::FieldMask>,
1725        {
1726            self.0.request.update_mask = v.map(|x| x.into());
1727            self
1728        }
1729    }
1730
1731    #[doc(hidden)]
1732    impl crate::RequestBuilder for UpdateExample {
1733        fn request_options(&mut self) -> &mut crate::RequestOptions {
1734            &mut self.0.options
1735        }
1736    }
1737
1738    /// The request builder for [AgentService::delete_example][crate::client::AgentService::delete_example] calls.
1739    ///
1740    /// # Example
1741    /// ```
1742    /// # use google_cloud_ces_v1::builder::agent_service::DeleteExample;
1743    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1744    ///
1745    /// let builder = prepare_request_builder();
1746    /// let response = builder.send().await?;
1747    /// # Ok(()) }
1748    ///
1749    /// fn prepare_request_builder() -> DeleteExample {
1750    ///   # panic!();
1751    ///   // ... details omitted ...
1752    /// }
1753    /// ```
1754    #[derive(Clone, Debug)]
1755    pub struct DeleteExample(RequestBuilder<crate::model::DeleteExampleRequest>);
1756
1757    impl DeleteExample {
1758        pub(crate) fn new(
1759            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1760        ) -> Self {
1761            Self(RequestBuilder::new(stub))
1762        }
1763
1764        /// Sets the full request, replacing any prior values.
1765        pub fn with_request<V: Into<crate::model::DeleteExampleRequest>>(mut self, v: V) -> Self {
1766            self.0.request = v.into();
1767            self
1768        }
1769
1770        /// Sets all the options, replacing any prior values.
1771        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1772            self.0.options = v.into();
1773            self
1774        }
1775
1776        /// Sends the request.
1777        pub async fn send(self) -> Result<()> {
1778            (*self.0.stub)
1779                .delete_example(self.0.request, self.0.options)
1780                .await
1781                .map(crate::Response::into_body)
1782        }
1783
1784        /// Sets the value of [name][crate::model::DeleteExampleRequest::name].
1785        ///
1786        /// This is a **required** field for requests.
1787        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788            self.0.request.name = v.into();
1789            self
1790        }
1791
1792        /// Sets the value of [etag][crate::model::DeleteExampleRequest::etag].
1793        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1794            self.0.request.etag = v.into();
1795            self
1796        }
1797    }
1798
1799    #[doc(hidden)]
1800    impl crate::RequestBuilder for DeleteExample {
1801        fn request_options(&mut self) -> &mut crate::RequestOptions {
1802            &mut self.0.options
1803        }
1804    }
1805
1806    /// The request builder for [AgentService::list_tools][crate::client::AgentService::list_tools] calls.
1807    ///
1808    /// # Example
1809    /// ```
1810    /// # use google_cloud_ces_v1::builder::agent_service::ListTools;
1811    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1812    /// use google_cloud_gax::paginator::ItemPaginator;
1813    ///
1814    /// let builder = prepare_request_builder();
1815    /// let mut items = builder.by_item();
1816    /// while let Some(result) = items.next().await {
1817    ///   let item = result?;
1818    /// }
1819    /// # Ok(()) }
1820    ///
1821    /// fn prepare_request_builder() -> ListTools {
1822    ///   # panic!();
1823    ///   // ... details omitted ...
1824    /// }
1825    /// ```
1826    #[derive(Clone, Debug)]
1827    pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
1828
1829    impl ListTools {
1830        pub(crate) fn new(
1831            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1832        ) -> Self {
1833            Self(RequestBuilder::new(stub))
1834        }
1835
1836        /// Sets the full request, replacing any prior values.
1837        pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
1838            self.0.request = v.into();
1839            self
1840        }
1841
1842        /// Sets all the options, replacing any prior values.
1843        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1844            self.0.options = v.into();
1845            self
1846        }
1847
1848        /// Sends the request.
1849        pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
1850            (*self.0.stub)
1851                .list_tools(self.0.request, self.0.options)
1852                .await
1853                .map(crate::Response::into_body)
1854        }
1855
1856        /// Streams each page in the collection.
1857        pub fn by_page(
1858            self,
1859        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsResponse, crate::Error>
1860        {
1861            use std::clone::Clone;
1862            let token = self.0.request.page_token.clone();
1863            let execute = move |token: String| {
1864                let mut builder = self.clone();
1865                builder.0.request = builder.0.request.set_page_token(token);
1866                builder.send()
1867            };
1868            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1869        }
1870
1871        /// Streams each item in the collection.
1872        pub fn by_item(
1873            self,
1874        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListToolsResponse, crate::Error>
1875        {
1876            use google_cloud_gax::paginator::Paginator;
1877            self.by_page().items()
1878        }
1879
1880        /// Sets the value of [parent][crate::model::ListToolsRequest::parent].
1881        ///
1882        /// This is a **required** field for requests.
1883        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1884            self.0.request.parent = v.into();
1885            self
1886        }
1887
1888        /// Sets the value of [page_size][crate::model::ListToolsRequest::page_size].
1889        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1890            self.0.request.page_size = v.into();
1891            self
1892        }
1893
1894        /// Sets the value of [page_token][crate::model::ListToolsRequest::page_token].
1895        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1896            self.0.request.page_token = v.into();
1897            self
1898        }
1899
1900        /// Sets the value of [filter][crate::model::ListToolsRequest::filter].
1901        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1902            self.0.request.filter = v.into();
1903            self
1904        }
1905
1906        /// Sets the value of [order_by][crate::model::ListToolsRequest::order_by].
1907        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1908            self.0.request.order_by = v.into();
1909            self
1910        }
1911    }
1912
1913    #[doc(hidden)]
1914    impl crate::RequestBuilder for ListTools {
1915        fn request_options(&mut self) -> &mut crate::RequestOptions {
1916            &mut self.0.options
1917        }
1918    }
1919
1920    /// The request builder for [AgentService::get_tool][crate::client::AgentService::get_tool] calls.
1921    ///
1922    /// # Example
1923    /// ```
1924    /// # use google_cloud_ces_v1::builder::agent_service::GetTool;
1925    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1926    ///
1927    /// let builder = prepare_request_builder();
1928    /// let response = builder.send().await?;
1929    /// # Ok(()) }
1930    ///
1931    /// fn prepare_request_builder() -> GetTool {
1932    ///   # panic!();
1933    ///   // ... details omitted ...
1934    /// }
1935    /// ```
1936    #[derive(Clone, Debug)]
1937    pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
1938
1939    impl GetTool {
1940        pub(crate) fn new(
1941            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1942        ) -> Self {
1943            Self(RequestBuilder::new(stub))
1944        }
1945
1946        /// Sets the full request, replacing any prior values.
1947        pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> Self {
1948            self.0.request = v.into();
1949            self
1950        }
1951
1952        /// Sets all the options, replacing any prior values.
1953        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1954            self.0.options = v.into();
1955            self
1956        }
1957
1958        /// Sends the request.
1959        pub async fn send(self) -> Result<crate::model::Tool> {
1960            (*self.0.stub)
1961                .get_tool(self.0.request, self.0.options)
1962                .await
1963                .map(crate::Response::into_body)
1964        }
1965
1966        /// Sets the value of [name][crate::model::GetToolRequest::name].
1967        ///
1968        /// This is a **required** field for requests.
1969        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1970            self.0.request.name = v.into();
1971            self
1972        }
1973    }
1974
1975    #[doc(hidden)]
1976    impl crate::RequestBuilder for GetTool {
1977        fn request_options(&mut self) -> &mut crate::RequestOptions {
1978            &mut self.0.options
1979        }
1980    }
1981
1982    /// The request builder for [AgentService::list_conversations][crate::client::AgentService::list_conversations] calls.
1983    ///
1984    /// # Example
1985    /// ```
1986    /// # use google_cloud_ces_v1::builder::agent_service::ListConversations;
1987    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
1988    /// use google_cloud_gax::paginator::ItemPaginator;
1989    ///
1990    /// let builder = prepare_request_builder();
1991    /// let mut items = builder.by_item();
1992    /// while let Some(result) = items.next().await {
1993    ///   let item = result?;
1994    /// }
1995    /// # Ok(()) }
1996    ///
1997    /// fn prepare_request_builder() -> ListConversations {
1998    ///   # panic!();
1999    ///   // ... details omitted ...
2000    /// }
2001    /// ```
2002    #[derive(Clone, Debug)]
2003    pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);
2004
2005    impl ListConversations {
2006        pub(crate) fn new(
2007            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2008        ) -> Self {
2009            Self(RequestBuilder::new(stub))
2010        }
2011
2012        /// Sets the full request, replacing any prior values.
2013        pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
2014            mut self,
2015            v: V,
2016        ) -> Self {
2017            self.0.request = v.into();
2018            self
2019        }
2020
2021        /// Sets all the options, replacing any prior values.
2022        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2023            self.0.options = v.into();
2024            self
2025        }
2026
2027        /// Sends the request.
2028        pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
2029            (*self.0.stub)
2030                .list_conversations(self.0.request, self.0.options)
2031                .await
2032                .map(crate::Response::into_body)
2033        }
2034
2035        /// Streams each page in the collection.
2036        pub fn by_page(
2037            self,
2038        ) -> impl google_cloud_gax::paginator::Paginator<
2039            crate::model::ListConversationsResponse,
2040            crate::Error,
2041        > {
2042            use std::clone::Clone;
2043            let token = self.0.request.page_token.clone();
2044            let execute = move |token: String| {
2045                let mut builder = self.clone();
2046                builder.0.request = builder.0.request.set_page_token(token);
2047                builder.send()
2048            };
2049            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2050        }
2051
2052        /// Streams each item in the collection.
2053        pub fn by_item(
2054            self,
2055        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2056            crate::model::ListConversationsResponse,
2057            crate::Error,
2058        > {
2059            use google_cloud_gax::paginator::Paginator;
2060            self.by_page().items()
2061        }
2062
2063        /// Sets the value of [parent][crate::model::ListConversationsRequest::parent].
2064        ///
2065        /// This is a **required** field for requests.
2066        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2067            self.0.request.parent = v.into();
2068            self
2069        }
2070
2071        /// Sets the value of [page_size][crate::model::ListConversationsRequest::page_size].
2072        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2073            self.0.request.page_size = v.into();
2074            self
2075        }
2076
2077        /// Sets the value of [page_token][crate::model::ListConversationsRequest::page_token].
2078        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2079            self.0.request.page_token = v.into();
2080            self
2081        }
2082
2083        /// Sets the value of [filter][crate::model::ListConversationsRequest::filter].
2084        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2085            self.0.request.filter = v.into();
2086            self
2087        }
2088
2089        /// Sets the value of [source][crate::model::ListConversationsRequest::source].
2090        pub fn set_source<T: Into<crate::model::conversation::Source>>(mut self, v: T) -> Self {
2091            self.0.request.source = v.into();
2092            self
2093        }
2094
2095        /// Sets the value of [sources][crate::model::ListConversationsRequest::sources].
2096        pub fn set_sources<T, V>(mut self, v: T) -> Self
2097        where
2098            T: std::iter::IntoIterator<Item = V>,
2099            V: std::convert::Into<crate::model::conversation::Source>,
2100        {
2101            use std::iter::Iterator;
2102            self.0.request.sources = v.into_iter().map(|i| i.into()).collect();
2103            self
2104        }
2105    }
2106
2107    #[doc(hidden)]
2108    impl crate::RequestBuilder for ListConversations {
2109        fn request_options(&mut self) -> &mut crate::RequestOptions {
2110            &mut self.0.options
2111        }
2112    }
2113
2114    /// The request builder for [AgentService::get_conversation][crate::client::AgentService::get_conversation] calls.
2115    ///
2116    /// # Example
2117    /// ```
2118    /// # use google_cloud_ces_v1::builder::agent_service::GetConversation;
2119    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2120    ///
2121    /// let builder = prepare_request_builder();
2122    /// let response = builder.send().await?;
2123    /// # Ok(()) }
2124    ///
2125    /// fn prepare_request_builder() -> GetConversation {
2126    ///   # panic!();
2127    ///   // ... details omitted ...
2128    /// }
2129    /// ```
2130    #[derive(Clone, Debug)]
2131    pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);
2132
2133    impl GetConversation {
2134        pub(crate) fn new(
2135            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2136        ) -> Self {
2137            Self(RequestBuilder::new(stub))
2138        }
2139
2140        /// Sets the full request, replacing any prior values.
2141        pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
2142            self.0.request = v.into();
2143            self
2144        }
2145
2146        /// Sets all the options, replacing any prior values.
2147        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2148            self.0.options = v.into();
2149            self
2150        }
2151
2152        /// Sends the request.
2153        pub async fn send(self) -> Result<crate::model::Conversation> {
2154            (*self.0.stub)
2155                .get_conversation(self.0.request, self.0.options)
2156                .await
2157                .map(crate::Response::into_body)
2158        }
2159
2160        /// Sets the value of [name][crate::model::GetConversationRequest::name].
2161        ///
2162        /// This is a **required** field for requests.
2163        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2164            self.0.request.name = v.into();
2165            self
2166        }
2167
2168        /// Sets the value of [source][crate::model::GetConversationRequest::source].
2169        #[deprecated]
2170        pub fn set_source<T: Into<crate::model::conversation::Source>>(mut self, v: T) -> Self {
2171            self.0.request.source = v.into();
2172            self
2173        }
2174    }
2175
2176    #[doc(hidden)]
2177    impl crate::RequestBuilder for GetConversation {
2178        fn request_options(&mut self) -> &mut crate::RequestOptions {
2179            &mut self.0.options
2180        }
2181    }
2182
2183    /// The request builder for [AgentService::delete_conversation][crate::client::AgentService::delete_conversation] calls.
2184    ///
2185    /// # Example
2186    /// ```
2187    /// # use google_cloud_ces_v1::builder::agent_service::DeleteConversation;
2188    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2189    ///
2190    /// let builder = prepare_request_builder();
2191    /// let response = builder.send().await?;
2192    /// # Ok(()) }
2193    ///
2194    /// fn prepare_request_builder() -> DeleteConversation {
2195    ///   # panic!();
2196    ///   // ... details omitted ...
2197    /// }
2198    /// ```
2199    #[derive(Clone, Debug)]
2200    pub struct DeleteConversation(RequestBuilder<crate::model::DeleteConversationRequest>);
2201
2202    impl DeleteConversation {
2203        pub(crate) fn new(
2204            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2205        ) -> Self {
2206            Self(RequestBuilder::new(stub))
2207        }
2208
2209        /// Sets the full request, replacing any prior values.
2210        pub fn with_request<V: Into<crate::model::DeleteConversationRequest>>(
2211            mut self,
2212            v: V,
2213        ) -> Self {
2214            self.0.request = v.into();
2215            self
2216        }
2217
2218        /// Sets all the options, replacing any prior values.
2219        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2220            self.0.options = v.into();
2221            self
2222        }
2223
2224        /// Sends the request.
2225        pub async fn send(self) -> Result<()> {
2226            (*self.0.stub)
2227                .delete_conversation(self.0.request, self.0.options)
2228                .await
2229                .map(crate::Response::into_body)
2230        }
2231
2232        /// Sets the value of [name][crate::model::DeleteConversationRequest::name].
2233        ///
2234        /// This is a **required** field for requests.
2235        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2236            self.0.request.name = v.into();
2237            self
2238        }
2239
2240        /// Sets the value of [source][crate::model::DeleteConversationRequest::source].
2241        #[deprecated]
2242        pub fn set_source<T: Into<crate::model::conversation::Source>>(mut self, v: T) -> Self {
2243            self.0.request.source = v.into();
2244            self
2245        }
2246    }
2247
2248    #[doc(hidden)]
2249    impl crate::RequestBuilder for DeleteConversation {
2250        fn request_options(&mut self) -> &mut crate::RequestOptions {
2251            &mut self.0.options
2252        }
2253    }
2254
2255    /// The request builder for [AgentService::batch_delete_conversations][crate::client::AgentService::batch_delete_conversations] calls.
2256    ///
2257    /// # Example
2258    /// ```
2259    /// # use google_cloud_ces_v1::builder::agent_service::BatchDeleteConversations;
2260    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2261    /// use google_cloud_lro::Poller;
2262    ///
2263    /// let builder = prepare_request_builder();
2264    /// let response = builder.poller().until_done().await?;
2265    /// # Ok(()) }
2266    ///
2267    /// fn prepare_request_builder() -> BatchDeleteConversations {
2268    ///   # panic!();
2269    ///   // ... details omitted ...
2270    /// }
2271    /// ```
2272    #[derive(Clone, Debug)]
2273    pub struct BatchDeleteConversations(
2274        RequestBuilder<crate::model::BatchDeleteConversationsRequest>,
2275    );
2276
2277    impl BatchDeleteConversations {
2278        pub(crate) fn new(
2279            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2280        ) -> Self {
2281            Self(RequestBuilder::new(stub))
2282        }
2283
2284        /// Sets the full request, replacing any prior values.
2285        pub fn with_request<V: Into<crate::model::BatchDeleteConversationsRequest>>(
2286            mut self,
2287            v: V,
2288        ) -> Self {
2289            self.0.request = v.into();
2290            self
2291        }
2292
2293        /// Sets all the options, replacing any prior values.
2294        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2295            self.0.options = v.into();
2296            self
2297        }
2298
2299        /// Sends the request.
2300        ///
2301        /// # Long running operations
2302        ///
2303        /// This starts, but does not poll, a longrunning operation. More information
2304        /// on [batch_delete_conversations][crate::client::AgentService::batch_delete_conversations].
2305        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2306            (*self.0.stub)
2307                .batch_delete_conversations(self.0.request, self.0.options)
2308                .await
2309                .map(crate::Response::into_body)
2310        }
2311
2312        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_conversations`.
2313        pub fn poller(
2314            self,
2315        ) -> impl google_cloud_lro::Poller<
2316            crate::model::BatchDeleteConversationsResponse,
2317            crate::model::OperationMetadata,
2318        > {
2319            type Operation = google_cloud_lro::internal::Operation<
2320                crate::model::BatchDeleteConversationsResponse,
2321                crate::model::OperationMetadata,
2322            >;
2323            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2324            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2325            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2326            if let Some(ref mut details) = poller_options.tracing {
2327                details.method_name = "google_cloud_ces_v1::client::AgentService::batch_delete_conversations::until_done";
2328            }
2329
2330            let stub = self.0.stub.clone();
2331            let mut options = self.0.options.clone();
2332            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2333            let query = move |name| {
2334                let stub = stub.clone();
2335                let options = options.clone();
2336                async {
2337                    let op = GetOperation::new(stub)
2338                        .set_name(name)
2339                        .with_options(options)
2340                        .send()
2341                        .await?;
2342                    Ok(Operation::new(op))
2343                }
2344            };
2345
2346            let start = move || async {
2347                let op = self.send().await?;
2348                Ok(Operation::new(op))
2349            };
2350
2351            use google_cloud_lro::internal::PollerExt;
2352            {
2353                google_cloud_lro::internal::new_poller(
2354                    polling_error_policy,
2355                    polling_backoff_policy,
2356                    start,
2357                    query,
2358                )
2359            }
2360            .with_options(poller_options)
2361        }
2362
2363        /// Sets the value of [parent][crate::model::BatchDeleteConversationsRequest::parent].
2364        ///
2365        /// This is a **required** field for requests.
2366        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2367            self.0.request.parent = v.into();
2368            self
2369        }
2370
2371        /// Sets the value of [conversations][crate::model::BatchDeleteConversationsRequest::conversations].
2372        ///
2373        /// This is a **required** field for requests.
2374        pub fn set_conversations<T, V>(mut self, v: T) -> Self
2375        where
2376            T: std::iter::IntoIterator<Item = V>,
2377            V: std::convert::Into<std::string::String>,
2378        {
2379            use std::iter::Iterator;
2380            self.0.request.conversations = v.into_iter().map(|i| i.into()).collect();
2381            self
2382        }
2383    }
2384
2385    #[doc(hidden)]
2386    impl crate::RequestBuilder for BatchDeleteConversations {
2387        fn request_options(&mut self) -> &mut crate::RequestOptions {
2388            &mut self.0.options
2389        }
2390    }
2391
2392    /// The request builder for [AgentService::create_tool][crate::client::AgentService::create_tool] calls.
2393    ///
2394    /// # Example
2395    /// ```
2396    /// # use google_cloud_ces_v1::builder::agent_service::CreateTool;
2397    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2398    ///
2399    /// let builder = prepare_request_builder();
2400    /// let response = builder.send().await?;
2401    /// # Ok(()) }
2402    ///
2403    /// fn prepare_request_builder() -> CreateTool {
2404    ///   # panic!();
2405    ///   // ... details omitted ...
2406    /// }
2407    /// ```
2408    #[derive(Clone, Debug)]
2409    pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
2410
2411    impl CreateTool {
2412        pub(crate) fn new(
2413            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2414        ) -> Self {
2415            Self(RequestBuilder::new(stub))
2416        }
2417
2418        /// Sets the full request, replacing any prior values.
2419        pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> Self {
2420            self.0.request = v.into();
2421            self
2422        }
2423
2424        /// Sets all the options, replacing any prior values.
2425        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2426            self.0.options = v.into();
2427            self
2428        }
2429
2430        /// Sends the request.
2431        pub async fn send(self) -> Result<crate::model::Tool> {
2432            (*self.0.stub)
2433                .create_tool(self.0.request, self.0.options)
2434                .await
2435                .map(crate::Response::into_body)
2436        }
2437
2438        /// Sets the value of [parent][crate::model::CreateToolRequest::parent].
2439        ///
2440        /// This is a **required** field for requests.
2441        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2442            self.0.request.parent = v.into();
2443            self
2444        }
2445
2446        /// Sets the value of [tool_id][crate::model::CreateToolRequest::tool_id].
2447        pub fn set_tool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2448            self.0.request.tool_id = v.into();
2449            self
2450        }
2451
2452        /// Sets the value of [tool][crate::model::CreateToolRequest::tool].
2453        ///
2454        /// This is a **required** field for requests.
2455        pub fn set_tool<T>(mut self, v: T) -> Self
2456        where
2457            T: std::convert::Into<crate::model::Tool>,
2458        {
2459            self.0.request.tool = std::option::Option::Some(v.into());
2460            self
2461        }
2462
2463        /// Sets or clears the value of [tool][crate::model::CreateToolRequest::tool].
2464        ///
2465        /// This is a **required** field for requests.
2466        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
2467        where
2468            T: std::convert::Into<crate::model::Tool>,
2469        {
2470            self.0.request.tool = v.map(|x| x.into());
2471            self
2472        }
2473    }
2474
2475    #[doc(hidden)]
2476    impl crate::RequestBuilder for CreateTool {
2477        fn request_options(&mut self) -> &mut crate::RequestOptions {
2478            &mut self.0.options
2479        }
2480    }
2481
2482    /// The request builder for [AgentService::update_tool][crate::client::AgentService::update_tool] calls.
2483    ///
2484    /// # Example
2485    /// ```
2486    /// # use google_cloud_ces_v1::builder::agent_service::UpdateTool;
2487    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2488    ///
2489    /// let builder = prepare_request_builder();
2490    /// let response = builder.send().await?;
2491    /// # Ok(()) }
2492    ///
2493    /// fn prepare_request_builder() -> UpdateTool {
2494    ///   # panic!();
2495    ///   // ... details omitted ...
2496    /// }
2497    /// ```
2498    #[derive(Clone, Debug)]
2499    pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
2500
2501    impl UpdateTool {
2502        pub(crate) fn new(
2503            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2504        ) -> Self {
2505            Self(RequestBuilder::new(stub))
2506        }
2507
2508        /// Sets the full request, replacing any prior values.
2509        pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
2510            self.0.request = v.into();
2511            self
2512        }
2513
2514        /// Sets all the options, replacing any prior values.
2515        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2516            self.0.options = v.into();
2517            self
2518        }
2519
2520        /// Sends the request.
2521        pub async fn send(self) -> Result<crate::model::Tool> {
2522            (*self.0.stub)
2523                .update_tool(self.0.request, self.0.options)
2524                .await
2525                .map(crate::Response::into_body)
2526        }
2527
2528        /// Sets the value of [tool][crate::model::UpdateToolRequest::tool].
2529        ///
2530        /// This is a **required** field for requests.
2531        pub fn set_tool<T>(mut self, v: T) -> Self
2532        where
2533            T: std::convert::Into<crate::model::Tool>,
2534        {
2535            self.0.request.tool = std::option::Option::Some(v.into());
2536            self
2537        }
2538
2539        /// Sets or clears the value of [tool][crate::model::UpdateToolRequest::tool].
2540        ///
2541        /// This is a **required** field for requests.
2542        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
2543        where
2544            T: std::convert::Into<crate::model::Tool>,
2545        {
2546            self.0.request.tool = v.map(|x| x.into());
2547            self
2548        }
2549
2550        /// Sets the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
2551        pub fn set_update_mask<T>(mut self, v: T) -> Self
2552        where
2553            T: std::convert::Into<wkt::FieldMask>,
2554        {
2555            self.0.request.update_mask = std::option::Option::Some(v.into());
2556            self
2557        }
2558
2559        /// Sets or clears the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
2560        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2561        where
2562            T: std::convert::Into<wkt::FieldMask>,
2563        {
2564            self.0.request.update_mask = v.map(|x| x.into());
2565            self
2566        }
2567    }
2568
2569    #[doc(hidden)]
2570    impl crate::RequestBuilder for UpdateTool {
2571        fn request_options(&mut self) -> &mut crate::RequestOptions {
2572            &mut self.0.options
2573        }
2574    }
2575
2576    /// The request builder for [AgentService::delete_tool][crate::client::AgentService::delete_tool] calls.
2577    ///
2578    /// # Example
2579    /// ```
2580    /// # use google_cloud_ces_v1::builder::agent_service::DeleteTool;
2581    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2582    ///
2583    /// let builder = prepare_request_builder();
2584    /// let response = builder.send().await?;
2585    /// # Ok(()) }
2586    ///
2587    /// fn prepare_request_builder() -> DeleteTool {
2588    ///   # panic!();
2589    ///   // ... details omitted ...
2590    /// }
2591    /// ```
2592    #[derive(Clone, Debug)]
2593    pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
2594
2595    impl DeleteTool {
2596        pub(crate) fn new(
2597            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2598        ) -> Self {
2599            Self(RequestBuilder::new(stub))
2600        }
2601
2602        /// Sets the full request, replacing any prior values.
2603        pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
2604            self.0.request = v.into();
2605            self
2606        }
2607
2608        /// Sets all the options, replacing any prior values.
2609        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2610            self.0.options = v.into();
2611            self
2612        }
2613
2614        /// Sends the request.
2615        pub async fn send(self) -> Result<()> {
2616            (*self.0.stub)
2617                .delete_tool(self.0.request, self.0.options)
2618                .await
2619                .map(crate::Response::into_body)
2620        }
2621
2622        /// Sets the value of [name][crate::model::DeleteToolRequest::name].
2623        ///
2624        /// This is a **required** field for requests.
2625        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2626            self.0.request.name = v.into();
2627            self
2628        }
2629
2630        /// Sets the value of [force][crate::model::DeleteToolRequest::force].
2631        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2632            self.0.request.force = v.into();
2633            self
2634        }
2635
2636        /// Sets the value of [etag][crate::model::DeleteToolRequest::etag].
2637        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2638            self.0.request.etag = v.into();
2639            self
2640        }
2641    }
2642
2643    #[doc(hidden)]
2644    impl crate::RequestBuilder for DeleteTool {
2645        fn request_options(&mut self) -> &mut crate::RequestOptions {
2646            &mut self.0.options
2647        }
2648    }
2649
2650    /// The request builder for [AgentService::list_guardrails][crate::client::AgentService::list_guardrails] calls.
2651    ///
2652    /// # Example
2653    /// ```
2654    /// # use google_cloud_ces_v1::builder::agent_service::ListGuardrails;
2655    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2656    /// use google_cloud_gax::paginator::ItemPaginator;
2657    ///
2658    /// let builder = prepare_request_builder();
2659    /// let mut items = builder.by_item();
2660    /// while let Some(result) = items.next().await {
2661    ///   let item = result?;
2662    /// }
2663    /// # Ok(()) }
2664    ///
2665    /// fn prepare_request_builder() -> ListGuardrails {
2666    ///   # panic!();
2667    ///   // ... details omitted ...
2668    /// }
2669    /// ```
2670    #[derive(Clone, Debug)]
2671    pub struct ListGuardrails(RequestBuilder<crate::model::ListGuardrailsRequest>);
2672
2673    impl ListGuardrails {
2674        pub(crate) fn new(
2675            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2676        ) -> Self {
2677            Self(RequestBuilder::new(stub))
2678        }
2679
2680        /// Sets the full request, replacing any prior values.
2681        pub fn with_request<V: Into<crate::model::ListGuardrailsRequest>>(mut self, v: V) -> Self {
2682            self.0.request = v.into();
2683            self
2684        }
2685
2686        /// Sets all the options, replacing any prior values.
2687        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2688            self.0.options = v.into();
2689            self
2690        }
2691
2692        /// Sends the request.
2693        pub async fn send(self) -> Result<crate::model::ListGuardrailsResponse> {
2694            (*self.0.stub)
2695                .list_guardrails(self.0.request, self.0.options)
2696                .await
2697                .map(crate::Response::into_body)
2698        }
2699
2700        /// Streams each page in the collection.
2701        pub fn by_page(
2702            self,
2703        ) -> impl google_cloud_gax::paginator::Paginator<
2704            crate::model::ListGuardrailsResponse,
2705            crate::Error,
2706        > {
2707            use std::clone::Clone;
2708            let token = self.0.request.page_token.clone();
2709            let execute = move |token: String| {
2710                let mut builder = self.clone();
2711                builder.0.request = builder.0.request.set_page_token(token);
2712                builder.send()
2713            };
2714            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2715        }
2716
2717        /// Streams each item in the collection.
2718        pub fn by_item(
2719            self,
2720        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2721            crate::model::ListGuardrailsResponse,
2722            crate::Error,
2723        > {
2724            use google_cloud_gax::paginator::Paginator;
2725            self.by_page().items()
2726        }
2727
2728        /// Sets the value of [parent][crate::model::ListGuardrailsRequest::parent].
2729        ///
2730        /// This is a **required** field for requests.
2731        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2732            self.0.request.parent = v.into();
2733            self
2734        }
2735
2736        /// Sets the value of [page_size][crate::model::ListGuardrailsRequest::page_size].
2737        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2738            self.0.request.page_size = v.into();
2739            self
2740        }
2741
2742        /// Sets the value of [page_token][crate::model::ListGuardrailsRequest::page_token].
2743        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2744            self.0.request.page_token = v.into();
2745            self
2746        }
2747
2748        /// Sets the value of [filter][crate::model::ListGuardrailsRequest::filter].
2749        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2750            self.0.request.filter = v.into();
2751            self
2752        }
2753
2754        /// Sets the value of [order_by][crate::model::ListGuardrailsRequest::order_by].
2755        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2756            self.0.request.order_by = v.into();
2757            self
2758        }
2759    }
2760
2761    #[doc(hidden)]
2762    impl crate::RequestBuilder for ListGuardrails {
2763        fn request_options(&mut self) -> &mut crate::RequestOptions {
2764            &mut self.0.options
2765        }
2766    }
2767
2768    /// The request builder for [AgentService::get_guardrail][crate::client::AgentService::get_guardrail] calls.
2769    ///
2770    /// # Example
2771    /// ```
2772    /// # use google_cloud_ces_v1::builder::agent_service::GetGuardrail;
2773    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2774    ///
2775    /// let builder = prepare_request_builder();
2776    /// let response = builder.send().await?;
2777    /// # Ok(()) }
2778    ///
2779    /// fn prepare_request_builder() -> GetGuardrail {
2780    ///   # panic!();
2781    ///   // ... details omitted ...
2782    /// }
2783    /// ```
2784    #[derive(Clone, Debug)]
2785    pub struct GetGuardrail(RequestBuilder<crate::model::GetGuardrailRequest>);
2786
2787    impl GetGuardrail {
2788        pub(crate) fn new(
2789            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2790        ) -> Self {
2791            Self(RequestBuilder::new(stub))
2792        }
2793
2794        /// Sets the full request, replacing any prior values.
2795        pub fn with_request<V: Into<crate::model::GetGuardrailRequest>>(mut self, v: V) -> Self {
2796            self.0.request = v.into();
2797            self
2798        }
2799
2800        /// Sets all the options, replacing any prior values.
2801        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2802            self.0.options = v.into();
2803            self
2804        }
2805
2806        /// Sends the request.
2807        pub async fn send(self) -> Result<crate::model::Guardrail> {
2808            (*self.0.stub)
2809                .get_guardrail(self.0.request, self.0.options)
2810                .await
2811                .map(crate::Response::into_body)
2812        }
2813
2814        /// Sets the value of [name][crate::model::GetGuardrailRequest::name].
2815        ///
2816        /// This is a **required** field for requests.
2817        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818            self.0.request.name = v.into();
2819            self
2820        }
2821    }
2822
2823    #[doc(hidden)]
2824    impl crate::RequestBuilder for GetGuardrail {
2825        fn request_options(&mut self) -> &mut crate::RequestOptions {
2826            &mut self.0.options
2827        }
2828    }
2829
2830    /// The request builder for [AgentService::create_guardrail][crate::client::AgentService::create_guardrail] calls.
2831    ///
2832    /// # Example
2833    /// ```
2834    /// # use google_cloud_ces_v1::builder::agent_service::CreateGuardrail;
2835    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2836    ///
2837    /// let builder = prepare_request_builder();
2838    /// let response = builder.send().await?;
2839    /// # Ok(()) }
2840    ///
2841    /// fn prepare_request_builder() -> CreateGuardrail {
2842    ///   # panic!();
2843    ///   // ... details omitted ...
2844    /// }
2845    /// ```
2846    #[derive(Clone, Debug)]
2847    pub struct CreateGuardrail(RequestBuilder<crate::model::CreateGuardrailRequest>);
2848
2849    impl CreateGuardrail {
2850        pub(crate) fn new(
2851            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2852        ) -> Self {
2853            Self(RequestBuilder::new(stub))
2854        }
2855
2856        /// Sets the full request, replacing any prior values.
2857        pub fn with_request<V: Into<crate::model::CreateGuardrailRequest>>(mut self, v: V) -> Self {
2858            self.0.request = v.into();
2859            self
2860        }
2861
2862        /// Sets all the options, replacing any prior values.
2863        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2864            self.0.options = v.into();
2865            self
2866        }
2867
2868        /// Sends the request.
2869        pub async fn send(self) -> Result<crate::model::Guardrail> {
2870            (*self.0.stub)
2871                .create_guardrail(self.0.request, self.0.options)
2872                .await
2873                .map(crate::Response::into_body)
2874        }
2875
2876        /// Sets the value of [parent][crate::model::CreateGuardrailRequest::parent].
2877        ///
2878        /// This is a **required** field for requests.
2879        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880            self.0.request.parent = v.into();
2881            self
2882        }
2883
2884        /// Sets the value of [guardrail_id][crate::model::CreateGuardrailRequest::guardrail_id].
2885        pub fn set_guardrail_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2886            self.0.request.guardrail_id = v.into();
2887            self
2888        }
2889
2890        /// Sets the value of [guardrail][crate::model::CreateGuardrailRequest::guardrail].
2891        ///
2892        /// This is a **required** field for requests.
2893        pub fn set_guardrail<T>(mut self, v: T) -> Self
2894        where
2895            T: std::convert::Into<crate::model::Guardrail>,
2896        {
2897            self.0.request.guardrail = std::option::Option::Some(v.into());
2898            self
2899        }
2900
2901        /// Sets or clears the value of [guardrail][crate::model::CreateGuardrailRequest::guardrail].
2902        ///
2903        /// This is a **required** field for requests.
2904        pub fn set_or_clear_guardrail<T>(mut self, v: std::option::Option<T>) -> Self
2905        where
2906            T: std::convert::Into<crate::model::Guardrail>,
2907        {
2908            self.0.request.guardrail = v.map(|x| x.into());
2909            self
2910        }
2911    }
2912
2913    #[doc(hidden)]
2914    impl crate::RequestBuilder for CreateGuardrail {
2915        fn request_options(&mut self) -> &mut crate::RequestOptions {
2916            &mut self.0.options
2917        }
2918    }
2919
2920    /// The request builder for [AgentService::update_guardrail][crate::client::AgentService::update_guardrail] calls.
2921    ///
2922    /// # Example
2923    /// ```
2924    /// # use google_cloud_ces_v1::builder::agent_service::UpdateGuardrail;
2925    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
2926    ///
2927    /// let builder = prepare_request_builder();
2928    /// let response = builder.send().await?;
2929    /// # Ok(()) }
2930    ///
2931    /// fn prepare_request_builder() -> UpdateGuardrail {
2932    ///   # panic!();
2933    ///   // ... details omitted ...
2934    /// }
2935    /// ```
2936    #[derive(Clone, Debug)]
2937    pub struct UpdateGuardrail(RequestBuilder<crate::model::UpdateGuardrailRequest>);
2938
2939    impl UpdateGuardrail {
2940        pub(crate) fn new(
2941            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2942        ) -> Self {
2943            Self(RequestBuilder::new(stub))
2944        }
2945
2946        /// Sets the full request, replacing any prior values.
2947        pub fn with_request<V: Into<crate::model::UpdateGuardrailRequest>>(mut self, v: V) -> Self {
2948            self.0.request = v.into();
2949            self
2950        }
2951
2952        /// Sets all the options, replacing any prior values.
2953        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2954            self.0.options = v.into();
2955            self
2956        }
2957
2958        /// Sends the request.
2959        pub async fn send(self) -> Result<crate::model::Guardrail> {
2960            (*self.0.stub)
2961                .update_guardrail(self.0.request, self.0.options)
2962                .await
2963                .map(crate::Response::into_body)
2964        }
2965
2966        /// Sets the value of [guardrail][crate::model::UpdateGuardrailRequest::guardrail].
2967        ///
2968        /// This is a **required** field for requests.
2969        pub fn set_guardrail<T>(mut self, v: T) -> Self
2970        where
2971            T: std::convert::Into<crate::model::Guardrail>,
2972        {
2973            self.0.request.guardrail = std::option::Option::Some(v.into());
2974            self
2975        }
2976
2977        /// Sets or clears the value of [guardrail][crate::model::UpdateGuardrailRequest::guardrail].
2978        ///
2979        /// This is a **required** field for requests.
2980        pub fn set_or_clear_guardrail<T>(mut self, v: std::option::Option<T>) -> Self
2981        where
2982            T: std::convert::Into<crate::model::Guardrail>,
2983        {
2984            self.0.request.guardrail = v.map(|x| x.into());
2985            self
2986        }
2987
2988        /// Sets the value of [update_mask][crate::model::UpdateGuardrailRequest::update_mask].
2989        pub fn set_update_mask<T>(mut self, v: T) -> Self
2990        where
2991            T: std::convert::Into<wkt::FieldMask>,
2992        {
2993            self.0.request.update_mask = std::option::Option::Some(v.into());
2994            self
2995        }
2996
2997        /// Sets or clears the value of [update_mask][crate::model::UpdateGuardrailRequest::update_mask].
2998        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2999        where
3000            T: std::convert::Into<wkt::FieldMask>,
3001        {
3002            self.0.request.update_mask = v.map(|x| x.into());
3003            self
3004        }
3005    }
3006
3007    #[doc(hidden)]
3008    impl crate::RequestBuilder for UpdateGuardrail {
3009        fn request_options(&mut self) -> &mut crate::RequestOptions {
3010            &mut self.0.options
3011        }
3012    }
3013
3014    /// The request builder for [AgentService::delete_guardrail][crate::client::AgentService::delete_guardrail] calls.
3015    ///
3016    /// # Example
3017    /// ```
3018    /// # use google_cloud_ces_v1::builder::agent_service::DeleteGuardrail;
3019    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3020    ///
3021    /// let builder = prepare_request_builder();
3022    /// let response = builder.send().await?;
3023    /// # Ok(()) }
3024    ///
3025    /// fn prepare_request_builder() -> DeleteGuardrail {
3026    ///   # panic!();
3027    ///   // ... details omitted ...
3028    /// }
3029    /// ```
3030    #[derive(Clone, Debug)]
3031    pub struct DeleteGuardrail(RequestBuilder<crate::model::DeleteGuardrailRequest>);
3032
3033    impl DeleteGuardrail {
3034        pub(crate) fn new(
3035            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3036        ) -> Self {
3037            Self(RequestBuilder::new(stub))
3038        }
3039
3040        /// Sets the full request, replacing any prior values.
3041        pub fn with_request<V: Into<crate::model::DeleteGuardrailRequest>>(mut self, v: V) -> Self {
3042            self.0.request = v.into();
3043            self
3044        }
3045
3046        /// Sets all the options, replacing any prior values.
3047        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3048            self.0.options = v.into();
3049            self
3050        }
3051
3052        /// Sends the request.
3053        pub async fn send(self) -> Result<()> {
3054            (*self.0.stub)
3055                .delete_guardrail(self.0.request, self.0.options)
3056                .await
3057                .map(crate::Response::into_body)
3058        }
3059
3060        /// Sets the value of [name][crate::model::DeleteGuardrailRequest::name].
3061        ///
3062        /// This is a **required** field for requests.
3063        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3064            self.0.request.name = v.into();
3065            self
3066        }
3067
3068        /// Sets the value of [force][crate::model::DeleteGuardrailRequest::force].
3069        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3070            self.0.request.force = v.into();
3071            self
3072        }
3073
3074        /// Sets the value of [etag][crate::model::DeleteGuardrailRequest::etag].
3075        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3076            self.0.request.etag = v.into();
3077            self
3078        }
3079    }
3080
3081    #[doc(hidden)]
3082    impl crate::RequestBuilder for DeleteGuardrail {
3083        fn request_options(&mut self) -> &mut crate::RequestOptions {
3084            &mut self.0.options
3085        }
3086    }
3087
3088    /// The request builder for [AgentService::list_deployments][crate::client::AgentService::list_deployments] calls.
3089    ///
3090    /// # Example
3091    /// ```
3092    /// # use google_cloud_ces_v1::builder::agent_service::ListDeployments;
3093    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3094    /// use google_cloud_gax::paginator::ItemPaginator;
3095    ///
3096    /// let builder = prepare_request_builder();
3097    /// let mut items = builder.by_item();
3098    /// while let Some(result) = items.next().await {
3099    ///   let item = result?;
3100    /// }
3101    /// # Ok(()) }
3102    ///
3103    /// fn prepare_request_builder() -> ListDeployments {
3104    ///   # panic!();
3105    ///   // ... details omitted ...
3106    /// }
3107    /// ```
3108    #[derive(Clone, Debug)]
3109    pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
3110
3111    impl ListDeployments {
3112        pub(crate) fn new(
3113            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3114        ) -> Self {
3115            Self(RequestBuilder::new(stub))
3116        }
3117
3118        /// Sets the full request, replacing any prior values.
3119        pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
3120            self.0.request = v.into();
3121            self
3122        }
3123
3124        /// Sets all the options, replacing any prior values.
3125        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3126            self.0.options = v.into();
3127            self
3128        }
3129
3130        /// Sends the request.
3131        pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
3132            (*self.0.stub)
3133                .list_deployments(self.0.request, self.0.options)
3134                .await
3135                .map(crate::Response::into_body)
3136        }
3137
3138        /// Streams each page in the collection.
3139        pub fn by_page(
3140            self,
3141        ) -> impl google_cloud_gax::paginator::Paginator<
3142            crate::model::ListDeploymentsResponse,
3143            crate::Error,
3144        > {
3145            use std::clone::Clone;
3146            let token = self.0.request.page_token.clone();
3147            let execute = move |token: String| {
3148                let mut builder = self.clone();
3149                builder.0.request = builder.0.request.set_page_token(token);
3150                builder.send()
3151            };
3152            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3153        }
3154
3155        /// Streams each item in the collection.
3156        pub fn by_item(
3157            self,
3158        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3159            crate::model::ListDeploymentsResponse,
3160            crate::Error,
3161        > {
3162            use google_cloud_gax::paginator::Paginator;
3163            self.by_page().items()
3164        }
3165
3166        /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
3167        ///
3168        /// This is a **required** field for requests.
3169        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3170            self.0.request.parent = v.into();
3171            self
3172        }
3173
3174        /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
3175        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3176            self.0.request.page_size = v.into();
3177            self
3178        }
3179
3180        /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
3181        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3182            self.0.request.page_token = v.into();
3183            self
3184        }
3185
3186        /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
3187        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3188            self.0.request.order_by = v.into();
3189            self
3190        }
3191    }
3192
3193    #[doc(hidden)]
3194    impl crate::RequestBuilder for ListDeployments {
3195        fn request_options(&mut self) -> &mut crate::RequestOptions {
3196            &mut self.0.options
3197        }
3198    }
3199
3200    /// The request builder for [AgentService::get_deployment][crate::client::AgentService::get_deployment] calls.
3201    ///
3202    /// # Example
3203    /// ```
3204    /// # use google_cloud_ces_v1::builder::agent_service::GetDeployment;
3205    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3206    ///
3207    /// let builder = prepare_request_builder();
3208    /// let response = builder.send().await?;
3209    /// # Ok(()) }
3210    ///
3211    /// fn prepare_request_builder() -> GetDeployment {
3212    ///   # panic!();
3213    ///   // ... details omitted ...
3214    /// }
3215    /// ```
3216    #[derive(Clone, Debug)]
3217    pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
3218
3219    impl GetDeployment {
3220        pub(crate) fn new(
3221            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3222        ) -> Self {
3223            Self(RequestBuilder::new(stub))
3224        }
3225
3226        /// Sets the full request, replacing any prior values.
3227        pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
3228            self.0.request = v.into();
3229            self
3230        }
3231
3232        /// Sets all the options, replacing any prior values.
3233        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3234            self.0.options = v.into();
3235            self
3236        }
3237
3238        /// Sends the request.
3239        pub async fn send(self) -> Result<crate::model::Deployment> {
3240            (*self.0.stub)
3241                .get_deployment(self.0.request, self.0.options)
3242                .await
3243                .map(crate::Response::into_body)
3244        }
3245
3246        /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
3247        ///
3248        /// This is a **required** field for requests.
3249        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3250            self.0.request.name = v.into();
3251            self
3252        }
3253    }
3254
3255    #[doc(hidden)]
3256    impl crate::RequestBuilder for GetDeployment {
3257        fn request_options(&mut self) -> &mut crate::RequestOptions {
3258            &mut self.0.options
3259        }
3260    }
3261
3262    /// The request builder for [AgentService::create_deployment][crate::client::AgentService::create_deployment] calls.
3263    ///
3264    /// # Example
3265    /// ```
3266    /// # use google_cloud_ces_v1::builder::agent_service::CreateDeployment;
3267    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3268    ///
3269    /// let builder = prepare_request_builder();
3270    /// let response = builder.send().await?;
3271    /// # Ok(()) }
3272    ///
3273    /// fn prepare_request_builder() -> CreateDeployment {
3274    ///   # panic!();
3275    ///   // ... details omitted ...
3276    /// }
3277    /// ```
3278    #[derive(Clone, Debug)]
3279    pub struct CreateDeployment(RequestBuilder<crate::model::CreateDeploymentRequest>);
3280
3281    impl CreateDeployment {
3282        pub(crate) fn new(
3283            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3284        ) -> Self {
3285            Self(RequestBuilder::new(stub))
3286        }
3287
3288        /// Sets the full request, replacing any prior values.
3289        pub fn with_request<V: Into<crate::model::CreateDeploymentRequest>>(
3290            mut self,
3291            v: V,
3292        ) -> Self {
3293            self.0.request = v.into();
3294            self
3295        }
3296
3297        /// Sets all the options, replacing any prior values.
3298        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3299            self.0.options = v.into();
3300            self
3301        }
3302
3303        /// Sends the request.
3304        pub async fn send(self) -> Result<crate::model::Deployment> {
3305            (*self.0.stub)
3306                .create_deployment(self.0.request, self.0.options)
3307                .await
3308                .map(crate::Response::into_body)
3309        }
3310
3311        /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
3312        ///
3313        /// This is a **required** field for requests.
3314        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3315            self.0.request.parent = v.into();
3316            self
3317        }
3318
3319        /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
3320        pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3321            self.0.request.deployment_id = v.into();
3322            self
3323        }
3324
3325        /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
3326        ///
3327        /// This is a **required** field for requests.
3328        pub fn set_deployment<T>(mut self, v: T) -> Self
3329        where
3330            T: std::convert::Into<crate::model::Deployment>,
3331        {
3332            self.0.request.deployment = std::option::Option::Some(v.into());
3333            self
3334        }
3335
3336        /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
3337        ///
3338        /// This is a **required** field for requests.
3339        pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3340        where
3341            T: std::convert::Into<crate::model::Deployment>,
3342        {
3343            self.0.request.deployment = v.map(|x| x.into());
3344            self
3345        }
3346    }
3347
3348    #[doc(hidden)]
3349    impl crate::RequestBuilder for CreateDeployment {
3350        fn request_options(&mut self) -> &mut crate::RequestOptions {
3351            &mut self.0.options
3352        }
3353    }
3354
3355    /// The request builder for [AgentService::update_deployment][crate::client::AgentService::update_deployment] calls.
3356    ///
3357    /// # Example
3358    /// ```
3359    /// # use google_cloud_ces_v1::builder::agent_service::UpdateDeployment;
3360    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3361    ///
3362    /// let builder = prepare_request_builder();
3363    /// let response = builder.send().await?;
3364    /// # Ok(()) }
3365    ///
3366    /// fn prepare_request_builder() -> UpdateDeployment {
3367    ///   # panic!();
3368    ///   // ... details omitted ...
3369    /// }
3370    /// ```
3371    #[derive(Clone, Debug)]
3372    pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
3373
3374    impl UpdateDeployment {
3375        pub(crate) fn new(
3376            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3377        ) -> Self {
3378            Self(RequestBuilder::new(stub))
3379        }
3380
3381        /// Sets the full request, replacing any prior values.
3382        pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
3383            mut self,
3384            v: V,
3385        ) -> Self {
3386            self.0.request = v.into();
3387            self
3388        }
3389
3390        /// Sets all the options, replacing any prior values.
3391        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3392            self.0.options = v.into();
3393            self
3394        }
3395
3396        /// Sends the request.
3397        pub async fn send(self) -> Result<crate::model::Deployment> {
3398            (*self.0.stub)
3399                .update_deployment(self.0.request, self.0.options)
3400                .await
3401                .map(crate::Response::into_body)
3402        }
3403
3404        /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3405        ///
3406        /// This is a **required** field for requests.
3407        pub fn set_deployment<T>(mut self, v: T) -> Self
3408        where
3409            T: std::convert::Into<crate::model::Deployment>,
3410        {
3411            self.0.request.deployment = std::option::Option::Some(v.into());
3412            self
3413        }
3414
3415        /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3416        ///
3417        /// This is a **required** field for requests.
3418        pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3419        where
3420            T: std::convert::Into<crate::model::Deployment>,
3421        {
3422            self.0.request.deployment = v.map(|x| x.into());
3423            self
3424        }
3425
3426        /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3427        pub fn set_update_mask<T>(mut self, v: T) -> Self
3428        where
3429            T: std::convert::Into<wkt::FieldMask>,
3430        {
3431            self.0.request.update_mask = std::option::Option::Some(v.into());
3432            self
3433        }
3434
3435        /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3436        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3437        where
3438            T: std::convert::Into<wkt::FieldMask>,
3439        {
3440            self.0.request.update_mask = v.map(|x| x.into());
3441            self
3442        }
3443    }
3444
3445    #[doc(hidden)]
3446    impl crate::RequestBuilder for UpdateDeployment {
3447        fn request_options(&mut self) -> &mut crate::RequestOptions {
3448            &mut self.0.options
3449        }
3450    }
3451
3452    /// The request builder for [AgentService::delete_deployment][crate::client::AgentService::delete_deployment] calls.
3453    ///
3454    /// # Example
3455    /// ```
3456    /// # use google_cloud_ces_v1::builder::agent_service::DeleteDeployment;
3457    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3458    ///
3459    /// let builder = prepare_request_builder();
3460    /// let response = builder.send().await?;
3461    /// # Ok(()) }
3462    ///
3463    /// fn prepare_request_builder() -> DeleteDeployment {
3464    ///   # panic!();
3465    ///   // ... details omitted ...
3466    /// }
3467    /// ```
3468    #[derive(Clone, Debug)]
3469    pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
3470
3471    impl DeleteDeployment {
3472        pub(crate) fn new(
3473            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3474        ) -> Self {
3475            Self(RequestBuilder::new(stub))
3476        }
3477
3478        /// Sets the full request, replacing any prior values.
3479        pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
3480            mut self,
3481            v: V,
3482        ) -> Self {
3483            self.0.request = v.into();
3484            self
3485        }
3486
3487        /// Sets all the options, replacing any prior values.
3488        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3489            self.0.options = v.into();
3490            self
3491        }
3492
3493        /// Sends the request.
3494        pub async fn send(self) -> Result<()> {
3495            (*self.0.stub)
3496                .delete_deployment(self.0.request, self.0.options)
3497                .await
3498                .map(crate::Response::into_body)
3499        }
3500
3501        /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
3502        ///
3503        /// This is a **required** field for requests.
3504        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3505            self.0.request.name = v.into();
3506            self
3507        }
3508
3509        /// Sets the value of [etag][crate::model::DeleteDeploymentRequest::etag].
3510        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3511            self.0.request.etag = v.into();
3512            self
3513        }
3514    }
3515
3516    #[doc(hidden)]
3517    impl crate::RequestBuilder for DeleteDeployment {
3518        fn request_options(&mut self) -> &mut crate::RequestOptions {
3519            &mut self.0.options
3520        }
3521    }
3522
3523    /// The request builder for [AgentService::list_toolsets][crate::client::AgentService::list_toolsets] calls.
3524    ///
3525    /// # Example
3526    /// ```
3527    /// # use google_cloud_ces_v1::builder::agent_service::ListToolsets;
3528    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3529    /// use google_cloud_gax::paginator::ItemPaginator;
3530    ///
3531    /// let builder = prepare_request_builder();
3532    /// let mut items = builder.by_item();
3533    /// while let Some(result) = items.next().await {
3534    ///   let item = result?;
3535    /// }
3536    /// # Ok(()) }
3537    ///
3538    /// fn prepare_request_builder() -> ListToolsets {
3539    ///   # panic!();
3540    ///   // ... details omitted ...
3541    /// }
3542    /// ```
3543    #[derive(Clone, Debug)]
3544    pub struct ListToolsets(RequestBuilder<crate::model::ListToolsetsRequest>);
3545
3546    impl ListToolsets {
3547        pub(crate) fn new(
3548            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3549        ) -> Self {
3550            Self(RequestBuilder::new(stub))
3551        }
3552
3553        /// Sets the full request, replacing any prior values.
3554        pub fn with_request<V: Into<crate::model::ListToolsetsRequest>>(mut self, v: V) -> Self {
3555            self.0.request = v.into();
3556            self
3557        }
3558
3559        /// Sets all the options, replacing any prior values.
3560        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3561            self.0.options = v.into();
3562            self
3563        }
3564
3565        /// Sends the request.
3566        pub async fn send(self) -> Result<crate::model::ListToolsetsResponse> {
3567            (*self.0.stub)
3568                .list_toolsets(self.0.request, self.0.options)
3569                .await
3570                .map(crate::Response::into_body)
3571        }
3572
3573        /// Streams each page in the collection.
3574        pub fn by_page(
3575            self,
3576        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsetsResponse, crate::Error>
3577        {
3578            use std::clone::Clone;
3579            let token = self.0.request.page_token.clone();
3580            let execute = move |token: String| {
3581                let mut builder = self.clone();
3582                builder.0.request = builder.0.request.set_page_token(token);
3583                builder.send()
3584            };
3585            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3586        }
3587
3588        /// Streams each item in the collection.
3589        pub fn by_item(
3590            self,
3591        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3592            crate::model::ListToolsetsResponse,
3593            crate::Error,
3594        > {
3595            use google_cloud_gax::paginator::Paginator;
3596            self.by_page().items()
3597        }
3598
3599        /// Sets the value of [parent][crate::model::ListToolsetsRequest::parent].
3600        ///
3601        /// This is a **required** field for requests.
3602        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3603            self.0.request.parent = v.into();
3604            self
3605        }
3606
3607        /// Sets the value of [page_size][crate::model::ListToolsetsRequest::page_size].
3608        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3609            self.0.request.page_size = v.into();
3610            self
3611        }
3612
3613        /// Sets the value of [page_token][crate::model::ListToolsetsRequest::page_token].
3614        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3615            self.0.request.page_token = v.into();
3616            self
3617        }
3618
3619        /// Sets the value of [filter][crate::model::ListToolsetsRequest::filter].
3620        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3621            self.0.request.filter = v.into();
3622            self
3623        }
3624
3625        /// Sets the value of [order_by][crate::model::ListToolsetsRequest::order_by].
3626        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3627            self.0.request.order_by = v.into();
3628            self
3629        }
3630    }
3631
3632    #[doc(hidden)]
3633    impl crate::RequestBuilder for ListToolsets {
3634        fn request_options(&mut self) -> &mut crate::RequestOptions {
3635            &mut self.0.options
3636        }
3637    }
3638
3639    /// The request builder for [AgentService::get_toolset][crate::client::AgentService::get_toolset] calls.
3640    ///
3641    /// # Example
3642    /// ```
3643    /// # use google_cloud_ces_v1::builder::agent_service::GetToolset;
3644    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3645    ///
3646    /// let builder = prepare_request_builder();
3647    /// let response = builder.send().await?;
3648    /// # Ok(()) }
3649    ///
3650    /// fn prepare_request_builder() -> GetToolset {
3651    ///   # panic!();
3652    ///   // ... details omitted ...
3653    /// }
3654    /// ```
3655    #[derive(Clone, Debug)]
3656    pub struct GetToolset(RequestBuilder<crate::model::GetToolsetRequest>);
3657
3658    impl GetToolset {
3659        pub(crate) fn new(
3660            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3661        ) -> Self {
3662            Self(RequestBuilder::new(stub))
3663        }
3664
3665        /// Sets the full request, replacing any prior values.
3666        pub fn with_request<V: Into<crate::model::GetToolsetRequest>>(mut self, v: V) -> Self {
3667            self.0.request = v.into();
3668            self
3669        }
3670
3671        /// Sets all the options, replacing any prior values.
3672        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3673            self.0.options = v.into();
3674            self
3675        }
3676
3677        /// Sends the request.
3678        pub async fn send(self) -> Result<crate::model::Toolset> {
3679            (*self.0.stub)
3680                .get_toolset(self.0.request, self.0.options)
3681                .await
3682                .map(crate::Response::into_body)
3683        }
3684
3685        /// Sets the value of [name][crate::model::GetToolsetRequest::name].
3686        ///
3687        /// This is a **required** field for requests.
3688        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3689            self.0.request.name = v.into();
3690            self
3691        }
3692    }
3693
3694    #[doc(hidden)]
3695    impl crate::RequestBuilder for GetToolset {
3696        fn request_options(&mut self) -> &mut crate::RequestOptions {
3697            &mut self.0.options
3698        }
3699    }
3700
3701    /// The request builder for [AgentService::create_toolset][crate::client::AgentService::create_toolset] calls.
3702    ///
3703    /// # Example
3704    /// ```
3705    /// # use google_cloud_ces_v1::builder::agent_service::CreateToolset;
3706    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3707    ///
3708    /// let builder = prepare_request_builder();
3709    /// let response = builder.send().await?;
3710    /// # Ok(()) }
3711    ///
3712    /// fn prepare_request_builder() -> CreateToolset {
3713    ///   # panic!();
3714    ///   // ... details omitted ...
3715    /// }
3716    /// ```
3717    #[derive(Clone, Debug)]
3718    pub struct CreateToolset(RequestBuilder<crate::model::CreateToolsetRequest>);
3719
3720    impl CreateToolset {
3721        pub(crate) fn new(
3722            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3723        ) -> Self {
3724            Self(RequestBuilder::new(stub))
3725        }
3726
3727        /// Sets the full request, replacing any prior values.
3728        pub fn with_request<V: Into<crate::model::CreateToolsetRequest>>(mut self, v: V) -> Self {
3729            self.0.request = v.into();
3730            self
3731        }
3732
3733        /// Sets all the options, replacing any prior values.
3734        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3735            self.0.options = v.into();
3736            self
3737        }
3738
3739        /// Sends the request.
3740        pub async fn send(self) -> Result<crate::model::Toolset> {
3741            (*self.0.stub)
3742                .create_toolset(self.0.request, self.0.options)
3743                .await
3744                .map(crate::Response::into_body)
3745        }
3746
3747        /// Sets the value of [parent][crate::model::CreateToolsetRequest::parent].
3748        ///
3749        /// This is a **required** field for requests.
3750        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3751            self.0.request.parent = v.into();
3752            self
3753        }
3754
3755        /// Sets the value of [toolset_id][crate::model::CreateToolsetRequest::toolset_id].
3756        pub fn set_toolset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3757            self.0.request.toolset_id = v.into();
3758            self
3759        }
3760
3761        /// Sets the value of [toolset][crate::model::CreateToolsetRequest::toolset].
3762        ///
3763        /// This is a **required** field for requests.
3764        pub fn set_toolset<T>(mut self, v: T) -> Self
3765        where
3766            T: std::convert::Into<crate::model::Toolset>,
3767        {
3768            self.0.request.toolset = std::option::Option::Some(v.into());
3769            self
3770        }
3771
3772        /// Sets or clears the value of [toolset][crate::model::CreateToolsetRequest::toolset].
3773        ///
3774        /// This is a **required** field for requests.
3775        pub fn set_or_clear_toolset<T>(mut self, v: std::option::Option<T>) -> Self
3776        where
3777            T: std::convert::Into<crate::model::Toolset>,
3778        {
3779            self.0.request.toolset = v.map(|x| x.into());
3780            self
3781        }
3782    }
3783
3784    #[doc(hidden)]
3785    impl crate::RequestBuilder for CreateToolset {
3786        fn request_options(&mut self) -> &mut crate::RequestOptions {
3787            &mut self.0.options
3788        }
3789    }
3790
3791    /// The request builder for [AgentService::update_toolset][crate::client::AgentService::update_toolset] calls.
3792    ///
3793    /// # Example
3794    /// ```
3795    /// # use google_cloud_ces_v1::builder::agent_service::UpdateToolset;
3796    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3797    ///
3798    /// let builder = prepare_request_builder();
3799    /// let response = builder.send().await?;
3800    /// # Ok(()) }
3801    ///
3802    /// fn prepare_request_builder() -> UpdateToolset {
3803    ///   # panic!();
3804    ///   // ... details omitted ...
3805    /// }
3806    /// ```
3807    #[derive(Clone, Debug)]
3808    pub struct UpdateToolset(RequestBuilder<crate::model::UpdateToolsetRequest>);
3809
3810    impl UpdateToolset {
3811        pub(crate) fn new(
3812            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3813        ) -> Self {
3814            Self(RequestBuilder::new(stub))
3815        }
3816
3817        /// Sets the full request, replacing any prior values.
3818        pub fn with_request<V: Into<crate::model::UpdateToolsetRequest>>(mut self, v: V) -> Self {
3819            self.0.request = v.into();
3820            self
3821        }
3822
3823        /// Sets all the options, replacing any prior values.
3824        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3825            self.0.options = v.into();
3826            self
3827        }
3828
3829        /// Sends the request.
3830        pub async fn send(self) -> Result<crate::model::Toolset> {
3831            (*self.0.stub)
3832                .update_toolset(self.0.request, self.0.options)
3833                .await
3834                .map(crate::Response::into_body)
3835        }
3836
3837        /// Sets the value of [toolset][crate::model::UpdateToolsetRequest::toolset].
3838        ///
3839        /// This is a **required** field for requests.
3840        pub fn set_toolset<T>(mut self, v: T) -> Self
3841        where
3842            T: std::convert::Into<crate::model::Toolset>,
3843        {
3844            self.0.request.toolset = std::option::Option::Some(v.into());
3845            self
3846        }
3847
3848        /// Sets or clears the value of [toolset][crate::model::UpdateToolsetRequest::toolset].
3849        ///
3850        /// This is a **required** field for requests.
3851        pub fn set_or_clear_toolset<T>(mut self, v: std::option::Option<T>) -> Self
3852        where
3853            T: std::convert::Into<crate::model::Toolset>,
3854        {
3855            self.0.request.toolset = v.map(|x| x.into());
3856            self
3857        }
3858
3859        /// Sets the value of [update_mask][crate::model::UpdateToolsetRequest::update_mask].
3860        pub fn set_update_mask<T>(mut self, v: T) -> Self
3861        where
3862            T: std::convert::Into<wkt::FieldMask>,
3863        {
3864            self.0.request.update_mask = std::option::Option::Some(v.into());
3865            self
3866        }
3867
3868        /// Sets or clears the value of [update_mask][crate::model::UpdateToolsetRequest::update_mask].
3869        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3870        where
3871            T: std::convert::Into<wkt::FieldMask>,
3872        {
3873            self.0.request.update_mask = v.map(|x| x.into());
3874            self
3875        }
3876    }
3877
3878    #[doc(hidden)]
3879    impl crate::RequestBuilder for UpdateToolset {
3880        fn request_options(&mut self) -> &mut crate::RequestOptions {
3881            &mut self.0.options
3882        }
3883    }
3884
3885    /// The request builder for [AgentService::delete_toolset][crate::client::AgentService::delete_toolset] calls.
3886    ///
3887    /// # Example
3888    /// ```
3889    /// # use google_cloud_ces_v1::builder::agent_service::DeleteToolset;
3890    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3891    ///
3892    /// let builder = prepare_request_builder();
3893    /// let response = builder.send().await?;
3894    /// # Ok(()) }
3895    ///
3896    /// fn prepare_request_builder() -> DeleteToolset {
3897    ///   # panic!();
3898    ///   // ... details omitted ...
3899    /// }
3900    /// ```
3901    #[derive(Clone, Debug)]
3902    pub struct DeleteToolset(RequestBuilder<crate::model::DeleteToolsetRequest>);
3903
3904    impl DeleteToolset {
3905        pub(crate) fn new(
3906            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3907        ) -> Self {
3908            Self(RequestBuilder::new(stub))
3909        }
3910
3911        /// Sets the full request, replacing any prior values.
3912        pub fn with_request<V: Into<crate::model::DeleteToolsetRequest>>(mut self, v: V) -> Self {
3913            self.0.request = v.into();
3914            self
3915        }
3916
3917        /// Sets all the options, replacing any prior values.
3918        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3919            self.0.options = v.into();
3920            self
3921        }
3922
3923        /// Sends the request.
3924        pub async fn send(self) -> Result<()> {
3925            (*self.0.stub)
3926                .delete_toolset(self.0.request, self.0.options)
3927                .await
3928                .map(crate::Response::into_body)
3929        }
3930
3931        /// Sets the value of [name][crate::model::DeleteToolsetRequest::name].
3932        ///
3933        /// This is a **required** field for requests.
3934        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3935            self.0.request.name = v.into();
3936            self
3937        }
3938
3939        /// Sets the value of [force][crate::model::DeleteToolsetRequest::force].
3940        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3941            self.0.request.force = v.into();
3942            self
3943        }
3944
3945        /// Sets the value of [etag][crate::model::DeleteToolsetRequest::etag].
3946        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3947            self.0.request.etag = v.into();
3948            self
3949        }
3950    }
3951
3952    #[doc(hidden)]
3953    impl crate::RequestBuilder for DeleteToolset {
3954        fn request_options(&mut self) -> &mut crate::RequestOptions {
3955            &mut self.0.options
3956        }
3957    }
3958
3959    /// The request builder for [AgentService::list_app_versions][crate::client::AgentService::list_app_versions] calls.
3960    ///
3961    /// # Example
3962    /// ```
3963    /// # use google_cloud_ces_v1::builder::agent_service::ListAppVersions;
3964    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
3965    /// use google_cloud_gax::paginator::ItemPaginator;
3966    ///
3967    /// let builder = prepare_request_builder();
3968    /// let mut items = builder.by_item();
3969    /// while let Some(result) = items.next().await {
3970    ///   let item = result?;
3971    /// }
3972    /// # Ok(()) }
3973    ///
3974    /// fn prepare_request_builder() -> ListAppVersions {
3975    ///   # panic!();
3976    ///   // ... details omitted ...
3977    /// }
3978    /// ```
3979    #[derive(Clone, Debug)]
3980    pub struct ListAppVersions(RequestBuilder<crate::model::ListAppVersionsRequest>);
3981
3982    impl ListAppVersions {
3983        pub(crate) fn new(
3984            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3985        ) -> Self {
3986            Self(RequestBuilder::new(stub))
3987        }
3988
3989        /// Sets the full request, replacing any prior values.
3990        pub fn with_request<V: Into<crate::model::ListAppVersionsRequest>>(mut self, v: V) -> Self {
3991            self.0.request = v.into();
3992            self
3993        }
3994
3995        /// Sets all the options, replacing any prior values.
3996        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3997            self.0.options = v.into();
3998            self
3999        }
4000
4001        /// Sends the request.
4002        pub async fn send(self) -> Result<crate::model::ListAppVersionsResponse> {
4003            (*self.0.stub)
4004                .list_app_versions(self.0.request, self.0.options)
4005                .await
4006                .map(crate::Response::into_body)
4007        }
4008
4009        /// Streams each page in the collection.
4010        pub fn by_page(
4011            self,
4012        ) -> impl google_cloud_gax::paginator::Paginator<
4013            crate::model::ListAppVersionsResponse,
4014            crate::Error,
4015        > {
4016            use std::clone::Clone;
4017            let token = self.0.request.page_token.clone();
4018            let execute = move |token: String| {
4019                let mut builder = self.clone();
4020                builder.0.request = builder.0.request.set_page_token(token);
4021                builder.send()
4022            };
4023            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4024        }
4025
4026        /// Streams each item in the collection.
4027        pub fn by_item(
4028            self,
4029        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4030            crate::model::ListAppVersionsResponse,
4031            crate::Error,
4032        > {
4033            use google_cloud_gax::paginator::Paginator;
4034            self.by_page().items()
4035        }
4036
4037        /// Sets the value of [parent][crate::model::ListAppVersionsRequest::parent].
4038        ///
4039        /// This is a **required** field for requests.
4040        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4041            self.0.request.parent = v.into();
4042            self
4043        }
4044
4045        /// Sets the value of [page_size][crate::model::ListAppVersionsRequest::page_size].
4046        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4047            self.0.request.page_size = v.into();
4048            self
4049        }
4050
4051        /// Sets the value of [page_token][crate::model::ListAppVersionsRequest::page_token].
4052        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4053            self.0.request.page_token = v.into();
4054            self
4055        }
4056
4057        /// Sets the value of [filter][crate::model::ListAppVersionsRequest::filter].
4058        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4059            self.0.request.filter = v.into();
4060            self
4061        }
4062
4063        /// Sets the value of [order_by][crate::model::ListAppVersionsRequest::order_by].
4064        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4065            self.0.request.order_by = v.into();
4066            self
4067        }
4068    }
4069
4070    #[doc(hidden)]
4071    impl crate::RequestBuilder for ListAppVersions {
4072        fn request_options(&mut self) -> &mut crate::RequestOptions {
4073            &mut self.0.options
4074        }
4075    }
4076
4077    /// The request builder for [AgentService::get_app_version][crate::client::AgentService::get_app_version] calls.
4078    ///
4079    /// # Example
4080    /// ```
4081    /// # use google_cloud_ces_v1::builder::agent_service::GetAppVersion;
4082    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4083    ///
4084    /// let builder = prepare_request_builder();
4085    /// let response = builder.send().await?;
4086    /// # Ok(()) }
4087    ///
4088    /// fn prepare_request_builder() -> GetAppVersion {
4089    ///   # panic!();
4090    ///   // ... details omitted ...
4091    /// }
4092    /// ```
4093    #[derive(Clone, Debug)]
4094    pub struct GetAppVersion(RequestBuilder<crate::model::GetAppVersionRequest>);
4095
4096    impl GetAppVersion {
4097        pub(crate) fn new(
4098            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4099        ) -> Self {
4100            Self(RequestBuilder::new(stub))
4101        }
4102
4103        /// Sets the full request, replacing any prior values.
4104        pub fn with_request<V: Into<crate::model::GetAppVersionRequest>>(mut self, v: V) -> Self {
4105            self.0.request = v.into();
4106            self
4107        }
4108
4109        /// Sets all the options, replacing any prior values.
4110        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4111            self.0.options = v.into();
4112            self
4113        }
4114
4115        /// Sends the request.
4116        pub async fn send(self) -> Result<crate::model::AppVersion> {
4117            (*self.0.stub)
4118                .get_app_version(self.0.request, self.0.options)
4119                .await
4120                .map(crate::Response::into_body)
4121        }
4122
4123        /// Sets the value of [name][crate::model::GetAppVersionRequest::name].
4124        ///
4125        /// This is a **required** field for requests.
4126        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4127            self.0.request.name = v.into();
4128            self
4129        }
4130    }
4131
4132    #[doc(hidden)]
4133    impl crate::RequestBuilder for GetAppVersion {
4134        fn request_options(&mut self) -> &mut crate::RequestOptions {
4135            &mut self.0.options
4136        }
4137    }
4138
4139    /// The request builder for [AgentService::create_app_version][crate::client::AgentService::create_app_version] calls.
4140    ///
4141    /// # Example
4142    /// ```
4143    /// # use google_cloud_ces_v1::builder::agent_service::CreateAppVersion;
4144    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4145    ///
4146    /// let builder = prepare_request_builder();
4147    /// let response = builder.send().await?;
4148    /// # Ok(()) }
4149    ///
4150    /// fn prepare_request_builder() -> CreateAppVersion {
4151    ///   # panic!();
4152    ///   // ... details omitted ...
4153    /// }
4154    /// ```
4155    #[derive(Clone, Debug)]
4156    pub struct CreateAppVersion(RequestBuilder<crate::model::CreateAppVersionRequest>);
4157
4158    impl CreateAppVersion {
4159        pub(crate) fn new(
4160            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4161        ) -> Self {
4162            Self(RequestBuilder::new(stub))
4163        }
4164
4165        /// Sets the full request, replacing any prior values.
4166        pub fn with_request<V: Into<crate::model::CreateAppVersionRequest>>(
4167            mut self,
4168            v: V,
4169        ) -> Self {
4170            self.0.request = v.into();
4171            self
4172        }
4173
4174        /// Sets all the options, replacing any prior values.
4175        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4176            self.0.options = v.into();
4177            self
4178        }
4179
4180        /// Sends the request.
4181        pub async fn send(self) -> Result<crate::model::AppVersion> {
4182            (*self.0.stub)
4183                .create_app_version(self.0.request, self.0.options)
4184                .await
4185                .map(crate::Response::into_body)
4186        }
4187
4188        /// Sets the value of [parent][crate::model::CreateAppVersionRequest::parent].
4189        ///
4190        /// This is a **required** field for requests.
4191        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4192            self.0.request.parent = v.into();
4193            self
4194        }
4195
4196        /// Sets the value of [app_version_id][crate::model::CreateAppVersionRequest::app_version_id].
4197        pub fn set_app_version_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4198            self.0.request.app_version_id = v.into();
4199            self
4200        }
4201
4202        /// Sets the value of [app_version][crate::model::CreateAppVersionRequest::app_version].
4203        ///
4204        /// This is a **required** field for requests.
4205        pub fn set_app_version<T>(mut self, v: T) -> Self
4206        where
4207            T: std::convert::Into<crate::model::AppVersion>,
4208        {
4209            self.0.request.app_version = std::option::Option::Some(v.into());
4210            self
4211        }
4212
4213        /// Sets or clears the value of [app_version][crate::model::CreateAppVersionRequest::app_version].
4214        ///
4215        /// This is a **required** field for requests.
4216        pub fn set_or_clear_app_version<T>(mut self, v: std::option::Option<T>) -> Self
4217        where
4218            T: std::convert::Into<crate::model::AppVersion>,
4219        {
4220            self.0.request.app_version = v.map(|x| x.into());
4221            self
4222        }
4223    }
4224
4225    #[doc(hidden)]
4226    impl crate::RequestBuilder for CreateAppVersion {
4227        fn request_options(&mut self) -> &mut crate::RequestOptions {
4228            &mut self.0.options
4229        }
4230    }
4231
4232    /// The request builder for [AgentService::delete_app_version][crate::client::AgentService::delete_app_version] calls.
4233    ///
4234    /// # Example
4235    /// ```
4236    /// # use google_cloud_ces_v1::builder::agent_service::DeleteAppVersion;
4237    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4238    ///
4239    /// let builder = prepare_request_builder();
4240    /// let response = builder.send().await?;
4241    /// # Ok(()) }
4242    ///
4243    /// fn prepare_request_builder() -> DeleteAppVersion {
4244    ///   # panic!();
4245    ///   // ... details omitted ...
4246    /// }
4247    /// ```
4248    #[derive(Clone, Debug)]
4249    pub struct DeleteAppVersion(RequestBuilder<crate::model::DeleteAppVersionRequest>);
4250
4251    impl DeleteAppVersion {
4252        pub(crate) fn new(
4253            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4254        ) -> Self {
4255            Self(RequestBuilder::new(stub))
4256        }
4257
4258        /// Sets the full request, replacing any prior values.
4259        pub fn with_request<V: Into<crate::model::DeleteAppVersionRequest>>(
4260            mut self,
4261            v: V,
4262        ) -> Self {
4263            self.0.request = v.into();
4264            self
4265        }
4266
4267        /// Sets all the options, replacing any prior values.
4268        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4269            self.0.options = v.into();
4270            self
4271        }
4272
4273        /// Sends the request.
4274        pub async fn send(self) -> Result<()> {
4275            (*self.0.stub)
4276                .delete_app_version(self.0.request, self.0.options)
4277                .await
4278                .map(crate::Response::into_body)
4279        }
4280
4281        /// Sets the value of [name][crate::model::DeleteAppVersionRequest::name].
4282        ///
4283        /// This is a **required** field for requests.
4284        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4285            self.0.request.name = v.into();
4286            self
4287        }
4288
4289        /// Sets the value of [etag][crate::model::DeleteAppVersionRequest::etag].
4290        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4291            self.0.request.etag = v.into();
4292            self
4293        }
4294    }
4295
4296    #[doc(hidden)]
4297    impl crate::RequestBuilder for DeleteAppVersion {
4298        fn request_options(&mut self) -> &mut crate::RequestOptions {
4299            &mut self.0.options
4300        }
4301    }
4302
4303    /// The request builder for [AgentService::restore_app_version][crate::client::AgentService::restore_app_version] calls.
4304    ///
4305    /// # Example
4306    /// ```
4307    /// # use google_cloud_ces_v1::builder::agent_service::RestoreAppVersion;
4308    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4309    /// use google_cloud_lro::Poller;
4310    ///
4311    /// let builder = prepare_request_builder();
4312    /// let response = builder.poller().until_done().await?;
4313    /// # Ok(()) }
4314    ///
4315    /// fn prepare_request_builder() -> RestoreAppVersion {
4316    ///   # panic!();
4317    ///   // ... details omitted ...
4318    /// }
4319    /// ```
4320    #[derive(Clone, Debug)]
4321    pub struct RestoreAppVersion(RequestBuilder<crate::model::RestoreAppVersionRequest>);
4322
4323    impl RestoreAppVersion {
4324        pub(crate) fn new(
4325            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4326        ) -> Self {
4327            Self(RequestBuilder::new(stub))
4328        }
4329
4330        /// Sets the full request, replacing any prior values.
4331        pub fn with_request<V: Into<crate::model::RestoreAppVersionRequest>>(
4332            mut self,
4333            v: V,
4334        ) -> Self {
4335            self.0.request = v.into();
4336            self
4337        }
4338
4339        /// Sets all the options, replacing any prior values.
4340        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4341            self.0.options = v.into();
4342            self
4343        }
4344
4345        /// Sends the request.
4346        ///
4347        /// # Long running operations
4348        ///
4349        /// This starts, but does not poll, a longrunning operation. More information
4350        /// on [restore_app_version][crate::client::AgentService::restore_app_version].
4351        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4352            (*self.0.stub)
4353                .restore_app_version(self.0.request, self.0.options)
4354                .await
4355                .map(crate::Response::into_body)
4356        }
4357
4358        /// Creates a [Poller][google_cloud_lro::Poller] to work with `restore_app_version`.
4359        pub fn poller(
4360            self,
4361        ) -> impl google_cloud_lro::Poller<
4362            crate::model::RestoreAppVersionResponse,
4363            crate::model::OperationMetadata,
4364        > {
4365            type Operation = google_cloud_lro::internal::Operation<
4366                crate::model::RestoreAppVersionResponse,
4367                crate::model::OperationMetadata,
4368            >;
4369            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4370            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4371            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4372            if let Some(ref mut details) = poller_options.tracing {
4373                details.method_name =
4374                    "google_cloud_ces_v1::client::AgentService::restore_app_version::until_done";
4375            }
4376
4377            let stub = self.0.stub.clone();
4378            let mut options = self.0.options.clone();
4379            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4380            let query = move |name| {
4381                let stub = stub.clone();
4382                let options = options.clone();
4383                async {
4384                    let op = GetOperation::new(stub)
4385                        .set_name(name)
4386                        .with_options(options)
4387                        .send()
4388                        .await?;
4389                    Ok(Operation::new(op))
4390                }
4391            };
4392
4393            let start = move || async {
4394                let op = self.send().await?;
4395                Ok(Operation::new(op))
4396            };
4397
4398            use google_cloud_lro::internal::PollerExt;
4399            {
4400                google_cloud_lro::internal::new_poller(
4401                    polling_error_policy,
4402                    polling_backoff_policy,
4403                    start,
4404                    query,
4405                )
4406            }
4407            .with_options(poller_options)
4408        }
4409
4410        /// Sets the value of [name][crate::model::RestoreAppVersionRequest::name].
4411        ///
4412        /// This is a **required** field for requests.
4413        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4414            self.0.request.name = v.into();
4415            self
4416        }
4417    }
4418
4419    #[doc(hidden)]
4420    impl crate::RequestBuilder for RestoreAppVersion {
4421        fn request_options(&mut self) -> &mut crate::RequestOptions {
4422            &mut self.0.options
4423        }
4424    }
4425
4426    /// The request builder for [AgentService::list_changelogs][crate::client::AgentService::list_changelogs] calls.
4427    ///
4428    /// # Example
4429    /// ```
4430    /// # use google_cloud_ces_v1::builder::agent_service::ListChangelogs;
4431    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4432    /// use google_cloud_gax::paginator::ItemPaginator;
4433    ///
4434    /// let builder = prepare_request_builder();
4435    /// let mut items = builder.by_item();
4436    /// while let Some(result) = items.next().await {
4437    ///   let item = result?;
4438    /// }
4439    /// # Ok(()) }
4440    ///
4441    /// fn prepare_request_builder() -> ListChangelogs {
4442    ///   # panic!();
4443    ///   // ... details omitted ...
4444    /// }
4445    /// ```
4446    #[derive(Clone, Debug)]
4447    pub struct ListChangelogs(RequestBuilder<crate::model::ListChangelogsRequest>);
4448
4449    impl ListChangelogs {
4450        pub(crate) fn new(
4451            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4452        ) -> Self {
4453            Self(RequestBuilder::new(stub))
4454        }
4455
4456        /// Sets the full request, replacing any prior values.
4457        pub fn with_request<V: Into<crate::model::ListChangelogsRequest>>(mut self, v: V) -> Self {
4458            self.0.request = v.into();
4459            self
4460        }
4461
4462        /// Sets all the options, replacing any prior values.
4463        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4464            self.0.options = v.into();
4465            self
4466        }
4467
4468        /// Sends the request.
4469        pub async fn send(self) -> Result<crate::model::ListChangelogsResponse> {
4470            (*self.0.stub)
4471                .list_changelogs(self.0.request, self.0.options)
4472                .await
4473                .map(crate::Response::into_body)
4474        }
4475
4476        /// Streams each page in the collection.
4477        pub fn by_page(
4478            self,
4479        ) -> impl google_cloud_gax::paginator::Paginator<
4480            crate::model::ListChangelogsResponse,
4481            crate::Error,
4482        > {
4483            use std::clone::Clone;
4484            let token = self.0.request.page_token.clone();
4485            let execute = move |token: String| {
4486                let mut builder = self.clone();
4487                builder.0.request = builder.0.request.set_page_token(token);
4488                builder.send()
4489            };
4490            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4491        }
4492
4493        /// Streams each item in the collection.
4494        pub fn by_item(
4495            self,
4496        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4497            crate::model::ListChangelogsResponse,
4498            crate::Error,
4499        > {
4500            use google_cloud_gax::paginator::Paginator;
4501            self.by_page().items()
4502        }
4503
4504        /// Sets the value of [parent][crate::model::ListChangelogsRequest::parent].
4505        ///
4506        /// This is a **required** field for requests.
4507        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4508            self.0.request.parent = v.into();
4509            self
4510        }
4511
4512        /// Sets the value of [page_size][crate::model::ListChangelogsRequest::page_size].
4513        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4514            self.0.request.page_size = v.into();
4515            self
4516        }
4517
4518        /// Sets the value of [page_token][crate::model::ListChangelogsRequest::page_token].
4519        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4520            self.0.request.page_token = v.into();
4521            self
4522        }
4523
4524        /// Sets the value of [filter][crate::model::ListChangelogsRequest::filter].
4525        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4526            self.0.request.filter = v.into();
4527            self
4528        }
4529
4530        /// Sets the value of [order_by][crate::model::ListChangelogsRequest::order_by].
4531        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4532            self.0.request.order_by = v.into();
4533            self
4534        }
4535    }
4536
4537    #[doc(hidden)]
4538    impl crate::RequestBuilder for ListChangelogs {
4539        fn request_options(&mut self) -> &mut crate::RequestOptions {
4540            &mut self.0.options
4541        }
4542    }
4543
4544    /// The request builder for [AgentService::get_changelog][crate::client::AgentService::get_changelog] calls.
4545    ///
4546    /// # Example
4547    /// ```
4548    /// # use google_cloud_ces_v1::builder::agent_service::GetChangelog;
4549    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4550    ///
4551    /// let builder = prepare_request_builder();
4552    /// let response = builder.send().await?;
4553    /// # Ok(()) }
4554    ///
4555    /// fn prepare_request_builder() -> GetChangelog {
4556    ///   # panic!();
4557    ///   // ... details omitted ...
4558    /// }
4559    /// ```
4560    #[derive(Clone, Debug)]
4561    pub struct GetChangelog(RequestBuilder<crate::model::GetChangelogRequest>);
4562
4563    impl GetChangelog {
4564        pub(crate) fn new(
4565            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4566        ) -> Self {
4567            Self(RequestBuilder::new(stub))
4568        }
4569
4570        /// Sets the full request, replacing any prior values.
4571        pub fn with_request<V: Into<crate::model::GetChangelogRequest>>(mut self, v: V) -> Self {
4572            self.0.request = v.into();
4573            self
4574        }
4575
4576        /// Sets all the options, replacing any prior values.
4577        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4578            self.0.options = v.into();
4579            self
4580        }
4581
4582        /// Sends the request.
4583        pub async fn send(self) -> Result<crate::model::Changelog> {
4584            (*self.0.stub)
4585                .get_changelog(self.0.request, self.0.options)
4586                .await
4587                .map(crate::Response::into_body)
4588        }
4589
4590        /// Sets the value of [name][crate::model::GetChangelogRequest::name].
4591        ///
4592        /// This is a **required** field for requests.
4593        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4594            self.0.request.name = v.into();
4595            self
4596        }
4597    }
4598
4599    #[doc(hidden)]
4600    impl crate::RequestBuilder for GetChangelog {
4601        fn request_options(&mut self) -> &mut crate::RequestOptions {
4602            &mut self.0.options
4603        }
4604    }
4605
4606    /// The request builder for [AgentService::list_locations][crate::client::AgentService::list_locations] calls.
4607    ///
4608    /// # Example
4609    /// ```
4610    /// # use google_cloud_ces_v1::builder::agent_service::ListLocations;
4611    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4612    /// use google_cloud_gax::paginator::ItemPaginator;
4613    ///
4614    /// let builder = prepare_request_builder();
4615    /// let mut items = builder.by_item();
4616    /// while let Some(result) = items.next().await {
4617    ///   let item = result?;
4618    /// }
4619    /// # Ok(()) }
4620    ///
4621    /// fn prepare_request_builder() -> ListLocations {
4622    ///   # panic!();
4623    ///   // ... details omitted ...
4624    /// }
4625    /// ```
4626    #[derive(Clone, Debug)]
4627    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4628
4629    impl ListLocations {
4630        pub(crate) fn new(
4631            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4632        ) -> Self {
4633            Self(RequestBuilder::new(stub))
4634        }
4635
4636        /// Sets the full request, replacing any prior values.
4637        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4638            mut self,
4639            v: V,
4640        ) -> Self {
4641            self.0.request = v.into();
4642            self
4643        }
4644
4645        /// Sets all the options, replacing any prior values.
4646        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4647            self.0.options = v.into();
4648            self
4649        }
4650
4651        /// Sends the request.
4652        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4653            (*self.0.stub)
4654                .list_locations(self.0.request, self.0.options)
4655                .await
4656                .map(crate::Response::into_body)
4657        }
4658
4659        /// Streams each page in the collection.
4660        pub fn by_page(
4661            self,
4662        ) -> impl google_cloud_gax::paginator::Paginator<
4663            google_cloud_location::model::ListLocationsResponse,
4664            crate::Error,
4665        > {
4666            use std::clone::Clone;
4667            let token = self.0.request.page_token.clone();
4668            let execute = move |token: String| {
4669                let mut builder = self.clone();
4670                builder.0.request = builder.0.request.set_page_token(token);
4671                builder.send()
4672            };
4673            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4674        }
4675
4676        /// Streams each item in the collection.
4677        pub fn by_item(
4678            self,
4679        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4680            google_cloud_location::model::ListLocationsResponse,
4681            crate::Error,
4682        > {
4683            use google_cloud_gax::paginator::Paginator;
4684            self.by_page().items()
4685        }
4686
4687        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4688        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4689            self.0.request.name = v.into();
4690            self
4691        }
4692
4693        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4694        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4695            self.0.request.filter = v.into();
4696            self
4697        }
4698
4699        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4700        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4701            self.0.request.page_size = v.into();
4702            self
4703        }
4704
4705        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4706        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4707            self.0.request.page_token = v.into();
4708            self
4709        }
4710    }
4711
4712    #[doc(hidden)]
4713    impl crate::RequestBuilder for ListLocations {
4714        fn request_options(&mut self) -> &mut crate::RequestOptions {
4715            &mut self.0.options
4716        }
4717    }
4718
4719    /// The request builder for [AgentService::get_location][crate::client::AgentService::get_location] calls.
4720    ///
4721    /// # Example
4722    /// ```
4723    /// # use google_cloud_ces_v1::builder::agent_service::GetLocation;
4724    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4725    ///
4726    /// let builder = prepare_request_builder();
4727    /// let response = builder.send().await?;
4728    /// # Ok(()) }
4729    ///
4730    /// fn prepare_request_builder() -> GetLocation {
4731    ///   # panic!();
4732    ///   // ... details omitted ...
4733    /// }
4734    /// ```
4735    #[derive(Clone, Debug)]
4736    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4737
4738    impl GetLocation {
4739        pub(crate) fn new(
4740            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4741        ) -> Self {
4742            Self(RequestBuilder::new(stub))
4743        }
4744
4745        /// Sets the full request, replacing any prior values.
4746        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4747            mut self,
4748            v: V,
4749        ) -> Self {
4750            self.0.request = v.into();
4751            self
4752        }
4753
4754        /// Sets all the options, replacing any prior values.
4755        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4756            self.0.options = v.into();
4757            self
4758        }
4759
4760        /// Sends the request.
4761        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4762            (*self.0.stub)
4763                .get_location(self.0.request, self.0.options)
4764                .await
4765                .map(crate::Response::into_body)
4766        }
4767
4768        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4769        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4770            self.0.request.name = v.into();
4771            self
4772        }
4773    }
4774
4775    #[doc(hidden)]
4776    impl crate::RequestBuilder for GetLocation {
4777        fn request_options(&mut self) -> &mut crate::RequestOptions {
4778            &mut self.0.options
4779        }
4780    }
4781
4782    /// The request builder for [AgentService::list_operations][crate::client::AgentService::list_operations] calls.
4783    ///
4784    /// # Example
4785    /// ```
4786    /// # use google_cloud_ces_v1::builder::agent_service::ListOperations;
4787    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4788    /// use google_cloud_gax::paginator::ItemPaginator;
4789    ///
4790    /// let builder = prepare_request_builder();
4791    /// let mut items = builder.by_item();
4792    /// while let Some(result) = items.next().await {
4793    ///   let item = result?;
4794    /// }
4795    /// # Ok(()) }
4796    ///
4797    /// fn prepare_request_builder() -> ListOperations {
4798    ///   # panic!();
4799    ///   // ... details omitted ...
4800    /// }
4801    /// ```
4802    #[derive(Clone, Debug)]
4803    pub struct ListOperations(
4804        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4805    );
4806
4807    impl ListOperations {
4808        pub(crate) fn new(
4809            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4810        ) -> Self {
4811            Self(RequestBuilder::new(stub))
4812        }
4813
4814        /// Sets the full request, replacing any prior values.
4815        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4816            mut self,
4817            v: V,
4818        ) -> Self {
4819            self.0.request = v.into();
4820            self
4821        }
4822
4823        /// Sets all the options, replacing any prior values.
4824        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4825            self.0.options = v.into();
4826            self
4827        }
4828
4829        /// Sends the request.
4830        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4831            (*self.0.stub)
4832                .list_operations(self.0.request, self.0.options)
4833                .await
4834                .map(crate::Response::into_body)
4835        }
4836
4837        /// Streams each page in the collection.
4838        pub fn by_page(
4839            self,
4840        ) -> impl google_cloud_gax::paginator::Paginator<
4841            google_cloud_longrunning::model::ListOperationsResponse,
4842            crate::Error,
4843        > {
4844            use std::clone::Clone;
4845            let token = self.0.request.page_token.clone();
4846            let execute = move |token: String| {
4847                let mut builder = self.clone();
4848                builder.0.request = builder.0.request.set_page_token(token);
4849                builder.send()
4850            };
4851            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4852        }
4853
4854        /// Streams each item in the collection.
4855        pub fn by_item(
4856            self,
4857        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4858            google_cloud_longrunning::model::ListOperationsResponse,
4859            crate::Error,
4860        > {
4861            use google_cloud_gax::paginator::Paginator;
4862            self.by_page().items()
4863        }
4864
4865        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4866        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4867            self.0.request.name = v.into();
4868            self
4869        }
4870
4871        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4872        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4873            self.0.request.filter = v.into();
4874            self
4875        }
4876
4877        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4878        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4879            self.0.request.page_size = v.into();
4880            self
4881        }
4882
4883        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4884        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4885            self.0.request.page_token = v.into();
4886            self
4887        }
4888
4889        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4890        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4891            self.0.request.return_partial_success = v.into();
4892            self
4893        }
4894    }
4895
4896    #[doc(hidden)]
4897    impl crate::RequestBuilder for ListOperations {
4898        fn request_options(&mut self) -> &mut crate::RequestOptions {
4899            &mut self.0.options
4900        }
4901    }
4902
4903    /// The request builder for [AgentService::get_operation][crate::client::AgentService::get_operation] calls.
4904    ///
4905    /// # Example
4906    /// ```
4907    /// # use google_cloud_ces_v1::builder::agent_service::GetOperation;
4908    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4909    ///
4910    /// let builder = prepare_request_builder();
4911    /// let response = builder.send().await?;
4912    /// # Ok(()) }
4913    ///
4914    /// fn prepare_request_builder() -> GetOperation {
4915    ///   # panic!();
4916    ///   // ... details omitted ...
4917    /// }
4918    /// ```
4919    #[derive(Clone, Debug)]
4920    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4921
4922    impl GetOperation {
4923        pub(crate) fn new(
4924            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4925        ) -> Self {
4926            Self(RequestBuilder::new(stub))
4927        }
4928
4929        /// Sets the full request, replacing any prior values.
4930        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4931            mut self,
4932            v: V,
4933        ) -> Self {
4934            self.0.request = v.into();
4935            self
4936        }
4937
4938        /// Sets all the options, replacing any prior values.
4939        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4940            self.0.options = v.into();
4941            self
4942        }
4943
4944        /// Sends the request.
4945        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4946            (*self.0.stub)
4947                .get_operation(self.0.request, self.0.options)
4948                .await
4949                .map(crate::Response::into_body)
4950        }
4951
4952        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4953        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4954            self.0.request.name = v.into();
4955            self
4956        }
4957    }
4958
4959    #[doc(hidden)]
4960    impl crate::RequestBuilder for GetOperation {
4961        fn request_options(&mut self) -> &mut crate::RequestOptions {
4962            &mut self.0.options
4963        }
4964    }
4965
4966    /// The request builder for [AgentService::delete_operation][crate::client::AgentService::delete_operation] calls.
4967    ///
4968    /// # Example
4969    /// ```
4970    /// # use google_cloud_ces_v1::builder::agent_service::DeleteOperation;
4971    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
4972    ///
4973    /// let builder = prepare_request_builder();
4974    /// let response = builder.send().await?;
4975    /// # Ok(()) }
4976    ///
4977    /// fn prepare_request_builder() -> DeleteOperation {
4978    ///   # panic!();
4979    ///   // ... details omitted ...
4980    /// }
4981    /// ```
4982    #[derive(Clone, Debug)]
4983    pub struct DeleteOperation(
4984        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4985    );
4986
4987    impl DeleteOperation {
4988        pub(crate) fn new(
4989            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4990        ) -> Self {
4991            Self(RequestBuilder::new(stub))
4992        }
4993
4994        /// Sets the full request, replacing any prior values.
4995        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4996            mut self,
4997            v: V,
4998        ) -> Self {
4999            self.0.request = v.into();
5000            self
5001        }
5002
5003        /// Sets all the options, replacing any prior values.
5004        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5005            self.0.options = v.into();
5006            self
5007        }
5008
5009        /// Sends the request.
5010        pub async fn send(self) -> Result<()> {
5011            (*self.0.stub)
5012                .delete_operation(self.0.request, self.0.options)
5013                .await
5014                .map(crate::Response::into_body)
5015        }
5016
5017        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5018        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5019            self.0.request.name = v.into();
5020            self
5021        }
5022    }
5023
5024    #[doc(hidden)]
5025    impl crate::RequestBuilder for DeleteOperation {
5026        fn request_options(&mut self) -> &mut crate::RequestOptions {
5027            &mut self.0.options
5028        }
5029    }
5030
5031    /// The request builder for [AgentService::cancel_operation][crate::client::AgentService::cancel_operation] calls.
5032    ///
5033    /// # Example
5034    /// ```
5035    /// # use google_cloud_ces_v1::builder::agent_service::CancelOperation;
5036    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5037    ///
5038    /// let builder = prepare_request_builder();
5039    /// let response = builder.send().await?;
5040    /// # Ok(()) }
5041    ///
5042    /// fn prepare_request_builder() -> CancelOperation {
5043    ///   # panic!();
5044    ///   // ... details omitted ...
5045    /// }
5046    /// ```
5047    #[derive(Clone, Debug)]
5048    pub struct CancelOperation(
5049        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5050    );
5051
5052    impl CancelOperation {
5053        pub(crate) fn new(
5054            stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
5055        ) -> Self {
5056            Self(RequestBuilder::new(stub))
5057        }
5058
5059        /// Sets the full request, replacing any prior values.
5060        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5061            mut self,
5062            v: V,
5063        ) -> Self {
5064            self.0.request = v.into();
5065            self
5066        }
5067
5068        /// Sets all the options, replacing any prior values.
5069        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5070            self.0.options = v.into();
5071            self
5072        }
5073
5074        /// Sends the request.
5075        pub async fn send(self) -> Result<()> {
5076            (*self.0.stub)
5077                .cancel_operation(self.0.request, self.0.options)
5078                .await
5079                .map(crate::Response::into_body)
5080        }
5081
5082        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5083        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5084            self.0.request.name = v.into();
5085            self
5086        }
5087    }
5088
5089    #[doc(hidden)]
5090    impl crate::RequestBuilder for CancelOperation {
5091        fn request_options(&mut self) -> &mut crate::RequestOptions {
5092            &mut self.0.options
5093        }
5094    }
5095}
5096
5097/// Request and client builders for [SessionService][crate::client::SessionService].
5098pub mod session_service {
5099    use crate::Result;
5100
5101    /// A builder for [SessionService][crate::client::SessionService].
5102    ///
5103    /// ```
5104    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5105    /// # use google_cloud_ces_v1::*;
5106    /// # use builder::session_service::ClientBuilder;
5107    /// # use client::SessionService;
5108    /// let builder : ClientBuilder = SessionService::builder();
5109    /// let client = builder
5110    ///     .with_endpoint("https://ces.googleapis.com")
5111    ///     .build().await?;
5112    /// # Ok(()) }
5113    /// ```
5114    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5115
5116    pub(crate) mod client {
5117        use super::super::super::client::SessionService;
5118        pub struct Factory;
5119        impl crate::ClientFactory for Factory {
5120            type Client = SessionService;
5121            type Credentials = gaxi::options::Credentials;
5122            async fn build(
5123                self,
5124                config: gaxi::options::ClientConfig,
5125            ) -> crate::ClientBuilderResult<Self::Client> {
5126                Self::Client::new(config).await
5127            }
5128        }
5129    }
5130
5131    /// Common implementation for [crate::client::SessionService] request builders.
5132    #[derive(Clone, Debug)]
5133    pub(crate) struct RequestBuilder<R: std::default::Default> {
5134        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5135        request: R,
5136        options: crate::RequestOptions,
5137    }
5138
5139    impl<R> RequestBuilder<R>
5140    where
5141        R: std::default::Default,
5142    {
5143        pub(crate) fn new(
5144            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5145        ) -> Self {
5146            Self {
5147                stub,
5148                request: R::default(),
5149                options: crate::RequestOptions::default(),
5150            }
5151        }
5152    }
5153
5154    /// The request builder for [SessionService::run_session][crate::client::SessionService::run_session] calls.
5155    ///
5156    /// # Example
5157    /// ```
5158    /// # use google_cloud_ces_v1::builder::session_service::RunSession;
5159    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5160    ///
5161    /// let builder = prepare_request_builder();
5162    /// let response = builder.send().await?;
5163    /// # Ok(()) }
5164    ///
5165    /// fn prepare_request_builder() -> RunSession {
5166    ///   # panic!();
5167    ///   // ... details omitted ...
5168    /// }
5169    /// ```
5170    #[derive(Clone, Debug)]
5171    pub struct RunSession(RequestBuilder<crate::model::RunSessionRequest>);
5172
5173    impl RunSession {
5174        pub(crate) fn new(
5175            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5176        ) -> Self {
5177            Self(RequestBuilder::new(stub))
5178        }
5179
5180        /// Sets the full request, replacing any prior values.
5181        pub fn with_request<V: Into<crate::model::RunSessionRequest>>(mut self, v: V) -> Self {
5182            self.0.request = v.into();
5183            self
5184        }
5185
5186        /// Sets all the options, replacing any prior values.
5187        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5188            self.0.options = v.into();
5189            self
5190        }
5191
5192        /// Sends the request.
5193        pub async fn send(self) -> Result<crate::model::RunSessionResponse> {
5194            (*self.0.stub)
5195                .run_session(self.0.request, self.0.options)
5196                .await
5197                .map(crate::Response::into_body)
5198        }
5199
5200        /// Sets the value of [config][crate::model::RunSessionRequest::config].
5201        ///
5202        /// This is a **required** field for requests.
5203        pub fn set_config<T>(mut self, v: T) -> Self
5204        where
5205            T: std::convert::Into<crate::model::SessionConfig>,
5206        {
5207            self.0.request.config = std::option::Option::Some(v.into());
5208            self
5209        }
5210
5211        /// Sets or clears the value of [config][crate::model::RunSessionRequest::config].
5212        ///
5213        /// This is a **required** field for requests.
5214        pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
5215        where
5216            T: std::convert::Into<crate::model::SessionConfig>,
5217        {
5218            self.0.request.config = v.map(|x| x.into());
5219            self
5220        }
5221
5222        /// Sets the value of [inputs][crate::model::RunSessionRequest::inputs].
5223        ///
5224        /// This is a **required** field for requests.
5225        pub fn set_inputs<T, V>(mut self, v: T) -> Self
5226        where
5227            T: std::iter::IntoIterator<Item = V>,
5228            V: std::convert::Into<crate::model::SessionInput>,
5229        {
5230            use std::iter::Iterator;
5231            self.0.request.inputs = v.into_iter().map(|i| i.into()).collect();
5232            self
5233        }
5234    }
5235
5236    #[doc(hidden)]
5237    impl crate::RequestBuilder for RunSession {
5238        fn request_options(&mut self) -> &mut crate::RequestOptions {
5239            &mut self.0.options
5240        }
5241    }
5242
5243    /// The request builder for [SessionService::list_locations][crate::client::SessionService::list_locations] calls.
5244    ///
5245    /// # Example
5246    /// ```
5247    /// # use google_cloud_ces_v1::builder::session_service::ListLocations;
5248    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5249    /// use google_cloud_gax::paginator::ItemPaginator;
5250    ///
5251    /// let builder = prepare_request_builder();
5252    /// let mut items = builder.by_item();
5253    /// while let Some(result) = items.next().await {
5254    ///   let item = result?;
5255    /// }
5256    /// # Ok(()) }
5257    ///
5258    /// fn prepare_request_builder() -> ListLocations {
5259    ///   # panic!();
5260    ///   // ... details omitted ...
5261    /// }
5262    /// ```
5263    #[derive(Clone, Debug)]
5264    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5265
5266    impl ListLocations {
5267        pub(crate) fn new(
5268            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5269        ) -> Self {
5270            Self(RequestBuilder::new(stub))
5271        }
5272
5273        /// Sets the full request, replacing any prior values.
5274        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5275            mut self,
5276            v: V,
5277        ) -> Self {
5278            self.0.request = v.into();
5279            self
5280        }
5281
5282        /// Sets all the options, replacing any prior values.
5283        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5284            self.0.options = v.into();
5285            self
5286        }
5287
5288        /// Sends the request.
5289        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5290            (*self.0.stub)
5291                .list_locations(self.0.request, self.0.options)
5292                .await
5293                .map(crate::Response::into_body)
5294        }
5295
5296        /// Streams each page in the collection.
5297        pub fn by_page(
5298            self,
5299        ) -> impl google_cloud_gax::paginator::Paginator<
5300            google_cloud_location::model::ListLocationsResponse,
5301            crate::Error,
5302        > {
5303            use std::clone::Clone;
5304            let token = self.0.request.page_token.clone();
5305            let execute = move |token: String| {
5306                let mut builder = self.clone();
5307                builder.0.request = builder.0.request.set_page_token(token);
5308                builder.send()
5309            };
5310            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5311        }
5312
5313        /// Streams each item in the collection.
5314        pub fn by_item(
5315            self,
5316        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5317            google_cloud_location::model::ListLocationsResponse,
5318            crate::Error,
5319        > {
5320            use google_cloud_gax::paginator::Paginator;
5321            self.by_page().items()
5322        }
5323
5324        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
5325        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5326            self.0.request.name = v.into();
5327            self
5328        }
5329
5330        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
5331        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5332            self.0.request.filter = v.into();
5333            self
5334        }
5335
5336        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
5337        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5338            self.0.request.page_size = v.into();
5339            self
5340        }
5341
5342        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
5343        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5344            self.0.request.page_token = v.into();
5345            self
5346        }
5347    }
5348
5349    #[doc(hidden)]
5350    impl crate::RequestBuilder for ListLocations {
5351        fn request_options(&mut self) -> &mut crate::RequestOptions {
5352            &mut self.0.options
5353        }
5354    }
5355
5356    /// The request builder for [SessionService::get_location][crate::client::SessionService::get_location] calls.
5357    ///
5358    /// # Example
5359    /// ```
5360    /// # use google_cloud_ces_v1::builder::session_service::GetLocation;
5361    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5362    ///
5363    /// let builder = prepare_request_builder();
5364    /// let response = builder.send().await?;
5365    /// # Ok(()) }
5366    ///
5367    /// fn prepare_request_builder() -> GetLocation {
5368    ///   # panic!();
5369    ///   // ... details omitted ...
5370    /// }
5371    /// ```
5372    #[derive(Clone, Debug)]
5373    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5374
5375    impl GetLocation {
5376        pub(crate) fn new(
5377            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5378        ) -> Self {
5379            Self(RequestBuilder::new(stub))
5380        }
5381
5382        /// Sets the full request, replacing any prior values.
5383        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5384            mut self,
5385            v: V,
5386        ) -> Self {
5387            self.0.request = v.into();
5388            self
5389        }
5390
5391        /// Sets all the options, replacing any prior values.
5392        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5393            self.0.options = v.into();
5394            self
5395        }
5396
5397        /// Sends the request.
5398        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5399            (*self.0.stub)
5400                .get_location(self.0.request, self.0.options)
5401                .await
5402                .map(crate::Response::into_body)
5403        }
5404
5405        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
5406        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5407            self.0.request.name = v.into();
5408            self
5409        }
5410    }
5411
5412    #[doc(hidden)]
5413    impl crate::RequestBuilder for GetLocation {
5414        fn request_options(&mut self) -> &mut crate::RequestOptions {
5415            &mut self.0.options
5416        }
5417    }
5418
5419    /// The request builder for [SessionService::list_operations][crate::client::SessionService::list_operations] calls.
5420    ///
5421    /// # Example
5422    /// ```
5423    /// # use google_cloud_ces_v1::builder::session_service::ListOperations;
5424    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5425    /// use google_cloud_gax::paginator::ItemPaginator;
5426    ///
5427    /// let builder = prepare_request_builder();
5428    /// let mut items = builder.by_item();
5429    /// while let Some(result) = items.next().await {
5430    ///   let item = result?;
5431    /// }
5432    /// # Ok(()) }
5433    ///
5434    /// fn prepare_request_builder() -> ListOperations {
5435    ///   # panic!();
5436    ///   // ... details omitted ...
5437    /// }
5438    /// ```
5439    #[derive(Clone, Debug)]
5440    pub struct ListOperations(
5441        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5442    );
5443
5444    impl ListOperations {
5445        pub(crate) fn new(
5446            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5447        ) -> Self {
5448            Self(RequestBuilder::new(stub))
5449        }
5450
5451        /// Sets the full request, replacing any prior values.
5452        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5453            mut self,
5454            v: V,
5455        ) -> Self {
5456            self.0.request = v.into();
5457            self
5458        }
5459
5460        /// Sets all the options, replacing any prior values.
5461        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5462            self.0.options = v.into();
5463            self
5464        }
5465
5466        /// Sends the request.
5467        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5468            (*self.0.stub)
5469                .list_operations(self.0.request, self.0.options)
5470                .await
5471                .map(crate::Response::into_body)
5472        }
5473
5474        /// Streams each page in the collection.
5475        pub fn by_page(
5476            self,
5477        ) -> impl google_cloud_gax::paginator::Paginator<
5478            google_cloud_longrunning::model::ListOperationsResponse,
5479            crate::Error,
5480        > {
5481            use std::clone::Clone;
5482            let token = self.0.request.page_token.clone();
5483            let execute = move |token: String| {
5484                let mut builder = self.clone();
5485                builder.0.request = builder.0.request.set_page_token(token);
5486                builder.send()
5487            };
5488            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5489        }
5490
5491        /// Streams each item in the collection.
5492        pub fn by_item(
5493            self,
5494        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5495            google_cloud_longrunning::model::ListOperationsResponse,
5496            crate::Error,
5497        > {
5498            use google_cloud_gax::paginator::Paginator;
5499            self.by_page().items()
5500        }
5501
5502        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5503        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5504            self.0.request.name = v.into();
5505            self
5506        }
5507
5508        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5509        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5510            self.0.request.filter = v.into();
5511            self
5512        }
5513
5514        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5515        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5516            self.0.request.page_size = v.into();
5517            self
5518        }
5519
5520        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5521        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5522            self.0.request.page_token = v.into();
5523            self
5524        }
5525
5526        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5527        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5528            self.0.request.return_partial_success = v.into();
5529            self
5530        }
5531    }
5532
5533    #[doc(hidden)]
5534    impl crate::RequestBuilder for ListOperations {
5535        fn request_options(&mut self) -> &mut crate::RequestOptions {
5536            &mut self.0.options
5537        }
5538    }
5539
5540    /// The request builder for [SessionService::get_operation][crate::client::SessionService::get_operation] calls.
5541    ///
5542    /// # Example
5543    /// ```
5544    /// # use google_cloud_ces_v1::builder::session_service::GetOperation;
5545    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5546    ///
5547    /// let builder = prepare_request_builder();
5548    /// let response = builder.send().await?;
5549    /// # Ok(()) }
5550    ///
5551    /// fn prepare_request_builder() -> GetOperation {
5552    ///   # panic!();
5553    ///   // ... details omitted ...
5554    /// }
5555    /// ```
5556    #[derive(Clone, Debug)]
5557    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5558
5559    impl GetOperation {
5560        pub(crate) fn new(
5561            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5562        ) -> Self {
5563            Self(RequestBuilder::new(stub))
5564        }
5565
5566        /// Sets the full request, replacing any prior values.
5567        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5568            mut self,
5569            v: V,
5570        ) -> Self {
5571            self.0.request = v.into();
5572            self
5573        }
5574
5575        /// Sets all the options, replacing any prior values.
5576        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5577            self.0.options = v.into();
5578            self
5579        }
5580
5581        /// Sends the request.
5582        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5583            (*self.0.stub)
5584                .get_operation(self.0.request, self.0.options)
5585                .await
5586                .map(crate::Response::into_body)
5587        }
5588
5589        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5590        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5591            self.0.request.name = v.into();
5592            self
5593        }
5594    }
5595
5596    #[doc(hidden)]
5597    impl crate::RequestBuilder for GetOperation {
5598        fn request_options(&mut self) -> &mut crate::RequestOptions {
5599            &mut self.0.options
5600        }
5601    }
5602
5603    /// The request builder for [SessionService::delete_operation][crate::client::SessionService::delete_operation] calls.
5604    ///
5605    /// # Example
5606    /// ```
5607    /// # use google_cloud_ces_v1::builder::session_service::DeleteOperation;
5608    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5609    ///
5610    /// let builder = prepare_request_builder();
5611    /// let response = builder.send().await?;
5612    /// # Ok(()) }
5613    ///
5614    /// fn prepare_request_builder() -> DeleteOperation {
5615    ///   # panic!();
5616    ///   // ... details omitted ...
5617    /// }
5618    /// ```
5619    #[derive(Clone, Debug)]
5620    pub struct DeleteOperation(
5621        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5622    );
5623
5624    impl DeleteOperation {
5625        pub(crate) fn new(
5626            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5627        ) -> Self {
5628            Self(RequestBuilder::new(stub))
5629        }
5630
5631        /// Sets the full request, replacing any prior values.
5632        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5633            mut self,
5634            v: V,
5635        ) -> Self {
5636            self.0.request = v.into();
5637            self
5638        }
5639
5640        /// Sets all the options, replacing any prior values.
5641        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5642            self.0.options = v.into();
5643            self
5644        }
5645
5646        /// Sends the request.
5647        pub async fn send(self) -> Result<()> {
5648            (*self.0.stub)
5649                .delete_operation(self.0.request, self.0.options)
5650                .await
5651                .map(crate::Response::into_body)
5652        }
5653
5654        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5655        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5656            self.0.request.name = v.into();
5657            self
5658        }
5659    }
5660
5661    #[doc(hidden)]
5662    impl crate::RequestBuilder for DeleteOperation {
5663        fn request_options(&mut self) -> &mut crate::RequestOptions {
5664            &mut self.0.options
5665        }
5666    }
5667
5668    /// The request builder for [SessionService::cancel_operation][crate::client::SessionService::cancel_operation] calls.
5669    ///
5670    /// # Example
5671    /// ```
5672    /// # use google_cloud_ces_v1::builder::session_service::CancelOperation;
5673    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5674    ///
5675    /// let builder = prepare_request_builder();
5676    /// let response = builder.send().await?;
5677    /// # Ok(()) }
5678    ///
5679    /// fn prepare_request_builder() -> CancelOperation {
5680    ///   # panic!();
5681    ///   // ... details omitted ...
5682    /// }
5683    /// ```
5684    #[derive(Clone, Debug)]
5685    pub struct CancelOperation(
5686        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5687    );
5688
5689    impl CancelOperation {
5690        pub(crate) fn new(
5691            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5692        ) -> Self {
5693            Self(RequestBuilder::new(stub))
5694        }
5695
5696        /// Sets the full request, replacing any prior values.
5697        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5698            mut self,
5699            v: V,
5700        ) -> Self {
5701            self.0.request = v.into();
5702            self
5703        }
5704
5705        /// Sets all the options, replacing any prior values.
5706        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5707            self.0.options = v.into();
5708            self
5709        }
5710
5711        /// Sends the request.
5712        pub async fn send(self) -> Result<()> {
5713            (*self.0.stub)
5714                .cancel_operation(self.0.request, self.0.options)
5715                .await
5716                .map(crate::Response::into_body)
5717        }
5718
5719        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5720        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5721            self.0.request.name = v.into();
5722            self
5723        }
5724    }
5725
5726    #[doc(hidden)]
5727    impl crate::RequestBuilder for CancelOperation {
5728        fn request_options(&mut self) -> &mut crate::RequestOptions {
5729            &mut self.0.options
5730        }
5731    }
5732}
5733
5734/// Request and client builders for [ToolService][crate::client::ToolService].
5735pub mod tool_service {
5736    use crate::Result;
5737
5738    /// A builder for [ToolService][crate::client::ToolService].
5739    ///
5740    /// ```
5741    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5742    /// # use google_cloud_ces_v1::*;
5743    /// # use builder::tool_service::ClientBuilder;
5744    /// # use client::ToolService;
5745    /// let builder : ClientBuilder = ToolService::builder();
5746    /// let client = builder
5747    ///     .with_endpoint("https://ces.googleapis.com")
5748    ///     .build().await?;
5749    /// # Ok(()) }
5750    /// ```
5751    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5752
5753    pub(crate) mod client {
5754        use super::super::super::client::ToolService;
5755        pub struct Factory;
5756        impl crate::ClientFactory for Factory {
5757            type Client = ToolService;
5758            type Credentials = gaxi::options::Credentials;
5759            async fn build(
5760                self,
5761                config: gaxi::options::ClientConfig,
5762            ) -> crate::ClientBuilderResult<Self::Client> {
5763                Self::Client::new(config).await
5764            }
5765        }
5766    }
5767
5768    /// Common implementation for [crate::client::ToolService] request builders.
5769    #[derive(Clone, Debug)]
5770    pub(crate) struct RequestBuilder<R: std::default::Default> {
5771        stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
5772        request: R,
5773        options: crate::RequestOptions,
5774    }
5775
5776    impl<R> RequestBuilder<R>
5777    where
5778        R: std::default::Default,
5779    {
5780        pub(crate) fn new(
5781            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
5782        ) -> Self {
5783            Self {
5784                stub,
5785                request: R::default(),
5786                options: crate::RequestOptions::default(),
5787            }
5788        }
5789    }
5790
5791    /// The request builder for [ToolService::execute_tool][crate::client::ToolService::execute_tool] calls.
5792    ///
5793    /// # Example
5794    /// ```
5795    /// # use google_cloud_ces_v1::builder::tool_service::ExecuteTool;
5796    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5797    ///
5798    /// let builder = prepare_request_builder();
5799    /// let response = builder.send().await?;
5800    /// # Ok(()) }
5801    ///
5802    /// fn prepare_request_builder() -> ExecuteTool {
5803    ///   # panic!();
5804    ///   // ... details omitted ...
5805    /// }
5806    /// ```
5807    #[derive(Clone, Debug)]
5808    pub struct ExecuteTool(RequestBuilder<crate::model::ExecuteToolRequest>);
5809
5810    impl ExecuteTool {
5811        pub(crate) fn new(
5812            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
5813        ) -> Self {
5814            Self(RequestBuilder::new(stub))
5815        }
5816
5817        /// Sets the full request, replacing any prior values.
5818        pub fn with_request<V: Into<crate::model::ExecuteToolRequest>>(mut self, v: V) -> Self {
5819            self.0.request = v.into();
5820            self
5821        }
5822
5823        /// Sets all the options, replacing any prior values.
5824        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5825            self.0.options = v.into();
5826            self
5827        }
5828
5829        /// Sends the request.
5830        pub async fn send(self) -> Result<crate::model::ExecuteToolResponse> {
5831            (*self.0.stub)
5832                .execute_tool(self.0.request, self.0.options)
5833                .await
5834                .map(crate::Response::into_body)
5835        }
5836
5837        /// Sets the value of [parent][crate::model::ExecuteToolRequest::parent].
5838        ///
5839        /// This is a **required** field for requests.
5840        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5841            self.0.request.parent = v.into();
5842            self
5843        }
5844
5845        /// Sets the value of [args][crate::model::ExecuteToolRequest::args].
5846        pub fn set_args<T>(mut self, v: T) -> Self
5847        where
5848            T: std::convert::Into<wkt::Struct>,
5849        {
5850            self.0.request.args = std::option::Option::Some(v.into());
5851            self
5852        }
5853
5854        /// Sets or clears the value of [args][crate::model::ExecuteToolRequest::args].
5855        pub fn set_or_clear_args<T>(mut self, v: std::option::Option<T>) -> Self
5856        where
5857            T: std::convert::Into<wkt::Struct>,
5858        {
5859            self.0.request.args = v.map(|x| x.into());
5860            self
5861        }
5862
5863        /// Sets the value of [mock_config][crate::model::ExecuteToolRequest::mock_config].
5864        pub fn set_mock_config<T>(mut self, v: T) -> Self
5865        where
5866            T: std::convert::Into<crate::model::MockConfig>,
5867        {
5868            self.0.request.mock_config = std::option::Option::Some(v.into());
5869            self
5870        }
5871
5872        /// Sets or clears the value of [mock_config][crate::model::ExecuteToolRequest::mock_config].
5873        pub fn set_or_clear_mock_config<T>(mut self, v: std::option::Option<T>) -> Self
5874        where
5875            T: std::convert::Into<crate::model::MockConfig>,
5876        {
5877            self.0.request.mock_config = v.map(|x| x.into());
5878            self
5879        }
5880
5881        /// Sets the value of [tool_identifier][crate::model::ExecuteToolRequest::tool_identifier].
5882        ///
5883        /// Note that all the setters affecting `tool_identifier` are
5884        /// mutually exclusive.
5885        pub fn set_tool_identifier<
5886            T: Into<Option<crate::model::execute_tool_request::ToolIdentifier>>,
5887        >(
5888            mut self,
5889            v: T,
5890        ) -> Self {
5891            self.0.request.tool_identifier = v.into();
5892            self
5893        }
5894
5895        /// Sets the value of [tool_identifier][crate::model::ExecuteToolRequest::tool_identifier]
5896        /// to hold a `Tool`.
5897        ///
5898        /// Note that all the setters affecting `tool_identifier` are
5899        /// mutually exclusive.
5900        pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5901            self.0.request = self.0.request.set_tool(v);
5902            self
5903        }
5904
5905        /// Sets the value of [tool_identifier][crate::model::ExecuteToolRequest::tool_identifier]
5906        /// to hold a `ToolsetTool`.
5907        ///
5908        /// Note that all the setters affecting `tool_identifier` are
5909        /// mutually exclusive.
5910        pub fn set_toolset_tool<
5911            T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>,
5912        >(
5913            mut self,
5914            v: T,
5915        ) -> Self {
5916            self.0.request = self.0.request.set_toolset_tool(v);
5917            self
5918        }
5919
5920        /// Sets the value of [tool_execution_context][crate::model::ExecuteToolRequest::tool_execution_context].
5921        ///
5922        /// Note that all the setters affecting `tool_execution_context` are
5923        /// mutually exclusive.
5924        pub fn set_tool_execution_context<
5925            T: Into<Option<crate::model::execute_tool_request::ToolExecutionContext>>,
5926        >(
5927            mut self,
5928            v: T,
5929        ) -> Self {
5930            self.0.request.tool_execution_context = v.into();
5931            self
5932        }
5933
5934        /// Sets the value of [tool_execution_context][crate::model::ExecuteToolRequest::tool_execution_context]
5935        /// to hold a `Variables`.
5936        ///
5937        /// Note that all the setters affecting `tool_execution_context` are
5938        /// mutually exclusive.
5939        pub fn set_variables<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
5940            mut self,
5941            v: T,
5942        ) -> Self {
5943            self.0.request = self.0.request.set_variables(v);
5944            self
5945        }
5946
5947        /// Sets the value of [tool_execution_context][crate::model::ExecuteToolRequest::tool_execution_context]
5948        /// to hold a `Context`.
5949        ///
5950        /// Note that all the setters affecting `tool_execution_context` are
5951        /// mutually exclusive.
5952        pub fn set_context<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
5953            mut self,
5954            v: T,
5955        ) -> Self {
5956            self.0.request = self.0.request.set_context(v);
5957            self
5958        }
5959    }
5960
5961    #[doc(hidden)]
5962    impl crate::RequestBuilder for ExecuteTool {
5963        fn request_options(&mut self) -> &mut crate::RequestOptions {
5964            &mut self.0.options
5965        }
5966    }
5967
5968    /// The request builder for [ToolService::retrieve_tool_schema][crate::client::ToolService::retrieve_tool_schema] calls.
5969    ///
5970    /// # Example
5971    /// ```
5972    /// # use google_cloud_ces_v1::builder::tool_service::RetrieveToolSchema;
5973    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
5974    ///
5975    /// let builder = prepare_request_builder();
5976    /// let response = builder.send().await?;
5977    /// # Ok(()) }
5978    ///
5979    /// fn prepare_request_builder() -> RetrieveToolSchema {
5980    ///   # panic!();
5981    ///   // ... details omitted ...
5982    /// }
5983    /// ```
5984    #[derive(Clone, Debug)]
5985    pub struct RetrieveToolSchema(RequestBuilder<crate::model::RetrieveToolSchemaRequest>);
5986
5987    impl RetrieveToolSchema {
5988        pub(crate) fn new(
5989            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
5990        ) -> Self {
5991            Self(RequestBuilder::new(stub))
5992        }
5993
5994        /// Sets the full request, replacing any prior values.
5995        pub fn with_request<V: Into<crate::model::RetrieveToolSchemaRequest>>(
5996            mut self,
5997            v: V,
5998        ) -> Self {
5999            self.0.request = v.into();
6000            self
6001        }
6002
6003        /// Sets all the options, replacing any prior values.
6004        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6005            self.0.options = v.into();
6006            self
6007        }
6008
6009        /// Sends the request.
6010        pub async fn send(self) -> Result<crate::model::RetrieveToolSchemaResponse> {
6011            (*self.0.stub)
6012                .retrieve_tool_schema(self.0.request, self.0.options)
6013                .await
6014                .map(crate::Response::into_body)
6015        }
6016
6017        /// Sets the value of [parent][crate::model::RetrieveToolSchemaRequest::parent].
6018        ///
6019        /// This is a **required** field for requests.
6020        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6021            self.0.request.parent = v.into();
6022            self
6023        }
6024
6025        /// Sets the value of [tool_identifier][crate::model::RetrieveToolSchemaRequest::tool_identifier].
6026        ///
6027        /// Note that all the setters affecting `tool_identifier` are
6028        /// mutually exclusive.
6029        pub fn set_tool_identifier<
6030            T: Into<Option<crate::model::retrieve_tool_schema_request::ToolIdentifier>>,
6031        >(
6032            mut self,
6033            v: T,
6034        ) -> Self {
6035            self.0.request.tool_identifier = v.into();
6036            self
6037        }
6038
6039        /// Sets the value of [tool_identifier][crate::model::RetrieveToolSchemaRequest::tool_identifier]
6040        /// to hold a `Tool`.
6041        ///
6042        /// Note that all the setters affecting `tool_identifier` are
6043        /// mutually exclusive.
6044        pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6045            self.0.request = self.0.request.set_tool(v);
6046            self
6047        }
6048
6049        /// Sets the value of [tool_identifier][crate::model::RetrieveToolSchemaRequest::tool_identifier]
6050        /// to hold a `ToolsetTool`.
6051        ///
6052        /// Note that all the setters affecting `tool_identifier` are
6053        /// mutually exclusive.
6054        pub fn set_toolset_tool<
6055            T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>,
6056        >(
6057            mut self,
6058            v: T,
6059        ) -> Self {
6060            self.0.request = self.0.request.set_toolset_tool(v);
6061            self
6062        }
6063    }
6064
6065    #[doc(hidden)]
6066    impl crate::RequestBuilder for RetrieveToolSchema {
6067        fn request_options(&mut self) -> &mut crate::RequestOptions {
6068            &mut self.0.options
6069        }
6070    }
6071
6072    /// The request builder for [ToolService::retrieve_tools][crate::client::ToolService::retrieve_tools] calls.
6073    ///
6074    /// # Example
6075    /// ```
6076    /// # use google_cloud_ces_v1::builder::tool_service::RetrieveTools;
6077    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6078    ///
6079    /// let builder = prepare_request_builder();
6080    /// let response = builder.send().await?;
6081    /// # Ok(()) }
6082    ///
6083    /// fn prepare_request_builder() -> RetrieveTools {
6084    ///   # panic!();
6085    ///   // ... details omitted ...
6086    /// }
6087    /// ```
6088    #[derive(Clone, Debug)]
6089    pub struct RetrieveTools(RequestBuilder<crate::model::RetrieveToolsRequest>);
6090
6091    impl RetrieveTools {
6092        pub(crate) fn new(
6093            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6094        ) -> Self {
6095            Self(RequestBuilder::new(stub))
6096        }
6097
6098        /// Sets the full request, replacing any prior values.
6099        pub fn with_request<V: Into<crate::model::RetrieveToolsRequest>>(mut self, v: V) -> Self {
6100            self.0.request = v.into();
6101            self
6102        }
6103
6104        /// Sets all the options, replacing any prior values.
6105        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6106            self.0.options = v.into();
6107            self
6108        }
6109
6110        /// Sends the request.
6111        pub async fn send(self) -> Result<crate::model::RetrieveToolsResponse> {
6112            (*self.0.stub)
6113                .retrieve_tools(self.0.request, self.0.options)
6114                .await
6115                .map(crate::Response::into_body)
6116        }
6117
6118        /// Sets the value of [toolset][crate::model::RetrieveToolsRequest::toolset].
6119        ///
6120        /// This is a **required** field for requests.
6121        pub fn set_toolset<T: Into<std::string::String>>(mut self, v: T) -> Self {
6122            self.0.request.toolset = v.into();
6123            self
6124        }
6125
6126        /// Sets the value of [tool_ids][crate::model::RetrieveToolsRequest::tool_ids].
6127        pub fn set_tool_ids<T, V>(mut self, v: T) -> Self
6128        where
6129            T: std::iter::IntoIterator<Item = V>,
6130            V: std::convert::Into<std::string::String>,
6131        {
6132            use std::iter::Iterator;
6133            self.0.request.tool_ids = v.into_iter().map(|i| i.into()).collect();
6134            self
6135        }
6136
6137        /// Sets the value of [bypass_persistence_config][crate::model::RetrieveToolsRequest::bypass_persistence_config].
6138        pub fn set_bypass_persistence_config<T: Into<bool>>(mut self, v: T) -> Self {
6139            self.0.request.bypass_persistence_config = v.into();
6140            self
6141        }
6142    }
6143
6144    #[doc(hidden)]
6145    impl crate::RequestBuilder for RetrieveTools {
6146        fn request_options(&mut self) -> &mut crate::RequestOptions {
6147            &mut self.0.options
6148        }
6149    }
6150
6151    /// The request builder for [ToolService::list_locations][crate::client::ToolService::list_locations] calls.
6152    ///
6153    /// # Example
6154    /// ```
6155    /// # use google_cloud_ces_v1::builder::tool_service::ListLocations;
6156    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6157    /// use google_cloud_gax::paginator::ItemPaginator;
6158    ///
6159    /// let builder = prepare_request_builder();
6160    /// let mut items = builder.by_item();
6161    /// while let Some(result) = items.next().await {
6162    ///   let item = result?;
6163    /// }
6164    /// # Ok(()) }
6165    ///
6166    /// fn prepare_request_builder() -> ListLocations {
6167    ///   # panic!();
6168    ///   // ... details omitted ...
6169    /// }
6170    /// ```
6171    #[derive(Clone, Debug)]
6172    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6173
6174    impl ListLocations {
6175        pub(crate) fn new(
6176            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6177        ) -> Self {
6178            Self(RequestBuilder::new(stub))
6179        }
6180
6181        /// Sets the full request, replacing any prior values.
6182        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6183            mut self,
6184            v: V,
6185        ) -> Self {
6186            self.0.request = v.into();
6187            self
6188        }
6189
6190        /// Sets all the options, replacing any prior values.
6191        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6192            self.0.options = v.into();
6193            self
6194        }
6195
6196        /// Sends the request.
6197        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6198            (*self.0.stub)
6199                .list_locations(self.0.request, self.0.options)
6200                .await
6201                .map(crate::Response::into_body)
6202        }
6203
6204        /// Streams each page in the collection.
6205        pub fn by_page(
6206            self,
6207        ) -> impl google_cloud_gax::paginator::Paginator<
6208            google_cloud_location::model::ListLocationsResponse,
6209            crate::Error,
6210        > {
6211            use std::clone::Clone;
6212            let token = self.0.request.page_token.clone();
6213            let execute = move |token: String| {
6214                let mut builder = self.clone();
6215                builder.0.request = builder.0.request.set_page_token(token);
6216                builder.send()
6217            };
6218            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6219        }
6220
6221        /// Streams each item in the collection.
6222        pub fn by_item(
6223            self,
6224        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6225            google_cloud_location::model::ListLocationsResponse,
6226            crate::Error,
6227        > {
6228            use google_cloud_gax::paginator::Paginator;
6229            self.by_page().items()
6230        }
6231
6232        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6233        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6234            self.0.request.name = v.into();
6235            self
6236        }
6237
6238        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6239        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6240            self.0.request.filter = v.into();
6241            self
6242        }
6243
6244        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6245        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6246            self.0.request.page_size = v.into();
6247            self
6248        }
6249
6250        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6251        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6252            self.0.request.page_token = v.into();
6253            self
6254        }
6255    }
6256
6257    #[doc(hidden)]
6258    impl crate::RequestBuilder for ListLocations {
6259        fn request_options(&mut self) -> &mut crate::RequestOptions {
6260            &mut self.0.options
6261        }
6262    }
6263
6264    /// The request builder for [ToolService::get_location][crate::client::ToolService::get_location] calls.
6265    ///
6266    /// # Example
6267    /// ```
6268    /// # use google_cloud_ces_v1::builder::tool_service::GetLocation;
6269    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6270    ///
6271    /// let builder = prepare_request_builder();
6272    /// let response = builder.send().await?;
6273    /// # Ok(()) }
6274    ///
6275    /// fn prepare_request_builder() -> GetLocation {
6276    ///   # panic!();
6277    ///   // ... details omitted ...
6278    /// }
6279    /// ```
6280    #[derive(Clone, Debug)]
6281    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6282
6283    impl GetLocation {
6284        pub(crate) fn new(
6285            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6286        ) -> Self {
6287            Self(RequestBuilder::new(stub))
6288        }
6289
6290        /// Sets the full request, replacing any prior values.
6291        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6292            mut self,
6293            v: V,
6294        ) -> Self {
6295            self.0.request = v.into();
6296            self
6297        }
6298
6299        /// Sets all the options, replacing any prior values.
6300        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6301            self.0.options = v.into();
6302            self
6303        }
6304
6305        /// Sends the request.
6306        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6307            (*self.0.stub)
6308                .get_location(self.0.request, self.0.options)
6309                .await
6310                .map(crate::Response::into_body)
6311        }
6312
6313        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6314        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6315            self.0.request.name = v.into();
6316            self
6317        }
6318    }
6319
6320    #[doc(hidden)]
6321    impl crate::RequestBuilder for GetLocation {
6322        fn request_options(&mut self) -> &mut crate::RequestOptions {
6323            &mut self.0.options
6324        }
6325    }
6326
6327    /// The request builder for [ToolService::list_operations][crate::client::ToolService::list_operations] calls.
6328    ///
6329    /// # Example
6330    /// ```
6331    /// # use google_cloud_ces_v1::builder::tool_service::ListOperations;
6332    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6333    /// use google_cloud_gax::paginator::ItemPaginator;
6334    ///
6335    /// let builder = prepare_request_builder();
6336    /// let mut items = builder.by_item();
6337    /// while let Some(result) = items.next().await {
6338    ///   let item = result?;
6339    /// }
6340    /// # Ok(()) }
6341    ///
6342    /// fn prepare_request_builder() -> ListOperations {
6343    ///   # panic!();
6344    ///   // ... details omitted ...
6345    /// }
6346    /// ```
6347    #[derive(Clone, Debug)]
6348    pub struct ListOperations(
6349        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6350    );
6351
6352    impl ListOperations {
6353        pub(crate) fn new(
6354            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6355        ) -> Self {
6356            Self(RequestBuilder::new(stub))
6357        }
6358
6359        /// Sets the full request, replacing any prior values.
6360        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6361            mut self,
6362            v: V,
6363        ) -> Self {
6364            self.0.request = v.into();
6365            self
6366        }
6367
6368        /// Sets all the options, replacing any prior values.
6369        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6370            self.0.options = v.into();
6371            self
6372        }
6373
6374        /// Sends the request.
6375        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6376            (*self.0.stub)
6377                .list_operations(self.0.request, self.0.options)
6378                .await
6379                .map(crate::Response::into_body)
6380        }
6381
6382        /// Streams each page in the collection.
6383        pub fn by_page(
6384            self,
6385        ) -> impl google_cloud_gax::paginator::Paginator<
6386            google_cloud_longrunning::model::ListOperationsResponse,
6387            crate::Error,
6388        > {
6389            use std::clone::Clone;
6390            let token = self.0.request.page_token.clone();
6391            let execute = move |token: String| {
6392                let mut builder = self.clone();
6393                builder.0.request = builder.0.request.set_page_token(token);
6394                builder.send()
6395            };
6396            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6397        }
6398
6399        /// Streams each item in the collection.
6400        pub fn by_item(
6401            self,
6402        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6403            google_cloud_longrunning::model::ListOperationsResponse,
6404            crate::Error,
6405        > {
6406            use google_cloud_gax::paginator::Paginator;
6407            self.by_page().items()
6408        }
6409
6410        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6411        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6412            self.0.request.name = v.into();
6413            self
6414        }
6415
6416        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6417        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6418            self.0.request.filter = v.into();
6419            self
6420        }
6421
6422        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6423        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6424            self.0.request.page_size = v.into();
6425            self
6426        }
6427
6428        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6429        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6430            self.0.request.page_token = v.into();
6431            self
6432        }
6433
6434        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6435        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6436            self.0.request.return_partial_success = v.into();
6437            self
6438        }
6439    }
6440
6441    #[doc(hidden)]
6442    impl crate::RequestBuilder for ListOperations {
6443        fn request_options(&mut self) -> &mut crate::RequestOptions {
6444            &mut self.0.options
6445        }
6446    }
6447
6448    /// The request builder for [ToolService::get_operation][crate::client::ToolService::get_operation] calls.
6449    ///
6450    /// # Example
6451    /// ```
6452    /// # use google_cloud_ces_v1::builder::tool_service::GetOperation;
6453    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6454    ///
6455    /// let builder = prepare_request_builder();
6456    /// let response = builder.send().await?;
6457    /// # Ok(()) }
6458    ///
6459    /// fn prepare_request_builder() -> GetOperation {
6460    ///   # panic!();
6461    ///   // ... details omitted ...
6462    /// }
6463    /// ```
6464    #[derive(Clone, Debug)]
6465    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6466
6467    impl GetOperation {
6468        pub(crate) fn new(
6469            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6470        ) -> Self {
6471            Self(RequestBuilder::new(stub))
6472        }
6473
6474        /// Sets the full request, replacing any prior values.
6475        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6476            mut self,
6477            v: V,
6478        ) -> Self {
6479            self.0.request = v.into();
6480            self
6481        }
6482
6483        /// Sets all the options, replacing any prior values.
6484        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6485            self.0.options = v.into();
6486            self
6487        }
6488
6489        /// Sends the request.
6490        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6491            (*self.0.stub)
6492                .get_operation(self.0.request, self.0.options)
6493                .await
6494                .map(crate::Response::into_body)
6495        }
6496
6497        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
6498        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6499            self.0.request.name = v.into();
6500            self
6501        }
6502    }
6503
6504    #[doc(hidden)]
6505    impl crate::RequestBuilder for GetOperation {
6506        fn request_options(&mut self) -> &mut crate::RequestOptions {
6507            &mut self.0.options
6508        }
6509    }
6510
6511    /// The request builder for [ToolService::delete_operation][crate::client::ToolService::delete_operation] calls.
6512    ///
6513    /// # Example
6514    /// ```
6515    /// # use google_cloud_ces_v1::builder::tool_service::DeleteOperation;
6516    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6517    ///
6518    /// let builder = prepare_request_builder();
6519    /// let response = builder.send().await?;
6520    /// # Ok(()) }
6521    ///
6522    /// fn prepare_request_builder() -> DeleteOperation {
6523    ///   # panic!();
6524    ///   // ... details omitted ...
6525    /// }
6526    /// ```
6527    #[derive(Clone, Debug)]
6528    pub struct DeleteOperation(
6529        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6530    );
6531
6532    impl DeleteOperation {
6533        pub(crate) fn new(
6534            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6535        ) -> Self {
6536            Self(RequestBuilder::new(stub))
6537        }
6538
6539        /// Sets the full request, replacing any prior values.
6540        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6541            mut self,
6542            v: V,
6543        ) -> Self {
6544            self.0.request = v.into();
6545            self
6546        }
6547
6548        /// Sets all the options, replacing any prior values.
6549        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6550            self.0.options = v.into();
6551            self
6552        }
6553
6554        /// Sends the request.
6555        pub async fn send(self) -> Result<()> {
6556            (*self.0.stub)
6557                .delete_operation(self.0.request, self.0.options)
6558                .await
6559                .map(crate::Response::into_body)
6560        }
6561
6562        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
6563        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6564            self.0.request.name = v.into();
6565            self
6566        }
6567    }
6568
6569    #[doc(hidden)]
6570    impl crate::RequestBuilder for DeleteOperation {
6571        fn request_options(&mut self) -> &mut crate::RequestOptions {
6572            &mut self.0.options
6573        }
6574    }
6575
6576    /// The request builder for [ToolService::cancel_operation][crate::client::ToolService::cancel_operation] calls.
6577    ///
6578    /// # Example
6579    /// ```
6580    /// # use google_cloud_ces_v1::builder::tool_service::CancelOperation;
6581    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6582    ///
6583    /// let builder = prepare_request_builder();
6584    /// let response = builder.send().await?;
6585    /// # Ok(()) }
6586    ///
6587    /// fn prepare_request_builder() -> CancelOperation {
6588    ///   # panic!();
6589    ///   // ... details omitted ...
6590    /// }
6591    /// ```
6592    #[derive(Clone, Debug)]
6593    pub struct CancelOperation(
6594        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6595    );
6596
6597    impl CancelOperation {
6598        pub(crate) fn new(
6599            stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6600        ) -> Self {
6601            Self(RequestBuilder::new(stub))
6602        }
6603
6604        /// Sets the full request, replacing any prior values.
6605        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6606            mut self,
6607            v: V,
6608        ) -> Self {
6609            self.0.request = v.into();
6610            self
6611        }
6612
6613        /// Sets all the options, replacing any prior values.
6614        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6615            self.0.options = v.into();
6616            self
6617        }
6618
6619        /// Sends the request.
6620        pub async fn send(self) -> Result<()> {
6621            (*self.0.stub)
6622                .cancel_operation(self.0.request, self.0.options)
6623                .await
6624                .map(crate::Response::into_body)
6625        }
6626
6627        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
6628        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6629            self.0.request.name = v.into();
6630            self
6631        }
6632    }
6633
6634    #[doc(hidden)]
6635    impl crate::RequestBuilder for CancelOperation {
6636        fn request_options(&mut self) -> &mut crate::RequestOptions {
6637            &mut self.0.options
6638        }
6639    }
6640}
6641
6642/// Request and client builders for [WidgetService][crate::client::WidgetService].
6643pub mod widget_service {
6644    use crate::Result;
6645
6646    /// A builder for [WidgetService][crate::client::WidgetService].
6647    ///
6648    /// ```
6649    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6650    /// # use google_cloud_ces_v1::*;
6651    /// # use builder::widget_service::ClientBuilder;
6652    /// # use client::WidgetService;
6653    /// let builder : ClientBuilder = WidgetService::builder();
6654    /// let client = builder
6655    ///     .with_endpoint("https://ces.googleapis.com")
6656    ///     .build().await?;
6657    /// # Ok(()) }
6658    /// ```
6659    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6660
6661    pub(crate) mod client {
6662        use super::super::super::client::WidgetService;
6663        pub struct Factory;
6664        impl crate::ClientFactory for Factory {
6665            type Client = WidgetService;
6666            type Credentials = gaxi::options::Credentials;
6667            async fn build(
6668                self,
6669                config: gaxi::options::ClientConfig,
6670            ) -> crate::ClientBuilderResult<Self::Client> {
6671                Self::Client::new(config).await
6672            }
6673        }
6674    }
6675
6676    /// Common implementation for [crate::client::WidgetService] request builders.
6677    #[derive(Clone, Debug)]
6678    pub(crate) struct RequestBuilder<R: std::default::Default> {
6679        stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6680        request: R,
6681        options: crate::RequestOptions,
6682    }
6683
6684    impl<R> RequestBuilder<R>
6685    where
6686        R: std::default::Default,
6687    {
6688        pub(crate) fn new(
6689            stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6690        ) -> Self {
6691            Self {
6692                stub,
6693                request: R::default(),
6694                options: crate::RequestOptions::default(),
6695            }
6696        }
6697    }
6698
6699    /// The request builder for [WidgetService::generate_chat_token][crate::client::WidgetService::generate_chat_token] calls.
6700    ///
6701    /// # Example
6702    /// ```
6703    /// # use google_cloud_ces_v1::builder::widget_service::GenerateChatToken;
6704    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6705    ///
6706    /// let builder = prepare_request_builder();
6707    /// let response = builder.send().await?;
6708    /// # Ok(()) }
6709    ///
6710    /// fn prepare_request_builder() -> GenerateChatToken {
6711    ///   # panic!();
6712    ///   // ... details omitted ...
6713    /// }
6714    /// ```
6715    #[derive(Clone, Debug)]
6716    pub struct GenerateChatToken(RequestBuilder<crate::model::GenerateChatTokenRequest>);
6717
6718    impl GenerateChatToken {
6719        pub(crate) fn new(
6720            stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6721        ) -> Self {
6722            Self(RequestBuilder::new(stub))
6723        }
6724
6725        /// Sets the full request, replacing any prior values.
6726        pub fn with_request<V: Into<crate::model::GenerateChatTokenRequest>>(
6727            mut self,
6728            v: V,
6729        ) -> Self {
6730            self.0.request = v.into();
6731            self
6732        }
6733
6734        /// Sets all the options, replacing any prior values.
6735        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6736            self.0.options = v.into();
6737            self
6738        }
6739
6740        /// Sends the request.
6741        pub async fn send(self) -> Result<crate::model::GenerateChatTokenResponse> {
6742            (*self.0.stub)
6743                .generate_chat_token(self.0.request, self.0.options)
6744                .await
6745                .map(crate::Response::into_body)
6746        }
6747
6748        /// Sets the value of [name][crate::model::GenerateChatTokenRequest::name].
6749        ///
6750        /// This is a **required** field for requests.
6751        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6752            self.0.request.name = v.into();
6753            self
6754        }
6755
6756        /// Sets the value of [deployment][crate::model::GenerateChatTokenRequest::deployment].
6757        ///
6758        /// This is a **required** field for requests.
6759        pub fn set_deployment<T: Into<std::string::String>>(mut self, v: T) -> Self {
6760            self.0.request.deployment = v.into();
6761            self
6762        }
6763
6764        /// Sets the value of [recaptcha_token][crate::model::GenerateChatTokenRequest::recaptcha_token].
6765        pub fn set_recaptcha_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6766            self.0.request.recaptcha_token = v.into();
6767            self
6768        }
6769
6770        /// Sets the value of [live_handoff_enabled][crate::model::GenerateChatTokenRequest::live_handoff_enabled].
6771        pub fn set_live_handoff_enabled<T: Into<bool>>(mut self, v: T) -> Self {
6772            self.0.request.live_handoff_enabled = v.into();
6773            self
6774        }
6775    }
6776
6777    #[doc(hidden)]
6778    impl crate::RequestBuilder for GenerateChatToken {
6779        fn request_options(&mut self) -> &mut crate::RequestOptions {
6780            &mut self.0.options
6781        }
6782    }
6783
6784    /// The request builder for [WidgetService::list_locations][crate::client::WidgetService::list_locations] calls.
6785    ///
6786    /// # Example
6787    /// ```
6788    /// # use google_cloud_ces_v1::builder::widget_service::ListLocations;
6789    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6790    /// use google_cloud_gax::paginator::ItemPaginator;
6791    ///
6792    /// let builder = prepare_request_builder();
6793    /// let mut items = builder.by_item();
6794    /// while let Some(result) = items.next().await {
6795    ///   let item = result?;
6796    /// }
6797    /// # Ok(()) }
6798    ///
6799    /// fn prepare_request_builder() -> ListLocations {
6800    ///   # panic!();
6801    ///   // ... details omitted ...
6802    /// }
6803    /// ```
6804    #[derive(Clone, Debug)]
6805    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6806
6807    impl ListLocations {
6808        pub(crate) fn new(
6809            stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6810        ) -> Self {
6811            Self(RequestBuilder::new(stub))
6812        }
6813
6814        /// Sets the full request, replacing any prior values.
6815        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6816            mut self,
6817            v: V,
6818        ) -> Self {
6819            self.0.request = v.into();
6820            self
6821        }
6822
6823        /// Sets all the options, replacing any prior values.
6824        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6825            self.0.options = v.into();
6826            self
6827        }
6828
6829        /// Sends the request.
6830        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6831            (*self.0.stub)
6832                .list_locations(self.0.request, self.0.options)
6833                .await
6834                .map(crate::Response::into_body)
6835        }
6836
6837        /// Streams each page in the collection.
6838        pub fn by_page(
6839            self,
6840        ) -> impl google_cloud_gax::paginator::Paginator<
6841            google_cloud_location::model::ListLocationsResponse,
6842            crate::Error,
6843        > {
6844            use std::clone::Clone;
6845            let token = self.0.request.page_token.clone();
6846            let execute = move |token: String| {
6847                let mut builder = self.clone();
6848                builder.0.request = builder.0.request.set_page_token(token);
6849                builder.send()
6850            };
6851            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6852        }
6853
6854        /// Streams each item in the collection.
6855        pub fn by_item(
6856            self,
6857        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6858            google_cloud_location::model::ListLocationsResponse,
6859            crate::Error,
6860        > {
6861            use google_cloud_gax::paginator::Paginator;
6862            self.by_page().items()
6863        }
6864
6865        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6866        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6867            self.0.request.name = v.into();
6868            self
6869        }
6870
6871        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6872        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6873            self.0.request.filter = v.into();
6874            self
6875        }
6876
6877        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6878        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6879            self.0.request.page_size = v.into();
6880            self
6881        }
6882
6883        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6884        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6885            self.0.request.page_token = v.into();
6886            self
6887        }
6888    }
6889
6890    #[doc(hidden)]
6891    impl crate::RequestBuilder for ListLocations {
6892        fn request_options(&mut self) -> &mut crate::RequestOptions {
6893            &mut self.0.options
6894        }
6895    }
6896
6897    /// The request builder for [WidgetService::get_location][crate::client::WidgetService::get_location] calls.
6898    ///
6899    /// # Example
6900    /// ```
6901    /// # use google_cloud_ces_v1::builder::widget_service::GetLocation;
6902    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6903    ///
6904    /// let builder = prepare_request_builder();
6905    /// let response = builder.send().await?;
6906    /// # Ok(()) }
6907    ///
6908    /// fn prepare_request_builder() -> GetLocation {
6909    ///   # panic!();
6910    ///   // ... details omitted ...
6911    /// }
6912    /// ```
6913    #[derive(Clone, Debug)]
6914    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6915
6916    impl GetLocation {
6917        pub(crate) fn new(
6918            stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6919        ) -> Self {
6920            Self(RequestBuilder::new(stub))
6921        }
6922
6923        /// Sets the full request, replacing any prior values.
6924        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6925            mut self,
6926            v: V,
6927        ) -> Self {
6928            self.0.request = v.into();
6929            self
6930        }
6931
6932        /// Sets all the options, replacing any prior values.
6933        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6934            self.0.options = v.into();
6935            self
6936        }
6937
6938        /// Sends the request.
6939        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6940            (*self.0.stub)
6941                .get_location(self.0.request, self.0.options)
6942                .await
6943                .map(crate::Response::into_body)
6944        }
6945
6946        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6947        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6948            self.0.request.name = v.into();
6949            self
6950        }
6951    }
6952
6953    #[doc(hidden)]
6954    impl crate::RequestBuilder for GetLocation {
6955        fn request_options(&mut self) -> &mut crate::RequestOptions {
6956            &mut self.0.options
6957        }
6958    }
6959
6960    /// The request builder for [WidgetService::list_operations][crate::client::WidgetService::list_operations] calls.
6961    ///
6962    /// # Example
6963    /// ```
6964    /// # use google_cloud_ces_v1::builder::widget_service::ListOperations;
6965    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
6966    /// use google_cloud_gax::paginator::ItemPaginator;
6967    ///
6968    /// let builder = prepare_request_builder();
6969    /// let mut items = builder.by_item();
6970    /// while let Some(result) = items.next().await {
6971    ///   let item = result?;
6972    /// }
6973    /// # Ok(()) }
6974    ///
6975    /// fn prepare_request_builder() -> ListOperations {
6976    ///   # panic!();
6977    ///   // ... details omitted ...
6978    /// }
6979    /// ```
6980    #[derive(Clone, Debug)]
6981    pub struct ListOperations(
6982        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6983    );
6984
6985    impl ListOperations {
6986        pub(crate) fn new(
6987            stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6988        ) -> Self {
6989            Self(RequestBuilder::new(stub))
6990        }
6991
6992        /// Sets the full request, replacing any prior values.
6993        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6994            mut self,
6995            v: V,
6996        ) -> Self {
6997            self.0.request = v.into();
6998            self
6999        }
7000
7001        /// Sets all the options, replacing any prior values.
7002        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7003            self.0.options = v.into();
7004            self
7005        }
7006
7007        /// Sends the request.
7008        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7009            (*self.0.stub)
7010                .list_operations(self.0.request, self.0.options)
7011                .await
7012                .map(crate::Response::into_body)
7013        }
7014
7015        /// Streams each page in the collection.
7016        pub fn by_page(
7017            self,
7018        ) -> impl google_cloud_gax::paginator::Paginator<
7019            google_cloud_longrunning::model::ListOperationsResponse,
7020            crate::Error,
7021        > {
7022            use std::clone::Clone;
7023            let token = self.0.request.page_token.clone();
7024            let execute = move |token: String| {
7025                let mut builder = self.clone();
7026                builder.0.request = builder.0.request.set_page_token(token);
7027                builder.send()
7028            };
7029            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7030        }
7031
7032        /// Streams each item in the collection.
7033        pub fn by_item(
7034            self,
7035        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7036            google_cloud_longrunning::model::ListOperationsResponse,
7037            crate::Error,
7038        > {
7039            use google_cloud_gax::paginator::Paginator;
7040            self.by_page().items()
7041        }
7042
7043        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
7044        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7045            self.0.request.name = v.into();
7046            self
7047        }
7048
7049        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
7050        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7051            self.0.request.filter = v.into();
7052            self
7053        }
7054
7055        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
7056        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7057            self.0.request.page_size = v.into();
7058            self
7059        }
7060
7061        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
7062        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7063            self.0.request.page_token = v.into();
7064            self
7065        }
7066
7067        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
7068        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7069            self.0.request.return_partial_success = v.into();
7070            self
7071        }
7072    }
7073
7074    #[doc(hidden)]
7075    impl crate::RequestBuilder for ListOperations {
7076        fn request_options(&mut self) -> &mut crate::RequestOptions {
7077            &mut self.0.options
7078        }
7079    }
7080
7081    /// The request builder for [WidgetService::get_operation][crate::client::WidgetService::get_operation] calls.
7082    ///
7083    /// # Example
7084    /// ```
7085    /// # use google_cloud_ces_v1::builder::widget_service::GetOperation;
7086    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
7087    ///
7088    /// let builder = prepare_request_builder();
7089    /// let response = builder.send().await?;
7090    /// # Ok(()) }
7091    ///
7092    /// fn prepare_request_builder() -> GetOperation {
7093    ///   # panic!();
7094    ///   // ... details omitted ...
7095    /// }
7096    /// ```
7097    #[derive(Clone, Debug)]
7098    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7099
7100    impl GetOperation {
7101        pub(crate) fn new(
7102            stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
7103        ) -> Self {
7104            Self(RequestBuilder::new(stub))
7105        }
7106
7107        /// Sets the full request, replacing any prior values.
7108        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7109            mut self,
7110            v: V,
7111        ) -> Self {
7112            self.0.request = v.into();
7113            self
7114        }
7115
7116        /// Sets all the options, replacing any prior values.
7117        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7118            self.0.options = v.into();
7119            self
7120        }
7121
7122        /// Sends the request.
7123        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7124            (*self.0.stub)
7125                .get_operation(self.0.request, self.0.options)
7126                .await
7127                .map(crate::Response::into_body)
7128        }
7129
7130        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7131        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7132            self.0.request.name = v.into();
7133            self
7134        }
7135    }
7136
7137    #[doc(hidden)]
7138    impl crate::RequestBuilder for GetOperation {
7139        fn request_options(&mut self) -> &mut crate::RequestOptions {
7140            &mut self.0.options
7141        }
7142    }
7143
7144    /// The request builder for [WidgetService::delete_operation][crate::client::WidgetService::delete_operation] calls.
7145    ///
7146    /// # Example
7147    /// ```
7148    /// # use google_cloud_ces_v1::builder::widget_service::DeleteOperation;
7149    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
7150    ///
7151    /// let builder = prepare_request_builder();
7152    /// let response = builder.send().await?;
7153    /// # Ok(()) }
7154    ///
7155    /// fn prepare_request_builder() -> DeleteOperation {
7156    ///   # panic!();
7157    ///   // ... details omitted ...
7158    /// }
7159    /// ```
7160    #[derive(Clone, Debug)]
7161    pub struct DeleteOperation(
7162        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7163    );
7164
7165    impl DeleteOperation {
7166        pub(crate) fn new(
7167            stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
7168        ) -> Self {
7169            Self(RequestBuilder::new(stub))
7170        }
7171
7172        /// Sets the full request, replacing any prior values.
7173        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7174            mut self,
7175            v: V,
7176        ) -> Self {
7177            self.0.request = v.into();
7178            self
7179        }
7180
7181        /// Sets all the options, replacing any prior values.
7182        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7183            self.0.options = v.into();
7184            self
7185        }
7186
7187        /// Sends the request.
7188        pub async fn send(self) -> Result<()> {
7189            (*self.0.stub)
7190                .delete_operation(self.0.request, self.0.options)
7191                .await
7192                .map(crate::Response::into_body)
7193        }
7194
7195        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
7196        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7197            self.0.request.name = v.into();
7198            self
7199        }
7200    }
7201
7202    #[doc(hidden)]
7203    impl crate::RequestBuilder for DeleteOperation {
7204        fn request_options(&mut self) -> &mut crate::RequestOptions {
7205            &mut self.0.options
7206        }
7207    }
7208
7209    /// The request builder for [WidgetService::cancel_operation][crate::client::WidgetService::cancel_operation] calls.
7210    ///
7211    /// # Example
7212    /// ```
7213    /// # use google_cloud_ces_v1::builder::widget_service::CancelOperation;
7214    /// # async fn sample() -> google_cloud_ces_v1::Result<()> {
7215    ///
7216    /// let builder = prepare_request_builder();
7217    /// let response = builder.send().await?;
7218    /// # Ok(()) }
7219    ///
7220    /// fn prepare_request_builder() -> CancelOperation {
7221    ///   # panic!();
7222    ///   // ... details omitted ...
7223    /// }
7224    /// ```
7225    #[derive(Clone, Debug)]
7226    pub struct CancelOperation(
7227        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7228    );
7229
7230    impl CancelOperation {
7231        pub(crate) fn new(
7232            stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
7233        ) -> Self {
7234            Self(RequestBuilder::new(stub))
7235        }
7236
7237        /// Sets the full request, replacing any prior values.
7238        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7239            mut self,
7240            v: V,
7241        ) -> Self {
7242            self.0.request = v.into();
7243            self
7244        }
7245
7246        /// Sets all the options, replacing any prior values.
7247        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7248            self.0.options = v.into();
7249            self
7250        }
7251
7252        /// Sends the request.
7253        pub async fn send(self) -> Result<()> {
7254            (*self.0.stub)
7255                .cancel_operation(self.0.request, self.0.options)
7256                .await
7257                .map(crate::Response::into_body)
7258        }
7259
7260        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7261        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7262            self.0.request.name = v.into();
7263            self
7264        }
7265    }
7266
7267    #[doc(hidden)]
7268    impl crate::RequestBuilder for CancelOperation {
7269        fn request_options(&mut self) -> &mut crate::RequestOptions {
7270            &mut self.0.options
7271        }
7272    }
7273}