Skip to main content

google_cloud_dialogflow_v2/
builder.rs

1// Copyright 2025 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 [Agents][crate::client::Agents].
18#[cfg(feature = "agents")]
19#[cfg_attr(docsrs, doc(cfg(feature = "agents")))]
20pub mod agents {
21    use crate::Result;
22
23    /// A builder for [Agents][crate::client::Agents].
24    ///
25    /// ```
26    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
27    /// # use google_cloud_dialogflow_v2::*;
28    /// # use builder::agents::ClientBuilder;
29    /// # use client::Agents;
30    /// let builder : ClientBuilder = Agents::builder();
31    /// let client = builder
32    ///     .with_endpoint("https://dialogflow.googleapis.com")
33    ///     .build().await?;
34    /// # Ok(()) }
35    /// ```
36    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
37
38    pub(crate) mod client {
39        use super::super::super::client::Agents;
40        pub struct Factory;
41        impl crate::ClientFactory for Factory {
42            type Client = Agents;
43            type Credentials = gaxi::options::Credentials;
44            async fn build(
45                self,
46                config: gaxi::options::ClientConfig,
47            ) -> crate::ClientBuilderResult<Self::Client> {
48                Self::Client::new(config).await
49            }
50        }
51    }
52
53    /// Common implementation for [crate::client::Agents] request builders.
54    #[derive(Clone, Debug)]
55    pub(crate) struct RequestBuilder<R: std::default::Default> {
56        stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>,
57        request: R,
58        options: crate::RequestOptions,
59    }
60
61    impl<R> RequestBuilder<R>
62    where
63        R: std::default::Default,
64    {
65        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Agents::get_agent][crate::client::Agents::get_agent] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_dialogflow_v2::builder::agents::GetAgent;
79    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> GetAgent {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
92
93    impl GetAgent {
94        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
95            Self(RequestBuilder::new(stub))
96        }
97
98        /// Sets the full request, replacing any prior values.
99        pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
100            self.0.request = v.into();
101            self
102        }
103
104        /// Sets all the options, replacing any prior values.
105        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
106            self.0.options = v.into();
107            self
108        }
109
110        /// Sends the request.
111        pub async fn send(self) -> Result<crate::model::Agent> {
112            (*self.0.stub)
113                .get_agent(self.0.request, self.0.options)
114                .await
115                .map(crate::Response::into_body)
116        }
117
118        /// Sets the value of [parent][crate::model::GetAgentRequest::parent].
119        ///
120        /// This is a **required** field for requests.
121        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
122            self.0.request.parent = v.into();
123            self
124        }
125    }
126
127    #[doc(hidden)]
128    impl crate::RequestBuilder for GetAgent {
129        fn request_options(&mut self) -> &mut crate::RequestOptions {
130            &mut self.0.options
131        }
132    }
133
134    /// The request builder for [Agents::set_agent][crate::client::Agents::set_agent] calls.
135    ///
136    /// # Example
137    /// ```
138    /// # use google_cloud_dialogflow_v2::builder::agents::SetAgent;
139    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
140    ///
141    /// let builder = prepare_request_builder();
142    /// let response = builder.send().await?;
143    /// # Ok(()) }
144    ///
145    /// fn prepare_request_builder() -> SetAgent {
146    ///   # panic!();
147    ///   // ... details omitted ...
148    /// }
149    /// ```
150    #[derive(Clone, Debug)]
151    pub struct SetAgent(RequestBuilder<crate::model::SetAgentRequest>);
152
153    impl SetAgent {
154        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
155            Self(RequestBuilder::new(stub))
156        }
157
158        /// Sets the full request, replacing any prior values.
159        pub fn with_request<V: Into<crate::model::SetAgentRequest>>(mut self, v: V) -> Self {
160            self.0.request = v.into();
161            self
162        }
163
164        /// Sets all the options, replacing any prior values.
165        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
166            self.0.options = v.into();
167            self
168        }
169
170        /// Sends the request.
171        pub async fn send(self) -> Result<crate::model::Agent> {
172            (*self.0.stub)
173                .set_agent(self.0.request, self.0.options)
174                .await
175                .map(crate::Response::into_body)
176        }
177
178        /// Sets the value of [agent][crate::model::SetAgentRequest::agent].
179        ///
180        /// This is a **required** field for requests.
181        pub fn set_agent<T>(mut self, v: T) -> Self
182        where
183            T: std::convert::Into<crate::model::Agent>,
184        {
185            self.0.request.agent = std::option::Option::Some(v.into());
186            self
187        }
188
189        /// Sets or clears the value of [agent][crate::model::SetAgentRequest::agent].
190        ///
191        /// This is a **required** field for requests.
192        pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
193        where
194            T: std::convert::Into<crate::model::Agent>,
195        {
196            self.0.request.agent = v.map(|x| x.into());
197            self
198        }
199
200        /// Sets the value of [update_mask][crate::model::SetAgentRequest::update_mask].
201        pub fn set_update_mask<T>(mut self, v: T) -> Self
202        where
203            T: std::convert::Into<wkt::FieldMask>,
204        {
205            self.0.request.update_mask = std::option::Option::Some(v.into());
206            self
207        }
208
209        /// Sets or clears the value of [update_mask][crate::model::SetAgentRequest::update_mask].
210        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
211        where
212            T: std::convert::Into<wkt::FieldMask>,
213        {
214            self.0.request.update_mask = v.map(|x| x.into());
215            self
216        }
217    }
218
219    #[doc(hidden)]
220    impl crate::RequestBuilder for SetAgent {
221        fn request_options(&mut self) -> &mut crate::RequestOptions {
222            &mut self.0.options
223        }
224    }
225
226    /// The request builder for [Agents::delete_agent][crate::client::Agents::delete_agent] calls.
227    ///
228    /// # Example
229    /// ```
230    /// # use google_cloud_dialogflow_v2::builder::agents::DeleteAgent;
231    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
232    ///
233    /// let builder = prepare_request_builder();
234    /// let response = builder.send().await?;
235    /// # Ok(()) }
236    ///
237    /// fn prepare_request_builder() -> DeleteAgent {
238    ///   # panic!();
239    ///   // ... details omitted ...
240    /// }
241    /// ```
242    #[derive(Clone, Debug)]
243    pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
244
245    impl DeleteAgent {
246        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
247            Self(RequestBuilder::new(stub))
248        }
249
250        /// Sets the full request, replacing any prior values.
251        pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
252            self.0.request = v.into();
253            self
254        }
255
256        /// Sets all the options, replacing any prior values.
257        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
258            self.0.options = v.into();
259            self
260        }
261
262        /// Sends the request.
263        pub async fn send(self) -> Result<()> {
264            (*self.0.stub)
265                .delete_agent(self.0.request, self.0.options)
266                .await
267                .map(crate::Response::into_body)
268        }
269
270        /// Sets the value of [parent][crate::model::DeleteAgentRequest::parent].
271        ///
272        /// This is a **required** field for requests.
273        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
274            self.0.request.parent = v.into();
275            self
276        }
277    }
278
279    #[doc(hidden)]
280    impl crate::RequestBuilder for DeleteAgent {
281        fn request_options(&mut self) -> &mut crate::RequestOptions {
282            &mut self.0.options
283        }
284    }
285
286    /// The request builder for [Agents::search_agents][crate::client::Agents::search_agents] calls.
287    ///
288    /// # Example
289    /// ```
290    /// # use google_cloud_dialogflow_v2::builder::agents::SearchAgents;
291    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
292    /// use google_cloud_gax::paginator::ItemPaginator;
293    ///
294    /// let builder = prepare_request_builder();
295    /// let mut items = builder.by_item();
296    /// while let Some(result) = items.next().await {
297    ///   let item = result?;
298    /// }
299    /// # Ok(()) }
300    ///
301    /// fn prepare_request_builder() -> SearchAgents {
302    ///   # panic!();
303    ///   // ... details omitted ...
304    /// }
305    /// ```
306    #[derive(Clone, Debug)]
307    pub struct SearchAgents(RequestBuilder<crate::model::SearchAgentsRequest>);
308
309    impl SearchAgents {
310        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
311            Self(RequestBuilder::new(stub))
312        }
313
314        /// Sets the full request, replacing any prior values.
315        pub fn with_request<V: Into<crate::model::SearchAgentsRequest>>(mut self, v: V) -> Self {
316            self.0.request = v.into();
317            self
318        }
319
320        /// Sets all the options, replacing any prior values.
321        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
322            self.0.options = v.into();
323            self
324        }
325
326        /// Sends the request.
327        pub async fn send(self) -> Result<crate::model::SearchAgentsResponse> {
328            (*self.0.stub)
329                .search_agents(self.0.request, self.0.options)
330                .await
331                .map(crate::Response::into_body)
332        }
333
334        /// Streams each page in the collection.
335        pub fn by_page(
336            self,
337        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchAgentsResponse, crate::Error>
338        {
339            use std::clone::Clone;
340            let token = self.0.request.page_token.clone();
341            let execute = move |token: String| {
342                let mut builder = self.clone();
343                builder.0.request = builder.0.request.set_page_token(token);
344                builder.send()
345            };
346            google_cloud_gax::paginator::internal::new_paginator(token, execute)
347        }
348
349        /// Streams each item in the collection.
350        pub fn by_item(
351            self,
352        ) -> impl google_cloud_gax::paginator::ItemPaginator<
353            crate::model::SearchAgentsResponse,
354            crate::Error,
355        > {
356            use google_cloud_gax::paginator::Paginator;
357            self.by_page().items()
358        }
359
360        /// Sets the value of [parent][crate::model::SearchAgentsRequest::parent].
361        ///
362        /// This is a **required** field for requests.
363        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
364            self.0.request.parent = v.into();
365            self
366        }
367
368        /// Sets the value of [page_size][crate::model::SearchAgentsRequest::page_size].
369        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
370            self.0.request.page_size = v.into();
371            self
372        }
373
374        /// Sets the value of [page_token][crate::model::SearchAgentsRequest::page_token].
375        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
376            self.0.request.page_token = v.into();
377            self
378        }
379    }
380
381    #[doc(hidden)]
382    impl crate::RequestBuilder for SearchAgents {
383        fn request_options(&mut self) -> &mut crate::RequestOptions {
384            &mut self.0.options
385        }
386    }
387
388    /// The request builder for [Agents::train_agent][crate::client::Agents::train_agent] calls.
389    ///
390    /// # Example
391    /// ```
392    /// # use google_cloud_dialogflow_v2::builder::agents::TrainAgent;
393    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
394    /// use google_cloud_lro::Poller;
395    ///
396    /// let builder = prepare_request_builder();
397    /// let response = builder.poller().until_done().await?;
398    /// # Ok(()) }
399    ///
400    /// fn prepare_request_builder() -> TrainAgent {
401    ///   # panic!();
402    ///   // ... details omitted ...
403    /// }
404    /// ```
405    #[derive(Clone, Debug)]
406    pub struct TrainAgent(RequestBuilder<crate::model::TrainAgentRequest>);
407
408    impl TrainAgent {
409        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
410            Self(RequestBuilder::new(stub))
411        }
412
413        /// Sets the full request, replacing any prior values.
414        pub fn with_request<V: Into<crate::model::TrainAgentRequest>>(mut self, v: V) -> Self {
415            self.0.request = v.into();
416            self
417        }
418
419        /// Sets all the options, replacing any prior values.
420        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
421            self.0.options = v.into();
422            self
423        }
424
425        /// Sends the request.
426        ///
427        /// # Long running operations
428        ///
429        /// This starts, but does not poll, a longrunning operation. More information
430        /// on [train_agent][crate::client::Agents::train_agent].
431        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
432            (*self.0.stub)
433                .train_agent(self.0.request, self.0.options)
434                .await
435                .map(crate::Response::into_body)
436        }
437
438        /// Creates a [Poller][google_cloud_lro::Poller] to work with `train_agent`.
439        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
440            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
441            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
442            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
443            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
444            if let Some(ref mut details) = poller_options.tracing {
445                details.method_name =
446                    "google_cloud_dialogflow_v2::client::Agents::train_agent::until_done";
447            }
448
449            let stub = self.0.stub.clone();
450            let mut options = self.0.options.clone();
451            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
452            let query = move |name| {
453                let stub = stub.clone();
454                let options = options.clone();
455                async {
456                    let op = GetOperation::new(stub)
457                        .set_name(name)
458                        .with_options(options)
459                        .send()
460                        .await?;
461                    Ok(Operation::new(op))
462                }
463            };
464
465            let start = move || async {
466                let op = self.send().await?;
467                Ok(Operation::new(op))
468            };
469
470            use google_cloud_lro::internal::PollerExt;
471            {
472                google_cloud_lro::internal::new_unit_response_poller(
473                    polling_error_policy,
474                    polling_backoff_policy,
475                    start,
476                    query,
477                )
478            }
479            .with_options(poller_options)
480        }
481
482        /// Sets the value of [parent][crate::model::TrainAgentRequest::parent].
483        ///
484        /// This is a **required** field for requests.
485        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
486            self.0.request.parent = v.into();
487            self
488        }
489    }
490
491    #[doc(hidden)]
492    impl crate::RequestBuilder for TrainAgent {
493        fn request_options(&mut self) -> &mut crate::RequestOptions {
494            &mut self.0.options
495        }
496    }
497
498    /// The request builder for [Agents::export_agent][crate::client::Agents::export_agent] calls.
499    ///
500    /// # Example
501    /// ```
502    /// # use google_cloud_dialogflow_v2::builder::agents::ExportAgent;
503    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
504    /// use google_cloud_lro::Poller;
505    ///
506    /// let builder = prepare_request_builder();
507    /// let response = builder.poller().until_done().await?;
508    /// # Ok(()) }
509    ///
510    /// fn prepare_request_builder() -> ExportAgent {
511    ///   # panic!();
512    ///   // ... details omitted ...
513    /// }
514    /// ```
515    #[derive(Clone, Debug)]
516    pub struct ExportAgent(RequestBuilder<crate::model::ExportAgentRequest>);
517
518    impl ExportAgent {
519        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
520            Self(RequestBuilder::new(stub))
521        }
522
523        /// Sets the full request, replacing any prior values.
524        pub fn with_request<V: Into<crate::model::ExportAgentRequest>>(mut self, v: V) -> Self {
525            self.0.request = v.into();
526            self
527        }
528
529        /// Sets all the options, replacing any prior values.
530        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
531            self.0.options = v.into();
532            self
533        }
534
535        /// Sends the request.
536        ///
537        /// # Long running operations
538        ///
539        /// This starts, but does not poll, a longrunning operation. More information
540        /// on [export_agent][crate::client::Agents::export_agent].
541        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
542            (*self.0.stub)
543                .export_agent(self.0.request, self.0.options)
544                .await
545                .map(crate::Response::into_body)
546        }
547
548        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_agent`.
549        pub fn poller(
550            self,
551        ) -> impl google_cloud_lro::Poller<crate::model::ExportAgentResponse, wkt::Struct> {
552            type Operation = google_cloud_lro::internal::Operation<
553                crate::model::ExportAgentResponse,
554                wkt::Struct,
555            >;
556            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
557            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
558            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
559            if let Some(ref mut details) = poller_options.tracing {
560                details.method_name =
561                    "google_cloud_dialogflow_v2::client::Agents::export_agent::until_done";
562            }
563
564            let stub = self.0.stub.clone();
565            let mut options = self.0.options.clone();
566            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
567            let query = move |name| {
568                let stub = stub.clone();
569                let options = options.clone();
570                async {
571                    let op = GetOperation::new(stub)
572                        .set_name(name)
573                        .with_options(options)
574                        .send()
575                        .await?;
576                    Ok(Operation::new(op))
577                }
578            };
579
580            let start = move || async {
581                let op = self.send().await?;
582                Ok(Operation::new(op))
583            };
584
585            use google_cloud_lro::internal::PollerExt;
586            {
587                google_cloud_lro::internal::new_poller(
588                    polling_error_policy,
589                    polling_backoff_policy,
590                    start,
591                    query,
592                )
593            }
594            .with_options(poller_options)
595        }
596
597        /// Sets the value of [parent][crate::model::ExportAgentRequest::parent].
598        ///
599        /// This is a **required** field for requests.
600        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
601            self.0.request.parent = v.into();
602            self
603        }
604
605        /// Sets the value of [agent_uri][crate::model::ExportAgentRequest::agent_uri].
606        ///
607        /// This is a **required** field for requests.
608        pub fn set_agent_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
609            self.0.request.agent_uri = v.into();
610            self
611        }
612    }
613
614    #[doc(hidden)]
615    impl crate::RequestBuilder for ExportAgent {
616        fn request_options(&mut self) -> &mut crate::RequestOptions {
617            &mut self.0.options
618        }
619    }
620
621    /// The request builder for [Agents::import_agent][crate::client::Agents::import_agent] calls.
622    ///
623    /// # Example
624    /// ```
625    /// # use google_cloud_dialogflow_v2::builder::agents::ImportAgent;
626    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
627    /// use google_cloud_lro::Poller;
628    ///
629    /// let builder = prepare_request_builder();
630    /// let response = builder.poller().until_done().await?;
631    /// # Ok(()) }
632    ///
633    /// fn prepare_request_builder() -> ImportAgent {
634    ///   # panic!();
635    ///   // ... details omitted ...
636    /// }
637    /// ```
638    #[derive(Clone, Debug)]
639    pub struct ImportAgent(RequestBuilder<crate::model::ImportAgentRequest>);
640
641    impl ImportAgent {
642        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
643            Self(RequestBuilder::new(stub))
644        }
645
646        /// Sets the full request, replacing any prior values.
647        pub fn with_request<V: Into<crate::model::ImportAgentRequest>>(mut self, v: V) -> Self {
648            self.0.request = v.into();
649            self
650        }
651
652        /// Sets all the options, replacing any prior values.
653        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
654            self.0.options = v.into();
655            self
656        }
657
658        /// Sends the request.
659        ///
660        /// # Long running operations
661        ///
662        /// This starts, but does not poll, a longrunning operation. More information
663        /// on [import_agent][crate::client::Agents::import_agent].
664        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
665            (*self.0.stub)
666                .import_agent(self.0.request, self.0.options)
667                .await
668                .map(crate::Response::into_body)
669        }
670
671        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_agent`.
672        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
673            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
674            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
675            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
676            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
677            if let Some(ref mut details) = poller_options.tracing {
678                details.method_name =
679                    "google_cloud_dialogflow_v2::client::Agents::import_agent::until_done";
680            }
681
682            let stub = self.0.stub.clone();
683            let mut options = self.0.options.clone();
684            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
685            let query = move |name| {
686                let stub = stub.clone();
687                let options = options.clone();
688                async {
689                    let op = GetOperation::new(stub)
690                        .set_name(name)
691                        .with_options(options)
692                        .send()
693                        .await?;
694                    Ok(Operation::new(op))
695                }
696            };
697
698            let start = move || async {
699                let op = self.send().await?;
700                Ok(Operation::new(op))
701            };
702
703            use google_cloud_lro::internal::PollerExt;
704            {
705                google_cloud_lro::internal::new_unit_response_poller(
706                    polling_error_policy,
707                    polling_backoff_policy,
708                    start,
709                    query,
710                )
711            }
712            .with_options(poller_options)
713        }
714
715        /// Sets the value of [parent][crate::model::ImportAgentRequest::parent].
716        ///
717        /// This is a **required** field for requests.
718        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
719            self.0.request.parent = v.into();
720            self
721        }
722
723        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent].
724        ///
725        /// Note that all the setters affecting `agent` are
726        /// mutually exclusive.
727        pub fn set_agent<T: Into<Option<crate::model::import_agent_request::Agent>>>(
728            mut self,
729            v: T,
730        ) -> Self {
731            self.0.request.agent = v.into();
732            self
733        }
734
735        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
736        /// to hold a `AgentUri`.
737        ///
738        /// Note that all the setters affecting `agent` are
739        /// mutually exclusive.
740        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
741            self.0.request = self.0.request.set_agent_uri(v);
742            self
743        }
744
745        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
746        /// to hold a `AgentContent`.
747        ///
748        /// Note that all the setters affecting `agent` are
749        /// mutually exclusive.
750        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
751            self.0.request = self.0.request.set_agent_content(v);
752            self
753        }
754    }
755
756    #[doc(hidden)]
757    impl crate::RequestBuilder for ImportAgent {
758        fn request_options(&mut self) -> &mut crate::RequestOptions {
759            &mut self.0.options
760        }
761    }
762
763    /// The request builder for [Agents::restore_agent][crate::client::Agents::restore_agent] calls.
764    ///
765    /// # Example
766    /// ```
767    /// # use google_cloud_dialogflow_v2::builder::agents::RestoreAgent;
768    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
769    /// use google_cloud_lro::Poller;
770    ///
771    /// let builder = prepare_request_builder();
772    /// let response = builder.poller().until_done().await?;
773    /// # Ok(()) }
774    ///
775    /// fn prepare_request_builder() -> RestoreAgent {
776    ///   # panic!();
777    ///   // ... details omitted ...
778    /// }
779    /// ```
780    #[derive(Clone, Debug)]
781    pub struct RestoreAgent(RequestBuilder<crate::model::RestoreAgentRequest>);
782
783    impl RestoreAgent {
784        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
785            Self(RequestBuilder::new(stub))
786        }
787
788        /// Sets the full request, replacing any prior values.
789        pub fn with_request<V: Into<crate::model::RestoreAgentRequest>>(mut self, v: V) -> Self {
790            self.0.request = v.into();
791            self
792        }
793
794        /// Sets all the options, replacing any prior values.
795        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
796            self.0.options = v.into();
797            self
798        }
799
800        /// Sends the request.
801        ///
802        /// # Long running operations
803        ///
804        /// This starts, but does not poll, a longrunning operation. More information
805        /// on [restore_agent][crate::client::Agents::restore_agent].
806        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
807            (*self.0.stub)
808                .restore_agent(self.0.request, self.0.options)
809                .await
810                .map(crate::Response::into_body)
811        }
812
813        /// Creates a [Poller][google_cloud_lro::Poller] to work with `restore_agent`.
814        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
815            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
816            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
817            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
818            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
819            if let Some(ref mut details) = poller_options.tracing {
820                details.method_name =
821                    "google_cloud_dialogflow_v2::client::Agents::restore_agent::until_done";
822            }
823
824            let stub = self.0.stub.clone();
825            let mut options = self.0.options.clone();
826            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
827            let query = move |name| {
828                let stub = stub.clone();
829                let options = options.clone();
830                async {
831                    let op = GetOperation::new(stub)
832                        .set_name(name)
833                        .with_options(options)
834                        .send()
835                        .await?;
836                    Ok(Operation::new(op))
837                }
838            };
839
840            let start = move || async {
841                let op = self.send().await?;
842                Ok(Operation::new(op))
843            };
844
845            use google_cloud_lro::internal::PollerExt;
846            {
847                google_cloud_lro::internal::new_unit_response_poller(
848                    polling_error_policy,
849                    polling_backoff_policy,
850                    start,
851                    query,
852                )
853            }
854            .with_options(poller_options)
855        }
856
857        /// Sets the value of [parent][crate::model::RestoreAgentRequest::parent].
858        ///
859        /// This is a **required** field for requests.
860        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
861            self.0.request.parent = v.into();
862            self
863        }
864
865        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent].
866        ///
867        /// Note that all the setters affecting `agent` are
868        /// mutually exclusive.
869        pub fn set_agent<T: Into<Option<crate::model::restore_agent_request::Agent>>>(
870            mut self,
871            v: T,
872        ) -> Self {
873            self.0.request.agent = v.into();
874            self
875        }
876
877        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
878        /// to hold a `AgentUri`.
879        ///
880        /// Note that all the setters affecting `agent` are
881        /// mutually exclusive.
882        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
883            self.0.request = self.0.request.set_agent_uri(v);
884            self
885        }
886
887        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
888        /// to hold a `AgentContent`.
889        ///
890        /// Note that all the setters affecting `agent` are
891        /// mutually exclusive.
892        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
893            self.0.request = self.0.request.set_agent_content(v);
894            self
895        }
896    }
897
898    #[doc(hidden)]
899    impl crate::RequestBuilder for RestoreAgent {
900        fn request_options(&mut self) -> &mut crate::RequestOptions {
901            &mut self.0.options
902        }
903    }
904
905    /// The request builder for [Agents::get_validation_result][crate::client::Agents::get_validation_result] calls.
906    ///
907    /// # Example
908    /// ```
909    /// # use google_cloud_dialogflow_v2::builder::agents::GetValidationResult;
910    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
911    ///
912    /// let builder = prepare_request_builder();
913    /// let response = builder.send().await?;
914    /// # Ok(()) }
915    ///
916    /// fn prepare_request_builder() -> GetValidationResult {
917    ///   # panic!();
918    ///   // ... details omitted ...
919    /// }
920    /// ```
921    #[derive(Clone, Debug)]
922    pub struct GetValidationResult(RequestBuilder<crate::model::GetValidationResultRequest>);
923
924    impl GetValidationResult {
925        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
926            Self(RequestBuilder::new(stub))
927        }
928
929        /// Sets the full request, replacing any prior values.
930        pub fn with_request<V: Into<crate::model::GetValidationResultRequest>>(
931            mut self,
932            v: V,
933        ) -> Self {
934            self.0.request = v.into();
935            self
936        }
937
938        /// Sets all the options, replacing any prior values.
939        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
940            self.0.options = v.into();
941            self
942        }
943
944        /// Sends the request.
945        pub async fn send(self) -> Result<crate::model::ValidationResult> {
946            (*self.0.stub)
947                .get_validation_result(self.0.request, self.0.options)
948                .await
949                .map(crate::Response::into_body)
950        }
951
952        /// Sets the value of [parent][crate::model::GetValidationResultRequest::parent].
953        ///
954        /// This is a **required** field for requests.
955        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
956            self.0.request.parent = v.into();
957            self
958        }
959
960        /// Sets the value of [language_code][crate::model::GetValidationResultRequest::language_code].
961        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
962            self.0.request.language_code = v.into();
963            self
964        }
965    }
966
967    #[doc(hidden)]
968    impl crate::RequestBuilder for GetValidationResult {
969        fn request_options(&mut self) -> &mut crate::RequestOptions {
970            &mut self.0.options
971        }
972    }
973
974    /// The request builder for [Agents::list_locations][crate::client::Agents::list_locations] calls.
975    ///
976    /// # Example
977    /// ```
978    /// # use google_cloud_dialogflow_v2::builder::agents::ListLocations;
979    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
980    /// use google_cloud_gax::paginator::ItemPaginator;
981    ///
982    /// let builder = prepare_request_builder();
983    /// let mut items = builder.by_item();
984    /// while let Some(result) = items.next().await {
985    ///   let item = result?;
986    /// }
987    /// # Ok(()) }
988    ///
989    /// fn prepare_request_builder() -> ListLocations {
990    ///   # panic!();
991    ///   // ... details omitted ...
992    /// }
993    /// ```
994    #[derive(Clone, Debug)]
995    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
996
997    impl ListLocations {
998        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
999            Self(RequestBuilder::new(stub))
1000        }
1001
1002        /// Sets the full request, replacing any prior values.
1003        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1004            mut self,
1005            v: V,
1006        ) -> Self {
1007            self.0.request = v.into();
1008            self
1009        }
1010
1011        /// Sets all the options, replacing any prior values.
1012        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1013            self.0.options = v.into();
1014            self
1015        }
1016
1017        /// Sends the request.
1018        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1019            (*self.0.stub)
1020                .list_locations(self.0.request, self.0.options)
1021                .await
1022                .map(crate::Response::into_body)
1023        }
1024
1025        /// Streams each page in the collection.
1026        pub fn by_page(
1027            self,
1028        ) -> impl google_cloud_gax::paginator::Paginator<
1029            google_cloud_location::model::ListLocationsResponse,
1030            crate::Error,
1031        > {
1032            use std::clone::Clone;
1033            let token = self.0.request.page_token.clone();
1034            let execute = move |token: String| {
1035                let mut builder = self.clone();
1036                builder.0.request = builder.0.request.set_page_token(token);
1037                builder.send()
1038            };
1039            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1040        }
1041
1042        /// Streams each item in the collection.
1043        pub fn by_item(
1044            self,
1045        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1046            google_cloud_location::model::ListLocationsResponse,
1047            crate::Error,
1048        > {
1049            use google_cloud_gax::paginator::Paginator;
1050            self.by_page().items()
1051        }
1052
1053        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1054        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1055            self.0.request.name = v.into();
1056            self
1057        }
1058
1059        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1060        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1061            self.0.request.filter = v.into();
1062            self
1063        }
1064
1065        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1066        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1067            self.0.request.page_size = v.into();
1068            self
1069        }
1070
1071        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1072        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1073            self.0.request.page_token = v.into();
1074            self
1075        }
1076    }
1077
1078    #[doc(hidden)]
1079    impl crate::RequestBuilder for ListLocations {
1080        fn request_options(&mut self) -> &mut crate::RequestOptions {
1081            &mut self.0.options
1082        }
1083    }
1084
1085    /// The request builder for [Agents::get_location][crate::client::Agents::get_location] calls.
1086    ///
1087    /// # Example
1088    /// ```
1089    /// # use google_cloud_dialogflow_v2::builder::agents::GetLocation;
1090    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1091    ///
1092    /// let builder = prepare_request_builder();
1093    /// let response = builder.send().await?;
1094    /// # Ok(()) }
1095    ///
1096    /// fn prepare_request_builder() -> GetLocation {
1097    ///   # panic!();
1098    ///   // ... details omitted ...
1099    /// }
1100    /// ```
1101    #[derive(Clone, Debug)]
1102    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1103
1104    impl GetLocation {
1105        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1106            Self(RequestBuilder::new(stub))
1107        }
1108
1109        /// Sets the full request, replacing any prior values.
1110        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1111            mut self,
1112            v: V,
1113        ) -> Self {
1114            self.0.request = v.into();
1115            self
1116        }
1117
1118        /// Sets all the options, replacing any prior values.
1119        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1120            self.0.options = v.into();
1121            self
1122        }
1123
1124        /// Sends the request.
1125        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1126            (*self.0.stub)
1127                .get_location(self.0.request, self.0.options)
1128                .await
1129                .map(crate::Response::into_body)
1130        }
1131
1132        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1133        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1134            self.0.request.name = v.into();
1135            self
1136        }
1137    }
1138
1139    #[doc(hidden)]
1140    impl crate::RequestBuilder for GetLocation {
1141        fn request_options(&mut self) -> &mut crate::RequestOptions {
1142            &mut self.0.options
1143        }
1144    }
1145
1146    /// The request builder for [Agents::list_operations][crate::client::Agents::list_operations] calls.
1147    ///
1148    /// # Example
1149    /// ```
1150    /// # use google_cloud_dialogflow_v2::builder::agents::ListOperations;
1151    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1152    /// use google_cloud_gax::paginator::ItemPaginator;
1153    ///
1154    /// let builder = prepare_request_builder();
1155    /// let mut items = builder.by_item();
1156    /// while let Some(result) = items.next().await {
1157    ///   let item = result?;
1158    /// }
1159    /// # Ok(()) }
1160    ///
1161    /// fn prepare_request_builder() -> ListOperations {
1162    ///   # panic!();
1163    ///   // ... details omitted ...
1164    /// }
1165    /// ```
1166    #[derive(Clone, Debug)]
1167    pub struct ListOperations(
1168        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1169    );
1170
1171    impl ListOperations {
1172        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1173            Self(RequestBuilder::new(stub))
1174        }
1175
1176        /// Sets the full request, replacing any prior values.
1177        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1178            mut self,
1179            v: V,
1180        ) -> Self {
1181            self.0.request = v.into();
1182            self
1183        }
1184
1185        /// Sets all the options, replacing any prior values.
1186        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1187            self.0.options = v.into();
1188            self
1189        }
1190
1191        /// Sends the request.
1192        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1193            (*self.0.stub)
1194                .list_operations(self.0.request, self.0.options)
1195                .await
1196                .map(crate::Response::into_body)
1197        }
1198
1199        /// Streams each page in the collection.
1200        pub fn by_page(
1201            self,
1202        ) -> impl google_cloud_gax::paginator::Paginator<
1203            google_cloud_longrunning::model::ListOperationsResponse,
1204            crate::Error,
1205        > {
1206            use std::clone::Clone;
1207            let token = self.0.request.page_token.clone();
1208            let execute = move |token: String| {
1209                let mut builder = self.clone();
1210                builder.0.request = builder.0.request.set_page_token(token);
1211                builder.send()
1212            };
1213            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1214        }
1215
1216        /// Streams each item in the collection.
1217        pub fn by_item(
1218            self,
1219        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1220            google_cloud_longrunning::model::ListOperationsResponse,
1221            crate::Error,
1222        > {
1223            use google_cloud_gax::paginator::Paginator;
1224            self.by_page().items()
1225        }
1226
1227        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1228        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1229            self.0.request.name = v.into();
1230            self
1231        }
1232
1233        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1234        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1235            self.0.request.filter = v.into();
1236            self
1237        }
1238
1239        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1240        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1241            self.0.request.page_size = v.into();
1242            self
1243        }
1244
1245        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1246        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1247            self.0.request.page_token = v.into();
1248            self
1249        }
1250
1251        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1252        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1253            self.0.request.return_partial_success = v.into();
1254            self
1255        }
1256    }
1257
1258    #[doc(hidden)]
1259    impl crate::RequestBuilder for ListOperations {
1260        fn request_options(&mut self) -> &mut crate::RequestOptions {
1261            &mut self.0.options
1262        }
1263    }
1264
1265    /// The request builder for [Agents::get_operation][crate::client::Agents::get_operation] calls.
1266    ///
1267    /// # Example
1268    /// ```
1269    /// # use google_cloud_dialogflow_v2::builder::agents::GetOperation;
1270    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1271    ///
1272    /// let builder = prepare_request_builder();
1273    /// let response = builder.send().await?;
1274    /// # Ok(()) }
1275    ///
1276    /// fn prepare_request_builder() -> GetOperation {
1277    ///   # panic!();
1278    ///   // ... details omitted ...
1279    /// }
1280    /// ```
1281    #[derive(Clone, Debug)]
1282    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1283
1284    impl GetOperation {
1285        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1286            Self(RequestBuilder::new(stub))
1287        }
1288
1289        /// Sets the full request, replacing any prior values.
1290        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1291            mut self,
1292            v: V,
1293        ) -> Self {
1294            self.0.request = v.into();
1295            self
1296        }
1297
1298        /// Sets all the options, replacing any prior values.
1299        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1300            self.0.options = v.into();
1301            self
1302        }
1303
1304        /// Sends the request.
1305        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1306            (*self.0.stub)
1307                .get_operation(self.0.request, self.0.options)
1308                .await
1309                .map(crate::Response::into_body)
1310        }
1311
1312        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1313        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1314            self.0.request.name = v.into();
1315            self
1316        }
1317    }
1318
1319    #[doc(hidden)]
1320    impl crate::RequestBuilder for GetOperation {
1321        fn request_options(&mut self) -> &mut crate::RequestOptions {
1322            &mut self.0.options
1323        }
1324    }
1325
1326    /// The request builder for [Agents::cancel_operation][crate::client::Agents::cancel_operation] calls.
1327    ///
1328    /// # Example
1329    /// ```
1330    /// # use google_cloud_dialogflow_v2::builder::agents::CancelOperation;
1331    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1332    ///
1333    /// let builder = prepare_request_builder();
1334    /// let response = builder.send().await?;
1335    /// # Ok(()) }
1336    ///
1337    /// fn prepare_request_builder() -> CancelOperation {
1338    ///   # panic!();
1339    ///   // ... details omitted ...
1340    /// }
1341    /// ```
1342    #[derive(Clone, Debug)]
1343    pub struct CancelOperation(
1344        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1345    );
1346
1347    impl CancelOperation {
1348        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1349            Self(RequestBuilder::new(stub))
1350        }
1351
1352        /// Sets the full request, replacing any prior values.
1353        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1354            mut self,
1355            v: V,
1356        ) -> Self {
1357            self.0.request = v.into();
1358            self
1359        }
1360
1361        /// Sets all the options, replacing any prior values.
1362        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1363            self.0.options = v.into();
1364            self
1365        }
1366
1367        /// Sends the request.
1368        pub async fn send(self) -> Result<()> {
1369            (*self.0.stub)
1370                .cancel_operation(self.0.request, self.0.options)
1371                .await
1372                .map(crate::Response::into_body)
1373        }
1374
1375        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1376        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1377            self.0.request.name = v.into();
1378            self
1379        }
1380    }
1381
1382    #[doc(hidden)]
1383    impl crate::RequestBuilder for CancelOperation {
1384        fn request_options(&mut self) -> &mut crate::RequestOptions {
1385            &mut self.0.options
1386        }
1387    }
1388}
1389
1390/// Request and client builders for [AnswerRecords][crate::client::AnswerRecords].
1391#[cfg(feature = "answer-records")]
1392#[cfg_attr(docsrs, doc(cfg(feature = "answer-records")))]
1393pub mod answer_records {
1394    use crate::Result;
1395
1396    /// A builder for [AnswerRecords][crate::client::AnswerRecords].
1397    ///
1398    /// ```
1399    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1400    /// # use google_cloud_dialogflow_v2::*;
1401    /// # use builder::answer_records::ClientBuilder;
1402    /// # use client::AnswerRecords;
1403    /// let builder : ClientBuilder = AnswerRecords::builder();
1404    /// let client = builder
1405    ///     .with_endpoint("https://dialogflow.googleapis.com")
1406    ///     .build().await?;
1407    /// # Ok(()) }
1408    /// ```
1409    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1410
1411    pub(crate) mod client {
1412        use super::super::super::client::AnswerRecords;
1413        pub struct Factory;
1414        impl crate::ClientFactory for Factory {
1415            type Client = AnswerRecords;
1416            type Credentials = gaxi::options::Credentials;
1417            async fn build(
1418                self,
1419                config: gaxi::options::ClientConfig,
1420            ) -> crate::ClientBuilderResult<Self::Client> {
1421                Self::Client::new(config).await
1422            }
1423        }
1424    }
1425
1426    /// Common implementation for [crate::client::AnswerRecords] request builders.
1427    #[derive(Clone, Debug)]
1428    pub(crate) struct RequestBuilder<R: std::default::Default> {
1429        stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1430        request: R,
1431        options: crate::RequestOptions,
1432    }
1433
1434    impl<R> RequestBuilder<R>
1435    where
1436        R: std::default::Default,
1437    {
1438        pub(crate) fn new(
1439            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1440        ) -> Self {
1441            Self {
1442                stub,
1443                request: R::default(),
1444                options: crate::RequestOptions::default(),
1445            }
1446        }
1447    }
1448
1449    /// The request builder for [AnswerRecords::list_answer_records][crate::client::AnswerRecords::list_answer_records] calls.
1450    ///
1451    /// # Example
1452    /// ```
1453    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListAnswerRecords;
1454    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1455    /// use google_cloud_gax::paginator::ItemPaginator;
1456    ///
1457    /// let builder = prepare_request_builder();
1458    /// let mut items = builder.by_item();
1459    /// while let Some(result) = items.next().await {
1460    ///   let item = result?;
1461    /// }
1462    /// # Ok(()) }
1463    ///
1464    /// fn prepare_request_builder() -> ListAnswerRecords {
1465    ///   # panic!();
1466    ///   // ... details omitted ...
1467    /// }
1468    /// ```
1469    #[derive(Clone, Debug)]
1470    pub struct ListAnswerRecords(RequestBuilder<crate::model::ListAnswerRecordsRequest>);
1471
1472    impl ListAnswerRecords {
1473        pub(crate) fn new(
1474            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1475        ) -> Self {
1476            Self(RequestBuilder::new(stub))
1477        }
1478
1479        /// Sets the full request, replacing any prior values.
1480        pub fn with_request<V: Into<crate::model::ListAnswerRecordsRequest>>(
1481            mut self,
1482            v: V,
1483        ) -> Self {
1484            self.0.request = v.into();
1485            self
1486        }
1487
1488        /// Sets all the options, replacing any prior values.
1489        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1490            self.0.options = v.into();
1491            self
1492        }
1493
1494        /// Sends the request.
1495        pub async fn send(self) -> Result<crate::model::ListAnswerRecordsResponse> {
1496            (*self.0.stub)
1497                .list_answer_records(self.0.request, self.0.options)
1498                .await
1499                .map(crate::Response::into_body)
1500        }
1501
1502        /// Streams each page in the collection.
1503        pub fn by_page(
1504            self,
1505        ) -> impl google_cloud_gax::paginator::Paginator<
1506            crate::model::ListAnswerRecordsResponse,
1507            crate::Error,
1508        > {
1509            use std::clone::Clone;
1510            let token = self.0.request.page_token.clone();
1511            let execute = move |token: String| {
1512                let mut builder = self.clone();
1513                builder.0.request = builder.0.request.set_page_token(token);
1514                builder.send()
1515            };
1516            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1517        }
1518
1519        /// Streams each item in the collection.
1520        pub fn by_item(
1521            self,
1522        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1523            crate::model::ListAnswerRecordsResponse,
1524            crate::Error,
1525        > {
1526            use google_cloud_gax::paginator::Paginator;
1527            self.by_page().items()
1528        }
1529
1530        /// Sets the value of [parent][crate::model::ListAnswerRecordsRequest::parent].
1531        ///
1532        /// This is a **required** field for requests.
1533        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1534            self.0.request.parent = v.into();
1535            self
1536        }
1537
1538        /// Sets the value of [filter][crate::model::ListAnswerRecordsRequest::filter].
1539        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540            self.0.request.filter = v.into();
1541            self
1542        }
1543
1544        /// Sets the value of [page_size][crate::model::ListAnswerRecordsRequest::page_size].
1545        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1546            self.0.request.page_size = v.into();
1547            self
1548        }
1549
1550        /// Sets the value of [page_token][crate::model::ListAnswerRecordsRequest::page_token].
1551        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1552            self.0.request.page_token = v.into();
1553            self
1554        }
1555    }
1556
1557    #[doc(hidden)]
1558    impl crate::RequestBuilder for ListAnswerRecords {
1559        fn request_options(&mut self) -> &mut crate::RequestOptions {
1560            &mut self.0.options
1561        }
1562    }
1563
1564    /// The request builder for [AnswerRecords::update_answer_record][crate::client::AnswerRecords::update_answer_record] calls.
1565    ///
1566    /// # Example
1567    /// ```
1568    /// # use google_cloud_dialogflow_v2::builder::answer_records::UpdateAnswerRecord;
1569    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1570    ///
1571    /// let builder = prepare_request_builder();
1572    /// let response = builder.send().await?;
1573    /// # Ok(()) }
1574    ///
1575    /// fn prepare_request_builder() -> UpdateAnswerRecord {
1576    ///   # panic!();
1577    ///   // ... details omitted ...
1578    /// }
1579    /// ```
1580    #[derive(Clone, Debug)]
1581    pub struct UpdateAnswerRecord(RequestBuilder<crate::model::UpdateAnswerRecordRequest>);
1582
1583    impl UpdateAnswerRecord {
1584        pub(crate) fn new(
1585            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1586        ) -> Self {
1587            Self(RequestBuilder::new(stub))
1588        }
1589
1590        /// Sets the full request, replacing any prior values.
1591        pub fn with_request<V: Into<crate::model::UpdateAnswerRecordRequest>>(
1592            mut self,
1593            v: V,
1594        ) -> Self {
1595            self.0.request = v.into();
1596            self
1597        }
1598
1599        /// Sets all the options, replacing any prior values.
1600        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1601            self.0.options = v.into();
1602            self
1603        }
1604
1605        /// Sends the request.
1606        pub async fn send(self) -> Result<crate::model::AnswerRecord> {
1607            (*self.0.stub)
1608                .update_answer_record(self.0.request, self.0.options)
1609                .await
1610                .map(crate::Response::into_body)
1611        }
1612
1613        /// Sets the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1614        ///
1615        /// This is a **required** field for requests.
1616        pub fn set_answer_record<T>(mut self, v: T) -> Self
1617        where
1618            T: std::convert::Into<crate::model::AnswerRecord>,
1619        {
1620            self.0.request.answer_record = std::option::Option::Some(v.into());
1621            self
1622        }
1623
1624        /// Sets or clears the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1625        ///
1626        /// This is a **required** field for requests.
1627        pub fn set_or_clear_answer_record<T>(mut self, v: std::option::Option<T>) -> Self
1628        where
1629            T: std::convert::Into<crate::model::AnswerRecord>,
1630        {
1631            self.0.request.answer_record = v.map(|x| x.into());
1632            self
1633        }
1634
1635        /// Sets the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1636        ///
1637        /// This is a **required** field for requests.
1638        pub fn set_update_mask<T>(mut self, v: T) -> Self
1639        where
1640            T: std::convert::Into<wkt::FieldMask>,
1641        {
1642            self.0.request.update_mask = std::option::Option::Some(v.into());
1643            self
1644        }
1645
1646        /// Sets or clears the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1647        ///
1648        /// This is a **required** field for requests.
1649        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1650        where
1651            T: std::convert::Into<wkt::FieldMask>,
1652        {
1653            self.0.request.update_mask = v.map(|x| x.into());
1654            self
1655        }
1656    }
1657
1658    #[doc(hidden)]
1659    impl crate::RequestBuilder for UpdateAnswerRecord {
1660        fn request_options(&mut self) -> &mut crate::RequestOptions {
1661            &mut self.0.options
1662        }
1663    }
1664
1665    /// The request builder for [AnswerRecords::list_locations][crate::client::AnswerRecords::list_locations] calls.
1666    ///
1667    /// # Example
1668    /// ```
1669    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListLocations;
1670    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1671    /// use google_cloud_gax::paginator::ItemPaginator;
1672    ///
1673    /// let builder = prepare_request_builder();
1674    /// let mut items = builder.by_item();
1675    /// while let Some(result) = items.next().await {
1676    ///   let item = result?;
1677    /// }
1678    /// # Ok(()) }
1679    ///
1680    /// fn prepare_request_builder() -> ListLocations {
1681    ///   # panic!();
1682    ///   // ... details omitted ...
1683    /// }
1684    /// ```
1685    #[derive(Clone, Debug)]
1686    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1687
1688    impl ListLocations {
1689        pub(crate) fn new(
1690            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1691        ) -> Self {
1692            Self(RequestBuilder::new(stub))
1693        }
1694
1695        /// Sets the full request, replacing any prior values.
1696        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1697            mut self,
1698            v: V,
1699        ) -> Self {
1700            self.0.request = v.into();
1701            self
1702        }
1703
1704        /// Sets all the options, replacing any prior values.
1705        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1706            self.0.options = v.into();
1707            self
1708        }
1709
1710        /// Sends the request.
1711        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1712            (*self.0.stub)
1713                .list_locations(self.0.request, self.0.options)
1714                .await
1715                .map(crate::Response::into_body)
1716        }
1717
1718        /// Streams each page in the collection.
1719        pub fn by_page(
1720            self,
1721        ) -> impl google_cloud_gax::paginator::Paginator<
1722            google_cloud_location::model::ListLocationsResponse,
1723            crate::Error,
1724        > {
1725            use std::clone::Clone;
1726            let token = self.0.request.page_token.clone();
1727            let execute = move |token: String| {
1728                let mut builder = self.clone();
1729                builder.0.request = builder.0.request.set_page_token(token);
1730                builder.send()
1731            };
1732            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1733        }
1734
1735        /// Streams each item in the collection.
1736        pub fn by_item(
1737            self,
1738        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1739            google_cloud_location::model::ListLocationsResponse,
1740            crate::Error,
1741        > {
1742            use google_cloud_gax::paginator::Paginator;
1743            self.by_page().items()
1744        }
1745
1746        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1747        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1748            self.0.request.name = v.into();
1749            self
1750        }
1751
1752        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1753        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1754            self.0.request.filter = v.into();
1755            self
1756        }
1757
1758        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1759        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1760            self.0.request.page_size = v.into();
1761            self
1762        }
1763
1764        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1765        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1766            self.0.request.page_token = v.into();
1767            self
1768        }
1769    }
1770
1771    #[doc(hidden)]
1772    impl crate::RequestBuilder for ListLocations {
1773        fn request_options(&mut self) -> &mut crate::RequestOptions {
1774            &mut self.0.options
1775        }
1776    }
1777
1778    /// The request builder for [AnswerRecords::get_location][crate::client::AnswerRecords::get_location] calls.
1779    ///
1780    /// # Example
1781    /// ```
1782    /// # use google_cloud_dialogflow_v2::builder::answer_records::GetLocation;
1783    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1784    ///
1785    /// let builder = prepare_request_builder();
1786    /// let response = builder.send().await?;
1787    /// # Ok(()) }
1788    ///
1789    /// fn prepare_request_builder() -> GetLocation {
1790    ///   # panic!();
1791    ///   // ... details omitted ...
1792    /// }
1793    /// ```
1794    #[derive(Clone, Debug)]
1795    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1796
1797    impl GetLocation {
1798        pub(crate) fn new(
1799            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1800        ) -> Self {
1801            Self(RequestBuilder::new(stub))
1802        }
1803
1804        /// Sets the full request, replacing any prior values.
1805        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1806            mut self,
1807            v: V,
1808        ) -> Self {
1809            self.0.request = v.into();
1810            self
1811        }
1812
1813        /// Sets all the options, replacing any prior values.
1814        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1815            self.0.options = v.into();
1816            self
1817        }
1818
1819        /// Sends the request.
1820        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1821            (*self.0.stub)
1822                .get_location(self.0.request, self.0.options)
1823                .await
1824                .map(crate::Response::into_body)
1825        }
1826
1827        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1828        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829            self.0.request.name = v.into();
1830            self
1831        }
1832    }
1833
1834    #[doc(hidden)]
1835    impl crate::RequestBuilder for GetLocation {
1836        fn request_options(&mut self) -> &mut crate::RequestOptions {
1837            &mut self.0.options
1838        }
1839    }
1840
1841    /// The request builder for [AnswerRecords::list_operations][crate::client::AnswerRecords::list_operations] calls.
1842    ///
1843    /// # Example
1844    /// ```
1845    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListOperations;
1846    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1847    /// use google_cloud_gax::paginator::ItemPaginator;
1848    ///
1849    /// let builder = prepare_request_builder();
1850    /// let mut items = builder.by_item();
1851    /// while let Some(result) = items.next().await {
1852    ///   let item = result?;
1853    /// }
1854    /// # Ok(()) }
1855    ///
1856    /// fn prepare_request_builder() -> ListOperations {
1857    ///   # panic!();
1858    ///   // ... details omitted ...
1859    /// }
1860    /// ```
1861    #[derive(Clone, Debug)]
1862    pub struct ListOperations(
1863        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1864    );
1865
1866    impl ListOperations {
1867        pub(crate) fn new(
1868            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1869        ) -> Self {
1870            Self(RequestBuilder::new(stub))
1871        }
1872
1873        /// Sets the full request, replacing any prior values.
1874        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1875            mut self,
1876            v: V,
1877        ) -> Self {
1878            self.0.request = v.into();
1879            self
1880        }
1881
1882        /// Sets all the options, replacing any prior values.
1883        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1884            self.0.options = v.into();
1885            self
1886        }
1887
1888        /// Sends the request.
1889        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1890            (*self.0.stub)
1891                .list_operations(self.0.request, self.0.options)
1892                .await
1893                .map(crate::Response::into_body)
1894        }
1895
1896        /// Streams each page in the collection.
1897        pub fn by_page(
1898            self,
1899        ) -> impl google_cloud_gax::paginator::Paginator<
1900            google_cloud_longrunning::model::ListOperationsResponse,
1901            crate::Error,
1902        > {
1903            use std::clone::Clone;
1904            let token = self.0.request.page_token.clone();
1905            let execute = move |token: String| {
1906                let mut builder = self.clone();
1907                builder.0.request = builder.0.request.set_page_token(token);
1908                builder.send()
1909            };
1910            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1911        }
1912
1913        /// Streams each item in the collection.
1914        pub fn by_item(
1915            self,
1916        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1917            google_cloud_longrunning::model::ListOperationsResponse,
1918            crate::Error,
1919        > {
1920            use google_cloud_gax::paginator::Paginator;
1921            self.by_page().items()
1922        }
1923
1924        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1925        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1926            self.0.request.name = v.into();
1927            self
1928        }
1929
1930        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1931        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1932            self.0.request.filter = v.into();
1933            self
1934        }
1935
1936        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1937        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1938            self.0.request.page_size = v.into();
1939            self
1940        }
1941
1942        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1943        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944            self.0.request.page_token = v.into();
1945            self
1946        }
1947
1948        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1949        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1950            self.0.request.return_partial_success = v.into();
1951            self
1952        }
1953    }
1954
1955    #[doc(hidden)]
1956    impl crate::RequestBuilder for ListOperations {
1957        fn request_options(&mut self) -> &mut crate::RequestOptions {
1958            &mut self.0.options
1959        }
1960    }
1961
1962    /// The request builder for [AnswerRecords::get_operation][crate::client::AnswerRecords::get_operation] calls.
1963    ///
1964    /// # Example
1965    /// ```
1966    /// # use google_cloud_dialogflow_v2::builder::answer_records::GetOperation;
1967    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1968    ///
1969    /// let builder = prepare_request_builder();
1970    /// let response = builder.send().await?;
1971    /// # Ok(()) }
1972    ///
1973    /// fn prepare_request_builder() -> GetOperation {
1974    ///   # panic!();
1975    ///   // ... details omitted ...
1976    /// }
1977    /// ```
1978    #[derive(Clone, Debug)]
1979    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1980
1981    impl GetOperation {
1982        pub(crate) fn new(
1983            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1984        ) -> Self {
1985            Self(RequestBuilder::new(stub))
1986        }
1987
1988        /// Sets the full request, replacing any prior values.
1989        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1990            mut self,
1991            v: V,
1992        ) -> Self {
1993            self.0.request = v.into();
1994            self
1995        }
1996
1997        /// Sets all the options, replacing any prior values.
1998        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1999            self.0.options = v.into();
2000            self
2001        }
2002
2003        /// Sends the request.
2004        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2005            (*self.0.stub)
2006                .get_operation(self.0.request, self.0.options)
2007                .await
2008                .map(crate::Response::into_body)
2009        }
2010
2011        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2012        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2013            self.0.request.name = v.into();
2014            self
2015        }
2016    }
2017
2018    #[doc(hidden)]
2019    impl crate::RequestBuilder for GetOperation {
2020        fn request_options(&mut self) -> &mut crate::RequestOptions {
2021            &mut self.0.options
2022        }
2023    }
2024
2025    /// The request builder for [AnswerRecords::cancel_operation][crate::client::AnswerRecords::cancel_operation] calls.
2026    ///
2027    /// # Example
2028    /// ```
2029    /// # use google_cloud_dialogflow_v2::builder::answer_records::CancelOperation;
2030    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2031    ///
2032    /// let builder = prepare_request_builder();
2033    /// let response = builder.send().await?;
2034    /// # Ok(()) }
2035    ///
2036    /// fn prepare_request_builder() -> CancelOperation {
2037    ///   # panic!();
2038    ///   // ... details omitted ...
2039    /// }
2040    /// ```
2041    #[derive(Clone, Debug)]
2042    pub struct CancelOperation(
2043        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2044    );
2045
2046    impl CancelOperation {
2047        pub(crate) fn new(
2048            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
2049        ) -> Self {
2050            Self(RequestBuilder::new(stub))
2051        }
2052
2053        /// Sets the full request, replacing any prior values.
2054        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2055            mut self,
2056            v: V,
2057        ) -> Self {
2058            self.0.request = v.into();
2059            self
2060        }
2061
2062        /// Sets all the options, replacing any prior values.
2063        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2064            self.0.options = v.into();
2065            self
2066        }
2067
2068        /// Sends the request.
2069        pub async fn send(self) -> Result<()> {
2070            (*self.0.stub)
2071                .cancel_operation(self.0.request, self.0.options)
2072                .await
2073                .map(crate::Response::into_body)
2074        }
2075
2076        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2077        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2078            self.0.request.name = v.into();
2079            self
2080        }
2081    }
2082
2083    #[doc(hidden)]
2084    impl crate::RequestBuilder for CancelOperation {
2085        fn request_options(&mut self) -> &mut crate::RequestOptions {
2086            &mut self.0.options
2087        }
2088    }
2089}
2090
2091/// Request and client builders for [Contexts][crate::client::Contexts].
2092#[cfg(feature = "contexts")]
2093#[cfg_attr(docsrs, doc(cfg(feature = "contexts")))]
2094pub mod contexts {
2095    use crate::Result;
2096
2097    /// A builder for [Contexts][crate::client::Contexts].
2098    ///
2099    /// ```
2100    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2101    /// # use google_cloud_dialogflow_v2::*;
2102    /// # use builder::contexts::ClientBuilder;
2103    /// # use client::Contexts;
2104    /// let builder : ClientBuilder = Contexts::builder();
2105    /// let client = builder
2106    ///     .with_endpoint("https://dialogflow.googleapis.com")
2107    ///     .build().await?;
2108    /// # Ok(()) }
2109    /// ```
2110    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2111
2112    pub(crate) mod client {
2113        use super::super::super::client::Contexts;
2114        pub struct Factory;
2115        impl crate::ClientFactory for Factory {
2116            type Client = Contexts;
2117            type Credentials = gaxi::options::Credentials;
2118            async fn build(
2119                self,
2120                config: gaxi::options::ClientConfig,
2121            ) -> crate::ClientBuilderResult<Self::Client> {
2122                Self::Client::new(config).await
2123            }
2124        }
2125    }
2126
2127    /// Common implementation for [crate::client::Contexts] request builders.
2128    #[derive(Clone, Debug)]
2129    pub(crate) struct RequestBuilder<R: std::default::Default> {
2130        stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>,
2131        request: R,
2132        options: crate::RequestOptions,
2133    }
2134
2135    impl<R> RequestBuilder<R>
2136    where
2137        R: std::default::Default,
2138    {
2139        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2140            Self {
2141                stub,
2142                request: R::default(),
2143                options: crate::RequestOptions::default(),
2144            }
2145        }
2146    }
2147
2148    /// The request builder for [Contexts::list_contexts][crate::client::Contexts::list_contexts] calls.
2149    ///
2150    /// # Example
2151    /// ```
2152    /// # use google_cloud_dialogflow_v2::builder::contexts::ListContexts;
2153    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2154    /// use google_cloud_gax::paginator::ItemPaginator;
2155    ///
2156    /// let builder = prepare_request_builder();
2157    /// let mut items = builder.by_item();
2158    /// while let Some(result) = items.next().await {
2159    ///   let item = result?;
2160    /// }
2161    /// # Ok(()) }
2162    ///
2163    /// fn prepare_request_builder() -> ListContexts {
2164    ///   # panic!();
2165    ///   // ... details omitted ...
2166    /// }
2167    /// ```
2168    #[derive(Clone, Debug)]
2169    pub struct ListContexts(RequestBuilder<crate::model::ListContextsRequest>);
2170
2171    impl ListContexts {
2172        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2173            Self(RequestBuilder::new(stub))
2174        }
2175
2176        /// Sets the full request, replacing any prior values.
2177        pub fn with_request<V: Into<crate::model::ListContextsRequest>>(mut self, v: V) -> Self {
2178            self.0.request = v.into();
2179            self
2180        }
2181
2182        /// Sets all the options, replacing any prior values.
2183        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2184            self.0.options = v.into();
2185            self
2186        }
2187
2188        /// Sends the request.
2189        pub async fn send(self) -> Result<crate::model::ListContextsResponse> {
2190            (*self.0.stub)
2191                .list_contexts(self.0.request, self.0.options)
2192                .await
2193                .map(crate::Response::into_body)
2194        }
2195
2196        /// Streams each page in the collection.
2197        pub fn by_page(
2198            self,
2199        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListContextsResponse, crate::Error>
2200        {
2201            use std::clone::Clone;
2202            let token = self.0.request.page_token.clone();
2203            let execute = move |token: String| {
2204                let mut builder = self.clone();
2205                builder.0.request = builder.0.request.set_page_token(token);
2206                builder.send()
2207            };
2208            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2209        }
2210
2211        /// Streams each item in the collection.
2212        pub fn by_item(
2213            self,
2214        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2215            crate::model::ListContextsResponse,
2216            crate::Error,
2217        > {
2218            use google_cloud_gax::paginator::Paginator;
2219            self.by_page().items()
2220        }
2221
2222        /// Sets the value of [parent][crate::model::ListContextsRequest::parent].
2223        ///
2224        /// This is a **required** field for requests.
2225        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2226            self.0.request.parent = v.into();
2227            self
2228        }
2229
2230        /// Sets the value of [page_size][crate::model::ListContextsRequest::page_size].
2231        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2232            self.0.request.page_size = v.into();
2233            self
2234        }
2235
2236        /// Sets the value of [page_token][crate::model::ListContextsRequest::page_token].
2237        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2238            self.0.request.page_token = v.into();
2239            self
2240        }
2241    }
2242
2243    #[doc(hidden)]
2244    impl crate::RequestBuilder for ListContexts {
2245        fn request_options(&mut self) -> &mut crate::RequestOptions {
2246            &mut self.0.options
2247        }
2248    }
2249
2250    /// The request builder for [Contexts::get_context][crate::client::Contexts::get_context] calls.
2251    ///
2252    /// # Example
2253    /// ```
2254    /// # use google_cloud_dialogflow_v2::builder::contexts::GetContext;
2255    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2256    ///
2257    /// let builder = prepare_request_builder();
2258    /// let response = builder.send().await?;
2259    /// # Ok(()) }
2260    ///
2261    /// fn prepare_request_builder() -> GetContext {
2262    ///   # panic!();
2263    ///   // ... details omitted ...
2264    /// }
2265    /// ```
2266    #[derive(Clone, Debug)]
2267    pub struct GetContext(RequestBuilder<crate::model::GetContextRequest>);
2268
2269    impl GetContext {
2270        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2271            Self(RequestBuilder::new(stub))
2272        }
2273
2274        /// Sets the full request, replacing any prior values.
2275        pub fn with_request<V: Into<crate::model::GetContextRequest>>(mut self, v: V) -> Self {
2276            self.0.request = v.into();
2277            self
2278        }
2279
2280        /// Sets all the options, replacing any prior values.
2281        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2282            self.0.options = v.into();
2283            self
2284        }
2285
2286        /// Sends the request.
2287        pub async fn send(self) -> Result<crate::model::Context> {
2288            (*self.0.stub)
2289                .get_context(self.0.request, self.0.options)
2290                .await
2291                .map(crate::Response::into_body)
2292        }
2293
2294        /// Sets the value of [name][crate::model::GetContextRequest::name].
2295        ///
2296        /// This is a **required** field for requests.
2297        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2298            self.0.request.name = v.into();
2299            self
2300        }
2301    }
2302
2303    #[doc(hidden)]
2304    impl crate::RequestBuilder for GetContext {
2305        fn request_options(&mut self) -> &mut crate::RequestOptions {
2306            &mut self.0.options
2307        }
2308    }
2309
2310    /// The request builder for [Contexts::create_context][crate::client::Contexts::create_context] calls.
2311    ///
2312    /// # Example
2313    /// ```
2314    /// # use google_cloud_dialogflow_v2::builder::contexts::CreateContext;
2315    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2316    ///
2317    /// let builder = prepare_request_builder();
2318    /// let response = builder.send().await?;
2319    /// # Ok(()) }
2320    ///
2321    /// fn prepare_request_builder() -> CreateContext {
2322    ///   # panic!();
2323    ///   // ... details omitted ...
2324    /// }
2325    /// ```
2326    #[derive(Clone, Debug)]
2327    pub struct CreateContext(RequestBuilder<crate::model::CreateContextRequest>);
2328
2329    impl CreateContext {
2330        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2331            Self(RequestBuilder::new(stub))
2332        }
2333
2334        /// Sets the full request, replacing any prior values.
2335        pub fn with_request<V: Into<crate::model::CreateContextRequest>>(mut self, v: V) -> Self {
2336            self.0.request = v.into();
2337            self
2338        }
2339
2340        /// Sets all the options, replacing any prior values.
2341        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2342            self.0.options = v.into();
2343            self
2344        }
2345
2346        /// Sends the request.
2347        pub async fn send(self) -> Result<crate::model::Context> {
2348            (*self.0.stub)
2349                .create_context(self.0.request, self.0.options)
2350                .await
2351                .map(crate::Response::into_body)
2352        }
2353
2354        /// Sets the value of [parent][crate::model::CreateContextRequest::parent].
2355        ///
2356        /// This is a **required** field for requests.
2357        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2358            self.0.request.parent = v.into();
2359            self
2360        }
2361
2362        /// Sets the value of [context][crate::model::CreateContextRequest::context].
2363        ///
2364        /// This is a **required** field for requests.
2365        pub fn set_context<T>(mut self, v: T) -> Self
2366        where
2367            T: std::convert::Into<crate::model::Context>,
2368        {
2369            self.0.request.context = std::option::Option::Some(v.into());
2370            self
2371        }
2372
2373        /// Sets or clears the value of [context][crate::model::CreateContextRequest::context].
2374        ///
2375        /// This is a **required** field for requests.
2376        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2377        where
2378            T: std::convert::Into<crate::model::Context>,
2379        {
2380            self.0.request.context = v.map(|x| x.into());
2381            self
2382        }
2383    }
2384
2385    #[doc(hidden)]
2386    impl crate::RequestBuilder for CreateContext {
2387        fn request_options(&mut self) -> &mut crate::RequestOptions {
2388            &mut self.0.options
2389        }
2390    }
2391
2392    /// The request builder for [Contexts::update_context][crate::client::Contexts::update_context] calls.
2393    ///
2394    /// # Example
2395    /// ```
2396    /// # use google_cloud_dialogflow_v2::builder::contexts::UpdateContext;
2397    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2398    ///
2399    /// let builder = prepare_request_builder();
2400    /// let response = builder.send().await?;
2401    /// # Ok(()) }
2402    ///
2403    /// fn prepare_request_builder() -> UpdateContext {
2404    ///   # panic!();
2405    ///   // ... details omitted ...
2406    /// }
2407    /// ```
2408    #[derive(Clone, Debug)]
2409    pub struct UpdateContext(RequestBuilder<crate::model::UpdateContextRequest>);
2410
2411    impl UpdateContext {
2412        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2413            Self(RequestBuilder::new(stub))
2414        }
2415
2416        /// Sets the full request, replacing any prior values.
2417        pub fn with_request<V: Into<crate::model::UpdateContextRequest>>(mut self, v: V) -> Self {
2418            self.0.request = v.into();
2419            self
2420        }
2421
2422        /// Sets all the options, replacing any prior values.
2423        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2424            self.0.options = v.into();
2425            self
2426        }
2427
2428        /// Sends the request.
2429        pub async fn send(self) -> Result<crate::model::Context> {
2430            (*self.0.stub)
2431                .update_context(self.0.request, self.0.options)
2432                .await
2433                .map(crate::Response::into_body)
2434        }
2435
2436        /// Sets the value of [context][crate::model::UpdateContextRequest::context].
2437        ///
2438        /// This is a **required** field for requests.
2439        pub fn set_context<T>(mut self, v: T) -> Self
2440        where
2441            T: std::convert::Into<crate::model::Context>,
2442        {
2443            self.0.request.context = std::option::Option::Some(v.into());
2444            self
2445        }
2446
2447        /// Sets or clears the value of [context][crate::model::UpdateContextRequest::context].
2448        ///
2449        /// This is a **required** field for requests.
2450        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2451        where
2452            T: std::convert::Into<crate::model::Context>,
2453        {
2454            self.0.request.context = v.map(|x| x.into());
2455            self
2456        }
2457
2458        /// Sets the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2459        pub fn set_update_mask<T>(mut self, v: T) -> Self
2460        where
2461            T: std::convert::Into<wkt::FieldMask>,
2462        {
2463            self.0.request.update_mask = std::option::Option::Some(v.into());
2464            self
2465        }
2466
2467        /// Sets or clears the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2468        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2469        where
2470            T: std::convert::Into<wkt::FieldMask>,
2471        {
2472            self.0.request.update_mask = v.map(|x| x.into());
2473            self
2474        }
2475    }
2476
2477    #[doc(hidden)]
2478    impl crate::RequestBuilder for UpdateContext {
2479        fn request_options(&mut self) -> &mut crate::RequestOptions {
2480            &mut self.0.options
2481        }
2482    }
2483
2484    /// The request builder for [Contexts::delete_context][crate::client::Contexts::delete_context] calls.
2485    ///
2486    /// # Example
2487    /// ```
2488    /// # use google_cloud_dialogflow_v2::builder::contexts::DeleteContext;
2489    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2490    ///
2491    /// let builder = prepare_request_builder();
2492    /// let response = builder.send().await?;
2493    /// # Ok(()) }
2494    ///
2495    /// fn prepare_request_builder() -> DeleteContext {
2496    ///   # panic!();
2497    ///   // ... details omitted ...
2498    /// }
2499    /// ```
2500    #[derive(Clone, Debug)]
2501    pub struct DeleteContext(RequestBuilder<crate::model::DeleteContextRequest>);
2502
2503    impl DeleteContext {
2504        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> 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::DeleteContextRequest>>(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<()> {
2522            (*self.0.stub)
2523                .delete_context(self.0.request, self.0.options)
2524                .await
2525                .map(crate::Response::into_body)
2526        }
2527
2528        /// Sets the value of [name][crate::model::DeleteContextRequest::name].
2529        ///
2530        /// This is a **required** field for requests.
2531        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2532            self.0.request.name = v.into();
2533            self
2534        }
2535    }
2536
2537    #[doc(hidden)]
2538    impl crate::RequestBuilder for DeleteContext {
2539        fn request_options(&mut self) -> &mut crate::RequestOptions {
2540            &mut self.0.options
2541        }
2542    }
2543
2544    /// The request builder for [Contexts::delete_all_contexts][crate::client::Contexts::delete_all_contexts] calls.
2545    ///
2546    /// # Example
2547    /// ```
2548    /// # use google_cloud_dialogflow_v2::builder::contexts::DeleteAllContexts;
2549    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2550    ///
2551    /// let builder = prepare_request_builder();
2552    /// let response = builder.send().await?;
2553    /// # Ok(()) }
2554    ///
2555    /// fn prepare_request_builder() -> DeleteAllContexts {
2556    ///   # panic!();
2557    ///   // ... details omitted ...
2558    /// }
2559    /// ```
2560    #[derive(Clone, Debug)]
2561    pub struct DeleteAllContexts(RequestBuilder<crate::model::DeleteAllContextsRequest>);
2562
2563    impl DeleteAllContexts {
2564        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2565            Self(RequestBuilder::new(stub))
2566        }
2567
2568        /// Sets the full request, replacing any prior values.
2569        pub fn with_request<V: Into<crate::model::DeleteAllContextsRequest>>(
2570            mut self,
2571            v: V,
2572        ) -> Self {
2573            self.0.request = v.into();
2574            self
2575        }
2576
2577        /// Sets all the options, replacing any prior values.
2578        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2579            self.0.options = v.into();
2580            self
2581        }
2582
2583        /// Sends the request.
2584        pub async fn send(self) -> Result<()> {
2585            (*self.0.stub)
2586                .delete_all_contexts(self.0.request, self.0.options)
2587                .await
2588                .map(crate::Response::into_body)
2589        }
2590
2591        /// Sets the value of [parent][crate::model::DeleteAllContextsRequest::parent].
2592        ///
2593        /// This is a **required** field for requests.
2594        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2595            self.0.request.parent = v.into();
2596            self
2597        }
2598    }
2599
2600    #[doc(hidden)]
2601    impl crate::RequestBuilder for DeleteAllContexts {
2602        fn request_options(&mut self) -> &mut crate::RequestOptions {
2603            &mut self.0.options
2604        }
2605    }
2606
2607    /// The request builder for [Contexts::list_locations][crate::client::Contexts::list_locations] calls.
2608    ///
2609    /// # Example
2610    /// ```
2611    /// # use google_cloud_dialogflow_v2::builder::contexts::ListLocations;
2612    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2613    /// use google_cloud_gax::paginator::ItemPaginator;
2614    ///
2615    /// let builder = prepare_request_builder();
2616    /// let mut items = builder.by_item();
2617    /// while let Some(result) = items.next().await {
2618    ///   let item = result?;
2619    /// }
2620    /// # Ok(()) }
2621    ///
2622    /// fn prepare_request_builder() -> ListLocations {
2623    ///   # panic!();
2624    ///   // ... details omitted ...
2625    /// }
2626    /// ```
2627    #[derive(Clone, Debug)]
2628    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2629
2630    impl ListLocations {
2631        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2632            Self(RequestBuilder::new(stub))
2633        }
2634
2635        /// Sets the full request, replacing any prior values.
2636        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2637            mut self,
2638            v: V,
2639        ) -> Self {
2640            self.0.request = v.into();
2641            self
2642        }
2643
2644        /// Sets all the options, replacing any prior values.
2645        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2646            self.0.options = v.into();
2647            self
2648        }
2649
2650        /// Sends the request.
2651        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2652            (*self.0.stub)
2653                .list_locations(self.0.request, self.0.options)
2654                .await
2655                .map(crate::Response::into_body)
2656        }
2657
2658        /// Streams each page in the collection.
2659        pub fn by_page(
2660            self,
2661        ) -> impl google_cloud_gax::paginator::Paginator<
2662            google_cloud_location::model::ListLocationsResponse,
2663            crate::Error,
2664        > {
2665            use std::clone::Clone;
2666            let token = self.0.request.page_token.clone();
2667            let execute = move |token: String| {
2668                let mut builder = self.clone();
2669                builder.0.request = builder.0.request.set_page_token(token);
2670                builder.send()
2671            };
2672            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2673        }
2674
2675        /// Streams each item in the collection.
2676        pub fn by_item(
2677            self,
2678        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2679            google_cloud_location::model::ListLocationsResponse,
2680            crate::Error,
2681        > {
2682            use google_cloud_gax::paginator::Paginator;
2683            self.by_page().items()
2684        }
2685
2686        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2687        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2688            self.0.request.name = v.into();
2689            self
2690        }
2691
2692        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2693        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2694            self.0.request.filter = v.into();
2695            self
2696        }
2697
2698        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2699        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2700            self.0.request.page_size = v.into();
2701            self
2702        }
2703
2704        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2705        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2706            self.0.request.page_token = v.into();
2707            self
2708        }
2709    }
2710
2711    #[doc(hidden)]
2712    impl crate::RequestBuilder for ListLocations {
2713        fn request_options(&mut self) -> &mut crate::RequestOptions {
2714            &mut self.0.options
2715        }
2716    }
2717
2718    /// The request builder for [Contexts::get_location][crate::client::Contexts::get_location] calls.
2719    ///
2720    /// # Example
2721    /// ```
2722    /// # use google_cloud_dialogflow_v2::builder::contexts::GetLocation;
2723    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2724    ///
2725    /// let builder = prepare_request_builder();
2726    /// let response = builder.send().await?;
2727    /// # Ok(()) }
2728    ///
2729    /// fn prepare_request_builder() -> GetLocation {
2730    ///   # panic!();
2731    ///   // ... details omitted ...
2732    /// }
2733    /// ```
2734    #[derive(Clone, Debug)]
2735    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2736
2737    impl GetLocation {
2738        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2739            Self(RequestBuilder::new(stub))
2740        }
2741
2742        /// Sets the full request, replacing any prior values.
2743        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2744            mut self,
2745            v: V,
2746        ) -> Self {
2747            self.0.request = v.into();
2748            self
2749        }
2750
2751        /// Sets all the options, replacing any prior values.
2752        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2753            self.0.options = v.into();
2754            self
2755        }
2756
2757        /// Sends the request.
2758        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2759            (*self.0.stub)
2760                .get_location(self.0.request, self.0.options)
2761                .await
2762                .map(crate::Response::into_body)
2763        }
2764
2765        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2766        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2767            self.0.request.name = v.into();
2768            self
2769        }
2770    }
2771
2772    #[doc(hidden)]
2773    impl crate::RequestBuilder for GetLocation {
2774        fn request_options(&mut self) -> &mut crate::RequestOptions {
2775            &mut self.0.options
2776        }
2777    }
2778
2779    /// The request builder for [Contexts::list_operations][crate::client::Contexts::list_operations] calls.
2780    ///
2781    /// # Example
2782    /// ```
2783    /// # use google_cloud_dialogflow_v2::builder::contexts::ListOperations;
2784    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2785    /// use google_cloud_gax::paginator::ItemPaginator;
2786    ///
2787    /// let builder = prepare_request_builder();
2788    /// let mut items = builder.by_item();
2789    /// while let Some(result) = items.next().await {
2790    ///   let item = result?;
2791    /// }
2792    /// # Ok(()) }
2793    ///
2794    /// fn prepare_request_builder() -> ListOperations {
2795    ///   # panic!();
2796    ///   // ... details omitted ...
2797    /// }
2798    /// ```
2799    #[derive(Clone, Debug)]
2800    pub struct ListOperations(
2801        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2802    );
2803
2804    impl ListOperations {
2805        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2806            Self(RequestBuilder::new(stub))
2807        }
2808
2809        /// Sets the full request, replacing any prior values.
2810        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2811            mut self,
2812            v: V,
2813        ) -> Self {
2814            self.0.request = v.into();
2815            self
2816        }
2817
2818        /// Sets all the options, replacing any prior values.
2819        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2820            self.0.options = v.into();
2821            self
2822        }
2823
2824        /// Sends the request.
2825        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2826            (*self.0.stub)
2827                .list_operations(self.0.request, self.0.options)
2828                .await
2829                .map(crate::Response::into_body)
2830        }
2831
2832        /// Streams each page in the collection.
2833        pub fn by_page(
2834            self,
2835        ) -> impl google_cloud_gax::paginator::Paginator<
2836            google_cloud_longrunning::model::ListOperationsResponse,
2837            crate::Error,
2838        > {
2839            use std::clone::Clone;
2840            let token = self.0.request.page_token.clone();
2841            let execute = move |token: String| {
2842                let mut builder = self.clone();
2843                builder.0.request = builder.0.request.set_page_token(token);
2844                builder.send()
2845            };
2846            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2847        }
2848
2849        /// Streams each item in the collection.
2850        pub fn by_item(
2851            self,
2852        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2853            google_cloud_longrunning::model::ListOperationsResponse,
2854            crate::Error,
2855        > {
2856            use google_cloud_gax::paginator::Paginator;
2857            self.by_page().items()
2858        }
2859
2860        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2861        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2862            self.0.request.name = v.into();
2863            self
2864        }
2865
2866        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2867        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2868            self.0.request.filter = v.into();
2869            self
2870        }
2871
2872        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2873        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2874            self.0.request.page_size = v.into();
2875            self
2876        }
2877
2878        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2879        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880            self.0.request.page_token = v.into();
2881            self
2882        }
2883
2884        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2885        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2886            self.0.request.return_partial_success = v.into();
2887            self
2888        }
2889    }
2890
2891    #[doc(hidden)]
2892    impl crate::RequestBuilder for ListOperations {
2893        fn request_options(&mut self) -> &mut crate::RequestOptions {
2894            &mut self.0.options
2895        }
2896    }
2897
2898    /// The request builder for [Contexts::get_operation][crate::client::Contexts::get_operation] calls.
2899    ///
2900    /// # Example
2901    /// ```
2902    /// # use google_cloud_dialogflow_v2::builder::contexts::GetOperation;
2903    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2904    ///
2905    /// let builder = prepare_request_builder();
2906    /// let response = builder.send().await?;
2907    /// # Ok(()) }
2908    ///
2909    /// fn prepare_request_builder() -> GetOperation {
2910    ///   # panic!();
2911    ///   // ... details omitted ...
2912    /// }
2913    /// ```
2914    #[derive(Clone, Debug)]
2915    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2916
2917    impl GetOperation {
2918        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2919            Self(RequestBuilder::new(stub))
2920        }
2921
2922        /// Sets the full request, replacing any prior values.
2923        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2924            mut self,
2925            v: V,
2926        ) -> Self {
2927            self.0.request = v.into();
2928            self
2929        }
2930
2931        /// Sets all the options, replacing any prior values.
2932        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2933            self.0.options = v.into();
2934            self
2935        }
2936
2937        /// Sends the request.
2938        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2939            (*self.0.stub)
2940                .get_operation(self.0.request, self.0.options)
2941                .await
2942                .map(crate::Response::into_body)
2943        }
2944
2945        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2946        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2947            self.0.request.name = v.into();
2948            self
2949        }
2950    }
2951
2952    #[doc(hidden)]
2953    impl crate::RequestBuilder for GetOperation {
2954        fn request_options(&mut self) -> &mut crate::RequestOptions {
2955            &mut self.0.options
2956        }
2957    }
2958
2959    /// The request builder for [Contexts::cancel_operation][crate::client::Contexts::cancel_operation] calls.
2960    ///
2961    /// # Example
2962    /// ```
2963    /// # use google_cloud_dialogflow_v2::builder::contexts::CancelOperation;
2964    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2965    ///
2966    /// let builder = prepare_request_builder();
2967    /// let response = builder.send().await?;
2968    /// # Ok(()) }
2969    ///
2970    /// fn prepare_request_builder() -> CancelOperation {
2971    ///   # panic!();
2972    ///   // ... details omitted ...
2973    /// }
2974    /// ```
2975    #[derive(Clone, Debug)]
2976    pub struct CancelOperation(
2977        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2978    );
2979
2980    impl CancelOperation {
2981        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2982            Self(RequestBuilder::new(stub))
2983        }
2984
2985        /// Sets the full request, replacing any prior values.
2986        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2987            mut self,
2988            v: V,
2989        ) -> Self {
2990            self.0.request = v.into();
2991            self
2992        }
2993
2994        /// Sets all the options, replacing any prior values.
2995        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2996            self.0.options = v.into();
2997            self
2998        }
2999
3000        /// Sends the request.
3001        pub async fn send(self) -> Result<()> {
3002            (*self.0.stub)
3003                .cancel_operation(self.0.request, self.0.options)
3004                .await
3005                .map(crate::Response::into_body)
3006        }
3007
3008        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3009        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3010            self.0.request.name = v.into();
3011            self
3012        }
3013    }
3014
3015    #[doc(hidden)]
3016    impl crate::RequestBuilder for CancelOperation {
3017        fn request_options(&mut self) -> &mut crate::RequestOptions {
3018            &mut self.0.options
3019        }
3020    }
3021}
3022
3023/// Request and client builders for [Conversations][crate::client::Conversations].
3024#[cfg(feature = "conversations")]
3025#[cfg_attr(docsrs, doc(cfg(feature = "conversations")))]
3026pub mod conversations {
3027    use crate::Result;
3028
3029    /// A builder for [Conversations][crate::client::Conversations].
3030    ///
3031    /// ```
3032    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3033    /// # use google_cloud_dialogflow_v2::*;
3034    /// # use builder::conversations::ClientBuilder;
3035    /// # use client::Conversations;
3036    /// let builder : ClientBuilder = Conversations::builder();
3037    /// let client = builder
3038    ///     .with_endpoint("https://dialogflow.googleapis.com")
3039    ///     .build().await?;
3040    /// # Ok(()) }
3041    /// ```
3042    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3043
3044    pub(crate) mod client {
3045        use super::super::super::client::Conversations;
3046        pub struct Factory;
3047        impl crate::ClientFactory for Factory {
3048            type Client = Conversations;
3049            type Credentials = gaxi::options::Credentials;
3050            async fn build(
3051                self,
3052                config: gaxi::options::ClientConfig,
3053            ) -> crate::ClientBuilderResult<Self::Client> {
3054                Self::Client::new(config).await
3055            }
3056        }
3057    }
3058
3059    /// Common implementation for [crate::client::Conversations] request builders.
3060    #[derive(Clone, Debug)]
3061    pub(crate) struct RequestBuilder<R: std::default::Default> {
3062        stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3063        request: R,
3064        options: crate::RequestOptions,
3065    }
3066
3067    impl<R> RequestBuilder<R>
3068    where
3069        R: std::default::Default,
3070    {
3071        pub(crate) fn new(
3072            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3073        ) -> Self {
3074            Self {
3075                stub,
3076                request: R::default(),
3077                options: crate::RequestOptions::default(),
3078            }
3079        }
3080    }
3081
3082    /// The request builder for [Conversations::create_conversation][crate::client::Conversations::create_conversation] calls.
3083    ///
3084    /// # Example
3085    /// ```
3086    /// # use google_cloud_dialogflow_v2::builder::conversations::CreateConversation;
3087    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3088    ///
3089    /// let builder = prepare_request_builder();
3090    /// let response = builder.send().await?;
3091    /// # Ok(()) }
3092    ///
3093    /// fn prepare_request_builder() -> CreateConversation {
3094    ///   # panic!();
3095    ///   // ... details omitted ...
3096    /// }
3097    /// ```
3098    #[derive(Clone, Debug)]
3099    pub struct CreateConversation(RequestBuilder<crate::model::CreateConversationRequest>);
3100
3101    impl CreateConversation {
3102        pub(crate) fn new(
3103            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3104        ) -> Self {
3105            Self(RequestBuilder::new(stub))
3106        }
3107
3108        /// Sets the full request, replacing any prior values.
3109        pub fn with_request<V: Into<crate::model::CreateConversationRequest>>(
3110            mut self,
3111            v: V,
3112        ) -> Self {
3113            self.0.request = v.into();
3114            self
3115        }
3116
3117        /// Sets all the options, replacing any prior values.
3118        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3119            self.0.options = v.into();
3120            self
3121        }
3122
3123        /// Sends the request.
3124        pub async fn send(self) -> Result<crate::model::Conversation> {
3125            (*self.0.stub)
3126                .create_conversation(self.0.request, self.0.options)
3127                .await
3128                .map(crate::Response::into_body)
3129        }
3130
3131        /// Sets the value of [parent][crate::model::CreateConversationRequest::parent].
3132        ///
3133        /// This is a **required** field for requests.
3134        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3135            self.0.request.parent = v.into();
3136            self
3137        }
3138
3139        /// Sets the value of [conversation][crate::model::CreateConversationRequest::conversation].
3140        ///
3141        /// This is a **required** field for requests.
3142        pub fn set_conversation<T>(mut self, v: T) -> Self
3143        where
3144            T: std::convert::Into<crate::model::Conversation>,
3145        {
3146            self.0.request.conversation = std::option::Option::Some(v.into());
3147            self
3148        }
3149
3150        /// Sets or clears the value of [conversation][crate::model::CreateConversationRequest::conversation].
3151        ///
3152        /// This is a **required** field for requests.
3153        pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3154        where
3155            T: std::convert::Into<crate::model::Conversation>,
3156        {
3157            self.0.request.conversation = v.map(|x| x.into());
3158            self
3159        }
3160
3161        /// Sets the value of [conversation_id][crate::model::CreateConversationRequest::conversation_id].
3162        pub fn set_conversation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3163            self.0.request.conversation_id = v.into();
3164            self
3165        }
3166    }
3167
3168    #[doc(hidden)]
3169    impl crate::RequestBuilder for CreateConversation {
3170        fn request_options(&mut self) -> &mut crate::RequestOptions {
3171            &mut self.0.options
3172        }
3173    }
3174
3175    /// The request builder for [Conversations::list_conversations][crate::client::Conversations::list_conversations] calls.
3176    ///
3177    /// # Example
3178    /// ```
3179    /// # use google_cloud_dialogflow_v2::builder::conversations::ListConversations;
3180    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3181    /// use google_cloud_gax::paginator::ItemPaginator;
3182    ///
3183    /// let builder = prepare_request_builder();
3184    /// let mut items = builder.by_item();
3185    /// while let Some(result) = items.next().await {
3186    ///   let item = result?;
3187    /// }
3188    /// # Ok(()) }
3189    ///
3190    /// fn prepare_request_builder() -> ListConversations {
3191    ///   # panic!();
3192    ///   // ... details omitted ...
3193    /// }
3194    /// ```
3195    #[derive(Clone, Debug)]
3196    pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);
3197
3198    impl ListConversations {
3199        pub(crate) fn new(
3200            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3201        ) -> Self {
3202            Self(RequestBuilder::new(stub))
3203        }
3204
3205        /// Sets the full request, replacing any prior values.
3206        pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
3207            mut self,
3208            v: V,
3209        ) -> Self {
3210            self.0.request = v.into();
3211            self
3212        }
3213
3214        /// Sets all the options, replacing any prior values.
3215        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3216            self.0.options = v.into();
3217            self
3218        }
3219
3220        /// Sends the request.
3221        pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
3222            (*self.0.stub)
3223                .list_conversations(self.0.request, self.0.options)
3224                .await
3225                .map(crate::Response::into_body)
3226        }
3227
3228        /// Streams each page in the collection.
3229        pub fn by_page(
3230            self,
3231        ) -> impl google_cloud_gax::paginator::Paginator<
3232            crate::model::ListConversationsResponse,
3233            crate::Error,
3234        > {
3235            use std::clone::Clone;
3236            let token = self.0.request.page_token.clone();
3237            let execute = move |token: String| {
3238                let mut builder = self.clone();
3239                builder.0.request = builder.0.request.set_page_token(token);
3240                builder.send()
3241            };
3242            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3243        }
3244
3245        /// Streams each item in the collection.
3246        pub fn by_item(
3247            self,
3248        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3249            crate::model::ListConversationsResponse,
3250            crate::Error,
3251        > {
3252            use google_cloud_gax::paginator::Paginator;
3253            self.by_page().items()
3254        }
3255
3256        /// Sets the value of [parent][crate::model::ListConversationsRequest::parent].
3257        ///
3258        /// This is a **required** field for requests.
3259        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3260            self.0.request.parent = v.into();
3261            self
3262        }
3263
3264        /// Sets the value of [page_size][crate::model::ListConversationsRequest::page_size].
3265        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3266            self.0.request.page_size = v.into();
3267            self
3268        }
3269
3270        /// Sets the value of [page_token][crate::model::ListConversationsRequest::page_token].
3271        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3272            self.0.request.page_token = v.into();
3273            self
3274        }
3275
3276        /// Sets the value of [filter][crate::model::ListConversationsRequest::filter].
3277        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3278            self.0.request.filter = v.into();
3279            self
3280        }
3281    }
3282
3283    #[doc(hidden)]
3284    impl crate::RequestBuilder for ListConversations {
3285        fn request_options(&mut self) -> &mut crate::RequestOptions {
3286            &mut self.0.options
3287        }
3288    }
3289
3290    /// The request builder for [Conversations::get_conversation][crate::client::Conversations::get_conversation] calls.
3291    ///
3292    /// # Example
3293    /// ```
3294    /// # use google_cloud_dialogflow_v2::builder::conversations::GetConversation;
3295    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3296    ///
3297    /// let builder = prepare_request_builder();
3298    /// let response = builder.send().await?;
3299    /// # Ok(()) }
3300    ///
3301    /// fn prepare_request_builder() -> GetConversation {
3302    ///   # panic!();
3303    ///   // ... details omitted ...
3304    /// }
3305    /// ```
3306    #[derive(Clone, Debug)]
3307    pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);
3308
3309    impl GetConversation {
3310        pub(crate) fn new(
3311            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3312        ) -> Self {
3313            Self(RequestBuilder::new(stub))
3314        }
3315
3316        /// Sets the full request, replacing any prior values.
3317        pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
3318            self.0.request = v.into();
3319            self
3320        }
3321
3322        /// Sets all the options, replacing any prior values.
3323        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3324            self.0.options = v.into();
3325            self
3326        }
3327
3328        /// Sends the request.
3329        pub async fn send(self) -> Result<crate::model::Conversation> {
3330            (*self.0.stub)
3331                .get_conversation(self.0.request, self.0.options)
3332                .await
3333                .map(crate::Response::into_body)
3334        }
3335
3336        /// Sets the value of [name][crate::model::GetConversationRequest::name].
3337        ///
3338        /// This is a **required** field for requests.
3339        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3340            self.0.request.name = v.into();
3341            self
3342        }
3343    }
3344
3345    #[doc(hidden)]
3346    impl crate::RequestBuilder for GetConversation {
3347        fn request_options(&mut self) -> &mut crate::RequestOptions {
3348            &mut self.0.options
3349        }
3350    }
3351
3352    /// The request builder for [Conversations::complete_conversation][crate::client::Conversations::complete_conversation] calls.
3353    ///
3354    /// # Example
3355    /// ```
3356    /// # use google_cloud_dialogflow_v2::builder::conversations::CompleteConversation;
3357    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3358    ///
3359    /// let builder = prepare_request_builder();
3360    /// let response = builder.send().await?;
3361    /// # Ok(()) }
3362    ///
3363    /// fn prepare_request_builder() -> CompleteConversation {
3364    ///   # panic!();
3365    ///   // ... details omitted ...
3366    /// }
3367    /// ```
3368    #[derive(Clone, Debug)]
3369    pub struct CompleteConversation(RequestBuilder<crate::model::CompleteConversationRequest>);
3370
3371    impl CompleteConversation {
3372        pub(crate) fn new(
3373            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3374        ) -> Self {
3375            Self(RequestBuilder::new(stub))
3376        }
3377
3378        /// Sets the full request, replacing any prior values.
3379        pub fn with_request<V: Into<crate::model::CompleteConversationRequest>>(
3380            mut self,
3381            v: V,
3382        ) -> Self {
3383            self.0.request = v.into();
3384            self
3385        }
3386
3387        /// Sets all the options, replacing any prior values.
3388        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3389            self.0.options = v.into();
3390            self
3391        }
3392
3393        /// Sends the request.
3394        pub async fn send(self) -> Result<crate::model::Conversation> {
3395            (*self.0.stub)
3396                .complete_conversation(self.0.request, self.0.options)
3397                .await
3398                .map(crate::Response::into_body)
3399        }
3400
3401        /// Sets the value of [name][crate::model::CompleteConversationRequest::name].
3402        ///
3403        /// This is a **required** field for requests.
3404        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3405            self.0.request.name = v.into();
3406            self
3407        }
3408    }
3409
3410    #[doc(hidden)]
3411    impl crate::RequestBuilder for CompleteConversation {
3412        fn request_options(&mut self) -> &mut crate::RequestOptions {
3413            &mut self.0.options
3414        }
3415    }
3416
3417    /// The request builder for [Conversations::ingest_context_references][crate::client::Conversations::ingest_context_references] calls.
3418    ///
3419    /// # Example
3420    /// ```
3421    /// # use google_cloud_dialogflow_v2::builder::conversations::IngestContextReferences;
3422    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3423    ///
3424    /// let builder = prepare_request_builder();
3425    /// let response = builder.send().await?;
3426    /// # Ok(()) }
3427    ///
3428    /// fn prepare_request_builder() -> IngestContextReferences {
3429    ///   # panic!();
3430    ///   // ... details omitted ...
3431    /// }
3432    /// ```
3433    #[derive(Clone, Debug)]
3434    pub struct IngestContextReferences(
3435        RequestBuilder<crate::model::IngestContextReferencesRequest>,
3436    );
3437
3438    impl IngestContextReferences {
3439        pub(crate) fn new(
3440            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3441        ) -> Self {
3442            Self(RequestBuilder::new(stub))
3443        }
3444
3445        /// Sets the full request, replacing any prior values.
3446        pub fn with_request<V: Into<crate::model::IngestContextReferencesRequest>>(
3447            mut self,
3448            v: V,
3449        ) -> Self {
3450            self.0.request = v.into();
3451            self
3452        }
3453
3454        /// Sets all the options, replacing any prior values.
3455        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3456            self.0.options = v.into();
3457            self
3458        }
3459
3460        /// Sends the request.
3461        pub async fn send(self) -> Result<crate::model::IngestContextReferencesResponse> {
3462            (*self.0.stub)
3463                .ingest_context_references(self.0.request, self.0.options)
3464                .await
3465                .map(crate::Response::into_body)
3466        }
3467
3468        /// Sets the value of [conversation][crate::model::IngestContextReferencesRequest::conversation].
3469        ///
3470        /// This is a **required** field for requests.
3471        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3472            self.0.request.conversation = v.into();
3473            self
3474        }
3475
3476        /// Sets the value of [context_references][crate::model::IngestContextReferencesRequest::context_references].
3477        ///
3478        /// This is a **required** field for requests.
3479        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3480        where
3481            T: std::iter::IntoIterator<Item = (K, V)>,
3482            K: std::convert::Into<std::string::String>,
3483            V: std::convert::Into<crate::model::conversation::ContextReference>,
3484        {
3485            self.0.request.context_references =
3486                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3487            self
3488        }
3489    }
3490
3491    #[doc(hidden)]
3492    impl crate::RequestBuilder for IngestContextReferences {
3493        fn request_options(&mut self) -> &mut crate::RequestOptions {
3494            &mut self.0.options
3495        }
3496    }
3497
3498    /// The request builder for [Conversations::list_messages][crate::client::Conversations::list_messages] calls.
3499    ///
3500    /// # Example
3501    /// ```
3502    /// # use google_cloud_dialogflow_v2::builder::conversations::ListMessages;
3503    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3504    /// use google_cloud_gax::paginator::ItemPaginator;
3505    ///
3506    /// let builder = prepare_request_builder();
3507    /// let mut items = builder.by_item();
3508    /// while let Some(result) = items.next().await {
3509    ///   let item = result?;
3510    /// }
3511    /// # Ok(()) }
3512    ///
3513    /// fn prepare_request_builder() -> ListMessages {
3514    ///   # panic!();
3515    ///   // ... details omitted ...
3516    /// }
3517    /// ```
3518    #[derive(Clone, Debug)]
3519    pub struct ListMessages(RequestBuilder<crate::model::ListMessagesRequest>);
3520
3521    impl ListMessages {
3522        pub(crate) fn new(
3523            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3524        ) -> Self {
3525            Self(RequestBuilder::new(stub))
3526        }
3527
3528        /// Sets the full request, replacing any prior values.
3529        pub fn with_request<V: Into<crate::model::ListMessagesRequest>>(mut self, v: V) -> Self {
3530            self.0.request = v.into();
3531            self
3532        }
3533
3534        /// Sets all the options, replacing any prior values.
3535        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3536            self.0.options = v.into();
3537            self
3538        }
3539
3540        /// Sends the request.
3541        pub async fn send(self) -> Result<crate::model::ListMessagesResponse> {
3542            (*self.0.stub)
3543                .list_messages(self.0.request, self.0.options)
3544                .await
3545                .map(crate::Response::into_body)
3546        }
3547
3548        /// Streams each page in the collection.
3549        pub fn by_page(
3550            self,
3551        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListMessagesResponse, crate::Error>
3552        {
3553            use std::clone::Clone;
3554            let token = self.0.request.page_token.clone();
3555            let execute = move |token: String| {
3556                let mut builder = self.clone();
3557                builder.0.request = builder.0.request.set_page_token(token);
3558                builder.send()
3559            };
3560            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3561        }
3562
3563        /// Streams each item in the collection.
3564        pub fn by_item(
3565            self,
3566        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3567            crate::model::ListMessagesResponse,
3568            crate::Error,
3569        > {
3570            use google_cloud_gax::paginator::Paginator;
3571            self.by_page().items()
3572        }
3573
3574        /// Sets the value of [parent][crate::model::ListMessagesRequest::parent].
3575        ///
3576        /// This is a **required** field for requests.
3577        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3578            self.0.request.parent = v.into();
3579            self
3580        }
3581
3582        /// Sets the value of [filter][crate::model::ListMessagesRequest::filter].
3583        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3584            self.0.request.filter = v.into();
3585            self
3586        }
3587
3588        /// Sets the value of [page_size][crate::model::ListMessagesRequest::page_size].
3589        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3590            self.0.request.page_size = v.into();
3591            self
3592        }
3593
3594        /// Sets the value of [page_token][crate::model::ListMessagesRequest::page_token].
3595        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3596            self.0.request.page_token = v.into();
3597            self
3598        }
3599    }
3600
3601    #[doc(hidden)]
3602    impl crate::RequestBuilder for ListMessages {
3603        fn request_options(&mut self) -> &mut crate::RequestOptions {
3604            &mut self.0.options
3605        }
3606    }
3607
3608    /// The request builder for [Conversations::suggest_conversation_summary][crate::client::Conversations::suggest_conversation_summary] calls.
3609    ///
3610    /// # Example
3611    /// ```
3612    /// # use google_cloud_dialogflow_v2::builder::conversations::SuggestConversationSummary;
3613    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3614    ///
3615    /// let builder = prepare_request_builder();
3616    /// let response = builder.send().await?;
3617    /// # Ok(()) }
3618    ///
3619    /// fn prepare_request_builder() -> SuggestConversationSummary {
3620    ///   # panic!();
3621    ///   // ... details omitted ...
3622    /// }
3623    /// ```
3624    #[derive(Clone, Debug)]
3625    pub struct SuggestConversationSummary(
3626        RequestBuilder<crate::model::SuggestConversationSummaryRequest>,
3627    );
3628
3629    impl SuggestConversationSummary {
3630        pub(crate) fn new(
3631            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3632        ) -> Self {
3633            Self(RequestBuilder::new(stub))
3634        }
3635
3636        /// Sets the full request, replacing any prior values.
3637        pub fn with_request<V: Into<crate::model::SuggestConversationSummaryRequest>>(
3638            mut self,
3639            v: V,
3640        ) -> Self {
3641            self.0.request = v.into();
3642            self
3643        }
3644
3645        /// Sets all the options, replacing any prior values.
3646        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3647            self.0.options = v.into();
3648            self
3649        }
3650
3651        /// Sends the request.
3652        pub async fn send(self) -> Result<crate::model::SuggestConversationSummaryResponse> {
3653            (*self.0.stub)
3654                .suggest_conversation_summary(self.0.request, self.0.options)
3655                .await
3656                .map(crate::Response::into_body)
3657        }
3658
3659        /// Sets the value of [conversation][crate::model::SuggestConversationSummaryRequest::conversation].
3660        ///
3661        /// This is a **required** field for requests.
3662        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3663            self.0.request.conversation = v.into();
3664            self
3665        }
3666
3667        /// Sets the value of [latest_message][crate::model::SuggestConversationSummaryRequest::latest_message].
3668        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3669            self.0.request.latest_message = v.into();
3670            self
3671        }
3672
3673        /// Sets the value of [context_size][crate::model::SuggestConversationSummaryRequest::context_size].
3674        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3675            self.0.request.context_size = v.into();
3676            self
3677        }
3678
3679        /// Sets the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3680        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
3681        where
3682            T: std::convert::Into<crate::model::AssistQueryParameters>,
3683        {
3684            self.0.request.assist_query_params = std::option::Option::Some(v.into());
3685            self
3686        }
3687
3688        /// Sets or clears the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3689        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
3690        where
3691            T: std::convert::Into<crate::model::AssistQueryParameters>,
3692        {
3693            self.0.request.assist_query_params = v.map(|x| x.into());
3694            self
3695        }
3696    }
3697
3698    #[doc(hidden)]
3699    impl crate::RequestBuilder for SuggestConversationSummary {
3700        fn request_options(&mut self) -> &mut crate::RequestOptions {
3701            &mut self.0.options
3702        }
3703    }
3704
3705    /// The request builder for [Conversations::generate_stateless_summary][crate::client::Conversations::generate_stateless_summary] calls.
3706    ///
3707    /// # Example
3708    /// ```
3709    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateStatelessSummary;
3710    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3711    ///
3712    /// let builder = prepare_request_builder();
3713    /// let response = builder.send().await?;
3714    /// # Ok(()) }
3715    ///
3716    /// fn prepare_request_builder() -> GenerateStatelessSummary {
3717    ///   # panic!();
3718    ///   // ... details omitted ...
3719    /// }
3720    /// ```
3721    #[derive(Clone, Debug)]
3722    pub struct GenerateStatelessSummary(
3723        RequestBuilder<crate::model::GenerateStatelessSummaryRequest>,
3724    );
3725
3726    impl GenerateStatelessSummary {
3727        pub(crate) fn new(
3728            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3729        ) -> Self {
3730            Self(RequestBuilder::new(stub))
3731        }
3732
3733        /// Sets the full request, replacing any prior values.
3734        pub fn with_request<V: Into<crate::model::GenerateStatelessSummaryRequest>>(
3735            mut self,
3736            v: V,
3737        ) -> Self {
3738            self.0.request = v.into();
3739            self
3740        }
3741
3742        /// Sets all the options, replacing any prior values.
3743        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3744            self.0.options = v.into();
3745            self
3746        }
3747
3748        /// Sends the request.
3749        pub async fn send(self) -> Result<crate::model::GenerateStatelessSummaryResponse> {
3750            (*self.0.stub)
3751                .generate_stateless_summary(self.0.request, self.0.options)
3752                .await
3753                .map(crate::Response::into_body)
3754        }
3755
3756        /// Sets the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3757        ///
3758        /// This is a **required** field for requests.
3759        pub fn set_stateless_conversation<T>(mut self, v: T) -> Self
3760        where
3761            T: std::convert::Into<
3762                    crate::model::generate_stateless_summary_request::MinimalConversation,
3763                >,
3764        {
3765            self.0.request.stateless_conversation = std::option::Option::Some(v.into());
3766            self
3767        }
3768
3769        /// Sets or clears the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3770        ///
3771        /// This is a **required** field for requests.
3772        pub fn set_or_clear_stateless_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3773        where
3774            T: std::convert::Into<
3775                    crate::model::generate_stateless_summary_request::MinimalConversation,
3776                >,
3777        {
3778            self.0.request.stateless_conversation = v.map(|x| x.into());
3779            self
3780        }
3781
3782        /// Sets the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3783        ///
3784        /// This is a **required** field for requests.
3785        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
3786        where
3787            T: std::convert::Into<crate::model::ConversationProfile>,
3788        {
3789            self.0.request.conversation_profile = std::option::Option::Some(v.into());
3790            self
3791        }
3792
3793        /// Sets or clears the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3794        ///
3795        /// This is a **required** field for requests.
3796        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
3797        where
3798            T: std::convert::Into<crate::model::ConversationProfile>,
3799        {
3800            self.0.request.conversation_profile = v.map(|x| x.into());
3801            self
3802        }
3803
3804        /// Sets the value of [latest_message][crate::model::GenerateStatelessSummaryRequest::latest_message].
3805        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3806            self.0.request.latest_message = v.into();
3807            self
3808        }
3809
3810        /// Sets the value of [max_context_size][crate::model::GenerateStatelessSummaryRequest::max_context_size].
3811        pub fn set_max_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3812            self.0.request.max_context_size = v.into();
3813            self
3814        }
3815    }
3816
3817    #[doc(hidden)]
3818    impl crate::RequestBuilder for GenerateStatelessSummary {
3819        fn request_options(&mut self) -> &mut crate::RequestOptions {
3820            &mut self.0.options
3821        }
3822    }
3823
3824    /// The request builder for [Conversations::generate_stateless_suggestion][crate::client::Conversations::generate_stateless_suggestion] calls.
3825    ///
3826    /// # Example
3827    /// ```
3828    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateStatelessSuggestion;
3829    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3830    ///
3831    /// let builder = prepare_request_builder();
3832    /// let response = builder.send().await?;
3833    /// # Ok(()) }
3834    ///
3835    /// fn prepare_request_builder() -> GenerateStatelessSuggestion {
3836    ///   # panic!();
3837    ///   // ... details omitted ...
3838    /// }
3839    /// ```
3840    #[derive(Clone, Debug)]
3841    pub struct GenerateStatelessSuggestion(
3842        RequestBuilder<crate::model::GenerateStatelessSuggestionRequest>,
3843    );
3844
3845    impl GenerateStatelessSuggestion {
3846        pub(crate) fn new(
3847            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3848        ) -> Self {
3849            Self(RequestBuilder::new(stub))
3850        }
3851
3852        /// Sets the full request, replacing any prior values.
3853        pub fn with_request<V: Into<crate::model::GenerateStatelessSuggestionRequest>>(
3854            mut self,
3855            v: V,
3856        ) -> Self {
3857            self.0.request = v.into();
3858            self
3859        }
3860
3861        /// Sets all the options, replacing any prior values.
3862        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3863            self.0.options = v.into();
3864            self
3865        }
3866
3867        /// Sends the request.
3868        pub async fn send(self) -> Result<crate::model::GenerateStatelessSuggestionResponse> {
3869            (*self.0.stub)
3870                .generate_stateless_suggestion(self.0.request, self.0.options)
3871                .await
3872                .map(crate::Response::into_body)
3873        }
3874
3875        /// Sets the value of [parent][crate::model::GenerateStatelessSuggestionRequest::parent].
3876        ///
3877        /// This is a **required** field for requests.
3878        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3879            self.0.request.parent = v.into();
3880            self
3881        }
3882
3883        /// Sets the value of [context_references][crate::model::GenerateStatelessSuggestionRequest::context_references].
3884        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3885        where
3886            T: std::iter::IntoIterator<Item = (K, V)>,
3887            K: std::convert::Into<std::string::String>,
3888            V: std::convert::Into<crate::model::conversation::ContextReference>,
3889        {
3890            self.0.request.context_references =
3891                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3892            self
3893        }
3894
3895        /// Sets the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3896        pub fn set_conversation_context<T>(mut self, v: T) -> Self
3897        where
3898            T: std::convert::Into<crate::model::ConversationContext>,
3899        {
3900            self.0.request.conversation_context = std::option::Option::Some(v.into());
3901            self
3902        }
3903
3904        /// Sets or clears the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3905        pub fn set_or_clear_conversation_context<T>(mut self, v: std::option::Option<T>) -> Self
3906        where
3907            T: std::convert::Into<crate::model::ConversationContext>,
3908        {
3909            self.0.request.conversation_context = v.map(|x| x.into());
3910            self
3911        }
3912
3913        /// Sets the value of [trigger_events][crate::model::GenerateStatelessSuggestionRequest::trigger_events].
3914        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
3915        where
3916            T: std::iter::IntoIterator<Item = V>,
3917            V: std::convert::Into<crate::model::TriggerEvent>,
3918        {
3919            use std::iter::Iterator;
3920            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
3921            self
3922        }
3923
3924        /// Sets the value of [security_settings][crate::model::GenerateStatelessSuggestionRequest::security_settings].
3925        pub fn set_security_settings<T: Into<std::string::String>>(mut self, v: T) -> Self {
3926            self.0.request.security_settings = v.into();
3927            self
3928        }
3929
3930        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource].
3931        ///
3932        /// Note that all the setters affecting `generator_resource` are
3933        /// mutually exclusive.
3934        pub fn set_generator_resource<
3935            T: Into<Option<crate::model::generate_stateless_suggestion_request::GeneratorResource>>,
3936        >(
3937            mut self,
3938            v: T,
3939        ) -> Self {
3940            self.0.request.generator_resource = v.into();
3941            self
3942        }
3943
3944        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3945        /// to hold a `Generator`.
3946        ///
3947        /// Note that all the setters affecting `generator_resource` are
3948        /// mutually exclusive.
3949        pub fn set_generator<T: std::convert::Into<std::boxed::Box<crate::model::Generator>>>(
3950            mut self,
3951            v: T,
3952        ) -> Self {
3953            self.0.request = self.0.request.set_generator(v);
3954            self
3955        }
3956
3957        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3958        /// to hold a `GeneratorName`.
3959        ///
3960        /// Note that all the setters affecting `generator_resource` are
3961        /// mutually exclusive.
3962        pub fn set_generator_name<T: std::convert::Into<std::string::String>>(
3963            mut self,
3964            v: T,
3965        ) -> Self {
3966            self.0.request = self.0.request.set_generator_name(v);
3967            self
3968        }
3969    }
3970
3971    #[doc(hidden)]
3972    impl crate::RequestBuilder for GenerateStatelessSuggestion {
3973        fn request_options(&mut self) -> &mut crate::RequestOptions {
3974            &mut self.0.options
3975        }
3976    }
3977
3978    /// The request builder for [Conversations::search_knowledge][crate::client::Conversations::search_knowledge] calls.
3979    ///
3980    /// # Example
3981    /// ```
3982    /// # use google_cloud_dialogflow_v2::builder::conversations::SearchKnowledge;
3983    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3984    ///
3985    /// let builder = prepare_request_builder();
3986    /// let response = builder.send().await?;
3987    /// # Ok(()) }
3988    ///
3989    /// fn prepare_request_builder() -> SearchKnowledge {
3990    ///   # panic!();
3991    ///   // ... details omitted ...
3992    /// }
3993    /// ```
3994    #[derive(Clone, Debug)]
3995    pub struct SearchKnowledge(RequestBuilder<crate::model::SearchKnowledgeRequest>);
3996
3997    impl SearchKnowledge {
3998        pub(crate) fn new(
3999            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4000        ) -> Self {
4001            Self(RequestBuilder::new(stub))
4002        }
4003
4004        /// Sets the full request, replacing any prior values.
4005        pub fn with_request<V: Into<crate::model::SearchKnowledgeRequest>>(mut self, v: V) -> Self {
4006            self.0.request = v.into();
4007            self
4008        }
4009
4010        /// Sets all the options, replacing any prior values.
4011        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4012            self.0.options = v.into();
4013            self
4014        }
4015
4016        /// Sends the request.
4017        pub async fn send(self) -> Result<crate::model::SearchKnowledgeResponse> {
4018            (*self.0.stub)
4019                .search_knowledge(self.0.request, self.0.options)
4020                .await
4021                .map(crate::Response::into_body)
4022        }
4023
4024        /// Sets the value of [parent][crate::model::SearchKnowledgeRequest::parent].
4025        ///
4026        /// This is a **required** field for requests.
4027        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4028            self.0.request.parent = v.into();
4029            self
4030        }
4031
4032        /// Sets the value of [query][crate::model::SearchKnowledgeRequest::query].
4033        ///
4034        /// This is a **required** field for requests.
4035        pub fn set_query<T>(mut self, v: T) -> Self
4036        where
4037            T: std::convert::Into<crate::model::TextInput>,
4038        {
4039            self.0.request.query = std::option::Option::Some(v.into());
4040            self
4041        }
4042
4043        /// Sets or clears the value of [query][crate::model::SearchKnowledgeRequest::query].
4044        ///
4045        /// This is a **required** field for requests.
4046        pub fn set_or_clear_query<T>(mut self, v: std::option::Option<T>) -> Self
4047        where
4048            T: std::convert::Into<crate::model::TextInput>,
4049        {
4050            self.0.request.query = v.map(|x| x.into());
4051            self
4052        }
4053
4054        /// Sets the value of [conversation_profile][crate::model::SearchKnowledgeRequest::conversation_profile].
4055        ///
4056        /// This is a **required** field for requests.
4057        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
4058            self.0.request.conversation_profile = v.into();
4059            self
4060        }
4061
4062        /// Sets the value of [session_id][crate::model::SearchKnowledgeRequest::session_id].
4063        ///
4064        /// This is a **required** field for requests.
4065        pub fn set_session_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4066            self.0.request.session_id = v.into();
4067            self
4068        }
4069
4070        /// Sets the value of [conversation][crate::model::SearchKnowledgeRequest::conversation].
4071        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4072            self.0.request.conversation = v.into();
4073            self
4074        }
4075
4076        /// Sets the value of [latest_message][crate::model::SearchKnowledgeRequest::latest_message].
4077        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4078            self.0.request.latest_message = v.into();
4079            self
4080        }
4081
4082        /// Sets the value of [query_source][crate::model::SearchKnowledgeRequest::query_source].
4083        pub fn set_query_source<T: Into<crate::model::search_knowledge_request::QuerySource>>(
4084            mut self,
4085            v: T,
4086        ) -> Self {
4087            self.0.request.query_source = v.into();
4088            self
4089        }
4090
4091        /// Sets the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4092        pub fn set_end_user_metadata<T>(mut self, v: T) -> Self
4093        where
4094            T: std::convert::Into<wkt::Struct>,
4095        {
4096            self.0.request.end_user_metadata = std::option::Option::Some(v.into());
4097            self
4098        }
4099
4100        /// Sets or clears the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4101        pub fn set_or_clear_end_user_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4102        where
4103            T: std::convert::Into<wkt::Struct>,
4104        {
4105            self.0.request.end_user_metadata = v.map(|x| x.into());
4106            self
4107        }
4108
4109        /// Sets the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4110        pub fn set_search_config<T>(mut self, v: T) -> Self
4111        where
4112            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4113        {
4114            self.0.request.search_config = std::option::Option::Some(v.into());
4115            self
4116        }
4117
4118        /// Sets or clears the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4119        pub fn set_or_clear_search_config<T>(mut self, v: std::option::Option<T>) -> Self
4120        where
4121            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4122        {
4123            self.0.request.search_config = v.map(|x| x.into());
4124            self
4125        }
4126
4127        /// Sets the value of [exact_search][crate::model::SearchKnowledgeRequest::exact_search].
4128        pub fn set_exact_search<T: Into<bool>>(mut self, v: T) -> Self {
4129            self.0.request.exact_search = v.into();
4130            self
4131        }
4132    }
4133
4134    #[doc(hidden)]
4135    impl crate::RequestBuilder for SearchKnowledge {
4136        fn request_options(&mut self) -> &mut crate::RequestOptions {
4137            &mut self.0.options
4138        }
4139    }
4140
4141    /// The request builder for [Conversations::generate_suggestions][crate::client::Conversations::generate_suggestions] calls.
4142    ///
4143    /// # Example
4144    /// ```
4145    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateSuggestions;
4146    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4147    ///
4148    /// let builder = prepare_request_builder();
4149    /// let response = builder.send().await?;
4150    /// # Ok(()) }
4151    ///
4152    /// fn prepare_request_builder() -> GenerateSuggestions {
4153    ///   # panic!();
4154    ///   // ... details omitted ...
4155    /// }
4156    /// ```
4157    #[derive(Clone, Debug)]
4158    pub struct GenerateSuggestions(RequestBuilder<crate::model::GenerateSuggestionsRequest>);
4159
4160    impl GenerateSuggestions {
4161        pub(crate) fn new(
4162            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4163        ) -> Self {
4164            Self(RequestBuilder::new(stub))
4165        }
4166
4167        /// Sets the full request, replacing any prior values.
4168        pub fn with_request<V: Into<crate::model::GenerateSuggestionsRequest>>(
4169            mut self,
4170            v: V,
4171        ) -> Self {
4172            self.0.request = v.into();
4173            self
4174        }
4175
4176        /// Sets all the options, replacing any prior values.
4177        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4178            self.0.options = v.into();
4179            self
4180        }
4181
4182        /// Sends the request.
4183        pub async fn send(self) -> Result<crate::model::GenerateSuggestionsResponse> {
4184            (*self.0.stub)
4185                .generate_suggestions(self.0.request, self.0.options)
4186                .await
4187                .map(crate::Response::into_body)
4188        }
4189
4190        /// Sets the value of [conversation][crate::model::GenerateSuggestionsRequest::conversation].
4191        ///
4192        /// This is a **required** field for requests.
4193        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4194            self.0.request.conversation = v.into();
4195            self
4196        }
4197
4198        /// Sets the value of [latest_message][crate::model::GenerateSuggestionsRequest::latest_message].
4199        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4200            self.0.request.latest_message = v.into();
4201            self
4202        }
4203
4204        /// Sets the value of [trigger_events][crate::model::GenerateSuggestionsRequest::trigger_events].
4205        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
4206        where
4207            T: std::iter::IntoIterator<Item = V>,
4208            V: std::convert::Into<crate::model::TriggerEvent>,
4209        {
4210            use std::iter::Iterator;
4211            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
4212            self
4213        }
4214    }
4215
4216    #[doc(hidden)]
4217    impl crate::RequestBuilder for GenerateSuggestions {
4218        fn request_options(&mut self) -> &mut crate::RequestOptions {
4219            &mut self.0.options
4220        }
4221    }
4222
4223    /// The request builder for [Conversations::list_locations][crate::client::Conversations::list_locations] calls.
4224    ///
4225    /// # Example
4226    /// ```
4227    /// # use google_cloud_dialogflow_v2::builder::conversations::ListLocations;
4228    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4229    /// use google_cloud_gax::paginator::ItemPaginator;
4230    ///
4231    /// let builder = prepare_request_builder();
4232    /// let mut items = builder.by_item();
4233    /// while let Some(result) = items.next().await {
4234    ///   let item = result?;
4235    /// }
4236    /// # Ok(()) }
4237    ///
4238    /// fn prepare_request_builder() -> ListLocations {
4239    ///   # panic!();
4240    ///   // ... details omitted ...
4241    /// }
4242    /// ```
4243    #[derive(Clone, Debug)]
4244    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4245
4246    impl ListLocations {
4247        pub(crate) fn new(
4248            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4249        ) -> Self {
4250            Self(RequestBuilder::new(stub))
4251        }
4252
4253        /// Sets the full request, replacing any prior values.
4254        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4255            mut self,
4256            v: V,
4257        ) -> Self {
4258            self.0.request = v.into();
4259            self
4260        }
4261
4262        /// Sets all the options, replacing any prior values.
4263        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4264            self.0.options = v.into();
4265            self
4266        }
4267
4268        /// Sends the request.
4269        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4270            (*self.0.stub)
4271                .list_locations(self.0.request, self.0.options)
4272                .await
4273                .map(crate::Response::into_body)
4274        }
4275
4276        /// Streams each page in the collection.
4277        pub fn by_page(
4278            self,
4279        ) -> impl google_cloud_gax::paginator::Paginator<
4280            google_cloud_location::model::ListLocationsResponse,
4281            crate::Error,
4282        > {
4283            use std::clone::Clone;
4284            let token = self.0.request.page_token.clone();
4285            let execute = move |token: String| {
4286                let mut builder = self.clone();
4287                builder.0.request = builder.0.request.set_page_token(token);
4288                builder.send()
4289            };
4290            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4291        }
4292
4293        /// Streams each item in the collection.
4294        pub fn by_item(
4295            self,
4296        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4297            google_cloud_location::model::ListLocationsResponse,
4298            crate::Error,
4299        > {
4300            use google_cloud_gax::paginator::Paginator;
4301            self.by_page().items()
4302        }
4303
4304        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4305        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4306            self.0.request.name = v.into();
4307            self
4308        }
4309
4310        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4311        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4312            self.0.request.filter = v.into();
4313            self
4314        }
4315
4316        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4317        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4318            self.0.request.page_size = v.into();
4319            self
4320        }
4321
4322        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4323        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4324            self.0.request.page_token = v.into();
4325            self
4326        }
4327    }
4328
4329    #[doc(hidden)]
4330    impl crate::RequestBuilder for ListLocations {
4331        fn request_options(&mut self) -> &mut crate::RequestOptions {
4332            &mut self.0.options
4333        }
4334    }
4335
4336    /// The request builder for [Conversations::get_location][crate::client::Conversations::get_location] calls.
4337    ///
4338    /// # Example
4339    /// ```
4340    /// # use google_cloud_dialogflow_v2::builder::conversations::GetLocation;
4341    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4342    ///
4343    /// let builder = prepare_request_builder();
4344    /// let response = builder.send().await?;
4345    /// # Ok(()) }
4346    ///
4347    /// fn prepare_request_builder() -> GetLocation {
4348    ///   # panic!();
4349    ///   // ... details omitted ...
4350    /// }
4351    /// ```
4352    #[derive(Clone, Debug)]
4353    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4354
4355    impl GetLocation {
4356        pub(crate) fn new(
4357            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4358        ) -> Self {
4359            Self(RequestBuilder::new(stub))
4360        }
4361
4362        /// Sets the full request, replacing any prior values.
4363        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4364            mut self,
4365            v: V,
4366        ) -> Self {
4367            self.0.request = v.into();
4368            self
4369        }
4370
4371        /// Sets all the options, replacing any prior values.
4372        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4373            self.0.options = v.into();
4374            self
4375        }
4376
4377        /// Sends the request.
4378        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4379            (*self.0.stub)
4380                .get_location(self.0.request, self.0.options)
4381                .await
4382                .map(crate::Response::into_body)
4383        }
4384
4385        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4386        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4387            self.0.request.name = v.into();
4388            self
4389        }
4390    }
4391
4392    #[doc(hidden)]
4393    impl crate::RequestBuilder for GetLocation {
4394        fn request_options(&mut self) -> &mut crate::RequestOptions {
4395            &mut self.0.options
4396        }
4397    }
4398
4399    /// The request builder for [Conversations::list_operations][crate::client::Conversations::list_operations] calls.
4400    ///
4401    /// # Example
4402    /// ```
4403    /// # use google_cloud_dialogflow_v2::builder::conversations::ListOperations;
4404    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4405    /// use google_cloud_gax::paginator::ItemPaginator;
4406    ///
4407    /// let builder = prepare_request_builder();
4408    /// let mut items = builder.by_item();
4409    /// while let Some(result) = items.next().await {
4410    ///   let item = result?;
4411    /// }
4412    /// # Ok(()) }
4413    ///
4414    /// fn prepare_request_builder() -> ListOperations {
4415    ///   # panic!();
4416    ///   // ... details omitted ...
4417    /// }
4418    /// ```
4419    #[derive(Clone, Debug)]
4420    pub struct ListOperations(
4421        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4422    );
4423
4424    impl ListOperations {
4425        pub(crate) fn new(
4426            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4427        ) -> Self {
4428            Self(RequestBuilder::new(stub))
4429        }
4430
4431        /// Sets the full request, replacing any prior values.
4432        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4433            mut self,
4434            v: V,
4435        ) -> Self {
4436            self.0.request = v.into();
4437            self
4438        }
4439
4440        /// Sets all the options, replacing any prior values.
4441        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4442            self.0.options = v.into();
4443            self
4444        }
4445
4446        /// Sends the request.
4447        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4448            (*self.0.stub)
4449                .list_operations(self.0.request, self.0.options)
4450                .await
4451                .map(crate::Response::into_body)
4452        }
4453
4454        /// Streams each page in the collection.
4455        pub fn by_page(
4456            self,
4457        ) -> impl google_cloud_gax::paginator::Paginator<
4458            google_cloud_longrunning::model::ListOperationsResponse,
4459            crate::Error,
4460        > {
4461            use std::clone::Clone;
4462            let token = self.0.request.page_token.clone();
4463            let execute = move |token: String| {
4464                let mut builder = self.clone();
4465                builder.0.request = builder.0.request.set_page_token(token);
4466                builder.send()
4467            };
4468            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4469        }
4470
4471        /// Streams each item in the collection.
4472        pub fn by_item(
4473            self,
4474        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4475            google_cloud_longrunning::model::ListOperationsResponse,
4476            crate::Error,
4477        > {
4478            use google_cloud_gax::paginator::Paginator;
4479            self.by_page().items()
4480        }
4481
4482        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4483        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4484            self.0.request.name = v.into();
4485            self
4486        }
4487
4488        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4489        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4490            self.0.request.filter = v.into();
4491            self
4492        }
4493
4494        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4495        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4496            self.0.request.page_size = v.into();
4497            self
4498        }
4499
4500        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4501        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4502            self.0.request.page_token = v.into();
4503            self
4504        }
4505
4506        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4507        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4508            self.0.request.return_partial_success = v.into();
4509            self
4510        }
4511    }
4512
4513    #[doc(hidden)]
4514    impl crate::RequestBuilder for ListOperations {
4515        fn request_options(&mut self) -> &mut crate::RequestOptions {
4516            &mut self.0.options
4517        }
4518    }
4519
4520    /// The request builder for [Conversations::get_operation][crate::client::Conversations::get_operation] calls.
4521    ///
4522    /// # Example
4523    /// ```
4524    /// # use google_cloud_dialogflow_v2::builder::conversations::GetOperation;
4525    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4526    ///
4527    /// let builder = prepare_request_builder();
4528    /// let response = builder.send().await?;
4529    /// # Ok(()) }
4530    ///
4531    /// fn prepare_request_builder() -> GetOperation {
4532    ///   # panic!();
4533    ///   // ... details omitted ...
4534    /// }
4535    /// ```
4536    #[derive(Clone, Debug)]
4537    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4538
4539    impl GetOperation {
4540        pub(crate) fn new(
4541            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4542        ) -> Self {
4543            Self(RequestBuilder::new(stub))
4544        }
4545
4546        /// Sets the full request, replacing any prior values.
4547        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4548            mut self,
4549            v: V,
4550        ) -> Self {
4551            self.0.request = v.into();
4552            self
4553        }
4554
4555        /// Sets all the options, replacing any prior values.
4556        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4557            self.0.options = v.into();
4558            self
4559        }
4560
4561        /// Sends the request.
4562        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4563            (*self.0.stub)
4564                .get_operation(self.0.request, self.0.options)
4565                .await
4566                .map(crate::Response::into_body)
4567        }
4568
4569        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4570        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4571            self.0.request.name = v.into();
4572            self
4573        }
4574    }
4575
4576    #[doc(hidden)]
4577    impl crate::RequestBuilder for GetOperation {
4578        fn request_options(&mut self) -> &mut crate::RequestOptions {
4579            &mut self.0.options
4580        }
4581    }
4582
4583    /// The request builder for [Conversations::cancel_operation][crate::client::Conversations::cancel_operation] calls.
4584    ///
4585    /// # Example
4586    /// ```
4587    /// # use google_cloud_dialogflow_v2::builder::conversations::CancelOperation;
4588    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4589    ///
4590    /// let builder = prepare_request_builder();
4591    /// let response = builder.send().await?;
4592    /// # Ok(()) }
4593    ///
4594    /// fn prepare_request_builder() -> CancelOperation {
4595    ///   # panic!();
4596    ///   // ... details omitted ...
4597    /// }
4598    /// ```
4599    #[derive(Clone, Debug)]
4600    pub struct CancelOperation(
4601        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4602    );
4603
4604    impl CancelOperation {
4605        pub(crate) fn new(
4606            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4607        ) -> Self {
4608            Self(RequestBuilder::new(stub))
4609        }
4610
4611        /// Sets the full request, replacing any prior values.
4612        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4613            mut self,
4614            v: V,
4615        ) -> Self {
4616            self.0.request = v.into();
4617            self
4618        }
4619
4620        /// Sets all the options, replacing any prior values.
4621        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4622            self.0.options = v.into();
4623            self
4624        }
4625
4626        /// Sends the request.
4627        pub async fn send(self) -> Result<()> {
4628            (*self.0.stub)
4629                .cancel_operation(self.0.request, self.0.options)
4630                .await
4631                .map(crate::Response::into_body)
4632        }
4633
4634        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4635        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4636            self.0.request.name = v.into();
4637            self
4638        }
4639    }
4640
4641    #[doc(hidden)]
4642    impl crate::RequestBuilder for CancelOperation {
4643        fn request_options(&mut self) -> &mut crate::RequestOptions {
4644            &mut self.0.options
4645        }
4646    }
4647}
4648
4649/// Request and client builders for [ConversationDatasets][crate::client::ConversationDatasets].
4650#[cfg(feature = "conversation-datasets")]
4651#[cfg_attr(docsrs, doc(cfg(feature = "conversation-datasets")))]
4652pub mod conversation_datasets {
4653    use crate::Result;
4654
4655    /// A builder for [ConversationDatasets][crate::client::ConversationDatasets].
4656    ///
4657    /// ```
4658    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4659    /// # use google_cloud_dialogflow_v2::*;
4660    /// # use builder::conversation_datasets::ClientBuilder;
4661    /// # use client::ConversationDatasets;
4662    /// let builder : ClientBuilder = ConversationDatasets::builder();
4663    /// let client = builder
4664    ///     .with_endpoint("https://dialogflow.googleapis.com")
4665    ///     .build().await?;
4666    /// # Ok(()) }
4667    /// ```
4668    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4669
4670    pub(crate) mod client {
4671        use super::super::super::client::ConversationDatasets;
4672        pub struct Factory;
4673        impl crate::ClientFactory for Factory {
4674            type Client = ConversationDatasets;
4675            type Credentials = gaxi::options::Credentials;
4676            async fn build(
4677                self,
4678                config: gaxi::options::ClientConfig,
4679            ) -> crate::ClientBuilderResult<Self::Client> {
4680                Self::Client::new(config).await
4681            }
4682        }
4683    }
4684
4685    /// Common implementation for [crate::client::ConversationDatasets] request builders.
4686    #[derive(Clone, Debug)]
4687    pub(crate) struct RequestBuilder<R: std::default::Default> {
4688        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4689        request: R,
4690        options: crate::RequestOptions,
4691    }
4692
4693    impl<R> RequestBuilder<R>
4694    where
4695        R: std::default::Default,
4696    {
4697        pub(crate) fn new(
4698            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4699        ) -> Self {
4700            Self {
4701                stub,
4702                request: R::default(),
4703                options: crate::RequestOptions::default(),
4704            }
4705        }
4706    }
4707
4708    /// The request builder for [ConversationDatasets::create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset] calls.
4709    ///
4710    /// # Example
4711    /// ```
4712    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::CreateConversationDataset;
4713    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4714    /// use google_cloud_lro::Poller;
4715    ///
4716    /// let builder = prepare_request_builder();
4717    /// let response = builder.poller().until_done().await?;
4718    /// # Ok(()) }
4719    ///
4720    /// fn prepare_request_builder() -> CreateConversationDataset {
4721    ///   # panic!();
4722    ///   // ... details omitted ...
4723    /// }
4724    /// ```
4725    #[derive(Clone, Debug)]
4726    pub struct CreateConversationDataset(
4727        RequestBuilder<crate::model::CreateConversationDatasetRequest>,
4728    );
4729
4730    impl CreateConversationDataset {
4731        pub(crate) fn new(
4732            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4733        ) -> Self {
4734            Self(RequestBuilder::new(stub))
4735        }
4736
4737        /// Sets the full request, replacing any prior values.
4738        pub fn with_request<V: Into<crate::model::CreateConversationDatasetRequest>>(
4739            mut self,
4740            v: V,
4741        ) -> Self {
4742            self.0.request = v.into();
4743            self
4744        }
4745
4746        /// Sets all the options, replacing any prior values.
4747        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4748            self.0.options = v.into();
4749            self
4750        }
4751
4752        /// Sends the request.
4753        ///
4754        /// # Long running operations
4755        ///
4756        /// This starts, but does not poll, a longrunning operation. More information
4757        /// on [create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset].
4758        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4759            (*self.0.stub)
4760                .create_conversation_dataset(self.0.request, self.0.options)
4761                .await
4762                .map(crate::Response::into_body)
4763        }
4764
4765        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_dataset`.
4766        pub fn poller(
4767            self,
4768        ) -> impl google_cloud_lro::Poller<
4769            crate::model::ConversationDataset,
4770            crate::model::CreateConversationDatasetOperationMetadata,
4771        > {
4772            type Operation = google_cloud_lro::internal::Operation<
4773                crate::model::ConversationDataset,
4774                crate::model::CreateConversationDatasetOperationMetadata,
4775            >;
4776            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4777            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4778            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4779            if let Some(ref mut details) = poller_options.tracing {
4780                details.method_name = "google_cloud_dialogflow_v2::client::ConversationDatasets::create_conversation_dataset::until_done";
4781            }
4782
4783            let stub = self.0.stub.clone();
4784            let mut options = self.0.options.clone();
4785            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4786            let query = move |name| {
4787                let stub = stub.clone();
4788                let options = options.clone();
4789                async {
4790                    let op = GetOperation::new(stub)
4791                        .set_name(name)
4792                        .with_options(options)
4793                        .send()
4794                        .await?;
4795                    Ok(Operation::new(op))
4796                }
4797            };
4798
4799            let start = move || async {
4800                let op = self.send().await?;
4801                Ok(Operation::new(op))
4802            };
4803
4804            use google_cloud_lro::internal::PollerExt;
4805            {
4806                google_cloud_lro::internal::new_poller(
4807                    polling_error_policy,
4808                    polling_backoff_policy,
4809                    start,
4810                    query,
4811                )
4812            }
4813            .with_options(poller_options)
4814        }
4815
4816        /// Sets the value of [parent][crate::model::CreateConversationDatasetRequest::parent].
4817        ///
4818        /// This is a **required** field for requests.
4819        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4820            self.0.request.parent = v.into();
4821            self
4822        }
4823
4824        /// Sets the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4825        ///
4826        /// This is a **required** field for requests.
4827        pub fn set_conversation_dataset<T>(mut self, v: T) -> Self
4828        where
4829            T: std::convert::Into<crate::model::ConversationDataset>,
4830        {
4831            self.0.request.conversation_dataset = std::option::Option::Some(v.into());
4832            self
4833        }
4834
4835        /// Sets or clears the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4836        ///
4837        /// This is a **required** field for requests.
4838        pub fn set_or_clear_conversation_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4839        where
4840            T: std::convert::Into<crate::model::ConversationDataset>,
4841        {
4842            self.0.request.conversation_dataset = v.map(|x| x.into());
4843            self
4844        }
4845    }
4846
4847    #[doc(hidden)]
4848    impl crate::RequestBuilder for CreateConversationDataset {
4849        fn request_options(&mut self) -> &mut crate::RequestOptions {
4850            &mut self.0.options
4851        }
4852    }
4853
4854    /// The request builder for [ConversationDatasets::get_conversation_dataset][crate::client::ConversationDatasets::get_conversation_dataset] calls.
4855    ///
4856    /// # Example
4857    /// ```
4858    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetConversationDataset;
4859    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4860    ///
4861    /// let builder = prepare_request_builder();
4862    /// let response = builder.send().await?;
4863    /// # Ok(()) }
4864    ///
4865    /// fn prepare_request_builder() -> GetConversationDataset {
4866    ///   # panic!();
4867    ///   // ... details omitted ...
4868    /// }
4869    /// ```
4870    #[derive(Clone, Debug)]
4871    pub struct GetConversationDataset(RequestBuilder<crate::model::GetConversationDatasetRequest>);
4872
4873    impl GetConversationDataset {
4874        pub(crate) fn new(
4875            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4876        ) -> Self {
4877            Self(RequestBuilder::new(stub))
4878        }
4879
4880        /// Sets the full request, replacing any prior values.
4881        pub fn with_request<V: Into<crate::model::GetConversationDatasetRequest>>(
4882            mut self,
4883            v: V,
4884        ) -> Self {
4885            self.0.request = v.into();
4886            self
4887        }
4888
4889        /// Sets all the options, replacing any prior values.
4890        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4891            self.0.options = v.into();
4892            self
4893        }
4894
4895        /// Sends the request.
4896        pub async fn send(self) -> Result<crate::model::ConversationDataset> {
4897            (*self.0.stub)
4898                .get_conversation_dataset(self.0.request, self.0.options)
4899                .await
4900                .map(crate::Response::into_body)
4901        }
4902
4903        /// Sets the value of [name][crate::model::GetConversationDatasetRequest::name].
4904        ///
4905        /// This is a **required** field for requests.
4906        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4907            self.0.request.name = v.into();
4908            self
4909        }
4910    }
4911
4912    #[doc(hidden)]
4913    impl crate::RequestBuilder for GetConversationDataset {
4914        fn request_options(&mut self) -> &mut crate::RequestOptions {
4915            &mut self.0.options
4916        }
4917    }
4918
4919    /// The request builder for [ConversationDatasets::list_conversation_datasets][crate::client::ConversationDatasets::list_conversation_datasets] calls.
4920    ///
4921    /// # Example
4922    /// ```
4923    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListConversationDatasets;
4924    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4925    /// use google_cloud_gax::paginator::ItemPaginator;
4926    ///
4927    /// let builder = prepare_request_builder();
4928    /// let mut items = builder.by_item();
4929    /// while let Some(result) = items.next().await {
4930    ///   let item = result?;
4931    /// }
4932    /// # Ok(()) }
4933    ///
4934    /// fn prepare_request_builder() -> ListConversationDatasets {
4935    ///   # panic!();
4936    ///   // ... details omitted ...
4937    /// }
4938    /// ```
4939    #[derive(Clone, Debug)]
4940    pub struct ListConversationDatasets(
4941        RequestBuilder<crate::model::ListConversationDatasetsRequest>,
4942    );
4943
4944    impl ListConversationDatasets {
4945        pub(crate) fn new(
4946            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4947        ) -> Self {
4948            Self(RequestBuilder::new(stub))
4949        }
4950
4951        /// Sets the full request, replacing any prior values.
4952        pub fn with_request<V: Into<crate::model::ListConversationDatasetsRequest>>(
4953            mut self,
4954            v: V,
4955        ) -> Self {
4956            self.0.request = v.into();
4957            self
4958        }
4959
4960        /// Sets all the options, replacing any prior values.
4961        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4962            self.0.options = v.into();
4963            self
4964        }
4965
4966        /// Sends the request.
4967        pub async fn send(self) -> Result<crate::model::ListConversationDatasetsResponse> {
4968            (*self.0.stub)
4969                .list_conversation_datasets(self.0.request, self.0.options)
4970                .await
4971                .map(crate::Response::into_body)
4972        }
4973
4974        /// Streams each page in the collection.
4975        pub fn by_page(
4976            self,
4977        ) -> impl google_cloud_gax::paginator::Paginator<
4978            crate::model::ListConversationDatasetsResponse,
4979            crate::Error,
4980        > {
4981            use std::clone::Clone;
4982            let token = self.0.request.page_token.clone();
4983            let execute = move |token: String| {
4984                let mut builder = self.clone();
4985                builder.0.request = builder.0.request.set_page_token(token);
4986                builder.send()
4987            };
4988            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4989        }
4990
4991        /// Streams each item in the collection.
4992        pub fn by_item(
4993            self,
4994        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4995            crate::model::ListConversationDatasetsResponse,
4996            crate::Error,
4997        > {
4998            use google_cloud_gax::paginator::Paginator;
4999            self.by_page().items()
5000        }
5001
5002        /// Sets the value of [parent][crate::model::ListConversationDatasetsRequest::parent].
5003        ///
5004        /// This is a **required** field for requests.
5005        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5006            self.0.request.parent = v.into();
5007            self
5008        }
5009
5010        /// Sets the value of [page_size][crate::model::ListConversationDatasetsRequest::page_size].
5011        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5012            self.0.request.page_size = v.into();
5013            self
5014        }
5015
5016        /// Sets the value of [page_token][crate::model::ListConversationDatasetsRequest::page_token].
5017        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5018            self.0.request.page_token = v.into();
5019            self
5020        }
5021    }
5022
5023    #[doc(hidden)]
5024    impl crate::RequestBuilder for ListConversationDatasets {
5025        fn request_options(&mut self) -> &mut crate::RequestOptions {
5026            &mut self.0.options
5027        }
5028    }
5029
5030    /// The request builder for [ConversationDatasets::delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset] calls.
5031    ///
5032    /// # Example
5033    /// ```
5034    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::DeleteConversationDataset;
5035    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5036    /// use google_cloud_lro::Poller;
5037    ///
5038    /// let builder = prepare_request_builder();
5039    /// let response = builder.poller().until_done().await?;
5040    /// # Ok(()) }
5041    ///
5042    /// fn prepare_request_builder() -> DeleteConversationDataset {
5043    ///   # panic!();
5044    ///   // ... details omitted ...
5045    /// }
5046    /// ```
5047    #[derive(Clone, Debug)]
5048    pub struct DeleteConversationDataset(
5049        RequestBuilder<crate::model::DeleteConversationDatasetRequest>,
5050    );
5051
5052    impl DeleteConversationDataset {
5053        pub(crate) fn new(
5054            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
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<crate::model::DeleteConversationDatasetRequest>>(
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        ///
5076        /// # Long running operations
5077        ///
5078        /// This starts, but does not poll, a longrunning operation. More information
5079        /// on [delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset].
5080        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5081            (*self.0.stub)
5082                .delete_conversation_dataset(self.0.request, self.0.options)
5083                .await
5084                .map(crate::Response::into_body)
5085        }
5086
5087        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_conversation_dataset`.
5088        pub fn poller(
5089            self,
5090        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteConversationDatasetOperationMetadata>
5091        {
5092            type Operation = google_cloud_lro::internal::Operation<
5093                wkt::Empty,
5094                crate::model::DeleteConversationDatasetOperationMetadata,
5095            >;
5096            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5097            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5098            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5099            if let Some(ref mut details) = poller_options.tracing {
5100                details.method_name = "google_cloud_dialogflow_v2::client::ConversationDatasets::delete_conversation_dataset::until_done";
5101            }
5102
5103            let stub = self.0.stub.clone();
5104            let mut options = self.0.options.clone();
5105            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5106            let query = move |name| {
5107                let stub = stub.clone();
5108                let options = options.clone();
5109                async {
5110                    let op = GetOperation::new(stub)
5111                        .set_name(name)
5112                        .with_options(options)
5113                        .send()
5114                        .await?;
5115                    Ok(Operation::new(op))
5116                }
5117            };
5118
5119            let start = move || async {
5120                let op = self.send().await?;
5121                Ok(Operation::new(op))
5122            };
5123
5124            use google_cloud_lro::internal::PollerExt;
5125            {
5126                google_cloud_lro::internal::new_unit_response_poller(
5127                    polling_error_policy,
5128                    polling_backoff_policy,
5129                    start,
5130                    query,
5131                )
5132            }
5133            .with_options(poller_options)
5134        }
5135
5136        /// Sets the value of [name][crate::model::DeleteConversationDatasetRequest::name].
5137        ///
5138        /// This is a **required** field for requests.
5139        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5140            self.0.request.name = v.into();
5141            self
5142        }
5143    }
5144
5145    #[doc(hidden)]
5146    impl crate::RequestBuilder for DeleteConversationDataset {
5147        fn request_options(&mut self) -> &mut crate::RequestOptions {
5148            &mut self.0.options
5149        }
5150    }
5151
5152    /// The request builder for [ConversationDatasets::import_conversation_data][crate::client::ConversationDatasets::import_conversation_data] calls.
5153    ///
5154    /// # Example
5155    /// ```
5156    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ImportConversationData;
5157    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5158    /// use google_cloud_lro::Poller;
5159    ///
5160    /// let builder = prepare_request_builder();
5161    /// let response = builder.poller().until_done().await?;
5162    /// # Ok(()) }
5163    ///
5164    /// fn prepare_request_builder() -> ImportConversationData {
5165    ///   # panic!();
5166    ///   // ... details omitted ...
5167    /// }
5168    /// ```
5169    #[derive(Clone, Debug)]
5170    pub struct ImportConversationData(RequestBuilder<crate::model::ImportConversationDataRequest>);
5171
5172    impl ImportConversationData {
5173        pub(crate) fn new(
5174            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5175        ) -> Self {
5176            Self(RequestBuilder::new(stub))
5177        }
5178
5179        /// Sets the full request, replacing any prior values.
5180        pub fn with_request<V: Into<crate::model::ImportConversationDataRequest>>(
5181            mut self,
5182            v: V,
5183        ) -> Self {
5184            self.0.request = v.into();
5185            self
5186        }
5187
5188        /// Sets all the options, replacing any prior values.
5189        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5190            self.0.options = v.into();
5191            self
5192        }
5193
5194        /// Sends the request.
5195        ///
5196        /// # Long running operations
5197        ///
5198        /// This starts, but does not poll, a longrunning operation. More information
5199        /// on [import_conversation_data][crate::client::ConversationDatasets::import_conversation_data].
5200        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5201            (*self.0.stub)
5202                .import_conversation_data(self.0.request, self.0.options)
5203                .await
5204                .map(crate::Response::into_body)
5205        }
5206
5207        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_conversation_data`.
5208        pub fn poller(
5209            self,
5210        ) -> impl google_cloud_lro::Poller<
5211            crate::model::ImportConversationDataOperationResponse,
5212            crate::model::ImportConversationDataOperationMetadata,
5213        > {
5214            type Operation = google_cloud_lro::internal::Operation<
5215                crate::model::ImportConversationDataOperationResponse,
5216                crate::model::ImportConversationDataOperationMetadata,
5217            >;
5218            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5219            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5220            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5221            if let Some(ref mut details) = poller_options.tracing {
5222                details.method_name = "google_cloud_dialogflow_v2::client::ConversationDatasets::import_conversation_data::until_done";
5223            }
5224
5225            let stub = self.0.stub.clone();
5226            let mut options = self.0.options.clone();
5227            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5228            let query = move |name| {
5229                let stub = stub.clone();
5230                let options = options.clone();
5231                async {
5232                    let op = GetOperation::new(stub)
5233                        .set_name(name)
5234                        .with_options(options)
5235                        .send()
5236                        .await?;
5237                    Ok(Operation::new(op))
5238                }
5239            };
5240
5241            let start = move || async {
5242                let op = self.send().await?;
5243                Ok(Operation::new(op))
5244            };
5245
5246            use google_cloud_lro::internal::PollerExt;
5247            {
5248                google_cloud_lro::internal::new_poller(
5249                    polling_error_policy,
5250                    polling_backoff_policy,
5251                    start,
5252                    query,
5253                )
5254            }
5255            .with_options(poller_options)
5256        }
5257
5258        /// Sets the value of [name][crate::model::ImportConversationDataRequest::name].
5259        ///
5260        /// This is a **required** field for requests.
5261        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5262            self.0.request.name = v.into();
5263            self
5264        }
5265
5266        /// Sets the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5267        ///
5268        /// This is a **required** field for requests.
5269        pub fn set_input_config<T>(mut self, v: T) -> Self
5270        where
5271            T: std::convert::Into<crate::model::InputConfig>,
5272        {
5273            self.0.request.input_config = std::option::Option::Some(v.into());
5274            self
5275        }
5276
5277        /// Sets or clears the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5278        ///
5279        /// This is a **required** field for requests.
5280        pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5281        where
5282            T: std::convert::Into<crate::model::InputConfig>,
5283        {
5284            self.0.request.input_config = v.map(|x| x.into());
5285            self
5286        }
5287    }
5288
5289    #[doc(hidden)]
5290    impl crate::RequestBuilder for ImportConversationData {
5291        fn request_options(&mut self) -> &mut crate::RequestOptions {
5292            &mut self.0.options
5293        }
5294    }
5295
5296    /// The request builder for [ConversationDatasets::list_locations][crate::client::ConversationDatasets::list_locations] calls.
5297    ///
5298    /// # Example
5299    /// ```
5300    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListLocations;
5301    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5302    /// use google_cloud_gax::paginator::ItemPaginator;
5303    ///
5304    /// let builder = prepare_request_builder();
5305    /// let mut items = builder.by_item();
5306    /// while let Some(result) = items.next().await {
5307    ///   let item = result?;
5308    /// }
5309    /// # Ok(()) }
5310    ///
5311    /// fn prepare_request_builder() -> ListLocations {
5312    ///   # panic!();
5313    ///   // ... details omitted ...
5314    /// }
5315    /// ```
5316    #[derive(Clone, Debug)]
5317    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5318
5319    impl ListLocations {
5320        pub(crate) fn new(
5321            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5322        ) -> Self {
5323            Self(RequestBuilder::new(stub))
5324        }
5325
5326        /// Sets the full request, replacing any prior values.
5327        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5328            mut self,
5329            v: V,
5330        ) -> Self {
5331            self.0.request = v.into();
5332            self
5333        }
5334
5335        /// Sets all the options, replacing any prior values.
5336        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5337            self.0.options = v.into();
5338            self
5339        }
5340
5341        /// Sends the request.
5342        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5343            (*self.0.stub)
5344                .list_locations(self.0.request, self.0.options)
5345                .await
5346                .map(crate::Response::into_body)
5347        }
5348
5349        /// Streams each page in the collection.
5350        pub fn by_page(
5351            self,
5352        ) -> impl google_cloud_gax::paginator::Paginator<
5353            google_cloud_location::model::ListLocationsResponse,
5354            crate::Error,
5355        > {
5356            use std::clone::Clone;
5357            let token = self.0.request.page_token.clone();
5358            let execute = move |token: String| {
5359                let mut builder = self.clone();
5360                builder.0.request = builder.0.request.set_page_token(token);
5361                builder.send()
5362            };
5363            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5364        }
5365
5366        /// Streams each item in the collection.
5367        pub fn by_item(
5368            self,
5369        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5370            google_cloud_location::model::ListLocationsResponse,
5371            crate::Error,
5372        > {
5373            use google_cloud_gax::paginator::Paginator;
5374            self.by_page().items()
5375        }
5376
5377        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
5378        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5379            self.0.request.name = v.into();
5380            self
5381        }
5382
5383        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
5384        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5385            self.0.request.filter = v.into();
5386            self
5387        }
5388
5389        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
5390        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5391            self.0.request.page_size = v.into();
5392            self
5393        }
5394
5395        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
5396        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5397            self.0.request.page_token = v.into();
5398            self
5399        }
5400    }
5401
5402    #[doc(hidden)]
5403    impl crate::RequestBuilder for ListLocations {
5404        fn request_options(&mut self) -> &mut crate::RequestOptions {
5405            &mut self.0.options
5406        }
5407    }
5408
5409    /// The request builder for [ConversationDatasets::get_location][crate::client::ConversationDatasets::get_location] calls.
5410    ///
5411    /// # Example
5412    /// ```
5413    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetLocation;
5414    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5415    ///
5416    /// let builder = prepare_request_builder();
5417    /// let response = builder.send().await?;
5418    /// # Ok(()) }
5419    ///
5420    /// fn prepare_request_builder() -> GetLocation {
5421    ///   # panic!();
5422    ///   // ... details omitted ...
5423    /// }
5424    /// ```
5425    #[derive(Clone, Debug)]
5426    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5427
5428    impl GetLocation {
5429        pub(crate) fn new(
5430            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5431        ) -> Self {
5432            Self(RequestBuilder::new(stub))
5433        }
5434
5435        /// Sets the full request, replacing any prior values.
5436        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5437            mut self,
5438            v: V,
5439        ) -> Self {
5440            self.0.request = v.into();
5441            self
5442        }
5443
5444        /// Sets all the options, replacing any prior values.
5445        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5446            self.0.options = v.into();
5447            self
5448        }
5449
5450        /// Sends the request.
5451        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5452            (*self.0.stub)
5453                .get_location(self.0.request, self.0.options)
5454                .await
5455                .map(crate::Response::into_body)
5456        }
5457
5458        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
5459        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5460            self.0.request.name = v.into();
5461            self
5462        }
5463    }
5464
5465    #[doc(hidden)]
5466    impl crate::RequestBuilder for GetLocation {
5467        fn request_options(&mut self) -> &mut crate::RequestOptions {
5468            &mut self.0.options
5469        }
5470    }
5471
5472    /// The request builder for [ConversationDatasets::list_operations][crate::client::ConversationDatasets::list_operations] calls.
5473    ///
5474    /// # Example
5475    /// ```
5476    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListOperations;
5477    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5478    /// use google_cloud_gax::paginator::ItemPaginator;
5479    ///
5480    /// let builder = prepare_request_builder();
5481    /// let mut items = builder.by_item();
5482    /// while let Some(result) = items.next().await {
5483    ///   let item = result?;
5484    /// }
5485    /// # Ok(()) }
5486    ///
5487    /// fn prepare_request_builder() -> ListOperations {
5488    ///   # panic!();
5489    ///   // ... details omitted ...
5490    /// }
5491    /// ```
5492    #[derive(Clone, Debug)]
5493    pub struct ListOperations(
5494        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5495    );
5496
5497    impl ListOperations {
5498        pub(crate) fn new(
5499            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5500        ) -> Self {
5501            Self(RequestBuilder::new(stub))
5502        }
5503
5504        /// Sets the full request, replacing any prior values.
5505        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5506            mut self,
5507            v: V,
5508        ) -> Self {
5509            self.0.request = v.into();
5510            self
5511        }
5512
5513        /// Sets all the options, replacing any prior values.
5514        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5515            self.0.options = v.into();
5516            self
5517        }
5518
5519        /// Sends the request.
5520        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5521            (*self.0.stub)
5522                .list_operations(self.0.request, self.0.options)
5523                .await
5524                .map(crate::Response::into_body)
5525        }
5526
5527        /// Streams each page in the collection.
5528        pub fn by_page(
5529            self,
5530        ) -> impl google_cloud_gax::paginator::Paginator<
5531            google_cloud_longrunning::model::ListOperationsResponse,
5532            crate::Error,
5533        > {
5534            use std::clone::Clone;
5535            let token = self.0.request.page_token.clone();
5536            let execute = move |token: String| {
5537                let mut builder = self.clone();
5538                builder.0.request = builder.0.request.set_page_token(token);
5539                builder.send()
5540            };
5541            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5542        }
5543
5544        /// Streams each item in the collection.
5545        pub fn by_item(
5546            self,
5547        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5548            google_cloud_longrunning::model::ListOperationsResponse,
5549            crate::Error,
5550        > {
5551            use google_cloud_gax::paginator::Paginator;
5552            self.by_page().items()
5553        }
5554
5555        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5556        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5557            self.0.request.name = v.into();
5558            self
5559        }
5560
5561        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5562        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5563            self.0.request.filter = v.into();
5564            self
5565        }
5566
5567        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5568        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5569            self.0.request.page_size = v.into();
5570            self
5571        }
5572
5573        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5574        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5575            self.0.request.page_token = v.into();
5576            self
5577        }
5578
5579        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5580        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5581            self.0.request.return_partial_success = v.into();
5582            self
5583        }
5584    }
5585
5586    #[doc(hidden)]
5587    impl crate::RequestBuilder for ListOperations {
5588        fn request_options(&mut self) -> &mut crate::RequestOptions {
5589            &mut self.0.options
5590        }
5591    }
5592
5593    /// The request builder for [ConversationDatasets::get_operation][crate::client::ConversationDatasets::get_operation] calls.
5594    ///
5595    /// # Example
5596    /// ```
5597    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetOperation;
5598    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5599    ///
5600    /// let builder = prepare_request_builder();
5601    /// let response = builder.send().await?;
5602    /// # Ok(()) }
5603    ///
5604    /// fn prepare_request_builder() -> GetOperation {
5605    ///   # panic!();
5606    ///   // ... details omitted ...
5607    /// }
5608    /// ```
5609    #[derive(Clone, Debug)]
5610    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5611
5612    impl GetOperation {
5613        pub(crate) fn new(
5614            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5615        ) -> Self {
5616            Self(RequestBuilder::new(stub))
5617        }
5618
5619        /// Sets the full request, replacing any prior values.
5620        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5621            mut self,
5622            v: V,
5623        ) -> Self {
5624            self.0.request = v.into();
5625            self
5626        }
5627
5628        /// Sets all the options, replacing any prior values.
5629        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5630            self.0.options = v.into();
5631            self
5632        }
5633
5634        /// Sends the request.
5635        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5636            (*self.0.stub)
5637                .get_operation(self.0.request, self.0.options)
5638                .await
5639                .map(crate::Response::into_body)
5640        }
5641
5642        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5643        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5644            self.0.request.name = v.into();
5645            self
5646        }
5647    }
5648
5649    #[doc(hidden)]
5650    impl crate::RequestBuilder for GetOperation {
5651        fn request_options(&mut self) -> &mut crate::RequestOptions {
5652            &mut self.0.options
5653        }
5654    }
5655
5656    /// The request builder for [ConversationDatasets::cancel_operation][crate::client::ConversationDatasets::cancel_operation] calls.
5657    ///
5658    /// # Example
5659    /// ```
5660    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::CancelOperation;
5661    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5662    ///
5663    /// let builder = prepare_request_builder();
5664    /// let response = builder.send().await?;
5665    /// # Ok(()) }
5666    ///
5667    /// fn prepare_request_builder() -> CancelOperation {
5668    ///   # panic!();
5669    ///   // ... details omitted ...
5670    /// }
5671    /// ```
5672    #[derive(Clone, Debug)]
5673    pub struct CancelOperation(
5674        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5675    );
5676
5677    impl CancelOperation {
5678        pub(crate) fn new(
5679            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5680        ) -> Self {
5681            Self(RequestBuilder::new(stub))
5682        }
5683
5684        /// Sets the full request, replacing any prior values.
5685        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5686            mut self,
5687            v: V,
5688        ) -> Self {
5689            self.0.request = v.into();
5690            self
5691        }
5692
5693        /// Sets all the options, replacing any prior values.
5694        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5695            self.0.options = v.into();
5696            self
5697        }
5698
5699        /// Sends the request.
5700        pub async fn send(self) -> Result<()> {
5701            (*self.0.stub)
5702                .cancel_operation(self.0.request, self.0.options)
5703                .await
5704                .map(crate::Response::into_body)
5705        }
5706
5707        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5708        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5709            self.0.request.name = v.into();
5710            self
5711        }
5712    }
5713
5714    #[doc(hidden)]
5715    impl crate::RequestBuilder for CancelOperation {
5716        fn request_options(&mut self) -> &mut crate::RequestOptions {
5717            &mut self.0.options
5718        }
5719    }
5720}
5721
5722/// Request and client builders for [ConversationModels][crate::client::ConversationModels].
5723#[cfg(feature = "conversation-models")]
5724#[cfg_attr(docsrs, doc(cfg(feature = "conversation-models")))]
5725pub mod conversation_models {
5726    use crate::Result;
5727
5728    /// A builder for [ConversationModels][crate::client::ConversationModels].
5729    ///
5730    /// ```
5731    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5732    /// # use google_cloud_dialogflow_v2::*;
5733    /// # use builder::conversation_models::ClientBuilder;
5734    /// # use client::ConversationModels;
5735    /// let builder : ClientBuilder = ConversationModels::builder();
5736    /// let client = builder
5737    ///     .with_endpoint("https://dialogflow.googleapis.com")
5738    ///     .build().await?;
5739    /// # Ok(()) }
5740    /// ```
5741    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5742
5743    pub(crate) mod client {
5744        use super::super::super::client::ConversationModels;
5745        pub struct Factory;
5746        impl crate::ClientFactory for Factory {
5747            type Client = ConversationModels;
5748            type Credentials = gaxi::options::Credentials;
5749            async fn build(
5750                self,
5751                config: gaxi::options::ClientConfig,
5752            ) -> crate::ClientBuilderResult<Self::Client> {
5753                Self::Client::new(config).await
5754            }
5755        }
5756    }
5757
5758    /// Common implementation for [crate::client::ConversationModels] request builders.
5759    #[derive(Clone, Debug)]
5760    pub(crate) struct RequestBuilder<R: std::default::Default> {
5761        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5762        request: R,
5763        options: crate::RequestOptions,
5764    }
5765
5766    impl<R> RequestBuilder<R>
5767    where
5768        R: std::default::Default,
5769    {
5770        pub(crate) fn new(
5771            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5772        ) -> Self {
5773            Self {
5774                stub,
5775                request: R::default(),
5776                options: crate::RequestOptions::default(),
5777            }
5778        }
5779    }
5780
5781    /// The request builder for [ConversationModels::create_conversation_model][crate::client::ConversationModels::create_conversation_model] calls.
5782    ///
5783    /// # Example
5784    /// ```
5785    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CreateConversationModel;
5786    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5787    /// use google_cloud_lro::Poller;
5788    ///
5789    /// let builder = prepare_request_builder();
5790    /// let response = builder.poller().until_done().await?;
5791    /// # Ok(()) }
5792    ///
5793    /// fn prepare_request_builder() -> CreateConversationModel {
5794    ///   # panic!();
5795    ///   // ... details omitted ...
5796    /// }
5797    /// ```
5798    #[derive(Clone, Debug)]
5799    pub struct CreateConversationModel(
5800        RequestBuilder<crate::model::CreateConversationModelRequest>,
5801    );
5802
5803    impl CreateConversationModel {
5804        pub(crate) fn new(
5805            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5806        ) -> Self {
5807            Self(RequestBuilder::new(stub))
5808        }
5809
5810        /// Sets the full request, replacing any prior values.
5811        pub fn with_request<V: Into<crate::model::CreateConversationModelRequest>>(
5812            mut self,
5813            v: V,
5814        ) -> Self {
5815            self.0.request = v.into();
5816            self
5817        }
5818
5819        /// Sets all the options, replacing any prior values.
5820        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5821            self.0.options = v.into();
5822            self
5823        }
5824
5825        /// Sends the request.
5826        ///
5827        /// # Long running operations
5828        ///
5829        /// This starts, but does not poll, a longrunning operation. More information
5830        /// on [create_conversation_model][crate::client::ConversationModels::create_conversation_model].
5831        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5832            (*self.0.stub)
5833                .create_conversation_model(self.0.request, self.0.options)
5834                .await
5835                .map(crate::Response::into_body)
5836        }
5837
5838        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_model`.
5839        pub fn poller(
5840            self,
5841        ) -> impl google_cloud_lro::Poller<
5842            crate::model::ConversationModel,
5843            crate::model::CreateConversationModelOperationMetadata,
5844        > {
5845            type Operation = google_cloud_lro::internal::Operation<
5846                crate::model::ConversationModel,
5847                crate::model::CreateConversationModelOperationMetadata,
5848            >;
5849            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5850            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5851            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5852            if let Some(ref mut details) = poller_options.tracing {
5853                details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::create_conversation_model::until_done";
5854            }
5855
5856            let stub = self.0.stub.clone();
5857            let mut options = self.0.options.clone();
5858            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5859            let query = move |name| {
5860                let stub = stub.clone();
5861                let options = options.clone();
5862                async {
5863                    let op = GetOperation::new(stub)
5864                        .set_name(name)
5865                        .with_options(options)
5866                        .send()
5867                        .await?;
5868                    Ok(Operation::new(op))
5869                }
5870            };
5871
5872            let start = move || async {
5873                let op = self.send().await?;
5874                Ok(Operation::new(op))
5875            };
5876
5877            use google_cloud_lro::internal::PollerExt;
5878            {
5879                google_cloud_lro::internal::new_poller(
5880                    polling_error_policy,
5881                    polling_backoff_policy,
5882                    start,
5883                    query,
5884                )
5885            }
5886            .with_options(poller_options)
5887        }
5888
5889        /// Sets the value of [parent][crate::model::CreateConversationModelRequest::parent].
5890        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5891            self.0.request.parent = v.into();
5892            self
5893        }
5894
5895        /// Sets the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5896        ///
5897        /// This is a **required** field for requests.
5898        pub fn set_conversation_model<T>(mut self, v: T) -> Self
5899        where
5900            T: std::convert::Into<crate::model::ConversationModel>,
5901        {
5902            self.0.request.conversation_model = std::option::Option::Some(v.into());
5903            self
5904        }
5905
5906        /// Sets or clears the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5907        ///
5908        /// This is a **required** field for requests.
5909        pub fn set_or_clear_conversation_model<T>(mut self, v: std::option::Option<T>) -> Self
5910        where
5911            T: std::convert::Into<crate::model::ConversationModel>,
5912        {
5913            self.0.request.conversation_model = v.map(|x| x.into());
5914            self
5915        }
5916    }
5917
5918    #[doc(hidden)]
5919    impl crate::RequestBuilder for CreateConversationModel {
5920        fn request_options(&mut self) -> &mut crate::RequestOptions {
5921            &mut self.0.options
5922        }
5923    }
5924
5925    /// The request builder for [ConversationModels::get_conversation_model][crate::client::ConversationModels::get_conversation_model] calls.
5926    ///
5927    /// # Example
5928    /// ```
5929    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetConversationModel;
5930    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5931    ///
5932    /// let builder = prepare_request_builder();
5933    /// let response = builder.send().await?;
5934    /// # Ok(()) }
5935    ///
5936    /// fn prepare_request_builder() -> GetConversationModel {
5937    ///   # panic!();
5938    ///   // ... details omitted ...
5939    /// }
5940    /// ```
5941    #[derive(Clone, Debug)]
5942    pub struct GetConversationModel(RequestBuilder<crate::model::GetConversationModelRequest>);
5943
5944    impl GetConversationModel {
5945        pub(crate) fn new(
5946            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5947        ) -> Self {
5948            Self(RequestBuilder::new(stub))
5949        }
5950
5951        /// Sets the full request, replacing any prior values.
5952        pub fn with_request<V: Into<crate::model::GetConversationModelRequest>>(
5953            mut self,
5954            v: V,
5955        ) -> Self {
5956            self.0.request = v.into();
5957            self
5958        }
5959
5960        /// Sets all the options, replacing any prior values.
5961        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5962            self.0.options = v.into();
5963            self
5964        }
5965
5966        /// Sends the request.
5967        pub async fn send(self) -> Result<crate::model::ConversationModel> {
5968            (*self.0.stub)
5969                .get_conversation_model(self.0.request, self.0.options)
5970                .await
5971                .map(crate::Response::into_body)
5972        }
5973
5974        /// Sets the value of [name][crate::model::GetConversationModelRequest::name].
5975        ///
5976        /// This is a **required** field for requests.
5977        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5978            self.0.request.name = v.into();
5979            self
5980        }
5981    }
5982
5983    #[doc(hidden)]
5984    impl crate::RequestBuilder for GetConversationModel {
5985        fn request_options(&mut self) -> &mut crate::RequestOptions {
5986            &mut self.0.options
5987        }
5988    }
5989
5990    /// The request builder for [ConversationModels::list_conversation_models][crate::client::ConversationModels::list_conversation_models] calls.
5991    ///
5992    /// # Example
5993    /// ```
5994    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListConversationModels;
5995    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5996    /// use google_cloud_gax::paginator::ItemPaginator;
5997    ///
5998    /// let builder = prepare_request_builder();
5999    /// let mut items = builder.by_item();
6000    /// while let Some(result) = items.next().await {
6001    ///   let item = result?;
6002    /// }
6003    /// # Ok(()) }
6004    ///
6005    /// fn prepare_request_builder() -> ListConversationModels {
6006    ///   # panic!();
6007    ///   // ... details omitted ...
6008    /// }
6009    /// ```
6010    #[derive(Clone, Debug)]
6011    pub struct ListConversationModels(RequestBuilder<crate::model::ListConversationModelsRequest>);
6012
6013    impl ListConversationModels {
6014        pub(crate) fn new(
6015            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6016        ) -> Self {
6017            Self(RequestBuilder::new(stub))
6018        }
6019
6020        /// Sets the full request, replacing any prior values.
6021        pub fn with_request<V: Into<crate::model::ListConversationModelsRequest>>(
6022            mut self,
6023            v: V,
6024        ) -> Self {
6025            self.0.request = v.into();
6026            self
6027        }
6028
6029        /// Sets all the options, replacing any prior values.
6030        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6031            self.0.options = v.into();
6032            self
6033        }
6034
6035        /// Sends the request.
6036        pub async fn send(self) -> Result<crate::model::ListConversationModelsResponse> {
6037            (*self.0.stub)
6038                .list_conversation_models(self.0.request, self.0.options)
6039                .await
6040                .map(crate::Response::into_body)
6041        }
6042
6043        /// Streams each page in the collection.
6044        pub fn by_page(
6045            self,
6046        ) -> impl google_cloud_gax::paginator::Paginator<
6047            crate::model::ListConversationModelsResponse,
6048            crate::Error,
6049        > {
6050            use std::clone::Clone;
6051            let token = self.0.request.page_token.clone();
6052            let execute = move |token: String| {
6053                let mut builder = self.clone();
6054                builder.0.request = builder.0.request.set_page_token(token);
6055                builder.send()
6056            };
6057            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6058        }
6059
6060        /// Streams each item in the collection.
6061        pub fn by_item(
6062            self,
6063        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6064            crate::model::ListConversationModelsResponse,
6065            crate::Error,
6066        > {
6067            use google_cloud_gax::paginator::Paginator;
6068            self.by_page().items()
6069        }
6070
6071        /// Sets the value of [parent][crate::model::ListConversationModelsRequest::parent].
6072        ///
6073        /// This is a **required** field for requests.
6074        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6075            self.0.request.parent = v.into();
6076            self
6077        }
6078
6079        /// Sets the value of [page_size][crate::model::ListConversationModelsRequest::page_size].
6080        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6081            self.0.request.page_size = v.into();
6082            self
6083        }
6084
6085        /// Sets the value of [page_token][crate::model::ListConversationModelsRequest::page_token].
6086        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6087            self.0.request.page_token = v.into();
6088            self
6089        }
6090    }
6091
6092    #[doc(hidden)]
6093    impl crate::RequestBuilder for ListConversationModels {
6094        fn request_options(&mut self) -> &mut crate::RequestOptions {
6095            &mut self.0.options
6096        }
6097    }
6098
6099    /// The request builder for [ConversationModels::delete_conversation_model][crate::client::ConversationModels::delete_conversation_model] calls.
6100    ///
6101    /// # Example
6102    /// ```
6103    /// # use google_cloud_dialogflow_v2::builder::conversation_models::DeleteConversationModel;
6104    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6105    /// use google_cloud_lro::Poller;
6106    ///
6107    /// let builder = prepare_request_builder();
6108    /// let response = builder.poller().until_done().await?;
6109    /// # Ok(()) }
6110    ///
6111    /// fn prepare_request_builder() -> DeleteConversationModel {
6112    ///   # panic!();
6113    ///   // ... details omitted ...
6114    /// }
6115    /// ```
6116    #[derive(Clone, Debug)]
6117    pub struct DeleteConversationModel(
6118        RequestBuilder<crate::model::DeleteConversationModelRequest>,
6119    );
6120
6121    impl DeleteConversationModel {
6122        pub(crate) fn new(
6123            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6124        ) -> Self {
6125            Self(RequestBuilder::new(stub))
6126        }
6127
6128        /// Sets the full request, replacing any prior values.
6129        pub fn with_request<V: Into<crate::model::DeleteConversationModelRequest>>(
6130            mut self,
6131            v: V,
6132        ) -> Self {
6133            self.0.request = v.into();
6134            self
6135        }
6136
6137        /// Sets all the options, replacing any prior values.
6138        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6139            self.0.options = v.into();
6140            self
6141        }
6142
6143        /// Sends the request.
6144        ///
6145        /// # Long running operations
6146        ///
6147        /// This starts, but does not poll, a longrunning operation. More information
6148        /// on [delete_conversation_model][crate::client::ConversationModels::delete_conversation_model].
6149        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6150            (*self.0.stub)
6151                .delete_conversation_model(self.0.request, self.0.options)
6152                .await
6153                .map(crate::Response::into_body)
6154        }
6155
6156        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_conversation_model`.
6157        pub fn poller(
6158            self,
6159        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteConversationModelOperationMetadata>
6160        {
6161            type Operation = google_cloud_lro::internal::Operation<
6162                wkt::Empty,
6163                crate::model::DeleteConversationModelOperationMetadata,
6164            >;
6165            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6166            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6167            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6168            if let Some(ref mut details) = poller_options.tracing {
6169                details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::delete_conversation_model::until_done";
6170            }
6171
6172            let stub = self.0.stub.clone();
6173            let mut options = self.0.options.clone();
6174            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6175            let query = move |name| {
6176                let stub = stub.clone();
6177                let options = options.clone();
6178                async {
6179                    let op = GetOperation::new(stub)
6180                        .set_name(name)
6181                        .with_options(options)
6182                        .send()
6183                        .await?;
6184                    Ok(Operation::new(op))
6185                }
6186            };
6187
6188            let start = move || async {
6189                let op = self.send().await?;
6190                Ok(Operation::new(op))
6191            };
6192
6193            use google_cloud_lro::internal::PollerExt;
6194            {
6195                google_cloud_lro::internal::new_unit_response_poller(
6196                    polling_error_policy,
6197                    polling_backoff_policy,
6198                    start,
6199                    query,
6200                )
6201            }
6202            .with_options(poller_options)
6203        }
6204
6205        /// Sets the value of [name][crate::model::DeleteConversationModelRequest::name].
6206        ///
6207        /// This is a **required** field for requests.
6208        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6209            self.0.request.name = v.into();
6210            self
6211        }
6212    }
6213
6214    #[doc(hidden)]
6215    impl crate::RequestBuilder for DeleteConversationModel {
6216        fn request_options(&mut self) -> &mut crate::RequestOptions {
6217            &mut self.0.options
6218        }
6219    }
6220
6221    /// The request builder for [ConversationModels::deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model] calls.
6222    ///
6223    /// # Example
6224    /// ```
6225    /// # use google_cloud_dialogflow_v2::builder::conversation_models::DeployConversationModel;
6226    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6227    /// use google_cloud_lro::Poller;
6228    ///
6229    /// let builder = prepare_request_builder();
6230    /// let response = builder.poller().until_done().await?;
6231    /// # Ok(()) }
6232    ///
6233    /// fn prepare_request_builder() -> DeployConversationModel {
6234    ///   # panic!();
6235    ///   // ... details omitted ...
6236    /// }
6237    /// ```
6238    #[derive(Clone, Debug)]
6239    pub struct DeployConversationModel(
6240        RequestBuilder<crate::model::DeployConversationModelRequest>,
6241    );
6242
6243    impl DeployConversationModel {
6244        pub(crate) fn new(
6245            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6246        ) -> Self {
6247            Self(RequestBuilder::new(stub))
6248        }
6249
6250        /// Sets the full request, replacing any prior values.
6251        pub fn with_request<V: Into<crate::model::DeployConversationModelRequest>>(
6252            mut self,
6253            v: V,
6254        ) -> Self {
6255            self.0.request = v.into();
6256            self
6257        }
6258
6259        /// Sets all the options, replacing any prior values.
6260        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6261            self.0.options = v.into();
6262            self
6263        }
6264
6265        /// Sends the request.
6266        ///
6267        /// # Long running operations
6268        ///
6269        /// This starts, but does not poll, a longrunning operation. More information
6270        /// on [deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model].
6271        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6272            (*self.0.stub)
6273                .deploy_conversation_model(self.0.request, self.0.options)
6274                .await
6275                .map(crate::Response::into_body)
6276        }
6277
6278        /// Creates a [Poller][google_cloud_lro::Poller] to work with `deploy_conversation_model`.
6279        pub fn poller(
6280            self,
6281        ) -> impl google_cloud_lro::Poller<(), crate::model::DeployConversationModelOperationMetadata>
6282        {
6283            type Operation = google_cloud_lro::internal::Operation<
6284                wkt::Empty,
6285                crate::model::DeployConversationModelOperationMetadata,
6286            >;
6287            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6288            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6289            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6290            if let Some(ref mut details) = poller_options.tracing {
6291                details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::deploy_conversation_model::until_done";
6292            }
6293
6294            let stub = self.0.stub.clone();
6295            let mut options = self.0.options.clone();
6296            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6297            let query = move |name| {
6298                let stub = stub.clone();
6299                let options = options.clone();
6300                async {
6301                    let op = GetOperation::new(stub)
6302                        .set_name(name)
6303                        .with_options(options)
6304                        .send()
6305                        .await?;
6306                    Ok(Operation::new(op))
6307                }
6308            };
6309
6310            let start = move || async {
6311                let op = self.send().await?;
6312                Ok(Operation::new(op))
6313            };
6314
6315            use google_cloud_lro::internal::PollerExt;
6316            {
6317                google_cloud_lro::internal::new_unit_response_poller(
6318                    polling_error_policy,
6319                    polling_backoff_policy,
6320                    start,
6321                    query,
6322                )
6323            }
6324            .with_options(poller_options)
6325        }
6326
6327        /// Sets the value of [name][crate::model::DeployConversationModelRequest::name].
6328        ///
6329        /// This is a **required** field for requests.
6330        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6331            self.0.request.name = v.into();
6332            self
6333        }
6334    }
6335
6336    #[doc(hidden)]
6337    impl crate::RequestBuilder for DeployConversationModel {
6338        fn request_options(&mut self) -> &mut crate::RequestOptions {
6339            &mut self.0.options
6340        }
6341    }
6342
6343    /// The request builder for [ConversationModels::undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model] calls.
6344    ///
6345    /// # Example
6346    /// ```
6347    /// # use google_cloud_dialogflow_v2::builder::conversation_models::UndeployConversationModel;
6348    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6349    /// use google_cloud_lro::Poller;
6350    ///
6351    /// let builder = prepare_request_builder();
6352    /// let response = builder.poller().until_done().await?;
6353    /// # Ok(()) }
6354    ///
6355    /// fn prepare_request_builder() -> UndeployConversationModel {
6356    ///   # panic!();
6357    ///   // ... details omitted ...
6358    /// }
6359    /// ```
6360    #[derive(Clone, Debug)]
6361    pub struct UndeployConversationModel(
6362        RequestBuilder<crate::model::UndeployConversationModelRequest>,
6363    );
6364
6365    impl UndeployConversationModel {
6366        pub(crate) fn new(
6367            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6368        ) -> Self {
6369            Self(RequestBuilder::new(stub))
6370        }
6371
6372        /// Sets the full request, replacing any prior values.
6373        pub fn with_request<V: Into<crate::model::UndeployConversationModelRequest>>(
6374            mut self,
6375            v: V,
6376        ) -> Self {
6377            self.0.request = v.into();
6378            self
6379        }
6380
6381        /// Sets all the options, replacing any prior values.
6382        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6383            self.0.options = v.into();
6384            self
6385        }
6386
6387        /// Sends the request.
6388        ///
6389        /// # Long running operations
6390        ///
6391        /// This starts, but does not poll, a longrunning operation. More information
6392        /// on [undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model].
6393        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6394            (*self.0.stub)
6395                .undeploy_conversation_model(self.0.request, self.0.options)
6396                .await
6397                .map(crate::Response::into_body)
6398        }
6399
6400        /// Creates a [Poller][google_cloud_lro::Poller] to work with `undeploy_conversation_model`.
6401        pub fn poller(
6402            self,
6403        ) -> impl google_cloud_lro::Poller<(), crate::model::UndeployConversationModelOperationMetadata>
6404        {
6405            type Operation = google_cloud_lro::internal::Operation<
6406                wkt::Empty,
6407                crate::model::UndeployConversationModelOperationMetadata,
6408            >;
6409            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6410            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6411            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6412            if let Some(ref mut details) = poller_options.tracing {
6413                details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::undeploy_conversation_model::until_done";
6414            }
6415
6416            let stub = self.0.stub.clone();
6417            let mut options = self.0.options.clone();
6418            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6419            let query = move |name| {
6420                let stub = stub.clone();
6421                let options = options.clone();
6422                async {
6423                    let op = GetOperation::new(stub)
6424                        .set_name(name)
6425                        .with_options(options)
6426                        .send()
6427                        .await?;
6428                    Ok(Operation::new(op))
6429                }
6430            };
6431
6432            let start = move || async {
6433                let op = self.send().await?;
6434                Ok(Operation::new(op))
6435            };
6436
6437            use google_cloud_lro::internal::PollerExt;
6438            {
6439                google_cloud_lro::internal::new_unit_response_poller(
6440                    polling_error_policy,
6441                    polling_backoff_policy,
6442                    start,
6443                    query,
6444                )
6445            }
6446            .with_options(poller_options)
6447        }
6448
6449        /// Sets the value of [name][crate::model::UndeployConversationModelRequest::name].
6450        ///
6451        /// This is a **required** field for requests.
6452        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6453            self.0.request.name = v.into();
6454            self
6455        }
6456    }
6457
6458    #[doc(hidden)]
6459    impl crate::RequestBuilder for UndeployConversationModel {
6460        fn request_options(&mut self) -> &mut crate::RequestOptions {
6461            &mut self.0.options
6462        }
6463    }
6464
6465    /// The request builder for [ConversationModels::get_conversation_model_evaluation][crate::client::ConversationModels::get_conversation_model_evaluation] calls.
6466    ///
6467    /// # Example
6468    /// ```
6469    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetConversationModelEvaluation;
6470    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6471    ///
6472    /// let builder = prepare_request_builder();
6473    /// let response = builder.send().await?;
6474    /// # Ok(()) }
6475    ///
6476    /// fn prepare_request_builder() -> GetConversationModelEvaluation {
6477    ///   # panic!();
6478    ///   // ... details omitted ...
6479    /// }
6480    /// ```
6481    #[derive(Clone, Debug)]
6482    pub struct GetConversationModelEvaluation(
6483        RequestBuilder<crate::model::GetConversationModelEvaluationRequest>,
6484    );
6485
6486    impl GetConversationModelEvaluation {
6487        pub(crate) fn new(
6488            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6489        ) -> Self {
6490            Self(RequestBuilder::new(stub))
6491        }
6492
6493        /// Sets the full request, replacing any prior values.
6494        pub fn with_request<V: Into<crate::model::GetConversationModelEvaluationRequest>>(
6495            mut self,
6496            v: V,
6497        ) -> Self {
6498            self.0.request = v.into();
6499            self
6500        }
6501
6502        /// Sets all the options, replacing any prior values.
6503        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6504            self.0.options = v.into();
6505            self
6506        }
6507
6508        /// Sends the request.
6509        pub async fn send(self) -> Result<crate::model::ConversationModelEvaluation> {
6510            (*self.0.stub)
6511                .get_conversation_model_evaluation(self.0.request, self.0.options)
6512                .await
6513                .map(crate::Response::into_body)
6514        }
6515
6516        /// Sets the value of [name][crate::model::GetConversationModelEvaluationRequest::name].
6517        ///
6518        /// This is a **required** field for requests.
6519        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6520            self.0.request.name = v.into();
6521            self
6522        }
6523    }
6524
6525    #[doc(hidden)]
6526    impl crate::RequestBuilder for GetConversationModelEvaluation {
6527        fn request_options(&mut self) -> &mut crate::RequestOptions {
6528            &mut self.0.options
6529        }
6530    }
6531
6532    /// The request builder for [ConversationModels::list_conversation_model_evaluations][crate::client::ConversationModels::list_conversation_model_evaluations] calls.
6533    ///
6534    /// # Example
6535    /// ```
6536    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListConversationModelEvaluations;
6537    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6538    /// use google_cloud_gax::paginator::ItemPaginator;
6539    ///
6540    /// let builder = prepare_request_builder();
6541    /// let mut items = builder.by_item();
6542    /// while let Some(result) = items.next().await {
6543    ///   let item = result?;
6544    /// }
6545    /// # Ok(()) }
6546    ///
6547    /// fn prepare_request_builder() -> ListConversationModelEvaluations {
6548    ///   # panic!();
6549    ///   // ... details omitted ...
6550    /// }
6551    /// ```
6552    #[derive(Clone, Debug)]
6553    pub struct ListConversationModelEvaluations(
6554        RequestBuilder<crate::model::ListConversationModelEvaluationsRequest>,
6555    );
6556
6557    impl ListConversationModelEvaluations {
6558        pub(crate) fn new(
6559            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6560        ) -> Self {
6561            Self(RequestBuilder::new(stub))
6562        }
6563
6564        /// Sets the full request, replacing any prior values.
6565        pub fn with_request<V: Into<crate::model::ListConversationModelEvaluationsRequest>>(
6566            mut self,
6567            v: V,
6568        ) -> Self {
6569            self.0.request = v.into();
6570            self
6571        }
6572
6573        /// Sets all the options, replacing any prior values.
6574        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6575            self.0.options = v.into();
6576            self
6577        }
6578
6579        /// Sends the request.
6580        pub async fn send(self) -> Result<crate::model::ListConversationModelEvaluationsResponse> {
6581            (*self.0.stub)
6582                .list_conversation_model_evaluations(self.0.request, self.0.options)
6583                .await
6584                .map(crate::Response::into_body)
6585        }
6586
6587        /// Streams each page in the collection.
6588        pub fn by_page(
6589            self,
6590        ) -> impl google_cloud_gax::paginator::Paginator<
6591            crate::model::ListConversationModelEvaluationsResponse,
6592            crate::Error,
6593        > {
6594            use std::clone::Clone;
6595            let token = self.0.request.page_token.clone();
6596            let execute = move |token: String| {
6597                let mut builder = self.clone();
6598                builder.0.request = builder.0.request.set_page_token(token);
6599                builder.send()
6600            };
6601            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6602        }
6603
6604        /// Streams each item in the collection.
6605        pub fn by_item(
6606            self,
6607        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6608            crate::model::ListConversationModelEvaluationsResponse,
6609            crate::Error,
6610        > {
6611            use google_cloud_gax::paginator::Paginator;
6612            self.by_page().items()
6613        }
6614
6615        /// Sets the value of [parent][crate::model::ListConversationModelEvaluationsRequest::parent].
6616        ///
6617        /// This is a **required** field for requests.
6618        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6619            self.0.request.parent = v.into();
6620            self
6621        }
6622
6623        /// Sets the value of [page_size][crate::model::ListConversationModelEvaluationsRequest::page_size].
6624        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6625            self.0.request.page_size = v.into();
6626            self
6627        }
6628
6629        /// Sets the value of [page_token][crate::model::ListConversationModelEvaluationsRequest::page_token].
6630        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6631            self.0.request.page_token = v.into();
6632            self
6633        }
6634    }
6635
6636    #[doc(hidden)]
6637    impl crate::RequestBuilder for ListConversationModelEvaluations {
6638        fn request_options(&mut self) -> &mut crate::RequestOptions {
6639            &mut self.0.options
6640        }
6641    }
6642
6643    /// The request builder for [ConversationModels::create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation] calls.
6644    ///
6645    /// # Example
6646    /// ```
6647    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CreateConversationModelEvaluation;
6648    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6649    /// use google_cloud_lro::Poller;
6650    ///
6651    /// let builder = prepare_request_builder();
6652    /// let response = builder.poller().until_done().await?;
6653    /// # Ok(()) }
6654    ///
6655    /// fn prepare_request_builder() -> CreateConversationModelEvaluation {
6656    ///   # panic!();
6657    ///   // ... details omitted ...
6658    /// }
6659    /// ```
6660    #[derive(Clone, Debug)]
6661    pub struct CreateConversationModelEvaluation(
6662        RequestBuilder<crate::model::CreateConversationModelEvaluationRequest>,
6663    );
6664
6665    impl CreateConversationModelEvaluation {
6666        pub(crate) fn new(
6667            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6668        ) -> Self {
6669            Self(RequestBuilder::new(stub))
6670        }
6671
6672        /// Sets the full request, replacing any prior values.
6673        pub fn with_request<V: Into<crate::model::CreateConversationModelEvaluationRequest>>(
6674            mut self,
6675            v: V,
6676        ) -> Self {
6677            self.0.request = v.into();
6678            self
6679        }
6680
6681        /// Sets all the options, replacing any prior values.
6682        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6683            self.0.options = v.into();
6684            self
6685        }
6686
6687        /// Sends the request.
6688        ///
6689        /// # Long running operations
6690        ///
6691        /// This starts, but does not poll, a longrunning operation. More information
6692        /// on [create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation].
6693        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6694            (*self.0.stub)
6695                .create_conversation_model_evaluation(self.0.request, self.0.options)
6696                .await
6697                .map(crate::Response::into_body)
6698        }
6699
6700        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_model_evaluation`.
6701        pub fn poller(
6702            self,
6703        ) -> impl google_cloud_lro::Poller<
6704            crate::model::ConversationModelEvaluation,
6705            crate::model::CreateConversationModelEvaluationOperationMetadata,
6706        > {
6707            type Operation = google_cloud_lro::internal::Operation<
6708                crate::model::ConversationModelEvaluation,
6709                crate::model::CreateConversationModelEvaluationOperationMetadata,
6710            >;
6711            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6712            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6713            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6714            if let Some(ref mut details) = poller_options.tracing {
6715                details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::create_conversation_model_evaluation::until_done";
6716            }
6717
6718            let stub = self.0.stub.clone();
6719            let mut options = self.0.options.clone();
6720            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6721            let query = move |name| {
6722                let stub = stub.clone();
6723                let options = options.clone();
6724                async {
6725                    let op = GetOperation::new(stub)
6726                        .set_name(name)
6727                        .with_options(options)
6728                        .send()
6729                        .await?;
6730                    Ok(Operation::new(op))
6731                }
6732            };
6733
6734            let start = move || async {
6735                let op = self.send().await?;
6736                Ok(Operation::new(op))
6737            };
6738
6739            use google_cloud_lro::internal::PollerExt;
6740            {
6741                google_cloud_lro::internal::new_poller(
6742                    polling_error_policy,
6743                    polling_backoff_policy,
6744                    start,
6745                    query,
6746                )
6747            }
6748            .with_options(poller_options)
6749        }
6750
6751        /// Sets the value of [parent][crate::model::CreateConversationModelEvaluationRequest::parent].
6752        ///
6753        /// This is a **required** field for requests.
6754        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6755            self.0.request.parent = v.into();
6756            self
6757        }
6758
6759        /// Sets the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6760        ///
6761        /// This is a **required** field for requests.
6762        pub fn set_conversation_model_evaluation<T>(mut self, v: T) -> Self
6763        where
6764            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6765        {
6766            self.0.request.conversation_model_evaluation = std::option::Option::Some(v.into());
6767            self
6768        }
6769
6770        /// Sets or clears the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6771        ///
6772        /// This is a **required** field for requests.
6773        pub fn set_or_clear_conversation_model_evaluation<T>(
6774            mut self,
6775            v: std::option::Option<T>,
6776        ) -> Self
6777        where
6778            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6779        {
6780            self.0.request.conversation_model_evaluation = v.map(|x| x.into());
6781            self
6782        }
6783    }
6784
6785    #[doc(hidden)]
6786    impl crate::RequestBuilder for CreateConversationModelEvaluation {
6787        fn request_options(&mut self) -> &mut crate::RequestOptions {
6788            &mut self.0.options
6789        }
6790    }
6791
6792    /// The request builder for [ConversationModels::list_locations][crate::client::ConversationModels::list_locations] calls.
6793    ///
6794    /// # Example
6795    /// ```
6796    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListLocations;
6797    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6798    /// use google_cloud_gax::paginator::ItemPaginator;
6799    ///
6800    /// let builder = prepare_request_builder();
6801    /// let mut items = builder.by_item();
6802    /// while let Some(result) = items.next().await {
6803    ///   let item = result?;
6804    /// }
6805    /// # Ok(()) }
6806    ///
6807    /// fn prepare_request_builder() -> ListLocations {
6808    ///   # panic!();
6809    ///   // ... details omitted ...
6810    /// }
6811    /// ```
6812    #[derive(Clone, Debug)]
6813    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6814
6815    impl ListLocations {
6816        pub(crate) fn new(
6817            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6818        ) -> Self {
6819            Self(RequestBuilder::new(stub))
6820        }
6821
6822        /// Sets the full request, replacing any prior values.
6823        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6824            mut self,
6825            v: V,
6826        ) -> Self {
6827            self.0.request = v.into();
6828            self
6829        }
6830
6831        /// Sets all the options, replacing any prior values.
6832        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6833            self.0.options = v.into();
6834            self
6835        }
6836
6837        /// Sends the request.
6838        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6839            (*self.0.stub)
6840                .list_locations(self.0.request, self.0.options)
6841                .await
6842                .map(crate::Response::into_body)
6843        }
6844
6845        /// Streams each page in the collection.
6846        pub fn by_page(
6847            self,
6848        ) -> impl google_cloud_gax::paginator::Paginator<
6849            google_cloud_location::model::ListLocationsResponse,
6850            crate::Error,
6851        > {
6852            use std::clone::Clone;
6853            let token = self.0.request.page_token.clone();
6854            let execute = move |token: String| {
6855                let mut builder = self.clone();
6856                builder.0.request = builder.0.request.set_page_token(token);
6857                builder.send()
6858            };
6859            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6860        }
6861
6862        /// Streams each item in the collection.
6863        pub fn by_item(
6864            self,
6865        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6866            google_cloud_location::model::ListLocationsResponse,
6867            crate::Error,
6868        > {
6869            use google_cloud_gax::paginator::Paginator;
6870            self.by_page().items()
6871        }
6872
6873        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6874        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6875            self.0.request.name = v.into();
6876            self
6877        }
6878
6879        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6880        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6881            self.0.request.filter = v.into();
6882            self
6883        }
6884
6885        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6886        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6887            self.0.request.page_size = v.into();
6888            self
6889        }
6890
6891        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6892        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6893            self.0.request.page_token = v.into();
6894            self
6895        }
6896    }
6897
6898    #[doc(hidden)]
6899    impl crate::RequestBuilder for ListLocations {
6900        fn request_options(&mut self) -> &mut crate::RequestOptions {
6901            &mut self.0.options
6902        }
6903    }
6904
6905    /// The request builder for [ConversationModels::get_location][crate::client::ConversationModels::get_location] calls.
6906    ///
6907    /// # Example
6908    /// ```
6909    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetLocation;
6910    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6911    ///
6912    /// let builder = prepare_request_builder();
6913    /// let response = builder.send().await?;
6914    /// # Ok(()) }
6915    ///
6916    /// fn prepare_request_builder() -> GetLocation {
6917    ///   # panic!();
6918    ///   // ... details omitted ...
6919    /// }
6920    /// ```
6921    #[derive(Clone, Debug)]
6922    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6923
6924    impl GetLocation {
6925        pub(crate) fn new(
6926            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6927        ) -> Self {
6928            Self(RequestBuilder::new(stub))
6929        }
6930
6931        /// Sets the full request, replacing any prior values.
6932        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6933            mut self,
6934            v: V,
6935        ) -> Self {
6936            self.0.request = v.into();
6937            self
6938        }
6939
6940        /// Sets all the options, replacing any prior values.
6941        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6942            self.0.options = v.into();
6943            self
6944        }
6945
6946        /// Sends the request.
6947        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6948            (*self.0.stub)
6949                .get_location(self.0.request, self.0.options)
6950                .await
6951                .map(crate::Response::into_body)
6952        }
6953
6954        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6955        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6956            self.0.request.name = v.into();
6957            self
6958        }
6959    }
6960
6961    #[doc(hidden)]
6962    impl crate::RequestBuilder for GetLocation {
6963        fn request_options(&mut self) -> &mut crate::RequestOptions {
6964            &mut self.0.options
6965        }
6966    }
6967
6968    /// The request builder for [ConversationModels::list_operations][crate::client::ConversationModels::list_operations] calls.
6969    ///
6970    /// # Example
6971    /// ```
6972    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListOperations;
6973    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6974    /// use google_cloud_gax::paginator::ItemPaginator;
6975    ///
6976    /// let builder = prepare_request_builder();
6977    /// let mut items = builder.by_item();
6978    /// while let Some(result) = items.next().await {
6979    ///   let item = result?;
6980    /// }
6981    /// # Ok(()) }
6982    ///
6983    /// fn prepare_request_builder() -> ListOperations {
6984    ///   # panic!();
6985    ///   // ... details omitted ...
6986    /// }
6987    /// ```
6988    #[derive(Clone, Debug)]
6989    pub struct ListOperations(
6990        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6991    );
6992
6993    impl ListOperations {
6994        pub(crate) fn new(
6995            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6996        ) -> Self {
6997            Self(RequestBuilder::new(stub))
6998        }
6999
7000        /// Sets the full request, replacing any prior values.
7001        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7002            mut self,
7003            v: V,
7004        ) -> Self {
7005            self.0.request = v.into();
7006            self
7007        }
7008
7009        /// Sets all the options, replacing any prior values.
7010        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7011            self.0.options = v.into();
7012            self
7013        }
7014
7015        /// Sends the request.
7016        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7017            (*self.0.stub)
7018                .list_operations(self.0.request, self.0.options)
7019                .await
7020                .map(crate::Response::into_body)
7021        }
7022
7023        /// Streams each page in the collection.
7024        pub fn by_page(
7025            self,
7026        ) -> impl google_cloud_gax::paginator::Paginator<
7027            google_cloud_longrunning::model::ListOperationsResponse,
7028            crate::Error,
7029        > {
7030            use std::clone::Clone;
7031            let token = self.0.request.page_token.clone();
7032            let execute = move |token: String| {
7033                let mut builder = self.clone();
7034                builder.0.request = builder.0.request.set_page_token(token);
7035                builder.send()
7036            };
7037            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7038        }
7039
7040        /// Streams each item in the collection.
7041        pub fn by_item(
7042            self,
7043        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7044            google_cloud_longrunning::model::ListOperationsResponse,
7045            crate::Error,
7046        > {
7047            use google_cloud_gax::paginator::Paginator;
7048            self.by_page().items()
7049        }
7050
7051        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
7052        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7053            self.0.request.name = v.into();
7054            self
7055        }
7056
7057        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
7058        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7059            self.0.request.filter = v.into();
7060            self
7061        }
7062
7063        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
7064        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7065            self.0.request.page_size = v.into();
7066            self
7067        }
7068
7069        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
7070        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7071            self.0.request.page_token = v.into();
7072            self
7073        }
7074
7075        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
7076        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7077            self.0.request.return_partial_success = v.into();
7078            self
7079        }
7080    }
7081
7082    #[doc(hidden)]
7083    impl crate::RequestBuilder for ListOperations {
7084        fn request_options(&mut self) -> &mut crate::RequestOptions {
7085            &mut self.0.options
7086        }
7087    }
7088
7089    /// The request builder for [ConversationModels::get_operation][crate::client::ConversationModels::get_operation] calls.
7090    ///
7091    /// # Example
7092    /// ```
7093    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetOperation;
7094    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7095    ///
7096    /// let builder = prepare_request_builder();
7097    /// let response = builder.send().await?;
7098    /// # Ok(()) }
7099    ///
7100    /// fn prepare_request_builder() -> GetOperation {
7101    ///   # panic!();
7102    ///   // ... details omitted ...
7103    /// }
7104    /// ```
7105    #[derive(Clone, Debug)]
7106    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7107
7108    impl GetOperation {
7109        pub(crate) fn new(
7110            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7111        ) -> Self {
7112            Self(RequestBuilder::new(stub))
7113        }
7114
7115        /// Sets the full request, replacing any prior values.
7116        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7117            mut self,
7118            v: V,
7119        ) -> Self {
7120            self.0.request = v.into();
7121            self
7122        }
7123
7124        /// Sets all the options, replacing any prior values.
7125        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7126            self.0.options = v.into();
7127            self
7128        }
7129
7130        /// Sends the request.
7131        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7132            (*self.0.stub)
7133                .get_operation(self.0.request, self.0.options)
7134                .await
7135                .map(crate::Response::into_body)
7136        }
7137
7138        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7139        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7140            self.0.request.name = v.into();
7141            self
7142        }
7143    }
7144
7145    #[doc(hidden)]
7146    impl crate::RequestBuilder for GetOperation {
7147        fn request_options(&mut self) -> &mut crate::RequestOptions {
7148            &mut self.0.options
7149        }
7150    }
7151
7152    /// The request builder for [ConversationModels::cancel_operation][crate::client::ConversationModels::cancel_operation] calls.
7153    ///
7154    /// # Example
7155    /// ```
7156    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CancelOperation;
7157    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7158    ///
7159    /// let builder = prepare_request_builder();
7160    /// let response = builder.send().await?;
7161    /// # Ok(()) }
7162    ///
7163    /// fn prepare_request_builder() -> CancelOperation {
7164    ///   # panic!();
7165    ///   // ... details omitted ...
7166    /// }
7167    /// ```
7168    #[derive(Clone, Debug)]
7169    pub struct CancelOperation(
7170        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7171    );
7172
7173    impl CancelOperation {
7174        pub(crate) fn new(
7175            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7176        ) -> Self {
7177            Self(RequestBuilder::new(stub))
7178        }
7179
7180        /// Sets the full request, replacing any prior values.
7181        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7182            mut self,
7183            v: V,
7184        ) -> Self {
7185            self.0.request = v.into();
7186            self
7187        }
7188
7189        /// Sets all the options, replacing any prior values.
7190        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7191            self.0.options = v.into();
7192            self
7193        }
7194
7195        /// Sends the request.
7196        pub async fn send(self) -> Result<()> {
7197            (*self.0.stub)
7198                .cancel_operation(self.0.request, self.0.options)
7199                .await
7200                .map(crate::Response::into_body)
7201        }
7202
7203        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7204        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7205            self.0.request.name = v.into();
7206            self
7207        }
7208    }
7209
7210    #[doc(hidden)]
7211    impl crate::RequestBuilder for CancelOperation {
7212        fn request_options(&mut self) -> &mut crate::RequestOptions {
7213            &mut self.0.options
7214        }
7215    }
7216}
7217
7218/// Request and client builders for [ConversationProfiles][crate::client::ConversationProfiles].
7219#[cfg(feature = "conversation-profiles")]
7220#[cfg_attr(docsrs, doc(cfg(feature = "conversation-profiles")))]
7221pub mod conversation_profiles {
7222    use crate::Result;
7223
7224    /// A builder for [ConversationProfiles][crate::client::ConversationProfiles].
7225    ///
7226    /// ```
7227    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7228    /// # use google_cloud_dialogflow_v2::*;
7229    /// # use builder::conversation_profiles::ClientBuilder;
7230    /// # use client::ConversationProfiles;
7231    /// let builder : ClientBuilder = ConversationProfiles::builder();
7232    /// let client = builder
7233    ///     .with_endpoint("https://dialogflow.googleapis.com")
7234    ///     .build().await?;
7235    /// # Ok(()) }
7236    /// ```
7237    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7238
7239    pub(crate) mod client {
7240        use super::super::super::client::ConversationProfiles;
7241        pub struct Factory;
7242        impl crate::ClientFactory for Factory {
7243            type Client = ConversationProfiles;
7244            type Credentials = gaxi::options::Credentials;
7245            async fn build(
7246                self,
7247                config: gaxi::options::ClientConfig,
7248            ) -> crate::ClientBuilderResult<Self::Client> {
7249                Self::Client::new(config).await
7250            }
7251        }
7252    }
7253
7254    /// Common implementation for [crate::client::ConversationProfiles] request builders.
7255    #[derive(Clone, Debug)]
7256    pub(crate) struct RequestBuilder<R: std::default::Default> {
7257        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7258        request: R,
7259        options: crate::RequestOptions,
7260    }
7261
7262    impl<R> RequestBuilder<R>
7263    where
7264        R: std::default::Default,
7265    {
7266        pub(crate) fn new(
7267            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7268        ) -> Self {
7269            Self {
7270                stub,
7271                request: R::default(),
7272                options: crate::RequestOptions::default(),
7273            }
7274        }
7275    }
7276
7277    /// The request builder for [ConversationProfiles::list_conversation_profiles][crate::client::ConversationProfiles::list_conversation_profiles] calls.
7278    ///
7279    /// # Example
7280    /// ```
7281    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListConversationProfiles;
7282    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7283    /// use google_cloud_gax::paginator::ItemPaginator;
7284    ///
7285    /// let builder = prepare_request_builder();
7286    /// let mut items = builder.by_item();
7287    /// while let Some(result) = items.next().await {
7288    ///   let item = result?;
7289    /// }
7290    /// # Ok(()) }
7291    ///
7292    /// fn prepare_request_builder() -> ListConversationProfiles {
7293    ///   # panic!();
7294    ///   // ... details omitted ...
7295    /// }
7296    /// ```
7297    #[derive(Clone, Debug)]
7298    pub struct ListConversationProfiles(
7299        RequestBuilder<crate::model::ListConversationProfilesRequest>,
7300    );
7301
7302    impl ListConversationProfiles {
7303        pub(crate) fn new(
7304            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7305        ) -> Self {
7306            Self(RequestBuilder::new(stub))
7307        }
7308
7309        /// Sets the full request, replacing any prior values.
7310        pub fn with_request<V: Into<crate::model::ListConversationProfilesRequest>>(
7311            mut self,
7312            v: V,
7313        ) -> Self {
7314            self.0.request = v.into();
7315            self
7316        }
7317
7318        /// Sets all the options, replacing any prior values.
7319        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7320            self.0.options = v.into();
7321            self
7322        }
7323
7324        /// Sends the request.
7325        pub async fn send(self) -> Result<crate::model::ListConversationProfilesResponse> {
7326            (*self.0.stub)
7327                .list_conversation_profiles(self.0.request, self.0.options)
7328                .await
7329                .map(crate::Response::into_body)
7330        }
7331
7332        /// Streams each page in the collection.
7333        pub fn by_page(
7334            self,
7335        ) -> impl google_cloud_gax::paginator::Paginator<
7336            crate::model::ListConversationProfilesResponse,
7337            crate::Error,
7338        > {
7339            use std::clone::Clone;
7340            let token = self.0.request.page_token.clone();
7341            let execute = move |token: String| {
7342                let mut builder = self.clone();
7343                builder.0.request = builder.0.request.set_page_token(token);
7344                builder.send()
7345            };
7346            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7347        }
7348
7349        /// Streams each item in the collection.
7350        pub fn by_item(
7351            self,
7352        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7353            crate::model::ListConversationProfilesResponse,
7354            crate::Error,
7355        > {
7356            use google_cloud_gax::paginator::Paginator;
7357            self.by_page().items()
7358        }
7359
7360        /// Sets the value of [parent][crate::model::ListConversationProfilesRequest::parent].
7361        ///
7362        /// This is a **required** field for requests.
7363        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7364            self.0.request.parent = v.into();
7365            self
7366        }
7367
7368        /// Sets the value of [page_size][crate::model::ListConversationProfilesRequest::page_size].
7369        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7370            self.0.request.page_size = v.into();
7371            self
7372        }
7373
7374        /// Sets the value of [page_token][crate::model::ListConversationProfilesRequest::page_token].
7375        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7376            self.0.request.page_token = v.into();
7377            self
7378        }
7379    }
7380
7381    #[doc(hidden)]
7382    impl crate::RequestBuilder for ListConversationProfiles {
7383        fn request_options(&mut self) -> &mut crate::RequestOptions {
7384            &mut self.0.options
7385        }
7386    }
7387
7388    /// The request builder for [ConversationProfiles::get_conversation_profile][crate::client::ConversationProfiles::get_conversation_profile] calls.
7389    ///
7390    /// # Example
7391    /// ```
7392    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetConversationProfile;
7393    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7394    ///
7395    /// let builder = prepare_request_builder();
7396    /// let response = builder.send().await?;
7397    /// # Ok(()) }
7398    ///
7399    /// fn prepare_request_builder() -> GetConversationProfile {
7400    ///   # panic!();
7401    ///   // ... details omitted ...
7402    /// }
7403    /// ```
7404    #[derive(Clone, Debug)]
7405    pub struct GetConversationProfile(RequestBuilder<crate::model::GetConversationProfileRequest>);
7406
7407    impl GetConversationProfile {
7408        pub(crate) fn new(
7409            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7410        ) -> Self {
7411            Self(RequestBuilder::new(stub))
7412        }
7413
7414        /// Sets the full request, replacing any prior values.
7415        pub fn with_request<V: Into<crate::model::GetConversationProfileRequest>>(
7416            mut self,
7417            v: V,
7418        ) -> Self {
7419            self.0.request = v.into();
7420            self
7421        }
7422
7423        /// Sets all the options, replacing any prior values.
7424        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7425            self.0.options = v.into();
7426            self
7427        }
7428
7429        /// Sends the request.
7430        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7431            (*self.0.stub)
7432                .get_conversation_profile(self.0.request, self.0.options)
7433                .await
7434                .map(crate::Response::into_body)
7435        }
7436
7437        /// Sets the value of [name][crate::model::GetConversationProfileRequest::name].
7438        ///
7439        /// This is a **required** field for requests.
7440        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7441            self.0.request.name = v.into();
7442            self
7443        }
7444    }
7445
7446    #[doc(hidden)]
7447    impl crate::RequestBuilder for GetConversationProfile {
7448        fn request_options(&mut self) -> &mut crate::RequestOptions {
7449            &mut self.0.options
7450        }
7451    }
7452
7453    /// The request builder for [ConversationProfiles::create_conversation_profile][crate::client::ConversationProfiles::create_conversation_profile] calls.
7454    ///
7455    /// # Example
7456    /// ```
7457    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::CreateConversationProfile;
7458    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7459    ///
7460    /// let builder = prepare_request_builder();
7461    /// let response = builder.send().await?;
7462    /// # Ok(()) }
7463    ///
7464    /// fn prepare_request_builder() -> CreateConversationProfile {
7465    ///   # panic!();
7466    ///   // ... details omitted ...
7467    /// }
7468    /// ```
7469    #[derive(Clone, Debug)]
7470    pub struct CreateConversationProfile(
7471        RequestBuilder<crate::model::CreateConversationProfileRequest>,
7472    );
7473
7474    impl CreateConversationProfile {
7475        pub(crate) fn new(
7476            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7477        ) -> Self {
7478            Self(RequestBuilder::new(stub))
7479        }
7480
7481        /// Sets the full request, replacing any prior values.
7482        pub fn with_request<V: Into<crate::model::CreateConversationProfileRequest>>(
7483            mut self,
7484            v: V,
7485        ) -> Self {
7486            self.0.request = v.into();
7487            self
7488        }
7489
7490        /// Sets all the options, replacing any prior values.
7491        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7492            self.0.options = v.into();
7493            self
7494        }
7495
7496        /// Sends the request.
7497        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7498            (*self.0.stub)
7499                .create_conversation_profile(self.0.request, self.0.options)
7500                .await
7501                .map(crate::Response::into_body)
7502        }
7503
7504        /// Sets the value of [parent][crate::model::CreateConversationProfileRequest::parent].
7505        ///
7506        /// This is a **required** field for requests.
7507        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7508            self.0.request.parent = v.into();
7509            self
7510        }
7511
7512        /// Sets the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7513        ///
7514        /// This is a **required** field for requests.
7515        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7516        where
7517            T: std::convert::Into<crate::model::ConversationProfile>,
7518        {
7519            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7520            self
7521        }
7522
7523        /// Sets or clears the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7524        ///
7525        /// This is a **required** field for requests.
7526        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7527        where
7528            T: std::convert::Into<crate::model::ConversationProfile>,
7529        {
7530            self.0.request.conversation_profile = v.map(|x| x.into());
7531            self
7532        }
7533    }
7534
7535    #[doc(hidden)]
7536    impl crate::RequestBuilder for CreateConversationProfile {
7537        fn request_options(&mut self) -> &mut crate::RequestOptions {
7538            &mut self.0.options
7539        }
7540    }
7541
7542    /// The request builder for [ConversationProfiles::update_conversation_profile][crate::client::ConversationProfiles::update_conversation_profile] calls.
7543    ///
7544    /// # Example
7545    /// ```
7546    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::UpdateConversationProfile;
7547    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7548    ///
7549    /// let builder = prepare_request_builder();
7550    /// let response = builder.send().await?;
7551    /// # Ok(()) }
7552    ///
7553    /// fn prepare_request_builder() -> UpdateConversationProfile {
7554    ///   # panic!();
7555    ///   // ... details omitted ...
7556    /// }
7557    /// ```
7558    #[derive(Clone, Debug)]
7559    pub struct UpdateConversationProfile(
7560        RequestBuilder<crate::model::UpdateConversationProfileRequest>,
7561    );
7562
7563    impl UpdateConversationProfile {
7564        pub(crate) fn new(
7565            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7566        ) -> Self {
7567            Self(RequestBuilder::new(stub))
7568        }
7569
7570        /// Sets the full request, replacing any prior values.
7571        pub fn with_request<V: Into<crate::model::UpdateConversationProfileRequest>>(
7572            mut self,
7573            v: V,
7574        ) -> Self {
7575            self.0.request = v.into();
7576            self
7577        }
7578
7579        /// Sets all the options, replacing any prior values.
7580        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7581            self.0.options = v.into();
7582            self
7583        }
7584
7585        /// Sends the request.
7586        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7587            (*self.0.stub)
7588                .update_conversation_profile(self.0.request, self.0.options)
7589                .await
7590                .map(crate::Response::into_body)
7591        }
7592
7593        /// Sets the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7594        ///
7595        /// This is a **required** field for requests.
7596        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7597        where
7598            T: std::convert::Into<crate::model::ConversationProfile>,
7599        {
7600            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7601            self
7602        }
7603
7604        /// Sets or clears the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7605        ///
7606        /// This is a **required** field for requests.
7607        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7608        where
7609            T: std::convert::Into<crate::model::ConversationProfile>,
7610        {
7611            self.0.request.conversation_profile = v.map(|x| x.into());
7612            self
7613        }
7614
7615        /// Sets the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7616        ///
7617        /// This is a **required** field for requests.
7618        pub fn set_update_mask<T>(mut self, v: T) -> Self
7619        where
7620            T: std::convert::Into<wkt::FieldMask>,
7621        {
7622            self.0.request.update_mask = std::option::Option::Some(v.into());
7623            self
7624        }
7625
7626        /// Sets or clears the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7627        ///
7628        /// This is a **required** field for requests.
7629        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7630        where
7631            T: std::convert::Into<wkt::FieldMask>,
7632        {
7633            self.0.request.update_mask = v.map(|x| x.into());
7634            self
7635        }
7636    }
7637
7638    #[doc(hidden)]
7639    impl crate::RequestBuilder for UpdateConversationProfile {
7640        fn request_options(&mut self) -> &mut crate::RequestOptions {
7641            &mut self.0.options
7642        }
7643    }
7644
7645    /// The request builder for [ConversationProfiles::delete_conversation_profile][crate::client::ConversationProfiles::delete_conversation_profile] calls.
7646    ///
7647    /// # Example
7648    /// ```
7649    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::DeleteConversationProfile;
7650    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7651    ///
7652    /// let builder = prepare_request_builder();
7653    /// let response = builder.send().await?;
7654    /// # Ok(()) }
7655    ///
7656    /// fn prepare_request_builder() -> DeleteConversationProfile {
7657    ///   # panic!();
7658    ///   // ... details omitted ...
7659    /// }
7660    /// ```
7661    #[derive(Clone, Debug)]
7662    pub struct DeleteConversationProfile(
7663        RequestBuilder<crate::model::DeleteConversationProfileRequest>,
7664    );
7665
7666    impl DeleteConversationProfile {
7667        pub(crate) fn new(
7668            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7669        ) -> Self {
7670            Self(RequestBuilder::new(stub))
7671        }
7672
7673        /// Sets the full request, replacing any prior values.
7674        pub fn with_request<V: Into<crate::model::DeleteConversationProfileRequest>>(
7675            mut self,
7676            v: V,
7677        ) -> Self {
7678            self.0.request = v.into();
7679            self
7680        }
7681
7682        /// Sets all the options, replacing any prior values.
7683        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7684            self.0.options = v.into();
7685            self
7686        }
7687
7688        /// Sends the request.
7689        pub async fn send(self) -> Result<()> {
7690            (*self.0.stub)
7691                .delete_conversation_profile(self.0.request, self.0.options)
7692                .await
7693                .map(crate::Response::into_body)
7694        }
7695
7696        /// Sets the value of [name][crate::model::DeleteConversationProfileRequest::name].
7697        ///
7698        /// This is a **required** field for requests.
7699        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7700            self.0.request.name = v.into();
7701            self
7702        }
7703    }
7704
7705    #[doc(hidden)]
7706    impl crate::RequestBuilder for DeleteConversationProfile {
7707        fn request_options(&mut self) -> &mut crate::RequestOptions {
7708            &mut self.0.options
7709        }
7710    }
7711
7712    /// The request builder for [ConversationProfiles::set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config] calls.
7713    ///
7714    /// # Example
7715    /// ```
7716    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::SetSuggestionFeatureConfig;
7717    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7718    /// use google_cloud_lro::Poller;
7719    ///
7720    /// let builder = prepare_request_builder();
7721    /// let response = builder.poller().until_done().await?;
7722    /// # Ok(()) }
7723    ///
7724    /// fn prepare_request_builder() -> SetSuggestionFeatureConfig {
7725    ///   # panic!();
7726    ///   // ... details omitted ...
7727    /// }
7728    /// ```
7729    #[derive(Clone, Debug)]
7730    pub struct SetSuggestionFeatureConfig(
7731        RequestBuilder<crate::model::SetSuggestionFeatureConfigRequest>,
7732    );
7733
7734    impl SetSuggestionFeatureConfig {
7735        pub(crate) fn new(
7736            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7737        ) -> Self {
7738            Self(RequestBuilder::new(stub))
7739        }
7740
7741        /// Sets the full request, replacing any prior values.
7742        pub fn with_request<V: Into<crate::model::SetSuggestionFeatureConfigRequest>>(
7743            mut self,
7744            v: V,
7745        ) -> Self {
7746            self.0.request = v.into();
7747            self
7748        }
7749
7750        /// Sets all the options, replacing any prior values.
7751        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7752            self.0.options = v.into();
7753            self
7754        }
7755
7756        /// Sends the request.
7757        ///
7758        /// # Long running operations
7759        ///
7760        /// This starts, but does not poll, a longrunning operation. More information
7761        /// on [set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config].
7762        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7763            (*self.0.stub)
7764                .set_suggestion_feature_config(self.0.request, self.0.options)
7765                .await
7766                .map(crate::Response::into_body)
7767        }
7768
7769        /// Creates a [Poller][google_cloud_lro::Poller] to work with `set_suggestion_feature_config`.
7770        pub fn poller(
7771            self,
7772        ) -> impl google_cloud_lro::Poller<
7773            crate::model::ConversationProfile,
7774            crate::model::SetSuggestionFeatureConfigOperationMetadata,
7775        > {
7776            type Operation = google_cloud_lro::internal::Operation<
7777                crate::model::ConversationProfile,
7778                crate::model::SetSuggestionFeatureConfigOperationMetadata,
7779            >;
7780            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7781            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7782            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7783            if let Some(ref mut details) = poller_options.tracing {
7784                details.method_name = "google_cloud_dialogflow_v2::client::ConversationProfiles::set_suggestion_feature_config::until_done";
7785            }
7786
7787            let stub = self.0.stub.clone();
7788            let mut options = self.0.options.clone();
7789            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7790            let query = move |name| {
7791                let stub = stub.clone();
7792                let options = options.clone();
7793                async {
7794                    let op = GetOperation::new(stub)
7795                        .set_name(name)
7796                        .with_options(options)
7797                        .send()
7798                        .await?;
7799                    Ok(Operation::new(op))
7800                }
7801            };
7802
7803            let start = move || async {
7804                let op = self.send().await?;
7805                Ok(Operation::new(op))
7806            };
7807
7808            use google_cloud_lro::internal::PollerExt;
7809            {
7810                google_cloud_lro::internal::new_poller(
7811                    polling_error_policy,
7812                    polling_backoff_policy,
7813                    start,
7814                    query,
7815                )
7816            }
7817            .with_options(poller_options)
7818        }
7819
7820        /// Sets the value of [conversation_profile][crate::model::SetSuggestionFeatureConfigRequest::conversation_profile].
7821        ///
7822        /// This is a **required** field for requests.
7823        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7824            self.0.request.conversation_profile = v.into();
7825            self
7826        }
7827
7828        /// Sets the value of [participant_role][crate::model::SetSuggestionFeatureConfigRequest::participant_role].
7829        ///
7830        /// This is a **required** field for requests.
7831        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7832            mut self,
7833            v: T,
7834        ) -> Self {
7835            self.0.request.participant_role = v.into();
7836            self
7837        }
7838
7839        /// Sets the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7840        ///
7841        /// This is a **required** field for requests.
7842        pub fn set_suggestion_feature_config<T>(mut self, v: T) -> Self
7843        where
7844            T: std::convert::Into<
7845                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7846                >,
7847        {
7848            self.0.request.suggestion_feature_config = std::option::Option::Some(v.into());
7849            self
7850        }
7851
7852        /// Sets or clears the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7853        ///
7854        /// This is a **required** field for requests.
7855        pub fn set_or_clear_suggestion_feature_config<T>(
7856            mut self,
7857            v: std::option::Option<T>,
7858        ) -> Self
7859        where
7860            T: std::convert::Into<
7861                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7862                >,
7863        {
7864            self.0.request.suggestion_feature_config = v.map(|x| x.into());
7865            self
7866        }
7867    }
7868
7869    #[doc(hidden)]
7870    impl crate::RequestBuilder for SetSuggestionFeatureConfig {
7871        fn request_options(&mut self) -> &mut crate::RequestOptions {
7872            &mut self.0.options
7873        }
7874    }
7875
7876    /// The request builder for [ConversationProfiles::clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config] calls.
7877    ///
7878    /// # Example
7879    /// ```
7880    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ClearSuggestionFeatureConfig;
7881    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7882    /// use google_cloud_lro::Poller;
7883    ///
7884    /// let builder = prepare_request_builder();
7885    /// let response = builder.poller().until_done().await?;
7886    /// # Ok(()) }
7887    ///
7888    /// fn prepare_request_builder() -> ClearSuggestionFeatureConfig {
7889    ///   # panic!();
7890    ///   // ... details omitted ...
7891    /// }
7892    /// ```
7893    #[derive(Clone, Debug)]
7894    pub struct ClearSuggestionFeatureConfig(
7895        RequestBuilder<crate::model::ClearSuggestionFeatureConfigRequest>,
7896    );
7897
7898    impl ClearSuggestionFeatureConfig {
7899        pub(crate) fn new(
7900            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7901        ) -> Self {
7902            Self(RequestBuilder::new(stub))
7903        }
7904
7905        /// Sets the full request, replacing any prior values.
7906        pub fn with_request<V: Into<crate::model::ClearSuggestionFeatureConfigRequest>>(
7907            mut self,
7908            v: V,
7909        ) -> Self {
7910            self.0.request = v.into();
7911            self
7912        }
7913
7914        /// Sets all the options, replacing any prior values.
7915        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7916            self.0.options = v.into();
7917            self
7918        }
7919
7920        /// Sends the request.
7921        ///
7922        /// # Long running operations
7923        ///
7924        /// This starts, but does not poll, a longrunning operation. More information
7925        /// on [clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config].
7926        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7927            (*self.0.stub)
7928                .clear_suggestion_feature_config(self.0.request, self.0.options)
7929                .await
7930                .map(crate::Response::into_body)
7931        }
7932
7933        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clear_suggestion_feature_config`.
7934        pub fn poller(
7935            self,
7936        ) -> impl google_cloud_lro::Poller<
7937            crate::model::ConversationProfile,
7938            crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7939        > {
7940            type Operation = google_cloud_lro::internal::Operation<
7941                crate::model::ConversationProfile,
7942                crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7943            >;
7944            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7945            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7946            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7947            if let Some(ref mut details) = poller_options.tracing {
7948                details.method_name = "google_cloud_dialogflow_v2::client::ConversationProfiles::clear_suggestion_feature_config::until_done";
7949            }
7950
7951            let stub = self.0.stub.clone();
7952            let mut options = self.0.options.clone();
7953            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7954            let query = move |name| {
7955                let stub = stub.clone();
7956                let options = options.clone();
7957                async {
7958                    let op = GetOperation::new(stub)
7959                        .set_name(name)
7960                        .with_options(options)
7961                        .send()
7962                        .await?;
7963                    Ok(Operation::new(op))
7964                }
7965            };
7966
7967            let start = move || async {
7968                let op = self.send().await?;
7969                Ok(Operation::new(op))
7970            };
7971
7972            use google_cloud_lro::internal::PollerExt;
7973            {
7974                google_cloud_lro::internal::new_poller(
7975                    polling_error_policy,
7976                    polling_backoff_policy,
7977                    start,
7978                    query,
7979                )
7980            }
7981            .with_options(poller_options)
7982        }
7983
7984        /// Sets the value of [conversation_profile][crate::model::ClearSuggestionFeatureConfigRequest::conversation_profile].
7985        ///
7986        /// This is a **required** field for requests.
7987        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7988            self.0.request.conversation_profile = v.into();
7989            self
7990        }
7991
7992        /// Sets the value of [participant_role][crate::model::ClearSuggestionFeatureConfigRequest::participant_role].
7993        ///
7994        /// This is a **required** field for requests.
7995        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7996            mut self,
7997            v: T,
7998        ) -> Self {
7999            self.0.request.participant_role = v.into();
8000            self
8001        }
8002
8003        /// Sets the value of [suggestion_feature_type][crate::model::ClearSuggestionFeatureConfigRequest::suggestion_feature_type].
8004        ///
8005        /// This is a **required** field for requests.
8006        pub fn set_suggestion_feature_type<T: Into<crate::model::suggestion_feature::Type>>(
8007            mut self,
8008            v: T,
8009        ) -> Self {
8010            self.0.request.suggestion_feature_type = v.into();
8011            self
8012        }
8013    }
8014
8015    #[doc(hidden)]
8016    impl crate::RequestBuilder for ClearSuggestionFeatureConfig {
8017        fn request_options(&mut self) -> &mut crate::RequestOptions {
8018            &mut self.0.options
8019        }
8020    }
8021
8022    /// The request builder for [ConversationProfiles::list_locations][crate::client::ConversationProfiles::list_locations] calls.
8023    ///
8024    /// # Example
8025    /// ```
8026    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListLocations;
8027    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8028    /// use google_cloud_gax::paginator::ItemPaginator;
8029    ///
8030    /// let builder = prepare_request_builder();
8031    /// let mut items = builder.by_item();
8032    /// while let Some(result) = items.next().await {
8033    ///   let item = result?;
8034    /// }
8035    /// # Ok(()) }
8036    ///
8037    /// fn prepare_request_builder() -> ListLocations {
8038    ///   # panic!();
8039    ///   // ... details omitted ...
8040    /// }
8041    /// ```
8042    #[derive(Clone, Debug)]
8043    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8044
8045    impl ListLocations {
8046        pub(crate) fn new(
8047            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8048        ) -> Self {
8049            Self(RequestBuilder::new(stub))
8050        }
8051
8052        /// Sets the full request, replacing any prior values.
8053        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8054            mut self,
8055            v: V,
8056        ) -> Self {
8057            self.0.request = v.into();
8058            self
8059        }
8060
8061        /// Sets all the options, replacing any prior values.
8062        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8063            self.0.options = v.into();
8064            self
8065        }
8066
8067        /// Sends the request.
8068        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8069            (*self.0.stub)
8070                .list_locations(self.0.request, self.0.options)
8071                .await
8072                .map(crate::Response::into_body)
8073        }
8074
8075        /// Streams each page in the collection.
8076        pub fn by_page(
8077            self,
8078        ) -> impl google_cloud_gax::paginator::Paginator<
8079            google_cloud_location::model::ListLocationsResponse,
8080            crate::Error,
8081        > {
8082            use std::clone::Clone;
8083            let token = self.0.request.page_token.clone();
8084            let execute = move |token: String| {
8085                let mut builder = self.clone();
8086                builder.0.request = builder.0.request.set_page_token(token);
8087                builder.send()
8088            };
8089            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8090        }
8091
8092        /// Streams each item in the collection.
8093        pub fn by_item(
8094            self,
8095        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8096            google_cloud_location::model::ListLocationsResponse,
8097            crate::Error,
8098        > {
8099            use google_cloud_gax::paginator::Paginator;
8100            self.by_page().items()
8101        }
8102
8103        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
8104        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8105            self.0.request.name = v.into();
8106            self
8107        }
8108
8109        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
8110        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8111            self.0.request.filter = v.into();
8112            self
8113        }
8114
8115        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
8116        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8117            self.0.request.page_size = v.into();
8118            self
8119        }
8120
8121        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
8122        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8123            self.0.request.page_token = v.into();
8124            self
8125        }
8126    }
8127
8128    #[doc(hidden)]
8129    impl crate::RequestBuilder for ListLocations {
8130        fn request_options(&mut self) -> &mut crate::RequestOptions {
8131            &mut self.0.options
8132        }
8133    }
8134
8135    /// The request builder for [ConversationProfiles::get_location][crate::client::ConversationProfiles::get_location] calls.
8136    ///
8137    /// # Example
8138    /// ```
8139    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetLocation;
8140    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8141    ///
8142    /// let builder = prepare_request_builder();
8143    /// let response = builder.send().await?;
8144    /// # Ok(()) }
8145    ///
8146    /// fn prepare_request_builder() -> GetLocation {
8147    ///   # panic!();
8148    ///   // ... details omitted ...
8149    /// }
8150    /// ```
8151    #[derive(Clone, Debug)]
8152    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8153
8154    impl GetLocation {
8155        pub(crate) fn new(
8156            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8157        ) -> Self {
8158            Self(RequestBuilder::new(stub))
8159        }
8160
8161        /// Sets the full request, replacing any prior values.
8162        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8163            mut self,
8164            v: V,
8165        ) -> Self {
8166            self.0.request = v.into();
8167            self
8168        }
8169
8170        /// Sets all the options, replacing any prior values.
8171        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8172            self.0.options = v.into();
8173            self
8174        }
8175
8176        /// Sends the request.
8177        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8178            (*self.0.stub)
8179                .get_location(self.0.request, self.0.options)
8180                .await
8181                .map(crate::Response::into_body)
8182        }
8183
8184        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
8185        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8186            self.0.request.name = v.into();
8187            self
8188        }
8189    }
8190
8191    #[doc(hidden)]
8192    impl crate::RequestBuilder for GetLocation {
8193        fn request_options(&mut self) -> &mut crate::RequestOptions {
8194            &mut self.0.options
8195        }
8196    }
8197
8198    /// The request builder for [ConversationProfiles::list_operations][crate::client::ConversationProfiles::list_operations] calls.
8199    ///
8200    /// # Example
8201    /// ```
8202    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListOperations;
8203    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8204    /// use google_cloud_gax::paginator::ItemPaginator;
8205    ///
8206    /// let builder = prepare_request_builder();
8207    /// let mut items = builder.by_item();
8208    /// while let Some(result) = items.next().await {
8209    ///   let item = result?;
8210    /// }
8211    /// # Ok(()) }
8212    ///
8213    /// fn prepare_request_builder() -> ListOperations {
8214    ///   # panic!();
8215    ///   // ... details omitted ...
8216    /// }
8217    /// ```
8218    #[derive(Clone, Debug)]
8219    pub struct ListOperations(
8220        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8221    );
8222
8223    impl ListOperations {
8224        pub(crate) fn new(
8225            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8226        ) -> Self {
8227            Self(RequestBuilder::new(stub))
8228        }
8229
8230        /// Sets the full request, replacing any prior values.
8231        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8232            mut self,
8233            v: V,
8234        ) -> Self {
8235            self.0.request = v.into();
8236            self
8237        }
8238
8239        /// Sets all the options, replacing any prior values.
8240        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8241            self.0.options = v.into();
8242            self
8243        }
8244
8245        /// Sends the request.
8246        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8247            (*self.0.stub)
8248                .list_operations(self.0.request, self.0.options)
8249                .await
8250                .map(crate::Response::into_body)
8251        }
8252
8253        /// Streams each page in the collection.
8254        pub fn by_page(
8255            self,
8256        ) -> impl google_cloud_gax::paginator::Paginator<
8257            google_cloud_longrunning::model::ListOperationsResponse,
8258            crate::Error,
8259        > {
8260            use std::clone::Clone;
8261            let token = self.0.request.page_token.clone();
8262            let execute = move |token: String| {
8263                let mut builder = self.clone();
8264                builder.0.request = builder.0.request.set_page_token(token);
8265                builder.send()
8266            };
8267            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8268        }
8269
8270        /// Streams each item in the collection.
8271        pub fn by_item(
8272            self,
8273        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8274            google_cloud_longrunning::model::ListOperationsResponse,
8275            crate::Error,
8276        > {
8277            use google_cloud_gax::paginator::Paginator;
8278            self.by_page().items()
8279        }
8280
8281        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
8282        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8283            self.0.request.name = v.into();
8284            self
8285        }
8286
8287        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
8288        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8289            self.0.request.filter = v.into();
8290            self
8291        }
8292
8293        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
8294        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8295            self.0.request.page_size = v.into();
8296            self
8297        }
8298
8299        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
8300        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8301            self.0.request.page_token = v.into();
8302            self
8303        }
8304
8305        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
8306        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8307            self.0.request.return_partial_success = v.into();
8308            self
8309        }
8310    }
8311
8312    #[doc(hidden)]
8313    impl crate::RequestBuilder for ListOperations {
8314        fn request_options(&mut self) -> &mut crate::RequestOptions {
8315            &mut self.0.options
8316        }
8317    }
8318
8319    /// The request builder for [ConversationProfiles::get_operation][crate::client::ConversationProfiles::get_operation] calls.
8320    ///
8321    /// # Example
8322    /// ```
8323    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetOperation;
8324    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8325    ///
8326    /// let builder = prepare_request_builder();
8327    /// let response = builder.send().await?;
8328    /// # Ok(()) }
8329    ///
8330    /// fn prepare_request_builder() -> GetOperation {
8331    ///   # panic!();
8332    ///   // ... details omitted ...
8333    /// }
8334    /// ```
8335    #[derive(Clone, Debug)]
8336    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8337
8338    impl GetOperation {
8339        pub(crate) fn new(
8340            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8341        ) -> Self {
8342            Self(RequestBuilder::new(stub))
8343        }
8344
8345        /// Sets the full request, replacing any prior values.
8346        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8347            mut self,
8348            v: V,
8349        ) -> Self {
8350            self.0.request = v.into();
8351            self
8352        }
8353
8354        /// Sets all the options, replacing any prior values.
8355        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8356            self.0.options = v.into();
8357            self
8358        }
8359
8360        /// Sends the request.
8361        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8362            (*self.0.stub)
8363                .get_operation(self.0.request, self.0.options)
8364                .await
8365                .map(crate::Response::into_body)
8366        }
8367
8368        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
8369        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8370            self.0.request.name = v.into();
8371            self
8372        }
8373    }
8374
8375    #[doc(hidden)]
8376    impl crate::RequestBuilder for GetOperation {
8377        fn request_options(&mut self) -> &mut crate::RequestOptions {
8378            &mut self.0.options
8379        }
8380    }
8381
8382    /// The request builder for [ConversationProfiles::cancel_operation][crate::client::ConversationProfiles::cancel_operation] calls.
8383    ///
8384    /// # Example
8385    /// ```
8386    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::CancelOperation;
8387    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8388    ///
8389    /// let builder = prepare_request_builder();
8390    /// let response = builder.send().await?;
8391    /// # Ok(()) }
8392    ///
8393    /// fn prepare_request_builder() -> CancelOperation {
8394    ///   # panic!();
8395    ///   // ... details omitted ...
8396    /// }
8397    /// ```
8398    #[derive(Clone, Debug)]
8399    pub struct CancelOperation(
8400        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8401    );
8402
8403    impl CancelOperation {
8404        pub(crate) fn new(
8405            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8406        ) -> Self {
8407            Self(RequestBuilder::new(stub))
8408        }
8409
8410        /// Sets the full request, replacing any prior values.
8411        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8412            mut self,
8413            v: V,
8414        ) -> Self {
8415            self.0.request = v.into();
8416            self
8417        }
8418
8419        /// Sets all the options, replacing any prior values.
8420        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8421            self.0.options = v.into();
8422            self
8423        }
8424
8425        /// Sends the request.
8426        pub async fn send(self) -> Result<()> {
8427            (*self.0.stub)
8428                .cancel_operation(self.0.request, self.0.options)
8429                .await
8430                .map(crate::Response::into_body)
8431        }
8432
8433        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
8434        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8435            self.0.request.name = v.into();
8436            self
8437        }
8438    }
8439
8440    #[doc(hidden)]
8441    impl crate::RequestBuilder for CancelOperation {
8442        fn request_options(&mut self) -> &mut crate::RequestOptions {
8443            &mut self.0.options
8444        }
8445    }
8446}
8447
8448/// Request and client builders for [Documents][crate::client::Documents].
8449#[cfg(feature = "documents")]
8450#[cfg_attr(docsrs, doc(cfg(feature = "documents")))]
8451pub mod documents {
8452    use crate::Result;
8453
8454    /// A builder for [Documents][crate::client::Documents].
8455    ///
8456    /// ```
8457    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8458    /// # use google_cloud_dialogflow_v2::*;
8459    /// # use builder::documents::ClientBuilder;
8460    /// # use client::Documents;
8461    /// let builder : ClientBuilder = Documents::builder();
8462    /// let client = builder
8463    ///     .with_endpoint("https://dialogflow.googleapis.com")
8464    ///     .build().await?;
8465    /// # Ok(()) }
8466    /// ```
8467    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8468
8469    pub(crate) mod client {
8470        use super::super::super::client::Documents;
8471        pub struct Factory;
8472        impl crate::ClientFactory for Factory {
8473            type Client = Documents;
8474            type Credentials = gaxi::options::Credentials;
8475            async fn build(
8476                self,
8477                config: gaxi::options::ClientConfig,
8478            ) -> crate::ClientBuilderResult<Self::Client> {
8479                Self::Client::new(config).await
8480            }
8481        }
8482    }
8483
8484    /// Common implementation for [crate::client::Documents] request builders.
8485    #[derive(Clone, Debug)]
8486    pub(crate) struct RequestBuilder<R: std::default::Default> {
8487        stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8488        request: R,
8489        options: crate::RequestOptions,
8490    }
8491
8492    impl<R> RequestBuilder<R>
8493    where
8494        R: std::default::Default,
8495    {
8496        pub(crate) fn new(
8497            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8498        ) -> Self {
8499            Self {
8500                stub,
8501                request: R::default(),
8502                options: crate::RequestOptions::default(),
8503            }
8504        }
8505    }
8506
8507    /// The request builder for [Documents::list_documents][crate::client::Documents::list_documents] calls.
8508    ///
8509    /// # Example
8510    /// ```
8511    /// # use google_cloud_dialogflow_v2::builder::documents::ListDocuments;
8512    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8513    /// use google_cloud_gax::paginator::ItemPaginator;
8514    ///
8515    /// let builder = prepare_request_builder();
8516    /// let mut items = builder.by_item();
8517    /// while let Some(result) = items.next().await {
8518    ///   let item = result?;
8519    /// }
8520    /// # Ok(()) }
8521    ///
8522    /// fn prepare_request_builder() -> ListDocuments {
8523    ///   # panic!();
8524    ///   // ... details omitted ...
8525    /// }
8526    /// ```
8527    #[derive(Clone, Debug)]
8528    pub struct ListDocuments(RequestBuilder<crate::model::ListDocumentsRequest>);
8529
8530    impl ListDocuments {
8531        pub(crate) fn new(
8532            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8533        ) -> Self {
8534            Self(RequestBuilder::new(stub))
8535        }
8536
8537        /// Sets the full request, replacing any prior values.
8538        pub fn with_request<V: Into<crate::model::ListDocumentsRequest>>(mut self, v: V) -> Self {
8539            self.0.request = v.into();
8540            self
8541        }
8542
8543        /// Sets all the options, replacing any prior values.
8544        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8545            self.0.options = v.into();
8546            self
8547        }
8548
8549        /// Sends the request.
8550        pub async fn send(self) -> Result<crate::model::ListDocumentsResponse> {
8551            (*self.0.stub)
8552                .list_documents(self.0.request, self.0.options)
8553                .await
8554                .map(crate::Response::into_body)
8555        }
8556
8557        /// Streams each page in the collection.
8558        pub fn by_page(
8559            self,
8560        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDocumentsResponse, crate::Error>
8561        {
8562            use std::clone::Clone;
8563            let token = self.0.request.page_token.clone();
8564            let execute = move |token: String| {
8565                let mut builder = self.clone();
8566                builder.0.request = builder.0.request.set_page_token(token);
8567                builder.send()
8568            };
8569            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8570        }
8571
8572        /// Streams each item in the collection.
8573        pub fn by_item(
8574            self,
8575        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8576            crate::model::ListDocumentsResponse,
8577            crate::Error,
8578        > {
8579            use google_cloud_gax::paginator::Paginator;
8580            self.by_page().items()
8581        }
8582
8583        /// Sets the value of [parent][crate::model::ListDocumentsRequest::parent].
8584        ///
8585        /// This is a **required** field for requests.
8586        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8587            self.0.request.parent = v.into();
8588            self
8589        }
8590
8591        /// Sets the value of [page_size][crate::model::ListDocumentsRequest::page_size].
8592        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8593            self.0.request.page_size = v.into();
8594            self
8595        }
8596
8597        /// Sets the value of [page_token][crate::model::ListDocumentsRequest::page_token].
8598        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8599            self.0.request.page_token = v.into();
8600            self
8601        }
8602
8603        /// Sets the value of [filter][crate::model::ListDocumentsRequest::filter].
8604        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8605            self.0.request.filter = v.into();
8606            self
8607        }
8608    }
8609
8610    #[doc(hidden)]
8611    impl crate::RequestBuilder for ListDocuments {
8612        fn request_options(&mut self) -> &mut crate::RequestOptions {
8613            &mut self.0.options
8614        }
8615    }
8616
8617    /// The request builder for [Documents::get_document][crate::client::Documents::get_document] calls.
8618    ///
8619    /// # Example
8620    /// ```
8621    /// # use google_cloud_dialogflow_v2::builder::documents::GetDocument;
8622    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8623    ///
8624    /// let builder = prepare_request_builder();
8625    /// let response = builder.send().await?;
8626    /// # Ok(()) }
8627    ///
8628    /// fn prepare_request_builder() -> GetDocument {
8629    ///   # panic!();
8630    ///   // ... details omitted ...
8631    /// }
8632    /// ```
8633    #[derive(Clone, Debug)]
8634    pub struct GetDocument(RequestBuilder<crate::model::GetDocumentRequest>);
8635
8636    impl GetDocument {
8637        pub(crate) fn new(
8638            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8639        ) -> Self {
8640            Self(RequestBuilder::new(stub))
8641        }
8642
8643        /// Sets the full request, replacing any prior values.
8644        pub fn with_request<V: Into<crate::model::GetDocumentRequest>>(mut self, v: V) -> Self {
8645            self.0.request = v.into();
8646            self
8647        }
8648
8649        /// Sets all the options, replacing any prior values.
8650        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8651            self.0.options = v.into();
8652            self
8653        }
8654
8655        /// Sends the request.
8656        pub async fn send(self) -> Result<crate::model::Document> {
8657            (*self.0.stub)
8658                .get_document(self.0.request, self.0.options)
8659                .await
8660                .map(crate::Response::into_body)
8661        }
8662
8663        /// Sets the value of [name][crate::model::GetDocumentRequest::name].
8664        ///
8665        /// This is a **required** field for requests.
8666        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8667            self.0.request.name = v.into();
8668            self
8669        }
8670    }
8671
8672    #[doc(hidden)]
8673    impl crate::RequestBuilder for GetDocument {
8674        fn request_options(&mut self) -> &mut crate::RequestOptions {
8675            &mut self.0.options
8676        }
8677    }
8678
8679    /// The request builder for [Documents::create_document][crate::client::Documents::create_document] calls.
8680    ///
8681    /// # Example
8682    /// ```
8683    /// # use google_cloud_dialogflow_v2::builder::documents::CreateDocument;
8684    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8685    /// use google_cloud_lro::Poller;
8686    ///
8687    /// let builder = prepare_request_builder();
8688    /// let response = builder.poller().until_done().await?;
8689    /// # Ok(()) }
8690    ///
8691    /// fn prepare_request_builder() -> CreateDocument {
8692    ///   # panic!();
8693    ///   // ... details omitted ...
8694    /// }
8695    /// ```
8696    #[derive(Clone, Debug)]
8697    pub struct CreateDocument(RequestBuilder<crate::model::CreateDocumentRequest>);
8698
8699    impl CreateDocument {
8700        pub(crate) fn new(
8701            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8702        ) -> Self {
8703            Self(RequestBuilder::new(stub))
8704        }
8705
8706        /// Sets the full request, replacing any prior values.
8707        pub fn with_request<V: Into<crate::model::CreateDocumentRequest>>(mut self, v: V) -> Self {
8708            self.0.request = v.into();
8709            self
8710        }
8711
8712        /// Sets all the options, replacing any prior values.
8713        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8714            self.0.options = v.into();
8715            self
8716        }
8717
8718        /// Sends the request.
8719        ///
8720        /// # Long running operations
8721        ///
8722        /// This starts, but does not poll, a longrunning operation. More information
8723        /// on [create_document][crate::client::Documents::create_document].
8724        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8725            (*self.0.stub)
8726                .create_document(self.0.request, self.0.options)
8727                .await
8728                .map(crate::Response::into_body)
8729        }
8730
8731        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_document`.
8732        pub fn poller(
8733            self,
8734        ) -> impl google_cloud_lro::Poller<
8735            crate::model::Document,
8736            crate::model::KnowledgeOperationMetadata,
8737        > {
8738            type Operation = google_cloud_lro::internal::Operation<
8739                crate::model::Document,
8740                crate::model::KnowledgeOperationMetadata,
8741            >;
8742            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8743            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8744            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8745            if let Some(ref mut details) = poller_options.tracing {
8746                details.method_name =
8747                    "google_cloud_dialogflow_v2::client::Documents::create_document::until_done";
8748            }
8749
8750            let stub = self.0.stub.clone();
8751            let mut options = self.0.options.clone();
8752            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8753            let query = move |name| {
8754                let stub = stub.clone();
8755                let options = options.clone();
8756                async {
8757                    let op = GetOperation::new(stub)
8758                        .set_name(name)
8759                        .with_options(options)
8760                        .send()
8761                        .await?;
8762                    Ok(Operation::new(op))
8763                }
8764            };
8765
8766            let start = move || async {
8767                let op = self.send().await?;
8768                Ok(Operation::new(op))
8769            };
8770
8771            use google_cloud_lro::internal::PollerExt;
8772            {
8773                google_cloud_lro::internal::new_poller(
8774                    polling_error_policy,
8775                    polling_backoff_policy,
8776                    start,
8777                    query,
8778                )
8779            }
8780            .with_options(poller_options)
8781        }
8782
8783        /// Sets the value of [parent][crate::model::CreateDocumentRequest::parent].
8784        ///
8785        /// This is a **required** field for requests.
8786        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8787            self.0.request.parent = v.into();
8788            self
8789        }
8790
8791        /// Sets the value of [document][crate::model::CreateDocumentRequest::document].
8792        ///
8793        /// This is a **required** field for requests.
8794        pub fn set_document<T>(mut self, v: T) -> Self
8795        where
8796            T: std::convert::Into<crate::model::Document>,
8797        {
8798            self.0.request.document = std::option::Option::Some(v.into());
8799            self
8800        }
8801
8802        /// Sets or clears the value of [document][crate::model::CreateDocumentRequest::document].
8803        ///
8804        /// This is a **required** field for requests.
8805        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
8806        where
8807            T: std::convert::Into<crate::model::Document>,
8808        {
8809            self.0.request.document = v.map(|x| x.into());
8810            self
8811        }
8812    }
8813
8814    #[doc(hidden)]
8815    impl crate::RequestBuilder for CreateDocument {
8816        fn request_options(&mut self) -> &mut crate::RequestOptions {
8817            &mut self.0.options
8818        }
8819    }
8820
8821    /// The request builder for [Documents::import_documents][crate::client::Documents::import_documents] calls.
8822    ///
8823    /// # Example
8824    /// ```
8825    /// # use google_cloud_dialogflow_v2::builder::documents::ImportDocuments;
8826    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8827    /// use google_cloud_lro::Poller;
8828    ///
8829    /// let builder = prepare_request_builder();
8830    /// let response = builder.poller().until_done().await?;
8831    /// # Ok(()) }
8832    ///
8833    /// fn prepare_request_builder() -> ImportDocuments {
8834    ///   # panic!();
8835    ///   // ... details omitted ...
8836    /// }
8837    /// ```
8838    #[derive(Clone, Debug)]
8839    pub struct ImportDocuments(RequestBuilder<crate::model::ImportDocumentsRequest>);
8840
8841    impl ImportDocuments {
8842        pub(crate) fn new(
8843            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8844        ) -> Self {
8845            Self(RequestBuilder::new(stub))
8846        }
8847
8848        /// Sets the full request, replacing any prior values.
8849        pub fn with_request<V: Into<crate::model::ImportDocumentsRequest>>(mut self, v: V) -> Self {
8850            self.0.request = v.into();
8851            self
8852        }
8853
8854        /// Sets all the options, replacing any prior values.
8855        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8856            self.0.options = v.into();
8857            self
8858        }
8859
8860        /// Sends the request.
8861        ///
8862        /// # Long running operations
8863        ///
8864        /// This starts, but does not poll, a longrunning operation. More information
8865        /// on [import_documents][crate::client::Documents::import_documents].
8866        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8867            (*self.0.stub)
8868                .import_documents(self.0.request, self.0.options)
8869                .await
8870                .map(crate::Response::into_body)
8871        }
8872
8873        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_documents`.
8874        pub fn poller(
8875            self,
8876        ) -> impl google_cloud_lro::Poller<
8877            crate::model::ImportDocumentsResponse,
8878            crate::model::KnowledgeOperationMetadata,
8879        > {
8880            type Operation = google_cloud_lro::internal::Operation<
8881                crate::model::ImportDocumentsResponse,
8882                crate::model::KnowledgeOperationMetadata,
8883            >;
8884            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8885            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8886            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8887            if let Some(ref mut details) = poller_options.tracing {
8888                details.method_name =
8889                    "google_cloud_dialogflow_v2::client::Documents::import_documents::until_done";
8890            }
8891
8892            let stub = self.0.stub.clone();
8893            let mut options = self.0.options.clone();
8894            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8895            let query = move |name| {
8896                let stub = stub.clone();
8897                let options = options.clone();
8898                async {
8899                    let op = GetOperation::new(stub)
8900                        .set_name(name)
8901                        .with_options(options)
8902                        .send()
8903                        .await?;
8904                    Ok(Operation::new(op))
8905                }
8906            };
8907
8908            let start = move || async {
8909                let op = self.send().await?;
8910                Ok(Operation::new(op))
8911            };
8912
8913            use google_cloud_lro::internal::PollerExt;
8914            {
8915                google_cloud_lro::internal::new_poller(
8916                    polling_error_policy,
8917                    polling_backoff_policy,
8918                    start,
8919                    query,
8920                )
8921            }
8922            .with_options(poller_options)
8923        }
8924
8925        /// Sets the value of [parent][crate::model::ImportDocumentsRequest::parent].
8926        ///
8927        /// This is a **required** field for requests.
8928        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8929            self.0.request.parent = v.into();
8930            self
8931        }
8932
8933        /// Sets the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8934        ///
8935        /// This is a **required** field for requests.
8936        pub fn set_document_template<T>(mut self, v: T) -> Self
8937        where
8938            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8939        {
8940            self.0.request.document_template = std::option::Option::Some(v.into());
8941            self
8942        }
8943
8944        /// Sets or clears the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8945        ///
8946        /// This is a **required** field for requests.
8947        pub fn set_or_clear_document_template<T>(mut self, v: std::option::Option<T>) -> Self
8948        where
8949            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8950        {
8951            self.0.request.document_template = v.map(|x| x.into());
8952            self
8953        }
8954
8955        /// Sets the value of [import_gcs_custom_metadata][crate::model::ImportDocumentsRequest::import_gcs_custom_metadata].
8956        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
8957            self.0.request.import_gcs_custom_metadata = v.into();
8958            self
8959        }
8960
8961        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source].
8962        ///
8963        /// Note that all the setters affecting `source` are
8964        /// mutually exclusive.
8965        pub fn set_source<T: Into<Option<crate::model::import_documents_request::Source>>>(
8966            mut self,
8967            v: T,
8968        ) -> Self {
8969            self.0.request.source = v.into();
8970            self
8971        }
8972
8973        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source]
8974        /// to hold a `GcsSource`.
8975        ///
8976        /// Note that all the setters affecting `source` are
8977        /// mutually exclusive.
8978        pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSources>>>(
8979            mut self,
8980            v: T,
8981        ) -> Self {
8982            self.0.request = self.0.request.set_gcs_source(v);
8983            self
8984        }
8985    }
8986
8987    #[doc(hidden)]
8988    impl crate::RequestBuilder for ImportDocuments {
8989        fn request_options(&mut self) -> &mut crate::RequestOptions {
8990            &mut self.0.options
8991        }
8992    }
8993
8994    /// The request builder for [Documents::delete_document][crate::client::Documents::delete_document] calls.
8995    ///
8996    /// # Example
8997    /// ```
8998    /// # use google_cloud_dialogflow_v2::builder::documents::DeleteDocument;
8999    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9000    /// use google_cloud_lro::Poller;
9001    ///
9002    /// let builder = prepare_request_builder();
9003    /// let response = builder.poller().until_done().await?;
9004    /// # Ok(()) }
9005    ///
9006    /// fn prepare_request_builder() -> DeleteDocument {
9007    ///   # panic!();
9008    ///   // ... details omitted ...
9009    /// }
9010    /// ```
9011    #[derive(Clone, Debug)]
9012    pub struct DeleteDocument(RequestBuilder<crate::model::DeleteDocumentRequest>);
9013
9014    impl DeleteDocument {
9015        pub(crate) fn new(
9016            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9017        ) -> Self {
9018            Self(RequestBuilder::new(stub))
9019        }
9020
9021        /// Sets the full request, replacing any prior values.
9022        pub fn with_request<V: Into<crate::model::DeleteDocumentRequest>>(mut self, v: V) -> Self {
9023            self.0.request = v.into();
9024            self
9025        }
9026
9027        /// Sets all the options, replacing any prior values.
9028        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9029            self.0.options = v.into();
9030            self
9031        }
9032
9033        /// Sends the request.
9034        ///
9035        /// # Long running operations
9036        ///
9037        /// This starts, but does not poll, a longrunning operation. More information
9038        /// on [delete_document][crate::client::Documents::delete_document].
9039        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9040            (*self.0.stub)
9041                .delete_document(self.0.request, self.0.options)
9042                .await
9043                .map(crate::Response::into_body)
9044        }
9045
9046        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_document`.
9047        pub fn poller(
9048            self,
9049        ) -> impl google_cloud_lro::Poller<(), crate::model::KnowledgeOperationMetadata> {
9050            type Operation = google_cloud_lro::internal::Operation<
9051                wkt::Empty,
9052                crate::model::KnowledgeOperationMetadata,
9053            >;
9054            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9055            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9056            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9057            if let Some(ref mut details) = poller_options.tracing {
9058                details.method_name =
9059                    "google_cloud_dialogflow_v2::client::Documents::delete_document::until_done";
9060            }
9061
9062            let stub = self.0.stub.clone();
9063            let mut options = self.0.options.clone();
9064            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9065            let query = move |name| {
9066                let stub = stub.clone();
9067                let options = options.clone();
9068                async {
9069                    let op = GetOperation::new(stub)
9070                        .set_name(name)
9071                        .with_options(options)
9072                        .send()
9073                        .await?;
9074                    Ok(Operation::new(op))
9075                }
9076            };
9077
9078            let start = move || async {
9079                let op = self.send().await?;
9080                Ok(Operation::new(op))
9081            };
9082
9083            use google_cloud_lro::internal::PollerExt;
9084            {
9085                google_cloud_lro::internal::new_unit_response_poller(
9086                    polling_error_policy,
9087                    polling_backoff_policy,
9088                    start,
9089                    query,
9090                )
9091            }
9092            .with_options(poller_options)
9093        }
9094
9095        /// Sets the value of [name][crate::model::DeleteDocumentRequest::name].
9096        ///
9097        /// This is a **required** field for requests.
9098        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9099            self.0.request.name = v.into();
9100            self
9101        }
9102    }
9103
9104    #[doc(hidden)]
9105    impl crate::RequestBuilder for DeleteDocument {
9106        fn request_options(&mut self) -> &mut crate::RequestOptions {
9107            &mut self.0.options
9108        }
9109    }
9110
9111    /// The request builder for [Documents::update_document][crate::client::Documents::update_document] calls.
9112    ///
9113    /// # Example
9114    /// ```
9115    /// # use google_cloud_dialogflow_v2::builder::documents::UpdateDocument;
9116    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9117    /// use google_cloud_lro::Poller;
9118    ///
9119    /// let builder = prepare_request_builder();
9120    /// let response = builder.poller().until_done().await?;
9121    /// # Ok(()) }
9122    ///
9123    /// fn prepare_request_builder() -> UpdateDocument {
9124    ///   # panic!();
9125    ///   // ... details omitted ...
9126    /// }
9127    /// ```
9128    #[derive(Clone, Debug)]
9129    pub struct UpdateDocument(RequestBuilder<crate::model::UpdateDocumentRequest>);
9130
9131    impl UpdateDocument {
9132        pub(crate) fn new(
9133            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9134        ) -> Self {
9135            Self(RequestBuilder::new(stub))
9136        }
9137
9138        /// Sets the full request, replacing any prior values.
9139        pub fn with_request<V: Into<crate::model::UpdateDocumentRequest>>(mut self, v: V) -> Self {
9140            self.0.request = v.into();
9141            self
9142        }
9143
9144        /// Sets all the options, replacing any prior values.
9145        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9146            self.0.options = v.into();
9147            self
9148        }
9149
9150        /// Sends the request.
9151        ///
9152        /// # Long running operations
9153        ///
9154        /// This starts, but does not poll, a longrunning operation. More information
9155        /// on [update_document][crate::client::Documents::update_document].
9156        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9157            (*self.0.stub)
9158                .update_document(self.0.request, self.0.options)
9159                .await
9160                .map(crate::Response::into_body)
9161        }
9162
9163        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_document`.
9164        pub fn poller(
9165            self,
9166        ) -> impl google_cloud_lro::Poller<
9167            crate::model::Document,
9168            crate::model::KnowledgeOperationMetadata,
9169        > {
9170            type Operation = google_cloud_lro::internal::Operation<
9171                crate::model::Document,
9172                crate::model::KnowledgeOperationMetadata,
9173            >;
9174            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9175            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9176            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9177            if let Some(ref mut details) = poller_options.tracing {
9178                details.method_name =
9179                    "google_cloud_dialogflow_v2::client::Documents::update_document::until_done";
9180            }
9181
9182            let stub = self.0.stub.clone();
9183            let mut options = self.0.options.clone();
9184            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9185            let query = move |name| {
9186                let stub = stub.clone();
9187                let options = options.clone();
9188                async {
9189                    let op = GetOperation::new(stub)
9190                        .set_name(name)
9191                        .with_options(options)
9192                        .send()
9193                        .await?;
9194                    Ok(Operation::new(op))
9195                }
9196            };
9197
9198            let start = move || async {
9199                let op = self.send().await?;
9200                Ok(Operation::new(op))
9201            };
9202
9203            use google_cloud_lro::internal::PollerExt;
9204            {
9205                google_cloud_lro::internal::new_poller(
9206                    polling_error_policy,
9207                    polling_backoff_policy,
9208                    start,
9209                    query,
9210                )
9211            }
9212            .with_options(poller_options)
9213        }
9214
9215        /// Sets the value of [document][crate::model::UpdateDocumentRequest::document].
9216        ///
9217        /// This is a **required** field for requests.
9218        pub fn set_document<T>(mut self, v: T) -> Self
9219        where
9220            T: std::convert::Into<crate::model::Document>,
9221        {
9222            self.0.request.document = std::option::Option::Some(v.into());
9223            self
9224        }
9225
9226        /// Sets or clears the value of [document][crate::model::UpdateDocumentRequest::document].
9227        ///
9228        /// This is a **required** field for requests.
9229        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
9230        where
9231            T: std::convert::Into<crate::model::Document>,
9232        {
9233            self.0.request.document = v.map(|x| x.into());
9234            self
9235        }
9236
9237        /// Sets the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
9238        pub fn set_update_mask<T>(mut self, v: T) -> Self
9239        where
9240            T: std::convert::Into<wkt::FieldMask>,
9241        {
9242            self.0.request.update_mask = std::option::Option::Some(v.into());
9243            self
9244        }
9245
9246        /// Sets or clears the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
9247        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9248        where
9249            T: std::convert::Into<wkt::FieldMask>,
9250        {
9251            self.0.request.update_mask = v.map(|x| x.into());
9252            self
9253        }
9254    }
9255
9256    #[doc(hidden)]
9257    impl crate::RequestBuilder for UpdateDocument {
9258        fn request_options(&mut self) -> &mut crate::RequestOptions {
9259            &mut self.0.options
9260        }
9261    }
9262
9263    /// The request builder for [Documents::reload_document][crate::client::Documents::reload_document] calls.
9264    ///
9265    /// # Example
9266    /// ```
9267    /// # use google_cloud_dialogflow_v2::builder::documents::ReloadDocument;
9268    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9269    /// use google_cloud_lro::Poller;
9270    ///
9271    /// let builder = prepare_request_builder();
9272    /// let response = builder.poller().until_done().await?;
9273    /// # Ok(()) }
9274    ///
9275    /// fn prepare_request_builder() -> ReloadDocument {
9276    ///   # panic!();
9277    ///   // ... details omitted ...
9278    /// }
9279    /// ```
9280    #[derive(Clone, Debug)]
9281    pub struct ReloadDocument(RequestBuilder<crate::model::ReloadDocumentRequest>);
9282
9283    impl ReloadDocument {
9284        pub(crate) fn new(
9285            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9286        ) -> Self {
9287            Self(RequestBuilder::new(stub))
9288        }
9289
9290        /// Sets the full request, replacing any prior values.
9291        pub fn with_request<V: Into<crate::model::ReloadDocumentRequest>>(mut self, v: V) -> Self {
9292            self.0.request = v.into();
9293            self
9294        }
9295
9296        /// Sets all the options, replacing any prior values.
9297        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9298            self.0.options = v.into();
9299            self
9300        }
9301
9302        /// Sends the request.
9303        ///
9304        /// # Long running operations
9305        ///
9306        /// This starts, but does not poll, a longrunning operation. More information
9307        /// on [reload_document][crate::client::Documents::reload_document].
9308        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9309            (*self.0.stub)
9310                .reload_document(self.0.request, self.0.options)
9311                .await
9312                .map(crate::Response::into_body)
9313        }
9314
9315        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reload_document`.
9316        pub fn poller(
9317            self,
9318        ) -> impl google_cloud_lro::Poller<
9319            crate::model::Document,
9320            crate::model::KnowledgeOperationMetadata,
9321        > {
9322            type Operation = google_cloud_lro::internal::Operation<
9323                crate::model::Document,
9324                crate::model::KnowledgeOperationMetadata,
9325            >;
9326            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9327            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9328            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9329            if let Some(ref mut details) = poller_options.tracing {
9330                details.method_name =
9331                    "google_cloud_dialogflow_v2::client::Documents::reload_document::until_done";
9332            }
9333
9334            let stub = self.0.stub.clone();
9335            let mut options = self.0.options.clone();
9336            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9337            let query = move |name| {
9338                let stub = stub.clone();
9339                let options = options.clone();
9340                async {
9341                    let op = GetOperation::new(stub)
9342                        .set_name(name)
9343                        .with_options(options)
9344                        .send()
9345                        .await?;
9346                    Ok(Operation::new(op))
9347                }
9348            };
9349
9350            let start = move || async {
9351                let op = self.send().await?;
9352                Ok(Operation::new(op))
9353            };
9354
9355            use google_cloud_lro::internal::PollerExt;
9356            {
9357                google_cloud_lro::internal::new_poller(
9358                    polling_error_policy,
9359                    polling_backoff_policy,
9360                    start,
9361                    query,
9362                )
9363            }
9364            .with_options(poller_options)
9365        }
9366
9367        /// Sets the value of [name][crate::model::ReloadDocumentRequest::name].
9368        ///
9369        /// This is a **required** field for requests.
9370        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9371            self.0.request.name = v.into();
9372            self
9373        }
9374
9375        /// Sets the value of [import_gcs_custom_metadata][crate::model::ReloadDocumentRequest::import_gcs_custom_metadata].
9376        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
9377            self.0.request.import_gcs_custom_metadata = v.into();
9378            self
9379        }
9380
9381        /// Sets the value of [smart_messaging_partial_update][crate::model::ReloadDocumentRequest::smart_messaging_partial_update].
9382        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9383            self.0.request.smart_messaging_partial_update = v.into();
9384            self
9385        }
9386
9387        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source].
9388        ///
9389        /// Note that all the setters affecting `source` are
9390        /// mutually exclusive.
9391        pub fn set_source<T: Into<Option<crate::model::reload_document_request::Source>>>(
9392            mut self,
9393            v: T,
9394        ) -> Self {
9395            self.0.request.source = v.into();
9396            self
9397        }
9398
9399        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source]
9400        /// to hold a `ContentUri`.
9401        ///
9402        /// Note that all the setters affecting `source` are
9403        /// mutually exclusive.
9404        pub fn set_content_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9405            self.0.request = self.0.request.set_content_uri(v);
9406            self
9407        }
9408    }
9409
9410    #[doc(hidden)]
9411    impl crate::RequestBuilder for ReloadDocument {
9412        fn request_options(&mut self) -> &mut crate::RequestOptions {
9413            &mut self.0.options
9414        }
9415    }
9416
9417    /// The request builder for [Documents::export_document][crate::client::Documents::export_document] calls.
9418    ///
9419    /// # Example
9420    /// ```
9421    /// # use google_cloud_dialogflow_v2::builder::documents::ExportDocument;
9422    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9423    /// use google_cloud_lro::Poller;
9424    ///
9425    /// let builder = prepare_request_builder();
9426    /// let response = builder.poller().until_done().await?;
9427    /// # Ok(()) }
9428    ///
9429    /// fn prepare_request_builder() -> ExportDocument {
9430    ///   # panic!();
9431    ///   // ... details omitted ...
9432    /// }
9433    /// ```
9434    #[derive(Clone, Debug)]
9435    pub struct ExportDocument(RequestBuilder<crate::model::ExportDocumentRequest>);
9436
9437    impl ExportDocument {
9438        pub(crate) fn new(
9439            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9440        ) -> Self {
9441            Self(RequestBuilder::new(stub))
9442        }
9443
9444        /// Sets the full request, replacing any prior values.
9445        pub fn with_request<V: Into<crate::model::ExportDocumentRequest>>(mut self, v: V) -> Self {
9446            self.0.request = v.into();
9447            self
9448        }
9449
9450        /// Sets all the options, replacing any prior values.
9451        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9452            self.0.options = v.into();
9453            self
9454        }
9455
9456        /// Sends the request.
9457        ///
9458        /// # Long running operations
9459        ///
9460        /// This starts, but does not poll, a longrunning operation. More information
9461        /// on [export_document][crate::client::Documents::export_document].
9462        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9463            (*self.0.stub)
9464                .export_document(self.0.request, self.0.options)
9465                .await
9466                .map(crate::Response::into_body)
9467        }
9468
9469        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_document`.
9470        pub fn poller(
9471            self,
9472        ) -> impl google_cloud_lro::Poller<
9473            crate::model::Document,
9474            crate::model::KnowledgeOperationMetadata,
9475        > {
9476            type Operation = google_cloud_lro::internal::Operation<
9477                crate::model::Document,
9478                crate::model::KnowledgeOperationMetadata,
9479            >;
9480            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9481            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9482            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9483            if let Some(ref mut details) = poller_options.tracing {
9484                details.method_name =
9485                    "google_cloud_dialogflow_v2::client::Documents::export_document::until_done";
9486            }
9487
9488            let stub = self.0.stub.clone();
9489            let mut options = self.0.options.clone();
9490            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9491            let query = move |name| {
9492                let stub = stub.clone();
9493                let options = options.clone();
9494                async {
9495                    let op = GetOperation::new(stub)
9496                        .set_name(name)
9497                        .with_options(options)
9498                        .send()
9499                        .await?;
9500                    Ok(Operation::new(op))
9501                }
9502            };
9503
9504            let start = move || async {
9505                let op = self.send().await?;
9506                Ok(Operation::new(op))
9507            };
9508
9509            use google_cloud_lro::internal::PollerExt;
9510            {
9511                google_cloud_lro::internal::new_poller(
9512                    polling_error_policy,
9513                    polling_backoff_policy,
9514                    start,
9515                    query,
9516                )
9517            }
9518            .with_options(poller_options)
9519        }
9520
9521        /// Sets the value of [name][crate::model::ExportDocumentRequest::name].
9522        ///
9523        /// This is a **required** field for requests.
9524        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9525            self.0.request.name = v.into();
9526            self
9527        }
9528
9529        /// Sets the value of [export_full_content][crate::model::ExportDocumentRequest::export_full_content].
9530        pub fn set_export_full_content<T: Into<bool>>(mut self, v: T) -> Self {
9531            self.0.request.export_full_content = v.into();
9532            self
9533        }
9534
9535        /// Sets the value of [smart_messaging_partial_update][crate::model::ExportDocumentRequest::smart_messaging_partial_update].
9536        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9537            self.0.request.smart_messaging_partial_update = v.into();
9538            self
9539        }
9540
9541        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination].
9542        ///
9543        /// Note that all the setters affecting `destination` are
9544        /// mutually exclusive.
9545        pub fn set_destination<
9546            T: Into<Option<crate::model::export_document_request::Destination>>,
9547        >(
9548            mut self,
9549            v: T,
9550        ) -> Self {
9551            self.0.request.destination = v.into();
9552            self
9553        }
9554
9555        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination]
9556        /// to hold a `GcsDestination`.
9557        ///
9558        /// Note that all the setters affecting `destination` are
9559        /// mutually exclusive.
9560        pub fn set_gcs_destination<
9561            T: std::convert::Into<std::boxed::Box<crate::model::GcsDestination>>,
9562        >(
9563            mut self,
9564            v: T,
9565        ) -> Self {
9566            self.0.request = self.0.request.set_gcs_destination(v);
9567            self
9568        }
9569    }
9570
9571    #[doc(hidden)]
9572    impl crate::RequestBuilder for ExportDocument {
9573        fn request_options(&mut self) -> &mut crate::RequestOptions {
9574            &mut self.0.options
9575        }
9576    }
9577
9578    /// The request builder for [Documents::list_locations][crate::client::Documents::list_locations] calls.
9579    ///
9580    /// # Example
9581    /// ```
9582    /// # use google_cloud_dialogflow_v2::builder::documents::ListLocations;
9583    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9584    /// use google_cloud_gax::paginator::ItemPaginator;
9585    ///
9586    /// let builder = prepare_request_builder();
9587    /// let mut items = builder.by_item();
9588    /// while let Some(result) = items.next().await {
9589    ///   let item = result?;
9590    /// }
9591    /// # Ok(()) }
9592    ///
9593    /// fn prepare_request_builder() -> ListLocations {
9594    ///   # panic!();
9595    ///   // ... details omitted ...
9596    /// }
9597    /// ```
9598    #[derive(Clone, Debug)]
9599    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9600
9601    impl ListLocations {
9602        pub(crate) fn new(
9603            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9604        ) -> Self {
9605            Self(RequestBuilder::new(stub))
9606        }
9607
9608        /// Sets the full request, replacing any prior values.
9609        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9610            mut self,
9611            v: V,
9612        ) -> Self {
9613            self.0.request = v.into();
9614            self
9615        }
9616
9617        /// Sets all the options, replacing any prior values.
9618        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9619            self.0.options = v.into();
9620            self
9621        }
9622
9623        /// Sends the request.
9624        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9625            (*self.0.stub)
9626                .list_locations(self.0.request, self.0.options)
9627                .await
9628                .map(crate::Response::into_body)
9629        }
9630
9631        /// Streams each page in the collection.
9632        pub fn by_page(
9633            self,
9634        ) -> impl google_cloud_gax::paginator::Paginator<
9635            google_cloud_location::model::ListLocationsResponse,
9636            crate::Error,
9637        > {
9638            use std::clone::Clone;
9639            let token = self.0.request.page_token.clone();
9640            let execute = move |token: String| {
9641                let mut builder = self.clone();
9642                builder.0.request = builder.0.request.set_page_token(token);
9643                builder.send()
9644            };
9645            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9646        }
9647
9648        /// Streams each item in the collection.
9649        pub fn by_item(
9650            self,
9651        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9652            google_cloud_location::model::ListLocationsResponse,
9653            crate::Error,
9654        > {
9655            use google_cloud_gax::paginator::Paginator;
9656            self.by_page().items()
9657        }
9658
9659        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9660        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9661            self.0.request.name = v.into();
9662            self
9663        }
9664
9665        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9666        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9667            self.0.request.filter = v.into();
9668            self
9669        }
9670
9671        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9672        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9673            self.0.request.page_size = v.into();
9674            self
9675        }
9676
9677        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9678        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9679            self.0.request.page_token = v.into();
9680            self
9681        }
9682    }
9683
9684    #[doc(hidden)]
9685    impl crate::RequestBuilder for ListLocations {
9686        fn request_options(&mut self) -> &mut crate::RequestOptions {
9687            &mut self.0.options
9688        }
9689    }
9690
9691    /// The request builder for [Documents::get_location][crate::client::Documents::get_location] calls.
9692    ///
9693    /// # Example
9694    /// ```
9695    /// # use google_cloud_dialogflow_v2::builder::documents::GetLocation;
9696    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9697    ///
9698    /// let builder = prepare_request_builder();
9699    /// let response = builder.send().await?;
9700    /// # Ok(()) }
9701    ///
9702    /// fn prepare_request_builder() -> GetLocation {
9703    ///   # panic!();
9704    ///   // ... details omitted ...
9705    /// }
9706    /// ```
9707    #[derive(Clone, Debug)]
9708    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9709
9710    impl GetLocation {
9711        pub(crate) fn new(
9712            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9713        ) -> Self {
9714            Self(RequestBuilder::new(stub))
9715        }
9716
9717        /// Sets the full request, replacing any prior values.
9718        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9719            mut self,
9720            v: V,
9721        ) -> Self {
9722            self.0.request = v.into();
9723            self
9724        }
9725
9726        /// Sets all the options, replacing any prior values.
9727        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9728            self.0.options = v.into();
9729            self
9730        }
9731
9732        /// Sends the request.
9733        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9734            (*self.0.stub)
9735                .get_location(self.0.request, self.0.options)
9736                .await
9737                .map(crate::Response::into_body)
9738        }
9739
9740        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9741        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9742            self.0.request.name = v.into();
9743            self
9744        }
9745    }
9746
9747    #[doc(hidden)]
9748    impl crate::RequestBuilder for GetLocation {
9749        fn request_options(&mut self) -> &mut crate::RequestOptions {
9750            &mut self.0.options
9751        }
9752    }
9753
9754    /// The request builder for [Documents::list_operations][crate::client::Documents::list_operations] calls.
9755    ///
9756    /// # Example
9757    /// ```
9758    /// # use google_cloud_dialogflow_v2::builder::documents::ListOperations;
9759    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9760    /// use google_cloud_gax::paginator::ItemPaginator;
9761    ///
9762    /// let builder = prepare_request_builder();
9763    /// let mut items = builder.by_item();
9764    /// while let Some(result) = items.next().await {
9765    ///   let item = result?;
9766    /// }
9767    /// # Ok(()) }
9768    ///
9769    /// fn prepare_request_builder() -> ListOperations {
9770    ///   # panic!();
9771    ///   // ... details omitted ...
9772    /// }
9773    /// ```
9774    #[derive(Clone, Debug)]
9775    pub struct ListOperations(
9776        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9777    );
9778
9779    impl ListOperations {
9780        pub(crate) fn new(
9781            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9782        ) -> Self {
9783            Self(RequestBuilder::new(stub))
9784        }
9785
9786        /// Sets the full request, replacing any prior values.
9787        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9788            mut self,
9789            v: V,
9790        ) -> Self {
9791            self.0.request = v.into();
9792            self
9793        }
9794
9795        /// Sets all the options, replacing any prior values.
9796        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9797            self.0.options = v.into();
9798            self
9799        }
9800
9801        /// Sends the request.
9802        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9803            (*self.0.stub)
9804                .list_operations(self.0.request, self.0.options)
9805                .await
9806                .map(crate::Response::into_body)
9807        }
9808
9809        /// Streams each page in the collection.
9810        pub fn by_page(
9811            self,
9812        ) -> impl google_cloud_gax::paginator::Paginator<
9813            google_cloud_longrunning::model::ListOperationsResponse,
9814            crate::Error,
9815        > {
9816            use std::clone::Clone;
9817            let token = self.0.request.page_token.clone();
9818            let execute = move |token: String| {
9819                let mut builder = self.clone();
9820                builder.0.request = builder.0.request.set_page_token(token);
9821                builder.send()
9822            };
9823            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9824        }
9825
9826        /// Streams each item in the collection.
9827        pub fn by_item(
9828            self,
9829        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9830            google_cloud_longrunning::model::ListOperationsResponse,
9831            crate::Error,
9832        > {
9833            use google_cloud_gax::paginator::Paginator;
9834            self.by_page().items()
9835        }
9836
9837        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
9838        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9839            self.0.request.name = v.into();
9840            self
9841        }
9842
9843        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
9844        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9845            self.0.request.filter = v.into();
9846            self
9847        }
9848
9849        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
9850        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9851            self.0.request.page_size = v.into();
9852            self
9853        }
9854
9855        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
9856        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9857            self.0.request.page_token = v.into();
9858            self
9859        }
9860
9861        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
9862        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9863            self.0.request.return_partial_success = v.into();
9864            self
9865        }
9866    }
9867
9868    #[doc(hidden)]
9869    impl crate::RequestBuilder for ListOperations {
9870        fn request_options(&mut self) -> &mut crate::RequestOptions {
9871            &mut self.0.options
9872        }
9873    }
9874
9875    /// The request builder for [Documents::get_operation][crate::client::Documents::get_operation] calls.
9876    ///
9877    /// # Example
9878    /// ```
9879    /// # use google_cloud_dialogflow_v2::builder::documents::GetOperation;
9880    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9881    ///
9882    /// let builder = prepare_request_builder();
9883    /// let response = builder.send().await?;
9884    /// # Ok(()) }
9885    ///
9886    /// fn prepare_request_builder() -> GetOperation {
9887    ///   # panic!();
9888    ///   // ... details omitted ...
9889    /// }
9890    /// ```
9891    #[derive(Clone, Debug)]
9892    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9893
9894    impl GetOperation {
9895        pub(crate) fn new(
9896            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9897        ) -> Self {
9898            Self(RequestBuilder::new(stub))
9899        }
9900
9901        /// Sets the full request, replacing any prior values.
9902        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9903            mut self,
9904            v: V,
9905        ) -> Self {
9906            self.0.request = v.into();
9907            self
9908        }
9909
9910        /// Sets all the options, replacing any prior values.
9911        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9912            self.0.options = v.into();
9913            self
9914        }
9915
9916        /// Sends the request.
9917        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9918            (*self.0.stub)
9919                .get_operation(self.0.request, self.0.options)
9920                .await
9921                .map(crate::Response::into_body)
9922        }
9923
9924        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
9925        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9926            self.0.request.name = v.into();
9927            self
9928        }
9929    }
9930
9931    #[doc(hidden)]
9932    impl crate::RequestBuilder for GetOperation {
9933        fn request_options(&mut self) -> &mut crate::RequestOptions {
9934            &mut self.0.options
9935        }
9936    }
9937
9938    /// The request builder for [Documents::cancel_operation][crate::client::Documents::cancel_operation] calls.
9939    ///
9940    /// # Example
9941    /// ```
9942    /// # use google_cloud_dialogflow_v2::builder::documents::CancelOperation;
9943    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9944    ///
9945    /// let builder = prepare_request_builder();
9946    /// let response = builder.send().await?;
9947    /// # Ok(()) }
9948    ///
9949    /// fn prepare_request_builder() -> CancelOperation {
9950    ///   # panic!();
9951    ///   // ... details omitted ...
9952    /// }
9953    /// ```
9954    #[derive(Clone, Debug)]
9955    pub struct CancelOperation(
9956        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9957    );
9958
9959    impl CancelOperation {
9960        pub(crate) fn new(
9961            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9962        ) -> Self {
9963            Self(RequestBuilder::new(stub))
9964        }
9965
9966        /// Sets the full request, replacing any prior values.
9967        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9968            mut self,
9969            v: V,
9970        ) -> Self {
9971            self.0.request = v.into();
9972            self
9973        }
9974
9975        /// Sets all the options, replacing any prior values.
9976        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9977            self.0.options = v.into();
9978            self
9979        }
9980
9981        /// Sends the request.
9982        pub async fn send(self) -> Result<()> {
9983            (*self.0.stub)
9984                .cancel_operation(self.0.request, self.0.options)
9985                .await
9986                .map(crate::Response::into_body)
9987        }
9988
9989        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
9990        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9991            self.0.request.name = v.into();
9992            self
9993        }
9994    }
9995
9996    #[doc(hidden)]
9997    impl crate::RequestBuilder for CancelOperation {
9998        fn request_options(&mut self) -> &mut crate::RequestOptions {
9999            &mut self.0.options
10000        }
10001    }
10002}
10003
10004/// Request and client builders for [EncryptionSpecService][crate::client::EncryptionSpecService].
10005#[cfg(feature = "encryption-spec-service")]
10006#[cfg_attr(docsrs, doc(cfg(feature = "encryption-spec-service")))]
10007pub mod encryption_spec_service {
10008    use crate::Result;
10009
10010    /// A builder for [EncryptionSpecService][crate::client::EncryptionSpecService].
10011    ///
10012    /// ```
10013    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10014    /// # use google_cloud_dialogflow_v2::*;
10015    /// # use builder::encryption_spec_service::ClientBuilder;
10016    /// # use client::EncryptionSpecService;
10017    /// let builder : ClientBuilder = EncryptionSpecService::builder();
10018    /// let client = builder
10019    ///     .with_endpoint("https://dialogflow.googleapis.com")
10020    ///     .build().await?;
10021    /// # Ok(()) }
10022    /// ```
10023    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10024
10025    pub(crate) mod client {
10026        use super::super::super::client::EncryptionSpecService;
10027        pub struct Factory;
10028        impl crate::ClientFactory for Factory {
10029            type Client = EncryptionSpecService;
10030            type Credentials = gaxi::options::Credentials;
10031            async fn build(
10032                self,
10033                config: gaxi::options::ClientConfig,
10034            ) -> crate::ClientBuilderResult<Self::Client> {
10035                Self::Client::new(config).await
10036            }
10037        }
10038    }
10039
10040    /// Common implementation for [crate::client::EncryptionSpecService] request builders.
10041    #[derive(Clone, Debug)]
10042    pub(crate) struct RequestBuilder<R: std::default::Default> {
10043        stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10044        request: R,
10045        options: crate::RequestOptions,
10046    }
10047
10048    impl<R> RequestBuilder<R>
10049    where
10050        R: std::default::Default,
10051    {
10052        pub(crate) fn new(
10053            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10054        ) -> Self {
10055            Self {
10056                stub,
10057                request: R::default(),
10058                options: crate::RequestOptions::default(),
10059            }
10060        }
10061    }
10062
10063    /// The request builder for [EncryptionSpecService::get_encryption_spec][crate::client::EncryptionSpecService::get_encryption_spec] calls.
10064    ///
10065    /// # Example
10066    /// ```
10067    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetEncryptionSpec;
10068    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10069    ///
10070    /// let builder = prepare_request_builder();
10071    /// let response = builder.send().await?;
10072    /// # Ok(()) }
10073    ///
10074    /// fn prepare_request_builder() -> GetEncryptionSpec {
10075    ///   # panic!();
10076    ///   // ... details omitted ...
10077    /// }
10078    /// ```
10079    #[derive(Clone, Debug)]
10080    pub struct GetEncryptionSpec(RequestBuilder<crate::model::GetEncryptionSpecRequest>);
10081
10082    impl GetEncryptionSpec {
10083        pub(crate) fn new(
10084            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10085        ) -> Self {
10086            Self(RequestBuilder::new(stub))
10087        }
10088
10089        /// Sets the full request, replacing any prior values.
10090        pub fn with_request<V: Into<crate::model::GetEncryptionSpecRequest>>(
10091            mut self,
10092            v: V,
10093        ) -> Self {
10094            self.0.request = v.into();
10095            self
10096        }
10097
10098        /// Sets all the options, replacing any prior values.
10099        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10100            self.0.options = v.into();
10101            self
10102        }
10103
10104        /// Sends the request.
10105        pub async fn send(self) -> Result<crate::model::EncryptionSpec> {
10106            (*self.0.stub)
10107                .get_encryption_spec(self.0.request, self.0.options)
10108                .await
10109                .map(crate::Response::into_body)
10110        }
10111
10112        /// Sets the value of [name][crate::model::GetEncryptionSpecRequest::name].
10113        ///
10114        /// This is a **required** field for requests.
10115        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10116            self.0.request.name = v.into();
10117            self
10118        }
10119    }
10120
10121    #[doc(hidden)]
10122    impl crate::RequestBuilder for GetEncryptionSpec {
10123        fn request_options(&mut self) -> &mut crate::RequestOptions {
10124            &mut self.0.options
10125        }
10126    }
10127
10128    /// The request builder for [EncryptionSpecService::initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec] calls.
10129    ///
10130    /// # Example
10131    /// ```
10132    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::InitializeEncryptionSpec;
10133    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10134    /// use google_cloud_lro::Poller;
10135    ///
10136    /// let builder = prepare_request_builder();
10137    /// let response = builder.poller().until_done().await?;
10138    /// # Ok(()) }
10139    ///
10140    /// fn prepare_request_builder() -> InitializeEncryptionSpec {
10141    ///   # panic!();
10142    ///   // ... details omitted ...
10143    /// }
10144    /// ```
10145    #[derive(Clone, Debug)]
10146    pub struct InitializeEncryptionSpec(
10147        RequestBuilder<crate::model::InitializeEncryptionSpecRequest>,
10148    );
10149
10150    impl InitializeEncryptionSpec {
10151        pub(crate) fn new(
10152            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10153        ) -> Self {
10154            Self(RequestBuilder::new(stub))
10155        }
10156
10157        /// Sets the full request, replacing any prior values.
10158        pub fn with_request<V: Into<crate::model::InitializeEncryptionSpecRequest>>(
10159            mut self,
10160            v: V,
10161        ) -> Self {
10162            self.0.request = v.into();
10163            self
10164        }
10165
10166        /// Sets all the options, replacing any prior values.
10167        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10168            self.0.options = v.into();
10169            self
10170        }
10171
10172        /// Sends the request.
10173        ///
10174        /// # Long running operations
10175        ///
10176        /// This starts, but does not poll, a longrunning operation. More information
10177        /// on [initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec].
10178        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10179            (*self.0.stub)
10180                .initialize_encryption_spec(self.0.request, self.0.options)
10181                .await
10182                .map(crate::Response::into_body)
10183        }
10184
10185        /// Creates a [Poller][google_cloud_lro::Poller] to work with `initialize_encryption_spec`.
10186        pub fn poller(
10187            self,
10188        ) -> impl google_cloud_lro::Poller<
10189            crate::model::InitializeEncryptionSpecResponse,
10190            crate::model::InitializeEncryptionSpecMetadata,
10191        > {
10192            type Operation = google_cloud_lro::internal::Operation<
10193                crate::model::InitializeEncryptionSpecResponse,
10194                crate::model::InitializeEncryptionSpecMetadata,
10195            >;
10196            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10197            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10198            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10199            if let Some(ref mut details) = poller_options.tracing {
10200                details.method_name = "google_cloud_dialogflow_v2::client::EncryptionSpecService::initialize_encryption_spec::until_done";
10201            }
10202
10203            let stub = self.0.stub.clone();
10204            let mut options = self.0.options.clone();
10205            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10206            let query = move |name| {
10207                let stub = stub.clone();
10208                let options = options.clone();
10209                async {
10210                    let op = GetOperation::new(stub)
10211                        .set_name(name)
10212                        .with_options(options)
10213                        .send()
10214                        .await?;
10215                    Ok(Operation::new(op))
10216                }
10217            };
10218
10219            let start = move || async {
10220                let op = self.send().await?;
10221                Ok(Operation::new(op))
10222            };
10223
10224            use google_cloud_lro::internal::PollerExt;
10225            {
10226                google_cloud_lro::internal::new_poller(
10227                    polling_error_policy,
10228                    polling_backoff_policy,
10229                    start,
10230                    query,
10231                )
10232            }
10233            .with_options(poller_options)
10234        }
10235
10236        /// Sets the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
10237        ///
10238        /// This is a **required** field for requests.
10239        pub fn set_encryption_spec<T>(mut self, v: T) -> Self
10240        where
10241            T: std::convert::Into<crate::model::EncryptionSpec>,
10242        {
10243            self.0.request.encryption_spec = std::option::Option::Some(v.into());
10244            self
10245        }
10246
10247        /// Sets or clears the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
10248        ///
10249        /// This is a **required** field for requests.
10250        pub fn set_or_clear_encryption_spec<T>(mut self, v: std::option::Option<T>) -> Self
10251        where
10252            T: std::convert::Into<crate::model::EncryptionSpec>,
10253        {
10254            self.0.request.encryption_spec = v.map(|x| x.into());
10255            self
10256        }
10257    }
10258
10259    #[doc(hidden)]
10260    impl crate::RequestBuilder for InitializeEncryptionSpec {
10261        fn request_options(&mut self) -> &mut crate::RequestOptions {
10262            &mut self.0.options
10263        }
10264    }
10265
10266    /// The request builder for [EncryptionSpecService::list_locations][crate::client::EncryptionSpecService::list_locations] calls.
10267    ///
10268    /// # Example
10269    /// ```
10270    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::ListLocations;
10271    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10272    /// use google_cloud_gax::paginator::ItemPaginator;
10273    ///
10274    /// let builder = prepare_request_builder();
10275    /// let mut items = builder.by_item();
10276    /// while let Some(result) = items.next().await {
10277    ///   let item = result?;
10278    /// }
10279    /// # Ok(()) }
10280    ///
10281    /// fn prepare_request_builder() -> ListLocations {
10282    ///   # panic!();
10283    ///   // ... details omitted ...
10284    /// }
10285    /// ```
10286    #[derive(Clone, Debug)]
10287    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10288
10289    impl ListLocations {
10290        pub(crate) fn new(
10291            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10292        ) -> Self {
10293            Self(RequestBuilder::new(stub))
10294        }
10295
10296        /// Sets the full request, replacing any prior values.
10297        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10298            mut self,
10299            v: V,
10300        ) -> Self {
10301            self.0.request = v.into();
10302            self
10303        }
10304
10305        /// Sets all the options, replacing any prior values.
10306        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10307            self.0.options = v.into();
10308            self
10309        }
10310
10311        /// Sends the request.
10312        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10313            (*self.0.stub)
10314                .list_locations(self.0.request, self.0.options)
10315                .await
10316                .map(crate::Response::into_body)
10317        }
10318
10319        /// Streams each page in the collection.
10320        pub fn by_page(
10321            self,
10322        ) -> impl google_cloud_gax::paginator::Paginator<
10323            google_cloud_location::model::ListLocationsResponse,
10324            crate::Error,
10325        > {
10326            use std::clone::Clone;
10327            let token = self.0.request.page_token.clone();
10328            let execute = move |token: String| {
10329                let mut builder = self.clone();
10330                builder.0.request = builder.0.request.set_page_token(token);
10331                builder.send()
10332            };
10333            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10334        }
10335
10336        /// Streams each item in the collection.
10337        pub fn by_item(
10338            self,
10339        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10340            google_cloud_location::model::ListLocationsResponse,
10341            crate::Error,
10342        > {
10343            use google_cloud_gax::paginator::Paginator;
10344            self.by_page().items()
10345        }
10346
10347        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10348        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10349            self.0.request.name = v.into();
10350            self
10351        }
10352
10353        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10354        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10355            self.0.request.filter = v.into();
10356            self
10357        }
10358
10359        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10360        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10361            self.0.request.page_size = v.into();
10362            self
10363        }
10364
10365        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10366        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10367            self.0.request.page_token = v.into();
10368            self
10369        }
10370    }
10371
10372    #[doc(hidden)]
10373    impl crate::RequestBuilder for ListLocations {
10374        fn request_options(&mut self) -> &mut crate::RequestOptions {
10375            &mut self.0.options
10376        }
10377    }
10378
10379    /// The request builder for [EncryptionSpecService::get_location][crate::client::EncryptionSpecService::get_location] calls.
10380    ///
10381    /// # Example
10382    /// ```
10383    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetLocation;
10384    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10385    ///
10386    /// let builder = prepare_request_builder();
10387    /// let response = builder.send().await?;
10388    /// # Ok(()) }
10389    ///
10390    /// fn prepare_request_builder() -> GetLocation {
10391    ///   # panic!();
10392    ///   // ... details omitted ...
10393    /// }
10394    /// ```
10395    #[derive(Clone, Debug)]
10396    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10397
10398    impl GetLocation {
10399        pub(crate) fn new(
10400            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10401        ) -> Self {
10402            Self(RequestBuilder::new(stub))
10403        }
10404
10405        /// Sets the full request, replacing any prior values.
10406        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10407            mut self,
10408            v: V,
10409        ) -> Self {
10410            self.0.request = v.into();
10411            self
10412        }
10413
10414        /// Sets all the options, replacing any prior values.
10415        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10416            self.0.options = v.into();
10417            self
10418        }
10419
10420        /// Sends the request.
10421        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10422            (*self.0.stub)
10423                .get_location(self.0.request, self.0.options)
10424                .await
10425                .map(crate::Response::into_body)
10426        }
10427
10428        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
10429        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10430            self.0.request.name = v.into();
10431            self
10432        }
10433    }
10434
10435    #[doc(hidden)]
10436    impl crate::RequestBuilder for GetLocation {
10437        fn request_options(&mut self) -> &mut crate::RequestOptions {
10438            &mut self.0.options
10439        }
10440    }
10441
10442    /// The request builder for [EncryptionSpecService::list_operations][crate::client::EncryptionSpecService::list_operations] calls.
10443    ///
10444    /// # Example
10445    /// ```
10446    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::ListOperations;
10447    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10448    /// use google_cloud_gax::paginator::ItemPaginator;
10449    ///
10450    /// let builder = prepare_request_builder();
10451    /// let mut items = builder.by_item();
10452    /// while let Some(result) = items.next().await {
10453    ///   let item = result?;
10454    /// }
10455    /// # Ok(()) }
10456    ///
10457    /// fn prepare_request_builder() -> ListOperations {
10458    ///   # panic!();
10459    ///   // ... details omitted ...
10460    /// }
10461    /// ```
10462    #[derive(Clone, Debug)]
10463    pub struct ListOperations(
10464        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10465    );
10466
10467    impl ListOperations {
10468        pub(crate) fn new(
10469            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10470        ) -> Self {
10471            Self(RequestBuilder::new(stub))
10472        }
10473
10474        /// Sets the full request, replacing any prior values.
10475        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10476            mut self,
10477            v: V,
10478        ) -> Self {
10479            self.0.request = v.into();
10480            self
10481        }
10482
10483        /// Sets all the options, replacing any prior values.
10484        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10485            self.0.options = v.into();
10486            self
10487        }
10488
10489        /// Sends the request.
10490        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10491            (*self.0.stub)
10492                .list_operations(self.0.request, self.0.options)
10493                .await
10494                .map(crate::Response::into_body)
10495        }
10496
10497        /// Streams each page in the collection.
10498        pub fn by_page(
10499            self,
10500        ) -> impl google_cloud_gax::paginator::Paginator<
10501            google_cloud_longrunning::model::ListOperationsResponse,
10502            crate::Error,
10503        > {
10504            use std::clone::Clone;
10505            let token = self.0.request.page_token.clone();
10506            let execute = move |token: String| {
10507                let mut builder = self.clone();
10508                builder.0.request = builder.0.request.set_page_token(token);
10509                builder.send()
10510            };
10511            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10512        }
10513
10514        /// Streams each item in the collection.
10515        pub fn by_item(
10516            self,
10517        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10518            google_cloud_longrunning::model::ListOperationsResponse,
10519            crate::Error,
10520        > {
10521            use google_cloud_gax::paginator::Paginator;
10522            self.by_page().items()
10523        }
10524
10525        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
10526        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10527            self.0.request.name = v.into();
10528            self
10529        }
10530
10531        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
10532        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10533            self.0.request.filter = v.into();
10534            self
10535        }
10536
10537        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
10538        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10539            self.0.request.page_size = v.into();
10540            self
10541        }
10542
10543        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
10544        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10545            self.0.request.page_token = v.into();
10546            self
10547        }
10548
10549        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
10550        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10551            self.0.request.return_partial_success = v.into();
10552            self
10553        }
10554    }
10555
10556    #[doc(hidden)]
10557    impl crate::RequestBuilder for ListOperations {
10558        fn request_options(&mut self) -> &mut crate::RequestOptions {
10559            &mut self.0.options
10560        }
10561    }
10562
10563    /// The request builder for [EncryptionSpecService::get_operation][crate::client::EncryptionSpecService::get_operation] calls.
10564    ///
10565    /// # Example
10566    /// ```
10567    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetOperation;
10568    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10569    ///
10570    /// let builder = prepare_request_builder();
10571    /// let response = builder.send().await?;
10572    /// # Ok(()) }
10573    ///
10574    /// fn prepare_request_builder() -> GetOperation {
10575    ///   # panic!();
10576    ///   // ... details omitted ...
10577    /// }
10578    /// ```
10579    #[derive(Clone, Debug)]
10580    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10581
10582    impl GetOperation {
10583        pub(crate) fn new(
10584            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10585        ) -> Self {
10586            Self(RequestBuilder::new(stub))
10587        }
10588
10589        /// Sets the full request, replacing any prior values.
10590        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10591            mut self,
10592            v: V,
10593        ) -> Self {
10594            self.0.request = v.into();
10595            self
10596        }
10597
10598        /// Sets all the options, replacing any prior values.
10599        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10600            self.0.options = v.into();
10601            self
10602        }
10603
10604        /// Sends the request.
10605        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10606            (*self.0.stub)
10607                .get_operation(self.0.request, self.0.options)
10608                .await
10609                .map(crate::Response::into_body)
10610        }
10611
10612        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
10613        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10614            self.0.request.name = v.into();
10615            self
10616        }
10617    }
10618
10619    #[doc(hidden)]
10620    impl crate::RequestBuilder for GetOperation {
10621        fn request_options(&mut self) -> &mut crate::RequestOptions {
10622            &mut self.0.options
10623        }
10624    }
10625
10626    /// The request builder for [EncryptionSpecService::cancel_operation][crate::client::EncryptionSpecService::cancel_operation] calls.
10627    ///
10628    /// # Example
10629    /// ```
10630    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::CancelOperation;
10631    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10632    ///
10633    /// let builder = prepare_request_builder();
10634    /// let response = builder.send().await?;
10635    /// # Ok(()) }
10636    ///
10637    /// fn prepare_request_builder() -> CancelOperation {
10638    ///   # panic!();
10639    ///   // ... details omitted ...
10640    /// }
10641    /// ```
10642    #[derive(Clone, Debug)]
10643    pub struct CancelOperation(
10644        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10645    );
10646
10647    impl CancelOperation {
10648        pub(crate) fn new(
10649            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10650        ) -> Self {
10651            Self(RequestBuilder::new(stub))
10652        }
10653
10654        /// Sets the full request, replacing any prior values.
10655        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10656            mut self,
10657            v: V,
10658        ) -> Self {
10659            self.0.request = v.into();
10660            self
10661        }
10662
10663        /// Sets all the options, replacing any prior values.
10664        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10665            self.0.options = v.into();
10666            self
10667        }
10668
10669        /// Sends the request.
10670        pub async fn send(self) -> Result<()> {
10671            (*self.0.stub)
10672                .cancel_operation(self.0.request, self.0.options)
10673                .await
10674                .map(crate::Response::into_body)
10675        }
10676
10677        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
10678        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10679            self.0.request.name = v.into();
10680            self
10681        }
10682    }
10683
10684    #[doc(hidden)]
10685    impl crate::RequestBuilder for CancelOperation {
10686        fn request_options(&mut self) -> &mut crate::RequestOptions {
10687            &mut self.0.options
10688        }
10689    }
10690}
10691
10692/// Request and client builders for [EntityTypes][crate::client::EntityTypes].
10693#[cfg(feature = "entity-types")]
10694#[cfg_attr(docsrs, doc(cfg(feature = "entity-types")))]
10695pub mod entity_types {
10696    use crate::Result;
10697
10698    /// A builder for [EntityTypes][crate::client::EntityTypes].
10699    ///
10700    /// ```
10701    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10702    /// # use google_cloud_dialogflow_v2::*;
10703    /// # use builder::entity_types::ClientBuilder;
10704    /// # use client::EntityTypes;
10705    /// let builder : ClientBuilder = EntityTypes::builder();
10706    /// let client = builder
10707    ///     .with_endpoint("https://dialogflow.googleapis.com")
10708    ///     .build().await?;
10709    /// # Ok(()) }
10710    /// ```
10711    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10712
10713    pub(crate) mod client {
10714        use super::super::super::client::EntityTypes;
10715        pub struct Factory;
10716        impl crate::ClientFactory for Factory {
10717            type Client = EntityTypes;
10718            type Credentials = gaxi::options::Credentials;
10719            async fn build(
10720                self,
10721                config: gaxi::options::ClientConfig,
10722            ) -> crate::ClientBuilderResult<Self::Client> {
10723                Self::Client::new(config).await
10724            }
10725        }
10726    }
10727
10728    /// Common implementation for [crate::client::EntityTypes] request builders.
10729    #[derive(Clone, Debug)]
10730    pub(crate) struct RequestBuilder<R: std::default::Default> {
10731        stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10732        request: R,
10733        options: crate::RequestOptions,
10734    }
10735
10736    impl<R> RequestBuilder<R>
10737    where
10738        R: std::default::Default,
10739    {
10740        pub(crate) fn new(
10741            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10742        ) -> Self {
10743            Self {
10744                stub,
10745                request: R::default(),
10746                options: crate::RequestOptions::default(),
10747            }
10748        }
10749    }
10750
10751    /// The request builder for [EntityTypes::list_entity_types][crate::client::EntityTypes::list_entity_types] calls.
10752    ///
10753    /// # Example
10754    /// ```
10755    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListEntityTypes;
10756    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10757    /// use google_cloud_gax::paginator::ItemPaginator;
10758    ///
10759    /// let builder = prepare_request_builder();
10760    /// let mut items = builder.by_item();
10761    /// while let Some(result) = items.next().await {
10762    ///   let item = result?;
10763    /// }
10764    /// # Ok(()) }
10765    ///
10766    /// fn prepare_request_builder() -> ListEntityTypes {
10767    ///   # panic!();
10768    ///   // ... details omitted ...
10769    /// }
10770    /// ```
10771    #[derive(Clone, Debug)]
10772    pub struct ListEntityTypes(RequestBuilder<crate::model::ListEntityTypesRequest>);
10773
10774    impl ListEntityTypes {
10775        pub(crate) fn new(
10776            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10777        ) -> Self {
10778            Self(RequestBuilder::new(stub))
10779        }
10780
10781        /// Sets the full request, replacing any prior values.
10782        pub fn with_request<V: Into<crate::model::ListEntityTypesRequest>>(mut self, v: V) -> Self {
10783            self.0.request = v.into();
10784            self
10785        }
10786
10787        /// Sets all the options, replacing any prior values.
10788        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10789            self.0.options = v.into();
10790            self
10791        }
10792
10793        /// Sends the request.
10794        pub async fn send(self) -> Result<crate::model::ListEntityTypesResponse> {
10795            (*self.0.stub)
10796                .list_entity_types(self.0.request, self.0.options)
10797                .await
10798                .map(crate::Response::into_body)
10799        }
10800
10801        /// Streams each page in the collection.
10802        pub fn by_page(
10803            self,
10804        ) -> impl google_cloud_gax::paginator::Paginator<
10805            crate::model::ListEntityTypesResponse,
10806            crate::Error,
10807        > {
10808            use std::clone::Clone;
10809            let token = self.0.request.page_token.clone();
10810            let execute = move |token: String| {
10811                let mut builder = self.clone();
10812                builder.0.request = builder.0.request.set_page_token(token);
10813                builder.send()
10814            };
10815            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10816        }
10817
10818        /// Streams each item in the collection.
10819        pub fn by_item(
10820            self,
10821        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10822            crate::model::ListEntityTypesResponse,
10823            crate::Error,
10824        > {
10825            use google_cloud_gax::paginator::Paginator;
10826            self.by_page().items()
10827        }
10828
10829        /// Sets the value of [parent][crate::model::ListEntityTypesRequest::parent].
10830        ///
10831        /// This is a **required** field for requests.
10832        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10833            self.0.request.parent = v.into();
10834            self
10835        }
10836
10837        /// Sets the value of [language_code][crate::model::ListEntityTypesRequest::language_code].
10838        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10839            self.0.request.language_code = v.into();
10840            self
10841        }
10842
10843        /// Sets the value of [page_size][crate::model::ListEntityTypesRequest::page_size].
10844        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10845            self.0.request.page_size = v.into();
10846            self
10847        }
10848
10849        /// Sets the value of [page_token][crate::model::ListEntityTypesRequest::page_token].
10850        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10851            self.0.request.page_token = v.into();
10852            self
10853        }
10854    }
10855
10856    #[doc(hidden)]
10857    impl crate::RequestBuilder for ListEntityTypes {
10858        fn request_options(&mut self) -> &mut crate::RequestOptions {
10859            &mut self.0.options
10860        }
10861    }
10862
10863    /// The request builder for [EntityTypes::get_entity_type][crate::client::EntityTypes::get_entity_type] calls.
10864    ///
10865    /// # Example
10866    /// ```
10867    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetEntityType;
10868    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10869    ///
10870    /// let builder = prepare_request_builder();
10871    /// let response = builder.send().await?;
10872    /// # Ok(()) }
10873    ///
10874    /// fn prepare_request_builder() -> GetEntityType {
10875    ///   # panic!();
10876    ///   // ... details omitted ...
10877    /// }
10878    /// ```
10879    #[derive(Clone, Debug)]
10880    pub struct GetEntityType(RequestBuilder<crate::model::GetEntityTypeRequest>);
10881
10882    impl GetEntityType {
10883        pub(crate) fn new(
10884            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10885        ) -> Self {
10886            Self(RequestBuilder::new(stub))
10887        }
10888
10889        /// Sets the full request, replacing any prior values.
10890        pub fn with_request<V: Into<crate::model::GetEntityTypeRequest>>(mut self, v: V) -> Self {
10891            self.0.request = v.into();
10892            self
10893        }
10894
10895        /// Sets all the options, replacing any prior values.
10896        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10897            self.0.options = v.into();
10898            self
10899        }
10900
10901        /// Sends the request.
10902        pub async fn send(self) -> Result<crate::model::EntityType> {
10903            (*self.0.stub)
10904                .get_entity_type(self.0.request, self.0.options)
10905                .await
10906                .map(crate::Response::into_body)
10907        }
10908
10909        /// Sets the value of [name][crate::model::GetEntityTypeRequest::name].
10910        ///
10911        /// This is a **required** field for requests.
10912        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10913            self.0.request.name = v.into();
10914            self
10915        }
10916
10917        /// Sets the value of [language_code][crate::model::GetEntityTypeRequest::language_code].
10918        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10919            self.0.request.language_code = v.into();
10920            self
10921        }
10922    }
10923
10924    #[doc(hidden)]
10925    impl crate::RequestBuilder for GetEntityType {
10926        fn request_options(&mut self) -> &mut crate::RequestOptions {
10927            &mut self.0.options
10928        }
10929    }
10930
10931    /// The request builder for [EntityTypes::create_entity_type][crate::client::EntityTypes::create_entity_type] calls.
10932    ///
10933    /// # Example
10934    /// ```
10935    /// # use google_cloud_dialogflow_v2::builder::entity_types::CreateEntityType;
10936    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10937    ///
10938    /// let builder = prepare_request_builder();
10939    /// let response = builder.send().await?;
10940    /// # Ok(()) }
10941    ///
10942    /// fn prepare_request_builder() -> CreateEntityType {
10943    ///   # panic!();
10944    ///   // ... details omitted ...
10945    /// }
10946    /// ```
10947    #[derive(Clone, Debug)]
10948    pub struct CreateEntityType(RequestBuilder<crate::model::CreateEntityTypeRequest>);
10949
10950    impl CreateEntityType {
10951        pub(crate) fn new(
10952            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10953        ) -> Self {
10954            Self(RequestBuilder::new(stub))
10955        }
10956
10957        /// Sets the full request, replacing any prior values.
10958        pub fn with_request<V: Into<crate::model::CreateEntityTypeRequest>>(
10959            mut self,
10960            v: V,
10961        ) -> Self {
10962            self.0.request = v.into();
10963            self
10964        }
10965
10966        /// Sets all the options, replacing any prior values.
10967        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10968            self.0.options = v.into();
10969            self
10970        }
10971
10972        /// Sends the request.
10973        pub async fn send(self) -> Result<crate::model::EntityType> {
10974            (*self.0.stub)
10975                .create_entity_type(self.0.request, self.0.options)
10976                .await
10977                .map(crate::Response::into_body)
10978        }
10979
10980        /// Sets the value of [parent][crate::model::CreateEntityTypeRequest::parent].
10981        ///
10982        /// This is a **required** field for requests.
10983        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10984            self.0.request.parent = v.into();
10985            self
10986        }
10987
10988        /// Sets the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10989        ///
10990        /// This is a **required** field for requests.
10991        pub fn set_entity_type<T>(mut self, v: T) -> Self
10992        where
10993            T: std::convert::Into<crate::model::EntityType>,
10994        {
10995            self.0.request.entity_type = std::option::Option::Some(v.into());
10996            self
10997        }
10998
10999        /// Sets or clears the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
11000        ///
11001        /// This is a **required** field for requests.
11002        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
11003        where
11004            T: std::convert::Into<crate::model::EntityType>,
11005        {
11006            self.0.request.entity_type = v.map(|x| x.into());
11007            self
11008        }
11009
11010        /// Sets the value of [language_code][crate::model::CreateEntityTypeRequest::language_code].
11011        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11012            self.0.request.language_code = v.into();
11013            self
11014        }
11015    }
11016
11017    #[doc(hidden)]
11018    impl crate::RequestBuilder for CreateEntityType {
11019        fn request_options(&mut self) -> &mut crate::RequestOptions {
11020            &mut self.0.options
11021        }
11022    }
11023
11024    /// The request builder for [EntityTypes::update_entity_type][crate::client::EntityTypes::update_entity_type] calls.
11025    ///
11026    /// # Example
11027    /// ```
11028    /// # use google_cloud_dialogflow_v2::builder::entity_types::UpdateEntityType;
11029    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11030    ///
11031    /// let builder = prepare_request_builder();
11032    /// let response = builder.send().await?;
11033    /// # Ok(()) }
11034    ///
11035    /// fn prepare_request_builder() -> UpdateEntityType {
11036    ///   # panic!();
11037    ///   // ... details omitted ...
11038    /// }
11039    /// ```
11040    #[derive(Clone, Debug)]
11041    pub struct UpdateEntityType(RequestBuilder<crate::model::UpdateEntityTypeRequest>);
11042
11043    impl UpdateEntityType {
11044        pub(crate) fn new(
11045            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11046        ) -> Self {
11047            Self(RequestBuilder::new(stub))
11048        }
11049
11050        /// Sets the full request, replacing any prior values.
11051        pub fn with_request<V: Into<crate::model::UpdateEntityTypeRequest>>(
11052            mut self,
11053            v: V,
11054        ) -> Self {
11055            self.0.request = v.into();
11056            self
11057        }
11058
11059        /// Sets all the options, replacing any prior values.
11060        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11061            self.0.options = v.into();
11062            self
11063        }
11064
11065        /// Sends the request.
11066        pub async fn send(self) -> Result<crate::model::EntityType> {
11067            (*self.0.stub)
11068                .update_entity_type(self.0.request, self.0.options)
11069                .await
11070                .map(crate::Response::into_body)
11071        }
11072
11073        /// Sets the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
11074        ///
11075        /// This is a **required** field for requests.
11076        pub fn set_entity_type<T>(mut self, v: T) -> Self
11077        where
11078            T: std::convert::Into<crate::model::EntityType>,
11079        {
11080            self.0.request.entity_type = std::option::Option::Some(v.into());
11081            self
11082        }
11083
11084        /// Sets or clears the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
11085        ///
11086        /// This is a **required** field for requests.
11087        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
11088        where
11089            T: std::convert::Into<crate::model::EntityType>,
11090        {
11091            self.0.request.entity_type = v.map(|x| x.into());
11092            self
11093        }
11094
11095        /// Sets the value of [language_code][crate::model::UpdateEntityTypeRequest::language_code].
11096        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11097            self.0.request.language_code = v.into();
11098            self
11099        }
11100
11101        /// Sets the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
11102        pub fn set_update_mask<T>(mut self, v: T) -> Self
11103        where
11104            T: std::convert::Into<wkt::FieldMask>,
11105        {
11106            self.0.request.update_mask = std::option::Option::Some(v.into());
11107            self
11108        }
11109
11110        /// Sets or clears the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
11111        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11112        where
11113            T: std::convert::Into<wkt::FieldMask>,
11114        {
11115            self.0.request.update_mask = v.map(|x| x.into());
11116            self
11117        }
11118    }
11119
11120    #[doc(hidden)]
11121    impl crate::RequestBuilder for UpdateEntityType {
11122        fn request_options(&mut self) -> &mut crate::RequestOptions {
11123            &mut self.0.options
11124        }
11125    }
11126
11127    /// The request builder for [EntityTypes::delete_entity_type][crate::client::EntityTypes::delete_entity_type] calls.
11128    ///
11129    /// # Example
11130    /// ```
11131    /// # use google_cloud_dialogflow_v2::builder::entity_types::DeleteEntityType;
11132    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11133    ///
11134    /// let builder = prepare_request_builder();
11135    /// let response = builder.send().await?;
11136    /// # Ok(()) }
11137    ///
11138    /// fn prepare_request_builder() -> DeleteEntityType {
11139    ///   # panic!();
11140    ///   // ... details omitted ...
11141    /// }
11142    /// ```
11143    #[derive(Clone, Debug)]
11144    pub struct DeleteEntityType(RequestBuilder<crate::model::DeleteEntityTypeRequest>);
11145
11146    impl DeleteEntityType {
11147        pub(crate) fn new(
11148            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11149        ) -> Self {
11150            Self(RequestBuilder::new(stub))
11151        }
11152
11153        /// Sets the full request, replacing any prior values.
11154        pub fn with_request<V: Into<crate::model::DeleteEntityTypeRequest>>(
11155            mut self,
11156            v: V,
11157        ) -> Self {
11158            self.0.request = v.into();
11159            self
11160        }
11161
11162        /// Sets all the options, replacing any prior values.
11163        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11164            self.0.options = v.into();
11165            self
11166        }
11167
11168        /// Sends the request.
11169        pub async fn send(self) -> Result<()> {
11170            (*self.0.stub)
11171                .delete_entity_type(self.0.request, self.0.options)
11172                .await
11173                .map(crate::Response::into_body)
11174        }
11175
11176        /// Sets the value of [name][crate::model::DeleteEntityTypeRequest::name].
11177        ///
11178        /// This is a **required** field for requests.
11179        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11180            self.0.request.name = v.into();
11181            self
11182        }
11183    }
11184
11185    #[doc(hidden)]
11186    impl crate::RequestBuilder for DeleteEntityType {
11187        fn request_options(&mut self) -> &mut crate::RequestOptions {
11188            &mut self.0.options
11189        }
11190    }
11191
11192    /// The request builder for [EntityTypes::batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types] calls.
11193    ///
11194    /// # Example
11195    /// ```
11196    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchUpdateEntityTypes;
11197    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11198    /// use google_cloud_lro::Poller;
11199    ///
11200    /// let builder = prepare_request_builder();
11201    /// let response = builder.poller().until_done().await?;
11202    /// # Ok(()) }
11203    ///
11204    /// fn prepare_request_builder() -> BatchUpdateEntityTypes {
11205    ///   # panic!();
11206    ///   // ... details omitted ...
11207    /// }
11208    /// ```
11209    #[derive(Clone, Debug)]
11210    pub struct BatchUpdateEntityTypes(RequestBuilder<crate::model::BatchUpdateEntityTypesRequest>);
11211
11212    impl BatchUpdateEntityTypes {
11213        pub(crate) fn new(
11214            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11215        ) -> Self {
11216            Self(RequestBuilder::new(stub))
11217        }
11218
11219        /// Sets the full request, replacing any prior values.
11220        pub fn with_request<V: Into<crate::model::BatchUpdateEntityTypesRequest>>(
11221            mut self,
11222            v: V,
11223        ) -> Self {
11224            self.0.request = v.into();
11225            self
11226        }
11227
11228        /// Sets all the options, replacing any prior values.
11229        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11230            self.0.options = v.into();
11231            self
11232        }
11233
11234        /// Sends the request.
11235        ///
11236        /// # Long running operations
11237        ///
11238        /// This starts, but does not poll, a longrunning operation. More information
11239        /// on [batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types].
11240        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11241            (*self.0.stub)
11242                .batch_update_entity_types(self.0.request, self.0.options)
11243                .await
11244                .map(crate::Response::into_body)
11245        }
11246
11247        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_entity_types`.
11248        pub fn poller(
11249            self,
11250        ) -> impl google_cloud_lro::Poller<crate::model::BatchUpdateEntityTypesResponse, wkt::Struct>
11251        {
11252            type Operation = google_cloud_lro::internal::Operation<
11253                crate::model::BatchUpdateEntityTypesResponse,
11254                wkt::Struct,
11255            >;
11256            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11257            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11258            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11259            if let Some(ref mut details) = poller_options.tracing {
11260                details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_update_entity_types::until_done";
11261            }
11262
11263            let stub = self.0.stub.clone();
11264            let mut options = self.0.options.clone();
11265            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11266            let query = move |name| {
11267                let stub = stub.clone();
11268                let options = options.clone();
11269                async {
11270                    let op = GetOperation::new(stub)
11271                        .set_name(name)
11272                        .with_options(options)
11273                        .send()
11274                        .await?;
11275                    Ok(Operation::new(op))
11276                }
11277            };
11278
11279            let start = move || async {
11280                let op = self.send().await?;
11281                Ok(Operation::new(op))
11282            };
11283
11284            use google_cloud_lro::internal::PollerExt;
11285            {
11286                google_cloud_lro::internal::new_poller(
11287                    polling_error_policy,
11288                    polling_backoff_policy,
11289                    start,
11290                    query,
11291                )
11292            }
11293            .with_options(poller_options)
11294        }
11295
11296        /// Sets the value of [parent][crate::model::BatchUpdateEntityTypesRequest::parent].
11297        ///
11298        /// This is a **required** field for requests.
11299        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11300            self.0.request.parent = v.into();
11301            self
11302        }
11303
11304        /// Sets the value of [language_code][crate::model::BatchUpdateEntityTypesRequest::language_code].
11305        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11306            self.0.request.language_code = v.into();
11307            self
11308        }
11309
11310        /// Sets the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
11311        pub fn set_update_mask<T>(mut self, v: T) -> Self
11312        where
11313            T: std::convert::Into<wkt::FieldMask>,
11314        {
11315            self.0.request.update_mask = std::option::Option::Some(v.into());
11316            self
11317        }
11318
11319        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
11320        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11321        where
11322            T: std::convert::Into<wkt::FieldMask>,
11323        {
11324            self.0.request.update_mask = v.map(|x| x.into());
11325            self
11326        }
11327
11328        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch].
11329        ///
11330        /// Note that all the setters affecting `entity_type_batch` are
11331        /// mutually exclusive.
11332        pub fn set_entity_type_batch<
11333            T: Into<Option<crate::model::batch_update_entity_types_request::EntityTypeBatch>>,
11334        >(
11335            mut self,
11336            v: T,
11337        ) -> Self {
11338            self.0.request.entity_type_batch = v.into();
11339            self
11340        }
11341
11342        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
11343        /// to hold a `EntityTypeBatchUri`.
11344        ///
11345        /// Note that all the setters affecting `entity_type_batch` are
11346        /// mutually exclusive.
11347        pub fn set_entity_type_batch_uri<T: std::convert::Into<std::string::String>>(
11348            mut self,
11349            v: T,
11350        ) -> Self {
11351            self.0.request = self.0.request.set_entity_type_batch_uri(v);
11352            self
11353        }
11354
11355        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
11356        /// to hold a `EntityTypeBatchInline`.
11357        ///
11358        /// Note that all the setters affecting `entity_type_batch` are
11359        /// mutually exclusive.
11360        pub fn set_entity_type_batch_inline<
11361            T: std::convert::Into<std::boxed::Box<crate::model::EntityTypeBatch>>,
11362        >(
11363            mut self,
11364            v: T,
11365        ) -> Self {
11366            self.0.request = self.0.request.set_entity_type_batch_inline(v);
11367            self
11368        }
11369    }
11370
11371    #[doc(hidden)]
11372    impl crate::RequestBuilder for BatchUpdateEntityTypes {
11373        fn request_options(&mut self) -> &mut crate::RequestOptions {
11374            &mut self.0.options
11375        }
11376    }
11377
11378    /// The request builder for [EntityTypes::batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types] calls.
11379    ///
11380    /// # Example
11381    /// ```
11382    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchDeleteEntityTypes;
11383    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11384    /// use google_cloud_lro::Poller;
11385    ///
11386    /// let builder = prepare_request_builder();
11387    /// let response = builder.poller().until_done().await?;
11388    /// # Ok(()) }
11389    ///
11390    /// fn prepare_request_builder() -> BatchDeleteEntityTypes {
11391    ///   # panic!();
11392    ///   // ... details omitted ...
11393    /// }
11394    /// ```
11395    #[derive(Clone, Debug)]
11396    pub struct BatchDeleteEntityTypes(RequestBuilder<crate::model::BatchDeleteEntityTypesRequest>);
11397
11398    impl BatchDeleteEntityTypes {
11399        pub(crate) fn new(
11400            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11401        ) -> Self {
11402            Self(RequestBuilder::new(stub))
11403        }
11404
11405        /// Sets the full request, replacing any prior values.
11406        pub fn with_request<V: Into<crate::model::BatchDeleteEntityTypesRequest>>(
11407            mut self,
11408            v: V,
11409        ) -> Self {
11410            self.0.request = v.into();
11411            self
11412        }
11413
11414        /// Sets all the options, replacing any prior values.
11415        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11416            self.0.options = v.into();
11417            self
11418        }
11419
11420        /// Sends the request.
11421        ///
11422        /// # Long running operations
11423        ///
11424        /// This starts, but does not poll, a longrunning operation. More information
11425        /// on [batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types].
11426        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11427            (*self.0.stub)
11428                .batch_delete_entity_types(self.0.request, self.0.options)
11429                .await
11430                .map(crate::Response::into_body)
11431        }
11432
11433        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_entity_types`.
11434        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11435            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11436            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11437            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11438            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11439            if let Some(ref mut details) = poller_options.tracing {
11440                details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_delete_entity_types::until_done";
11441            }
11442
11443            let stub = self.0.stub.clone();
11444            let mut options = self.0.options.clone();
11445            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11446            let query = move |name| {
11447                let stub = stub.clone();
11448                let options = options.clone();
11449                async {
11450                    let op = GetOperation::new(stub)
11451                        .set_name(name)
11452                        .with_options(options)
11453                        .send()
11454                        .await?;
11455                    Ok(Operation::new(op))
11456                }
11457            };
11458
11459            let start = move || async {
11460                let op = self.send().await?;
11461                Ok(Operation::new(op))
11462            };
11463
11464            use google_cloud_lro::internal::PollerExt;
11465            {
11466                google_cloud_lro::internal::new_unit_response_poller(
11467                    polling_error_policy,
11468                    polling_backoff_policy,
11469                    start,
11470                    query,
11471                )
11472            }
11473            .with_options(poller_options)
11474        }
11475
11476        /// Sets the value of [parent][crate::model::BatchDeleteEntityTypesRequest::parent].
11477        ///
11478        /// This is a **required** field for requests.
11479        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11480            self.0.request.parent = v.into();
11481            self
11482        }
11483
11484        /// Sets the value of [entity_type_names][crate::model::BatchDeleteEntityTypesRequest::entity_type_names].
11485        ///
11486        /// This is a **required** field for requests.
11487        pub fn set_entity_type_names<T, V>(mut self, v: T) -> Self
11488        where
11489            T: std::iter::IntoIterator<Item = V>,
11490            V: std::convert::Into<std::string::String>,
11491        {
11492            use std::iter::Iterator;
11493            self.0.request.entity_type_names = v.into_iter().map(|i| i.into()).collect();
11494            self
11495        }
11496    }
11497
11498    #[doc(hidden)]
11499    impl crate::RequestBuilder for BatchDeleteEntityTypes {
11500        fn request_options(&mut self) -> &mut crate::RequestOptions {
11501            &mut self.0.options
11502        }
11503    }
11504
11505    /// The request builder for [EntityTypes::batch_create_entities][crate::client::EntityTypes::batch_create_entities] calls.
11506    ///
11507    /// # Example
11508    /// ```
11509    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchCreateEntities;
11510    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11511    /// use google_cloud_lro::Poller;
11512    ///
11513    /// let builder = prepare_request_builder();
11514    /// let response = builder.poller().until_done().await?;
11515    /// # Ok(()) }
11516    ///
11517    /// fn prepare_request_builder() -> BatchCreateEntities {
11518    ///   # panic!();
11519    ///   // ... details omitted ...
11520    /// }
11521    /// ```
11522    #[derive(Clone, Debug)]
11523    pub struct BatchCreateEntities(RequestBuilder<crate::model::BatchCreateEntitiesRequest>);
11524
11525    impl BatchCreateEntities {
11526        pub(crate) fn new(
11527            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11528        ) -> Self {
11529            Self(RequestBuilder::new(stub))
11530        }
11531
11532        /// Sets the full request, replacing any prior values.
11533        pub fn with_request<V: Into<crate::model::BatchCreateEntitiesRequest>>(
11534            mut self,
11535            v: V,
11536        ) -> Self {
11537            self.0.request = v.into();
11538            self
11539        }
11540
11541        /// Sets all the options, replacing any prior values.
11542        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11543            self.0.options = v.into();
11544            self
11545        }
11546
11547        /// Sends the request.
11548        ///
11549        /// # Long running operations
11550        ///
11551        /// This starts, but does not poll, a longrunning operation. More information
11552        /// on [batch_create_entities][crate::client::EntityTypes::batch_create_entities].
11553        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11554            (*self.0.stub)
11555                .batch_create_entities(self.0.request, self.0.options)
11556                .await
11557                .map(crate::Response::into_body)
11558        }
11559
11560        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_create_entities`.
11561        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11562            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11563            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11564            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11565            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11566            if let Some(ref mut details) = poller_options.tracing {
11567                details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_create_entities::until_done";
11568            }
11569
11570            let stub = self.0.stub.clone();
11571            let mut options = self.0.options.clone();
11572            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11573            let query = move |name| {
11574                let stub = stub.clone();
11575                let options = options.clone();
11576                async {
11577                    let op = GetOperation::new(stub)
11578                        .set_name(name)
11579                        .with_options(options)
11580                        .send()
11581                        .await?;
11582                    Ok(Operation::new(op))
11583                }
11584            };
11585
11586            let start = move || async {
11587                let op = self.send().await?;
11588                Ok(Operation::new(op))
11589            };
11590
11591            use google_cloud_lro::internal::PollerExt;
11592            {
11593                google_cloud_lro::internal::new_unit_response_poller(
11594                    polling_error_policy,
11595                    polling_backoff_policy,
11596                    start,
11597                    query,
11598                )
11599            }
11600            .with_options(poller_options)
11601        }
11602
11603        /// Sets the value of [parent][crate::model::BatchCreateEntitiesRequest::parent].
11604        ///
11605        /// This is a **required** field for requests.
11606        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11607            self.0.request.parent = v.into();
11608            self
11609        }
11610
11611        /// Sets the value of [entities][crate::model::BatchCreateEntitiesRequest::entities].
11612        ///
11613        /// This is a **required** field for requests.
11614        pub fn set_entities<T, V>(mut self, v: T) -> Self
11615        where
11616            T: std::iter::IntoIterator<Item = V>,
11617            V: std::convert::Into<crate::model::entity_type::Entity>,
11618        {
11619            use std::iter::Iterator;
11620            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11621            self
11622        }
11623
11624        /// Sets the value of [language_code][crate::model::BatchCreateEntitiesRequest::language_code].
11625        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11626            self.0.request.language_code = v.into();
11627            self
11628        }
11629    }
11630
11631    #[doc(hidden)]
11632    impl crate::RequestBuilder for BatchCreateEntities {
11633        fn request_options(&mut self) -> &mut crate::RequestOptions {
11634            &mut self.0.options
11635        }
11636    }
11637
11638    /// The request builder for [EntityTypes::batch_update_entities][crate::client::EntityTypes::batch_update_entities] calls.
11639    ///
11640    /// # Example
11641    /// ```
11642    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchUpdateEntities;
11643    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11644    /// use google_cloud_lro::Poller;
11645    ///
11646    /// let builder = prepare_request_builder();
11647    /// let response = builder.poller().until_done().await?;
11648    /// # Ok(()) }
11649    ///
11650    /// fn prepare_request_builder() -> BatchUpdateEntities {
11651    ///   # panic!();
11652    ///   // ... details omitted ...
11653    /// }
11654    /// ```
11655    #[derive(Clone, Debug)]
11656    pub struct BatchUpdateEntities(RequestBuilder<crate::model::BatchUpdateEntitiesRequest>);
11657
11658    impl BatchUpdateEntities {
11659        pub(crate) fn new(
11660            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11661        ) -> Self {
11662            Self(RequestBuilder::new(stub))
11663        }
11664
11665        /// Sets the full request, replacing any prior values.
11666        pub fn with_request<V: Into<crate::model::BatchUpdateEntitiesRequest>>(
11667            mut self,
11668            v: V,
11669        ) -> Self {
11670            self.0.request = v.into();
11671            self
11672        }
11673
11674        /// Sets all the options, replacing any prior values.
11675        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11676            self.0.options = v.into();
11677            self
11678        }
11679
11680        /// Sends the request.
11681        ///
11682        /// # Long running operations
11683        ///
11684        /// This starts, but does not poll, a longrunning operation. More information
11685        /// on [batch_update_entities][crate::client::EntityTypes::batch_update_entities].
11686        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11687            (*self.0.stub)
11688                .batch_update_entities(self.0.request, self.0.options)
11689                .await
11690                .map(crate::Response::into_body)
11691        }
11692
11693        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_entities`.
11694        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11695            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11696            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11697            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11698            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11699            if let Some(ref mut details) = poller_options.tracing {
11700                details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_update_entities::until_done";
11701            }
11702
11703            let stub = self.0.stub.clone();
11704            let mut options = self.0.options.clone();
11705            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11706            let query = move |name| {
11707                let stub = stub.clone();
11708                let options = options.clone();
11709                async {
11710                    let op = GetOperation::new(stub)
11711                        .set_name(name)
11712                        .with_options(options)
11713                        .send()
11714                        .await?;
11715                    Ok(Operation::new(op))
11716                }
11717            };
11718
11719            let start = move || async {
11720                let op = self.send().await?;
11721                Ok(Operation::new(op))
11722            };
11723
11724            use google_cloud_lro::internal::PollerExt;
11725            {
11726                google_cloud_lro::internal::new_unit_response_poller(
11727                    polling_error_policy,
11728                    polling_backoff_policy,
11729                    start,
11730                    query,
11731                )
11732            }
11733            .with_options(poller_options)
11734        }
11735
11736        /// Sets the value of [parent][crate::model::BatchUpdateEntitiesRequest::parent].
11737        ///
11738        /// This is a **required** field for requests.
11739        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11740            self.0.request.parent = v.into();
11741            self
11742        }
11743
11744        /// Sets the value of [entities][crate::model::BatchUpdateEntitiesRequest::entities].
11745        ///
11746        /// This is a **required** field for requests.
11747        pub fn set_entities<T, V>(mut self, v: T) -> Self
11748        where
11749            T: std::iter::IntoIterator<Item = V>,
11750            V: std::convert::Into<crate::model::entity_type::Entity>,
11751        {
11752            use std::iter::Iterator;
11753            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11754            self
11755        }
11756
11757        /// Sets the value of [language_code][crate::model::BatchUpdateEntitiesRequest::language_code].
11758        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11759            self.0.request.language_code = v.into();
11760            self
11761        }
11762
11763        /// Sets the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11764        pub fn set_update_mask<T>(mut self, v: T) -> Self
11765        where
11766            T: std::convert::Into<wkt::FieldMask>,
11767        {
11768            self.0.request.update_mask = std::option::Option::Some(v.into());
11769            self
11770        }
11771
11772        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11773        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11774        where
11775            T: std::convert::Into<wkt::FieldMask>,
11776        {
11777            self.0.request.update_mask = v.map(|x| x.into());
11778            self
11779        }
11780    }
11781
11782    #[doc(hidden)]
11783    impl crate::RequestBuilder for BatchUpdateEntities {
11784        fn request_options(&mut self) -> &mut crate::RequestOptions {
11785            &mut self.0.options
11786        }
11787    }
11788
11789    /// The request builder for [EntityTypes::batch_delete_entities][crate::client::EntityTypes::batch_delete_entities] calls.
11790    ///
11791    /// # Example
11792    /// ```
11793    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchDeleteEntities;
11794    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11795    /// use google_cloud_lro::Poller;
11796    ///
11797    /// let builder = prepare_request_builder();
11798    /// let response = builder.poller().until_done().await?;
11799    /// # Ok(()) }
11800    ///
11801    /// fn prepare_request_builder() -> BatchDeleteEntities {
11802    ///   # panic!();
11803    ///   // ... details omitted ...
11804    /// }
11805    /// ```
11806    #[derive(Clone, Debug)]
11807    pub struct BatchDeleteEntities(RequestBuilder<crate::model::BatchDeleteEntitiesRequest>);
11808
11809    impl BatchDeleteEntities {
11810        pub(crate) fn new(
11811            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11812        ) -> Self {
11813            Self(RequestBuilder::new(stub))
11814        }
11815
11816        /// Sets the full request, replacing any prior values.
11817        pub fn with_request<V: Into<crate::model::BatchDeleteEntitiesRequest>>(
11818            mut self,
11819            v: V,
11820        ) -> Self {
11821            self.0.request = v.into();
11822            self
11823        }
11824
11825        /// Sets all the options, replacing any prior values.
11826        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11827            self.0.options = v.into();
11828            self
11829        }
11830
11831        /// Sends the request.
11832        ///
11833        /// # Long running operations
11834        ///
11835        /// This starts, but does not poll, a longrunning operation. More information
11836        /// on [batch_delete_entities][crate::client::EntityTypes::batch_delete_entities].
11837        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11838            (*self.0.stub)
11839                .batch_delete_entities(self.0.request, self.0.options)
11840                .await
11841                .map(crate::Response::into_body)
11842        }
11843
11844        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_entities`.
11845        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11846            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11847            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11848            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11849            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11850            if let Some(ref mut details) = poller_options.tracing {
11851                details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_delete_entities::until_done";
11852            }
11853
11854            let stub = self.0.stub.clone();
11855            let mut options = self.0.options.clone();
11856            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11857            let query = move |name| {
11858                let stub = stub.clone();
11859                let options = options.clone();
11860                async {
11861                    let op = GetOperation::new(stub)
11862                        .set_name(name)
11863                        .with_options(options)
11864                        .send()
11865                        .await?;
11866                    Ok(Operation::new(op))
11867                }
11868            };
11869
11870            let start = move || async {
11871                let op = self.send().await?;
11872                Ok(Operation::new(op))
11873            };
11874
11875            use google_cloud_lro::internal::PollerExt;
11876            {
11877                google_cloud_lro::internal::new_unit_response_poller(
11878                    polling_error_policy,
11879                    polling_backoff_policy,
11880                    start,
11881                    query,
11882                )
11883            }
11884            .with_options(poller_options)
11885        }
11886
11887        /// Sets the value of [parent][crate::model::BatchDeleteEntitiesRequest::parent].
11888        ///
11889        /// This is a **required** field for requests.
11890        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11891            self.0.request.parent = v.into();
11892            self
11893        }
11894
11895        /// Sets the value of [entity_values][crate::model::BatchDeleteEntitiesRequest::entity_values].
11896        ///
11897        /// This is a **required** field for requests.
11898        pub fn set_entity_values<T, V>(mut self, v: T) -> Self
11899        where
11900            T: std::iter::IntoIterator<Item = V>,
11901            V: std::convert::Into<std::string::String>,
11902        {
11903            use std::iter::Iterator;
11904            self.0.request.entity_values = v.into_iter().map(|i| i.into()).collect();
11905            self
11906        }
11907
11908        /// Sets the value of [language_code][crate::model::BatchDeleteEntitiesRequest::language_code].
11909        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11910            self.0.request.language_code = v.into();
11911            self
11912        }
11913    }
11914
11915    #[doc(hidden)]
11916    impl crate::RequestBuilder for BatchDeleteEntities {
11917        fn request_options(&mut self) -> &mut crate::RequestOptions {
11918            &mut self.0.options
11919        }
11920    }
11921
11922    /// The request builder for [EntityTypes::list_locations][crate::client::EntityTypes::list_locations] calls.
11923    ///
11924    /// # Example
11925    /// ```
11926    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListLocations;
11927    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11928    /// use google_cloud_gax::paginator::ItemPaginator;
11929    ///
11930    /// let builder = prepare_request_builder();
11931    /// let mut items = builder.by_item();
11932    /// while let Some(result) = items.next().await {
11933    ///   let item = result?;
11934    /// }
11935    /// # Ok(()) }
11936    ///
11937    /// fn prepare_request_builder() -> ListLocations {
11938    ///   # panic!();
11939    ///   // ... details omitted ...
11940    /// }
11941    /// ```
11942    #[derive(Clone, Debug)]
11943    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
11944
11945    impl ListLocations {
11946        pub(crate) fn new(
11947            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11948        ) -> Self {
11949            Self(RequestBuilder::new(stub))
11950        }
11951
11952        /// Sets the full request, replacing any prior values.
11953        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
11954            mut self,
11955            v: V,
11956        ) -> Self {
11957            self.0.request = v.into();
11958            self
11959        }
11960
11961        /// Sets all the options, replacing any prior values.
11962        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11963            self.0.options = v.into();
11964            self
11965        }
11966
11967        /// Sends the request.
11968        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
11969            (*self.0.stub)
11970                .list_locations(self.0.request, self.0.options)
11971                .await
11972                .map(crate::Response::into_body)
11973        }
11974
11975        /// Streams each page in the collection.
11976        pub fn by_page(
11977            self,
11978        ) -> impl google_cloud_gax::paginator::Paginator<
11979            google_cloud_location::model::ListLocationsResponse,
11980            crate::Error,
11981        > {
11982            use std::clone::Clone;
11983            let token = self.0.request.page_token.clone();
11984            let execute = move |token: String| {
11985                let mut builder = self.clone();
11986                builder.0.request = builder.0.request.set_page_token(token);
11987                builder.send()
11988            };
11989            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11990        }
11991
11992        /// Streams each item in the collection.
11993        pub fn by_item(
11994            self,
11995        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11996            google_cloud_location::model::ListLocationsResponse,
11997            crate::Error,
11998        > {
11999            use google_cloud_gax::paginator::Paginator;
12000            self.by_page().items()
12001        }
12002
12003        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
12004        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12005            self.0.request.name = v.into();
12006            self
12007        }
12008
12009        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
12010        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12011            self.0.request.filter = v.into();
12012            self
12013        }
12014
12015        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
12016        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12017            self.0.request.page_size = v.into();
12018            self
12019        }
12020
12021        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
12022        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12023            self.0.request.page_token = v.into();
12024            self
12025        }
12026    }
12027
12028    #[doc(hidden)]
12029    impl crate::RequestBuilder for ListLocations {
12030        fn request_options(&mut self) -> &mut crate::RequestOptions {
12031            &mut self.0.options
12032        }
12033    }
12034
12035    /// The request builder for [EntityTypes::get_location][crate::client::EntityTypes::get_location] calls.
12036    ///
12037    /// # Example
12038    /// ```
12039    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetLocation;
12040    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12041    ///
12042    /// let builder = prepare_request_builder();
12043    /// let response = builder.send().await?;
12044    /// # Ok(()) }
12045    ///
12046    /// fn prepare_request_builder() -> GetLocation {
12047    ///   # panic!();
12048    ///   // ... details omitted ...
12049    /// }
12050    /// ```
12051    #[derive(Clone, Debug)]
12052    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
12053
12054    impl GetLocation {
12055        pub(crate) fn new(
12056            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12057        ) -> Self {
12058            Self(RequestBuilder::new(stub))
12059        }
12060
12061        /// Sets the full request, replacing any prior values.
12062        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
12063            mut self,
12064            v: V,
12065        ) -> Self {
12066            self.0.request = v.into();
12067            self
12068        }
12069
12070        /// Sets all the options, replacing any prior values.
12071        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12072            self.0.options = v.into();
12073            self
12074        }
12075
12076        /// Sends the request.
12077        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
12078            (*self.0.stub)
12079                .get_location(self.0.request, self.0.options)
12080                .await
12081                .map(crate::Response::into_body)
12082        }
12083
12084        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
12085        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12086            self.0.request.name = v.into();
12087            self
12088        }
12089    }
12090
12091    #[doc(hidden)]
12092    impl crate::RequestBuilder for GetLocation {
12093        fn request_options(&mut self) -> &mut crate::RequestOptions {
12094            &mut self.0.options
12095        }
12096    }
12097
12098    /// The request builder for [EntityTypes::list_operations][crate::client::EntityTypes::list_operations] calls.
12099    ///
12100    /// # Example
12101    /// ```
12102    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListOperations;
12103    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12104    /// use google_cloud_gax::paginator::ItemPaginator;
12105    ///
12106    /// let builder = prepare_request_builder();
12107    /// let mut items = builder.by_item();
12108    /// while let Some(result) = items.next().await {
12109    ///   let item = result?;
12110    /// }
12111    /// # Ok(()) }
12112    ///
12113    /// fn prepare_request_builder() -> ListOperations {
12114    ///   # panic!();
12115    ///   // ... details omitted ...
12116    /// }
12117    /// ```
12118    #[derive(Clone, Debug)]
12119    pub struct ListOperations(
12120        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
12121    );
12122
12123    impl ListOperations {
12124        pub(crate) fn new(
12125            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12126        ) -> Self {
12127            Self(RequestBuilder::new(stub))
12128        }
12129
12130        /// Sets the full request, replacing any prior values.
12131        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
12132            mut self,
12133            v: V,
12134        ) -> Self {
12135            self.0.request = v.into();
12136            self
12137        }
12138
12139        /// Sets all the options, replacing any prior values.
12140        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12141            self.0.options = v.into();
12142            self
12143        }
12144
12145        /// Sends the request.
12146        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
12147            (*self.0.stub)
12148                .list_operations(self.0.request, self.0.options)
12149                .await
12150                .map(crate::Response::into_body)
12151        }
12152
12153        /// Streams each page in the collection.
12154        pub fn by_page(
12155            self,
12156        ) -> impl google_cloud_gax::paginator::Paginator<
12157            google_cloud_longrunning::model::ListOperationsResponse,
12158            crate::Error,
12159        > {
12160            use std::clone::Clone;
12161            let token = self.0.request.page_token.clone();
12162            let execute = move |token: String| {
12163                let mut builder = self.clone();
12164                builder.0.request = builder.0.request.set_page_token(token);
12165                builder.send()
12166            };
12167            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12168        }
12169
12170        /// Streams each item in the collection.
12171        pub fn by_item(
12172            self,
12173        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12174            google_cloud_longrunning::model::ListOperationsResponse,
12175            crate::Error,
12176        > {
12177            use google_cloud_gax::paginator::Paginator;
12178            self.by_page().items()
12179        }
12180
12181        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
12182        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12183            self.0.request.name = v.into();
12184            self
12185        }
12186
12187        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
12188        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12189            self.0.request.filter = v.into();
12190            self
12191        }
12192
12193        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
12194        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12195            self.0.request.page_size = v.into();
12196            self
12197        }
12198
12199        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
12200        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12201            self.0.request.page_token = v.into();
12202            self
12203        }
12204
12205        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
12206        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
12207            self.0.request.return_partial_success = v.into();
12208            self
12209        }
12210    }
12211
12212    #[doc(hidden)]
12213    impl crate::RequestBuilder for ListOperations {
12214        fn request_options(&mut self) -> &mut crate::RequestOptions {
12215            &mut self.0.options
12216        }
12217    }
12218
12219    /// The request builder for [EntityTypes::get_operation][crate::client::EntityTypes::get_operation] calls.
12220    ///
12221    /// # Example
12222    /// ```
12223    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetOperation;
12224    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12225    ///
12226    /// let builder = prepare_request_builder();
12227    /// let response = builder.send().await?;
12228    /// # Ok(()) }
12229    ///
12230    /// fn prepare_request_builder() -> GetOperation {
12231    ///   # panic!();
12232    ///   // ... details omitted ...
12233    /// }
12234    /// ```
12235    #[derive(Clone, Debug)]
12236    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
12237
12238    impl GetOperation {
12239        pub(crate) fn new(
12240            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12241        ) -> Self {
12242            Self(RequestBuilder::new(stub))
12243        }
12244
12245        /// Sets the full request, replacing any prior values.
12246        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
12247            mut self,
12248            v: V,
12249        ) -> Self {
12250            self.0.request = v.into();
12251            self
12252        }
12253
12254        /// Sets all the options, replacing any prior values.
12255        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12256            self.0.options = v.into();
12257            self
12258        }
12259
12260        /// Sends the request.
12261        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12262            (*self.0.stub)
12263                .get_operation(self.0.request, self.0.options)
12264                .await
12265                .map(crate::Response::into_body)
12266        }
12267
12268        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
12269        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12270            self.0.request.name = v.into();
12271            self
12272        }
12273    }
12274
12275    #[doc(hidden)]
12276    impl crate::RequestBuilder for GetOperation {
12277        fn request_options(&mut self) -> &mut crate::RequestOptions {
12278            &mut self.0.options
12279        }
12280    }
12281
12282    /// The request builder for [EntityTypes::cancel_operation][crate::client::EntityTypes::cancel_operation] calls.
12283    ///
12284    /// # Example
12285    /// ```
12286    /// # use google_cloud_dialogflow_v2::builder::entity_types::CancelOperation;
12287    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12288    ///
12289    /// let builder = prepare_request_builder();
12290    /// let response = builder.send().await?;
12291    /// # Ok(()) }
12292    ///
12293    /// fn prepare_request_builder() -> CancelOperation {
12294    ///   # panic!();
12295    ///   // ... details omitted ...
12296    /// }
12297    /// ```
12298    #[derive(Clone, Debug)]
12299    pub struct CancelOperation(
12300        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
12301    );
12302
12303    impl CancelOperation {
12304        pub(crate) fn new(
12305            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12306        ) -> Self {
12307            Self(RequestBuilder::new(stub))
12308        }
12309
12310        /// Sets the full request, replacing any prior values.
12311        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
12312            mut self,
12313            v: V,
12314        ) -> Self {
12315            self.0.request = v.into();
12316            self
12317        }
12318
12319        /// Sets all the options, replacing any prior values.
12320        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12321            self.0.options = v.into();
12322            self
12323        }
12324
12325        /// Sends the request.
12326        pub async fn send(self) -> Result<()> {
12327            (*self.0.stub)
12328                .cancel_operation(self.0.request, self.0.options)
12329                .await
12330                .map(crate::Response::into_body)
12331        }
12332
12333        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
12334        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12335            self.0.request.name = v.into();
12336            self
12337        }
12338    }
12339
12340    #[doc(hidden)]
12341    impl crate::RequestBuilder for CancelOperation {
12342        fn request_options(&mut self) -> &mut crate::RequestOptions {
12343            &mut self.0.options
12344        }
12345    }
12346}
12347
12348/// Request and client builders for [Environments][crate::client::Environments].
12349#[cfg(feature = "environments")]
12350#[cfg_attr(docsrs, doc(cfg(feature = "environments")))]
12351pub mod environments {
12352    use crate::Result;
12353
12354    /// A builder for [Environments][crate::client::Environments].
12355    ///
12356    /// ```
12357    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12358    /// # use google_cloud_dialogflow_v2::*;
12359    /// # use builder::environments::ClientBuilder;
12360    /// # use client::Environments;
12361    /// let builder : ClientBuilder = Environments::builder();
12362    /// let client = builder
12363    ///     .with_endpoint("https://dialogflow.googleapis.com")
12364    ///     .build().await?;
12365    /// # Ok(()) }
12366    /// ```
12367    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12368
12369    pub(crate) mod client {
12370        use super::super::super::client::Environments;
12371        pub struct Factory;
12372        impl crate::ClientFactory for Factory {
12373            type Client = Environments;
12374            type Credentials = gaxi::options::Credentials;
12375            async fn build(
12376                self,
12377                config: gaxi::options::ClientConfig,
12378            ) -> crate::ClientBuilderResult<Self::Client> {
12379                Self::Client::new(config).await
12380            }
12381        }
12382    }
12383
12384    /// Common implementation for [crate::client::Environments] request builders.
12385    #[derive(Clone, Debug)]
12386    pub(crate) struct RequestBuilder<R: std::default::Default> {
12387        stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12388        request: R,
12389        options: crate::RequestOptions,
12390    }
12391
12392    impl<R> RequestBuilder<R>
12393    where
12394        R: std::default::Default,
12395    {
12396        pub(crate) fn new(
12397            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12398        ) -> Self {
12399            Self {
12400                stub,
12401                request: R::default(),
12402                options: crate::RequestOptions::default(),
12403            }
12404        }
12405    }
12406
12407    /// The request builder for [Environments::list_environments][crate::client::Environments::list_environments] calls.
12408    ///
12409    /// # Example
12410    /// ```
12411    /// # use google_cloud_dialogflow_v2::builder::environments::ListEnvironments;
12412    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12413    /// use google_cloud_gax::paginator::ItemPaginator;
12414    ///
12415    /// let builder = prepare_request_builder();
12416    /// let mut items = builder.by_item();
12417    /// while let Some(result) = items.next().await {
12418    ///   let item = result?;
12419    /// }
12420    /// # Ok(()) }
12421    ///
12422    /// fn prepare_request_builder() -> ListEnvironments {
12423    ///   # panic!();
12424    ///   // ... details omitted ...
12425    /// }
12426    /// ```
12427    #[derive(Clone, Debug)]
12428    pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
12429
12430    impl ListEnvironments {
12431        pub(crate) fn new(
12432            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12433        ) -> Self {
12434            Self(RequestBuilder::new(stub))
12435        }
12436
12437        /// Sets the full request, replacing any prior values.
12438        pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
12439            mut self,
12440            v: V,
12441        ) -> Self {
12442            self.0.request = v.into();
12443            self
12444        }
12445
12446        /// Sets all the options, replacing any prior values.
12447        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12448            self.0.options = v.into();
12449            self
12450        }
12451
12452        /// Sends the request.
12453        pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
12454            (*self.0.stub)
12455                .list_environments(self.0.request, self.0.options)
12456                .await
12457                .map(crate::Response::into_body)
12458        }
12459
12460        /// Streams each page in the collection.
12461        pub fn by_page(
12462            self,
12463        ) -> impl google_cloud_gax::paginator::Paginator<
12464            crate::model::ListEnvironmentsResponse,
12465            crate::Error,
12466        > {
12467            use std::clone::Clone;
12468            let token = self.0.request.page_token.clone();
12469            let execute = move |token: String| {
12470                let mut builder = self.clone();
12471                builder.0.request = builder.0.request.set_page_token(token);
12472                builder.send()
12473            };
12474            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12475        }
12476
12477        /// Streams each item in the collection.
12478        pub fn by_item(
12479            self,
12480        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12481            crate::model::ListEnvironmentsResponse,
12482            crate::Error,
12483        > {
12484            use google_cloud_gax::paginator::Paginator;
12485            self.by_page().items()
12486        }
12487
12488        /// Sets the value of [parent][crate::model::ListEnvironmentsRequest::parent].
12489        ///
12490        /// This is a **required** field for requests.
12491        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12492            self.0.request.parent = v.into();
12493            self
12494        }
12495
12496        /// Sets the value of [page_size][crate::model::ListEnvironmentsRequest::page_size].
12497        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12498            self.0.request.page_size = v.into();
12499            self
12500        }
12501
12502        /// Sets the value of [page_token][crate::model::ListEnvironmentsRequest::page_token].
12503        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12504            self.0.request.page_token = v.into();
12505            self
12506        }
12507    }
12508
12509    #[doc(hidden)]
12510    impl crate::RequestBuilder for ListEnvironments {
12511        fn request_options(&mut self) -> &mut crate::RequestOptions {
12512            &mut self.0.options
12513        }
12514    }
12515
12516    /// The request builder for [Environments::get_environment][crate::client::Environments::get_environment] calls.
12517    ///
12518    /// # Example
12519    /// ```
12520    /// # use google_cloud_dialogflow_v2::builder::environments::GetEnvironment;
12521    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12522    ///
12523    /// let builder = prepare_request_builder();
12524    /// let response = builder.send().await?;
12525    /// # Ok(()) }
12526    ///
12527    /// fn prepare_request_builder() -> GetEnvironment {
12528    ///   # panic!();
12529    ///   // ... details omitted ...
12530    /// }
12531    /// ```
12532    #[derive(Clone, Debug)]
12533    pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
12534
12535    impl GetEnvironment {
12536        pub(crate) fn new(
12537            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12538        ) -> Self {
12539            Self(RequestBuilder::new(stub))
12540        }
12541
12542        /// Sets the full request, replacing any prior values.
12543        pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
12544            self.0.request = v.into();
12545            self
12546        }
12547
12548        /// Sets all the options, replacing any prior values.
12549        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12550            self.0.options = v.into();
12551            self
12552        }
12553
12554        /// Sends the request.
12555        pub async fn send(self) -> Result<crate::model::Environment> {
12556            (*self.0.stub)
12557                .get_environment(self.0.request, self.0.options)
12558                .await
12559                .map(crate::Response::into_body)
12560        }
12561
12562        /// Sets the value of [name][crate::model::GetEnvironmentRequest::name].
12563        ///
12564        /// This is a **required** field for requests.
12565        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12566            self.0.request.name = v.into();
12567            self
12568        }
12569    }
12570
12571    #[doc(hidden)]
12572    impl crate::RequestBuilder for GetEnvironment {
12573        fn request_options(&mut self) -> &mut crate::RequestOptions {
12574            &mut self.0.options
12575        }
12576    }
12577
12578    /// The request builder for [Environments::create_environment][crate::client::Environments::create_environment] calls.
12579    ///
12580    /// # Example
12581    /// ```
12582    /// # use google_cloud_dialogflow_v2::builder::environments::CreateEnvironment;
12583    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12584    ///
12585    /// let builder = prepare_request_builder();
12586    /// let response = builder.send().await?;
12587    /// # Ok(()) }
12588    ///
12589    /// fn prepare_request_builder() -> CreateEnvironment {
12590    ///   # panic!();
12591    ///   // ... details omitted ...
12592    /// }
12593    /// ```
12594    #[derive(Clone, Debug)]
12595    pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
12596
12597    impl CreateEnvironment {
12598        pub(crate) fn new(
12599            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12600        ) -> Self {
12601            Self(RequestBuilder::new(stub))
12602        }
12603
12604        /// Sets the full request, replacing any prior values.
12605        pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
12606            mut self,
12607            v: V,
12608        ) -> Self {
12609            self.0.request = v.into();
12610            self
12611        }
12612
12613        /// Sets all the options, replacing any prior values.
12614        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12615            self.0.options = v.into();
12616            self
12617        }
12618
12619        /// Sends the request.
12620        pub async fn send(self) -> Result<crate::model::Environment> {
12621            (*self.0.stub)
12622                .create_environment(self.0.request, self.0.options)
12623                .await
12624                .map(crate::Response::into_body)
12625        }
12626
12627        /// Sets the value of [parent][crate::model::CreateEnvironmentRequest::parent].
12628        ///
12629        /// This is a **required** field for requests.
12630        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12631            self.0.request.parent = v.into();
12632            self
12633        }
12634
12635        /// Sets the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12636        ///
12637        /// This is a **required** field for requests.
12638        pub fn set_environment<T>(mut self, v: T) -> Self
12639        where
12640            T: std::convert::Into<crate::model::Environment>,
12641        {
12642            self.0.request.environment = std::option::Option::Some(v.into());
12643            self
12644        }
12645
12646        /// Sets or clears the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12647        ///
12648        /// This is a **required** field for requests.
12649        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12650        where
12651            T: std::convert::Into<crate::model::Environment>,
12652        {
12653            self.0.request.environment = v.map(|x| x.into());
12654            self
12655        }
12656
12657        /// Sets the value of [environment_id][crate::model::CreateEnvironmentRequest::environment_id].
12658        ///
12659        /// This is a **required** field for requests.
12660        pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12661            self.0.request.environment_id = v.into();
12662            self
12663        }
12664    }
12665
12666    #[doc(hidden)]
12667    impl crate::RequestBuilder for CreateEnvironment {
12668        fn request_options(&mut self) -> &mut crate::RequestOptions {
12669            &mut self.0.options
12670        }
12671    }
12672
12673    /// The request builder for [Environments::update_environment][crate::client::Environments::update_environment] calls.
12674    ///
12675    /// # Example
12676    /// ```
12677    /// # use google_cloud_dialogflow_v2::builder::environments::UpdateEnvironment;
12678    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12679    ///
12680    /// let builder = prepare_request_builder();
12681    /// let response = builder.send().await?;
12682    /// # Ok(()) }
12683    ///
12684    /// fn prepare_request_builder() -> UpdateEnvironment {
12685    ///   # panic!();
12686    ///   // ... details omitted ...
12687    /// }
12688    /// ```
12689    #[derive(Clone, Debug)]
12690    pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
12691
12692    impl UpdateEnvironment {
12693        pub(crate) fn new(
12694            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12695        ) -> Self {
12696            Self(RequestBuilder::new(stub))
12697        }
12698
12699        /// Sets the full request, replacing any prior values.
12700        pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
12701            mut self,
12702            v: V,
12703        ) -> Self {
12704            self.0.request = v.into();
12705            self
12706        }
12707
12708        /// Sets all the options, replacing any prior values.
12709        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12710            self.0.options = v.into();
12711            self
12712        }
12713
12714        /// Sends the request.
12715        pub async fn send(self) -> Result<crate::model::Environment> {
12716            (*self.0.stub)
12717                .update_environment(self.0.request, self.0.options)
12718                .await
12719                .map(crate::Response::into_body)
12720        }
12721
12722        /// Sets the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12723        ///
12724        /// This is a **required** field for requests.
12725        pub fn set_environment<T>(mut self, v: T) -> Self
12726        where
12727            T: std::convert::Into<crate::model::Environment>,
12728        {
12729            self.0.request.environment = std::option::Option::Some(v.into());
12730            self
12731        }
12732
12733        /// Sets or clears the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12734        ///
12735        /// This is a **required** field for requests.
12736        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12737        where
12738            T: std::convert::Into<crate::model::Environment>,
12739        {
12740            self.0.request.environment = v.map(|x| x.into());
12741            self
12742        }
12743
12744        /// Sets the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12745        ///
12746        /// This is a **required** field for requests.
12747        pub fn set_update_mask<T>(mut self, v: T) -> Self
12748        where
12749            T: std::convert::Into<wkt::FieldMask>,
12750        {
12751            self.0.request.update_mask = std::option::Option::Some(v.into());
12752            self
12753        }
12754
12755        /// Sets or clears the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12756        ///
12757        /// This is a **required** field for requests.
12758        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12759        where
12760            T: std::convert::Into<wkt::FieldMask>,
12761        {
12762            self.0.request.update_mask = v.map(|x| x.into());
12763            self
12764        }
12765
12766        /// Sets the value of [allow_load_to_draft_and_discard_changes][crate::model::UpdateEnvironmentRequest::allow_load_to_draft_and_discard_changes].
12767        pub fn set_allow_load_to_draft_and_discard_changes<T: Into<bool>>(mut self, v: T) -> Self {
12768            self.0.request.allow_load_to_draft_and_discard_changes = v.into();
12769            self
12770        }
12771    }
12772
12773    #[doc(hidden)]
12774    impl crate::RequestBuilder for UpdateEnvironment {
12775        fn request_options(&mut self) -> &mut crate::RequestOptions {
12776            &mut self.0.options
12777        }
12778    }
12779
12780    /// The request builder for [Environments::delete_environment][crate::client::Environments::delete_environment] calls.
12781    ///
12782    /// # Example
12783    /// ```
12784    /// # use google_cloud_dialogflow_v2::builder::environments::DeleteEnvironment;
12785    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12786    ///
12787    /// let builder = prepare_request_builder();
12788    /// let response = builder.send().await?;
12789    /// # Ok(()) }
12790    ///
12791    /// fn prepare_request_builder() -> DeleteEnvironment {
12792    ///   # panic!();
12793    ///   // ... details omitted ...
12794    /// }
12795    /// ```
12796    #[derive(Clone, Debug)]
12797    pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
12798
12799    impl DeleteEnvironment {
12800        pub(crate) fn new(
12801            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12802        ) -> Self {
12803            Self(RequestBuilder::new(stub))
12804        }
12805
12806        /// Sets the full request, replacing any prior values.
12807        pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
12808            mut self,
12809            v: V,
12810        ) -> Self {
12811            self.0.request = v.into();
12812            self
12813        }
12814
12815        /// Sets all the options, replacing any prior values.
12816        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12817            self.0.options = v.into();
12818            self
12819        }
12820
12821        /// Sends the request.
12822        pub async fn send(self) -> Result<()> {
12823            (*self.0.stub)
12824                .delete_environment(self.0.request, self.0.options)
12825                .await
12826                .map(crate::Response::into_body)
12827        }
12828
12829        /// Sets the value of [name][crate::model::DeleteEnvironmentRequest::name].
12830        ///
12831        /// This is a **required** field for requests.
12832        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12833            self.0.request.name = v.into();
12834            self
12835        }
12836    }
12837
12838    #[doc(hidden)]
12839    impl crate::RequestBuilder for DeleteEnvironment {
12840        fn request_options(&mut self) -> &mut crate::RequestOptions {
12841            &mut self.0.options
12842        }
12843    }
12844
12845    /// The request builder for [Environments::get_environment_history][crate::client::Environments::get_environment_history] calls.
12846    ///
12847    /// # Example
12848    /// ```
12849    /// # use google_cloud_dialogflow_v2::builder::environments::GetEnvironmentHistory;
12850    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12851    /// use google_cloud_gax::paginator::ItemPaginator;
12852    ///
12853    /// let builder = prepare_request_builder();
12854    /// let mut items = builder.by_item();
12855    /// while let Some(result) = items.next().await {
12856    ///   let item = result?;
12857    /// }
12858    /// # Ok(()) }
12859    ///
12860    /// fn prepare_request_builder() -> GetEnvironmentHistory {
12861    ///   # panic!();
12862    ///   // ... details omitted ...
12863    /// }
12864    /// ```
12865    #[derive(Clone, Debug)]
12866    pub struct GetEnvironmentHistory(RequestBuilder<crate::model::GetEnvironmentHistoryRequest>);
12867
12868    impl GetEnvironmentHistory {
12869        pub(crate) fn new(
12870            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12871        ) -> Self {
12872            Self(RequestBuilder::new(stub))
12873        }
12874
12875        /// Sets the full request, replacing any prior values.
12876        pub fn with_request<V: Into<crate::model::GetEnvironmentHistoryRequest>>(
12877            mut self,
12878            v: V,
12879        ) -> Self {
12880            self.0.request = v.into();
12881            self
12882        }
12883
12884        /// Sets all the options, replacing any prior values.
12885        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12886            self.0.options = v.into();
12887            self
12888        }
12889
12890        /// Sends the request.
12891        pub async fn send(self) -> Result<crate::model::EnvironmentHistory> {
12892            (*self.0.stub)
12893                .get_environment_history(self.0.request, self.0.options)
12894                .await
12895                .map(crate::Response::into_body)
12896        }
12897
12898        /// Streams each page in the collection.
12899        pub fn by_page(
12900            self,
12901        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::EnvironmentHistory, crate::Error>
12902        {
12903            use std::clone::Clone;
12904            let token = self.0.request.page_token.clone();
12905            let execute = move |token: String| {
12906                let mut builder = self.clone();
12907                builder.0.request = builder.0.request.set_page_token(token);
12908                builder.send()
12909            };
12910            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12911        }
12912
12913        /// Streams each item in the collection.
12914        pub fn by_item(
12915            self,
12916        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12917            crate::model::EnvironmentHistory,
12918            crate::Error,
12919        > {
12920            use google_cloud_gax::paginator::Paginator;
12921            self.by_page().items()
12922        }
12923
12924        /// Sets the value of [parent][crate::model::GetEnvironmentHistoryRequest::parent].
12925        ///
12926        /// This is a **required** field for requests.
12927        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12928            self.0.request.parent = v.into();
12929            self
12930        }
12931
12932        /// Sets the value of [page_size][crate::model::GetEnvironmentHistoryRequest::page_size].
12933        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12934            self.0.request.page_size = v.into();
12935            self
12936        }
12937
12938        /// Sets the value of [page_token][crate::model::GetEnvironmentHistoryRequest::page_token].
12939        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12940            self.0.request.page_token = v.into();
12941            self
12942        }
12943    }
12944
12945    #[doc(hidden)]
12946    impl crate::RequestBuilder for GetEnvironmentHistory {
12947        fn request_options(&mut self) -> &mut crate::RequestOptions {
12948            &mut self.0.options
12949        }
12950    }
12951
12952    /// The request builder for [Environments::list_locations][crate::client::Environments::list_locations] calls.
12953    ///
12954    /// # Example
12955    /// ```
12956    /// # use google_cloud_dialogflow_v2::builder::environments::ListLocations;
12957    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12958    /// use google_cloud_gax::paginator::ItemPaginator;
12959    ///
12960    /// let builder = prepare_request_builder();
12961    /// let mut items = builder.by_item();
12962    /// while let Some(result) = items.next().await {
12963    ///   let item = result?;
12964    /// }
12965    /// # Ok(()) }
12966    ///
12967    /// fn prepare_request_builder() -> ListLocations {
12968    ///   # panic!();
12969    ///   // ... details omitted ...
12970    /// }
12971    /// ```
12972    #[derive(Clone, Debug)]
12973    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12974
12975    impl ListLocations {
12976        pub(crate) fn new(
12977            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12978        ) -> Self {
12979            Self(RequestBuilder::new(stub))
12980        }
12981
12982        /// Sets the full request, replacing any prior values.
12983        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12984            mut self,
12985            v: V,
12986        ) -> Self {
12987            self.0.request = v.into();
12988            self
12989        }
12990
12991        /// Sets all the options, replacing any prior values.
12992        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12993            self.0.options = v.into();
12994            self
12995        }
12996
12997        /// Sends the request.
12998        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12999            (*self.0.stub)
13000                .list_locations(self.0.request, self.0.options)
13001                .await
13002                .map(crate::Response::into_body)
13003        }
13004
13005        /// Streams each page in the collection.
13006        pub fn by_page(
13007            self,
13008        ) -> impl google_cloud_gax::paginator::Paginator<
13009            google_cloud_location::model::ListLocationsResponse,
13010            crate::Error,
13011        > {
13012            use std::clone::Clone;
13013            let token = self.0.request.page_token.clone();
13014            let execute = move |token: String| {
13015                let mut builder = self.clone();
13016                builder.0.request = builder.0.request.set_page_token(token);
13017                builder.send()
13018            };
13019            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13020        }
13021
13022        /// Streams each item in the collection.
13023        pub fn by_item(
13024            self,
13025        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13026            google_cloud_location::model::ListLocationsResponse,
13027            crate::Error,
13028        > {
13029            use google_cloud_gax::paginator::Paginator;
13030            self.by_page().items()
13031        }
13032
13033        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13034        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13035            self.0.request.name = v.into();
13036            self
13037        }
13038
13039        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13040        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13041            self.0.request.filter = v.into();
13042            self
13043        }
13044
13045        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13046        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13047            self.0.request.page_size = v.into();
13048            self
13049        }
13050
13051        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
13052        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13053            self.0.request.page_token = v.into();
13054            self
13055        }
13056    }
13057
13058    #[doc(hidden)]
13059    impl crate::RequestBuilder for ListLocations {
13060        fn request_options(&mut self) -> &mut crate::RequestOptions {
13061            &mut self.0.options
13062        }
13063    }
13064
13065    /// The request builder for [Environments::get_location][crate::client::Environments::get_location] calls.
13066    ///
13067    /// # Example
13068    /// ```
13069    /// # use google_cloud_dialogflow_v2::builder::environments::GetLocation;
13070    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13071    ///
13072    /// let builder = prepare_request_builder();
13073    /// let response = builder.send().await?;
13074    /// # Ok(()) }
13075    ///
13076    /// fn prepare_request_builder() -> GetLocation {
13077    ///   # panic!();
13078    ///   // ... details omitted ...
13079    /// }
13080    /// ```
13081    #[derive(Clone, Debug)]
13082    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13083
13084    impl GetLocation {
13085        pub(crate) fn new(
13086            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13087        ) -> Self {
13088            Self(RequestBuilder::new(stub))
13089        }
13090
13091        /// Sets the full request, replacing any prior values.
13092        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13093            mut self,
13094            v: V,
13095        ) -> Self {
13096            self.0.request = v.into();
13097            self
13098        }
13099
13100        /// Sets all the options, replacing any prior values.
13101        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13102            self.0.options = v.into();
13103            self
13104        }
13105
13106        /// Sends the request.
13107        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13108            (*self.0.stub)
13109                .get_location(self.0.request, self.0.options)
13110                .await
13111                .map(crate::Response::into_body)
13112        }
13113
13114        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
13115        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13116            self.0.request.name = v.into();
13117            self
13118        }
13119    }
13120
13121    #[doc(hidden)]
13122    impl crate::RequestBuilder for GetLocation {
13123        fn request_options(&mut self) -> &mut crate::RequestOptions {
13124            &mut self.0.options
13125        }
13126    }
13127
13128    /// The request builder for [Environments::list_operations][crate::client::Environments::list_operations] calls.
13129    ///
13130    /// # Example
13131    /// ```
13132    /// # use google_cloud_dialogflow_v2::builder::environments::ListOperations;
13133    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13134    /// use google_cloud_gax::paginator::ItemPaginator;
13135    ///
13136    /// let builder = prepare_request_builder();
13137    /// let mut items = builder.by_item();
13138    /// while let Some(result) = items.next().await {
13139    ///   let item = result?;
13140    /// }
13141    /// # Ok(()) }
13142    ///
13143    /// fn prepare_request_builder() -> ListOperations {
13144    ///   # panic!();
13145    ///   // ... details omitted ...
13146    /// }
13147    /// ```
13148    #[derive(Clone, Debug)]
13149    pub struct ListOperations(
13150        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13151    );
13152
13153    impl ListOperations {
13154        pub(crate) fn new(
13155            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13156        ) -> Self {
13157            Self(RequestBuilder::new(stub))
13158        }
13159
13160        /// Sets the full request, replacing any prior values.
13161        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13162            mut self,
13163            v: V,
13164        ) -> Self {
13165            self.0.request = v.into();
13166            self
13167        }
13168
13169        /// Sets all the options, replacing any prior values.
13170        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13171            self.0.options = v.into();
13172            self
13173        }
13174
13175        /// Sends the request.
13176        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13177            (*self.0.stub)
13178                .list_operations(self.0.request, self.0.options)
13179                .await
13180                .map(crate::Response::into_body)
13181        }
13182
13183        /// Streams each page in the collection.
13184        pub fn by_page(
13185            self,
13186        ) -> impl google_cloud_gax::paginator::Paginator<
13187            google_cloud_longrunning::model::ListOperationsResponse,
13188            crate::Error,
13189        > {
13190            use std::clone::Clone;
13191            let token = self.0.request.page_token.clone();
13192            let execute = move |token: String| {
13193                let mut builder = self.clone();
13194                builder.0.request = builder.0.request.set_page_token(token);
13195                builder.send()
13196            };
13197            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13198        }
13199
13200        /// Streams each item in the collection.
13201        pub fn by_item(
13202            self,
13203        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13204            google_cloud_longrunning::model::ListOperationsResponse,
13205            crate::Error,
13206        > {
13207            use google_cloud_gax::paginator::Paginator;
13208            self.by_page().items()
13209        }
13210
13211        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
13212        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13213            self.0.request.name = v.into();
13214            self
13215        }
13216
13217        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
13218        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13219            self.0.request.filter = v.into();
13220            self
13221        }
13222
13223        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
13224        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13225            self.0.request.page_size = v.into();
13226            self
13227        }
13228
13229        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13230        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13231            self.0.request.page_token = v.into();
13232            self
13233        }
13234
13235        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13236        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13237            self.0.request.return_partial_success = v.into();
13238            self
13239        }
13240    }
13241
13242    #[doc(hidden)]
13243    impl crate::RequestBuilder for ListOperations {
13244        fn request_options(&mut self) -> &mut crate::RequestOptions {
13245            &mut self.0.options
13246        }
13247    }
13248
13249    /// The request builder for [Environments::get_operation][crate::client::Environments::get_operation] calls.
13250    ///
13251    /// # Example
13252    /// ```
13253    /// # use google_cloud_dialogflow_v2::builder::environments::GetOperation;
13254    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13255    ///
13256    /// let builder = prepare_request_builder();
13257    /// let response = builder.send().await?;
13258    /// # Ok(()) }
13259    ///
13260    /// fn prepare_request_builder() -> GetOperation {
13261    ///   # panic!();
13262    ///   // ... details omitted ...
13263    /// }
13264    /// ```
13265    #[derive(Clone, Debug)]
13266    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13267
13268    impl GetOperation {
13269        pub(crate) fn new(
13270            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13271        ) -> Self {
13272            Self(RequestBuilder::new(stub))
13273        }
13274
13275        /// Sets the full request, replacing any prior values.
13276        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13277            mut self,
13278            v: V,
13279        ) -> Self {
13280            self.0.request = v.into();
13281            self
13282        }
13283
13284        /// Sets all the options, replacing any prior values.
13285        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13286            self.0.options = v.into();
13287            self
13288        }
13289
13290        /// Sends the request.
13291        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13292            (*self.0.stub)
13293                .get_operation(self.0.request, self.0.options)
13294                .await
13295                .map(crate::Response::into_body)
13296        }
13297
13298        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13299        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13300            self.0.request.name = v.into();
13301            self
13302        }
13303    }
13304
13305    #[doc(hidden)]
13306    impl crate::RequestBuilder for GetOperation {
13307        fn request_options(&mut self) -> &mut crate::RequestOptions {
13308            &mut self.0.options
13309        }
13310    }
13311
13312    /// The request builder for [Environments::cancel_operation][crate::client::Environments::cancel_operation] calls.
13313    ///
13314    /// # Example
13315    /// ```
13316    /// # use google_cloud_dialogflow_v2::builder::environments::CancelOperation;
13317    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13318    ///
13319    /// let builder = prepare_request_builder();
13320    /// let response = builder.send().await?;
13321    /// # Ok(()) }
13322    ///
13323    /// fn prepare_request_builder() -> CancelOperation {
13324    ///   # panic!();
13325    ///   // ... details omitted ...
13326    /// }
13327    /// ```
13328    #[derive(Clone, Debug)]
13329    pub struct CancelOperation(
13330        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13331    );
13332
13333    impl CancelOperation {
13334        pub(crate) fn new(
13335            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13336        ) -> Self {
13337            Self(RequestBuilder::new(stub))
13338        }
13339
13340        /// Sets the full request, replacing any prior values.
13341        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13342            mut self,
13343            v: V,
13344        ) -> Self {
13345            self.0.request = v.into();
13346            self
13347        }
13348
13349        /// Sets all the options, replacing any prior values.
13350        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13351            self.0.options = v.into();
13352            self
13353        }
13354
13355        /// Sends the request.
13356        pub async fn send(self) -> Result<()> {
13357            (*self.0.stub)
13358                .cancel_operation(self.0.request, self.0.options)
13359                .await
13360                .map(crate::Response::into_body)
13361        }
13362
13363        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
13364        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13365            self.0.request.name = v.into();
13366            self
13367        }
13368    }
13369
13370    #[doc(hidden)]
13371    impl crate::RequestBuilder for CancelOperation {
13372        fn request_options(&mut self) -> &mut crate::RequestOptions {
13373            &mut self.0.options
13374        }
13375    }
13376}
13377
13378/// Request and client builders for [Fulfillments][crate::client::Fulfillments].
13379#[cfg(feature = "fulfillments")]
13380#[cfg_attr(docsrs, doc(cfg(feature = "fulfillments")))]
13381pub mod fulfillments {
13382    use crate::Result;
13383
13384    /// A builder for [Fulfillments][crate::client::Fulfillments].
13385    ///
13386    /// ```
13387    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13388    /// # use google_cloud_dialogflow_v2::*;
13389    /// # use builder::fulfillments::ClientBuilder;
13390    /// # use client::Fulfillments;
13391    /// let builder : ClientBuilder = Fulfillments::builder();
13392    /// let client = builder
13393    ///     .with_endpoint("https://dialogflow.googleapis.com")
13394    ///     .build().await?;
13395    /// # Ok(()) }
13396    /// ```
13397    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13398
13399    pub(crate) mod client {
13400        use super::super::super::client::Fulfillments;
13401        pub struct Factory;
13402        impl crate::ClientFactory for Factory {
13403            type Client = Fulfillments;
13404            type Credentials = gaxi::options::Credentials;
13405            async fn build(
13406                self,
13407                config: gaxi::options::ClientConfig,
13408            ) -> crate::ClientBuilderResult<Self::Client> {
13409                Self::Client::new(config).await
13410            }
13411        }
13412    }
13413
13414    /// Common implementation for [crate::client::Fulfillments] request builders.
13415    #[derive(Clone, Debug)]
13416    pub(crate) struct RequestBuilder<R: std::default::Default> {
13417        stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13418        request: R,
13419        options: crate::RequestOptions,
13420    }
13421
13422    impl<R> RequestBuilder<R>
13423    where
13424        R: std::default::Default,
13425    {
13426        pub(crate) fn new(
13427            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13428        ) -> Self {
13429            Self {
13430                stub,
13431                request: R::default(),
13432                options: crate::RequestOptions::default(),
13433            }
13434        }
13435    }
13436
13437    /// The request builder for [Fulfillments::get_fulfillment][crate::client::Fulfillments::get_fulfillment] calls.
13438    ///
13439    /// # Example
13440    /// ```
13441    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetFulfillment;
13442    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13443    ///
13444    /// let builder = prepare_request_builder();
13445    /// let response = builder.send().await?;
13446    /// # Ok(()) }
13447    ///
13448    /// fn prepare_request_builder() -> GetFulfillment {
13449    ///   # panic!();
13450    ///   // ... details omitted ...
13451    /// }
13452    /// ```
13453    #[derive(Clone, Debug)]
13454    pub struct GetFulfillment(RequestBuilder<crate::model::GetFulfillmentRequest>);
13455
13456    impl GetFulfillment {
13457        pub(crate) fn new(
13458            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13459        ) -> Self {
13460            Self(RequestBuilder::new(stub))
13461        }
13462
13463        /// Sets the full request, replacing any prior values.
13464        pub fn with_request<V: Into<crate::model::GetFulfillmentRequest>>(mut self, v: V) -> Self {
13465            self.0.request = v.into();
13466            self
13467        }
13468
13469        /// Sets all the options, replacing any prior values.
13470        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13471            self.0.options = v.into();
13472            self
13473        }
13474
13475        /// Sends the request.
13476        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13477            (*self.0.stub)
13478                .get_fulfillment(self.0.request, self.0.options)
13479                .await
13480                .map(crate::Response::into_body)
13481        }
13482
13483        /// Sets the value of [name][crate::model::GetFulfillmentRequest::name].
13484        ///
13485        /// This is a **required** field for requests.
13486        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13487            self.0.request.name = v.into();
13488            self
13489        }
13490    }
13491
13492    #[doc(hidden)]
13493    impl crate::RequestBuilder for GetFulfillment {
13494        fn request_options(&mut self) -> &mut crate::RequestOptions {
13495            &mut self.0.options
13496        }
13497    }
13498
13499    /// The request builder for [Fulfillments::update_fulfillment][crate::client::Fulfillments::update_fulfillment] calls.
13500    ///
13501    /// # Example
13502    /// ```
13503    /// # use google_cloud_dialogflow_v2::builder::fulfillments::UpdateFulfillment;
13504    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13505    ///
13506    /// let builder = prepare_request_builder();
13507    /// let response = builder.send().await?;
13508    /// # Ok(()) }
13509    ///
13510    /// fn prepare_request_builder() -> UpdateFulfillment {
13511    ///   # panic!();
13512    ///   // ... details omitted ...
13513    /// }
13514    /// ```
13515    #[derive(Clone, Debug)]
13516    pub struct UpdateFulfillment(RequestBuilder<crate::model::UpdateFulfillmentRequest>);
13517
13518    impl UpdateFulfillment {
13519        pub(crate) fn new(
13520            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13521        ) -> Self {
13522            Self(RequestBuilder::new(stub))
13523        }
13524
13525        /// Sets the full request, replacing any prior values.
13526        pub fn with_request<V: Into<crate::model::UpdateFulfillmentRequest>>(
13527            mut self,
13528            v: V,
13529        ) -> Self {
13530            self.0.request = v.into();
13531            self
13532        }
13533
13534        /// Sets all the options, replacing any prior values.
13535        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13536            self.0.options = v.into();
13537            self
13538        }
13539
13540        /// Sends the request.
13541        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13542            (*self.0.stub)
13543                .update_fulfillment(self.0.request, self.0.options)
13544                .await
13545                .map(crate::Response::into_body)
13546        }
13547
13548        /// Sets the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13549        ///
13550        /// This is a **required** field for requests.
13551        pub fn set_fulfillment<T>(mut self, v: T) -> Self
13552        where
13553            T: std::convert::Into<crate::model::Fulfillment>,
13554        {
13555            self.0.request.fulfillment = std::option::Option::Some(v.into());
13556            self
13557        }
13558
13559        /// Sets or clears the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13560        ///
13561        /// This is a **required** field for requests.
13562        pub fn set_or_clear_fulfillment<T>(mut self, v: std::option::Option<T>) -> Self
13563        where
13564            T: std::convert::Into<crate::model::Fulfillment>,
13565        {
13566            self.0.request.fulfillment = v.map(|x| x.into());
13567            self
13568        }
13569
13570        /// Sets the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13571        ///
13572        /// This is a **required** field for requests.
13573        pub fn set_update_mask<T>(mut self, v: T) -> Self
13574        where
13575            T: std::convert::Into<wkt::FieldMask>,
13576        {
13577            self.0.request.update_mask = std::option::Option::Some(v.into());
13578            self
13579        }
13580
13581        /// Sets or clears the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13582        ///
13583        /// This is a **required** field for requests.
13584        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13585        where
13586            T: std::convert::Into<wkt::FieldMask>,
13587        {
13588            self.0.request.update_mask = v.map(|x| x.into());
13589            self
13590        }
13591    }
13592
13593    #[doc(hidden)]
13594    impl crate::RequestBuilder for UpdateFulfillment {
13595        fn request_options(&mut self) -> &mut crate::RequestOptions {
13596            &mut self.0.options
13597        }
13598    }
13599
13600    /// The request builder for [Fulfillments::list_locations][crate::client::Fulfillments::list_locations] calls.
13601    ///
13602    /// # Example
13603    /// ```
13604    /// # use google_cloud_dialogflow_v2::builder::fulfillments::ListLocations;
13605    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13606    /// use google_cloud_gax::paginator::ItemPaginator;
13607    ///
13608    /// let builder = prepare_request_builder();
13609    /// let mut items = builder.by_item();
13610    /// while let Some(result) = items.next().await {
13611    ///   let item = result?;
13612    /// }
13613    /// # Ok(()) }
13614    ///
13615    /// fn prepare_request_builder() -> ListLocations {
13616    ///   # panic!();
13617    ///   // ... details omitted ...
13618    /// }
13619    /// ```
13620    #[derive(Clone, Debug)]
13621    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13622
13623    impl ListLocations {
13624        pub(crate) fn new(
13625            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13626        ) -> Self {
13627            Self(RequestBuilder::new(stub))
13628        }
13629
13630        /// Sets the full request, replacing any prior values.
13631        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13632            mut self,
13633            v: V,
13634        ) -> Self {
13635            self.0.request = v.into();
13636            self
13637        }
13638
13639        /// Sets all the options, replacing any prior values.
13640        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13641            self.0.options = v.into();
13642            self
13643        }
13644
13645        /// Sends the request.
13646        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13647            (*self.0.stub)
13648                .list_locations(self.0.request, self.0.options)
13649                .await
13650                .map(crate::Response::into_body)
13651        }
13652
13653        /// Streams each page in the collection.
13654        pub fn by_page(
13655            self,
13656        ) -> impl google_cloud_gax::paginator::Paginator<
13657            google_cloud_location::model::ListLocationsResponse,
13658            crate::Error,
13659        > {
13660            use std::clone::Clone;
13661            let token = self.0.request.page_token.clone();
13662            let execute = move |token: String| {
13663                let mut builder = self.clone();
13664                builder.0.request = builder.0.request.set_page_token(token);
13665                builder.send()
13666            };
13667            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13668        }
13669
13670        /// Streams each item in the collection.
13671        pub fn by_item(
13672            self,
13673        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13674            google_cloud_location::model::ListLocationsResponse,
13675            crate::Error,
13676        > {
13677            use google_cloud_gax::paginator::Paginator;
13678            self.by_page().items()
13679        }
13680
13681        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13682        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13683            self.0.request.name = v.into();
13684            self
13685        }
13686
13687        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13688        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13689            self.0.request.filter = v.into();
13690            self
13691        }
13692
13693        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13694        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13695            self.0.request.page_size = v.into();
13696            self
13697        }
13698
13699        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
13700        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13701            self.0.request.page_token = v.into();
13702            self
13703        }
13704    }
13705
13706    #[doc(hidden)]
13707    impl crate::RequestBuilder for ListLocations {
13708        fn request_options(&mut self) -> &mut crate::RequestOptions {
13709            &mut self.0.options
13710        }
13711    }
13712
13713    /// The request builder for [Fulfillments::get_location][crate::client::Fulfillments::get_location] calls.
13714    ///
13715    /// # Example
13716    /// ```
13717    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetLocation;
13718    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13719    ///
13720    /// let builder = prepare_request_builder();
13721    /// let response = builder.send().await?;
13722    /// # Ok(()) }
13723    ///
13724    /// fn prepare_request_builder() -> GetLocation {
13725    ///   # panic!();
13726    ///   // ... details omitted ...
13727    /// }
13728    /// ```
13729    #[derive(Clone, Debug)]
13730    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13731
13732    impl GetLocation {
13733        pub(crate) fn new(
13734            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13735        ) -> Self {
13736            Self(RequestBuilder::new(stub))
13737        }
13738
13739        /// Sets the full request, replacing any prior values.
13740        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13741            mut self,
13742            v: V,
13743        ) -> Self {
13744            self.0.request = v.into();
13745            self
13746        }
13747
13748        /// Sets all the options, replacing any prior values.
13749        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13750            self.0.options = v.into();
13751            self
13752        }
13753
13754        /// Sends the request.
13755        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13756            (*self.0.stub)
13757                .get_location(self.0.request, self.0.options)
13758                .await
13759                .map(crate::Response::into_body)
13760        }
13761
13762        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
13763        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13764            self.0.request.name = v.into();
13765            self
13766        }
13767    }
13768
13769    #[doc(hidden)]
13770    impl crate::RequestBuilder for GetLocation {
13771        fn request_options(&mut self) -> &mut crate::RequestOptions {
13772            &mut self.0.options
13773        }
13774    }
13775
13776    /// The request builder for [Fulfillments::list_operations][crate::client::Fulfillments::list_operations] calls.
13777    ///
13778    /// # Example
13779    /// ```
13780    /// # use google_cloud_dialogflow_v2::builder::fulfillments::ListOperations;
13781    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13782    /// use google_cloud_gax::paginator::ItemPaginator;
13783    ///
13784    /// let builder = prepare_request_builder();
13785    /// let mut items = builder.by_item();
13786    /// while let Some(result) = items.next().await {
13787    ///   let item = result?;
13788    /// }
13789    /// # Ok(()) }
13790    ///
13791    /// fn prepare_request_builder() -> ListOperations {
13792    ///   # panic!();
13793    ///   // ... details omitted ...
13794    /// }
13795    /// ```
13796    #[derive(Clone, Debug)]
13797    pub struct ListOperations(
13798        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13799    );
13800
13801    impl ListOperations {
13802        pub(crate) fn new(
13803            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13804        ) -> Self {
13805            Self(RequestBuilder::new(stub))
13806        }
13807
13808        /// Sets the full request, replacing any prior values.
13809        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13810            mut self,
13811            v: V,
13812        ) -> Self {
13813            self.0.request = v.into();
13814            self
13815        }
13816
13817        /// Sets all the options, replacing any prior values.
13818        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13819            self.0.options = v.into();
13820            self
13821        }
13822
13823        /// Sends the request.
13824        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13825            (*self.0.stub)
13826                .list_operations(self.0.request, self.0.options)
13827                .await
13828                .map(crate::Response::into_body)
13829        }
13830
13831        /// Streams each page in the collection.
13832        pub fn by_page(
13833            self,
13834        ) -> impl google_cloud_gax::paginator::Paginator<
13835            google_cloud_longrunning::model::ListOperationsResponse,
13836            crate::Error,
13837        > {
13838            use std::clone::Clone;
13839            let token = self.0.request.page_token.clone();
13840            let execute = move |token: String| {
13841                let mut builder = self.clone();
13842                builder.0.request = builder.0.request.set_page_token(token);
13843                builder.send()
13844            };
13845            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13846        }
13847
13848        /// Streams each item in the collection.
13849        pub fn by_item(
13850            self,
13851        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13852            google_cloud_longrunning::model::ListOperationsResponse,
13853            crate::Error,
13854        > {
13855            use google_cloud_gax::paginator::Paginator;
13856            self.by_page().items()
13857        }
13858
13859        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
13860        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13861            self.0.request.name = v.into();
13862            self
13863        }
13864
13865        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
13866        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13867            self.0.request.filter = v.into();
13868            self
13869        }
13870
13871        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
13872        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13873            self.0.request.page_size = v.into();
13874            self
13875        }
13876
13877        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13878        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13879            self.0.request.page_token = v.into();
13880            self
13881        }
13882
13883        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13884        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13885            self.0.request.return_partial_success = v.into();
13886            self
13887        }
13888    }
13889
13890    #[doc(hidden)]
13891    impl crate::RequestBuilder for ListOperations {
13892        fn request_options(&mut self) -> &mut crate::RequestOptions {
13893            &mut self.0.options
13894        }
13895    }
13896
13897    /// The request builder for [Fulfillments::get_operation][crate::client::Fulfillments::get_operation] calls.
13898    ///
13899    /// # Example
13900    /// ```
13901    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetOperation;
13902    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13903    ///
13904    /// let builder = prepare_request_builder();
13905    /// let response = builder.send().await?;
13906    /// # Ok(()) }
13907    ///
13908    /// fn prepare_request_builder() -> GetOperation {
13909    ///   # panic!();
13910    ///   // ... details omitted ...
13911    /// }
13912    /// ```
13913    #[derive(Clone, Debug)]
13914    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13915
13916    impl GetOperation {
13917        pub(crate) fn new(
13918            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13919        ) -> Self {
13920            Self(RequestBuilder::new(stub))
13921        }
13922
13923        /// Sets the full request, replacing any prior values.
13924        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13925            mut self,
13926            v: V,
13927        ) -> Self {
13928            self.0.request = v.into();
13929            self
13930        }
13931
13932        /// Sets all the options, replacing any prior values.
13933        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13934            self.0.options = v.into();
13935            self
13936        }
13937
13938        /// Sends the request.
13939        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13940            (*self.0.stub)
13941                .get_operation(self.0.request, self.0.options)
13942                .await
13943                .map(crate::Response::into_body)
13944        }
13945
13946        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13947        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13948            self.0.request.name = v.into();
13949            self
13950        }
13951    }
13952
13953    #[doc(hidden)]
13954    impl crate::RequestBuilder for GetOperation {
13955        fn request_options(&mut self) -> &mut crate::RequestOptions {
13956            &mut self.0.options
13957        }
13958    }
13959
13960    /// The request builder for [Fulfillments::cancel_operation][crate::client::Fulfillments::cancel_operation] calls.
13961    ///
13962    /// # Example
13963    /// ```
13964    /// # use google_cloud_dialogflow_v2::builder::fulfillments::CancelOperation;
13965    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13966    ///
13967    /// let builder = prepare_request_builder();
13968    /// let response = builder.send().await?;
13969    /// # Ok(()) }
13970    ///
13971    /// fn prepare_request_builder() -> CancelOperation {
13972    ///   # panic!();
13973    ///   // ... details omitted ...
13974    /// }
13975    /// ```
13976    #[derive(Clone, Debug)]
13977    pub struct CancelOperation(
13978        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13979    );
13980
13981    impl CancelOperation {
13982        pub(crate) fn new(
13983            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13984        ) -> Self {
13985            Self(RequestBuilder::new(stub))
13986        }
13987
13988        /// Sets the full request, replacing any prior values.
13989        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13990            mut self,
13991            v: V,
13992        ) -> Self {
13993            self.0.request = v.into();
13994            self
13995        }
13996
13997        /// Sets all the options, replacing any prior values.
13998        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13999            self.0.options = v.into();
14000            self
14001        }
14002
14003        /// Sends the request.
14004        pub async fn send(self) -> Result<()> {
14005            (*self.0.stub)
14006                .cancel_operation(self.0.request, self.0.options)
14007                .await
14008                .map(crate::Response::into_body)
14009        }
14010
14011        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
14012        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14013            self.0.request.name = v.into();
14014            self
14015        }
14016    }
14017
14018    #[doc(hidden)]
14019    impl crate::RequestBuilder for CancelOperation {
14020        fn request_options(&mut self) -> &mut crate::RequestOptions {
14021            &mut self.0.options
14022        }
14023    }
14024}
14025
14026/// Request and client builders for [Generators][crate::client::Generators].
14027#[cfg(feature = "generators")]
14028#[cfg_attr(docsrs, doc(cfg(feature = "generators")))]
14029pub mod generators {
14030    use crate::Result;
14031
14032    /// A builder for [Generators][crate::client::Generators].
14033    ///
14034    /// ```
14035    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14036    /// # use google_cloud_dialogflow_v2::*;
14037    /// # use builder::generators::ClientBuilder;
14038    /// # use client::Generators;
14039    /// let builder : ClientBuilder = Generators::builder();
14040    /// let client = builder
14041    ///     .with_endpoint("https://dialogflow.googleapis.com")
14042    ///     .build().await?;
14043    /// # Ok(()) }
14044    /// ```
14045    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14046
14047    pub(crate) mod client {
14048        use super::super::super::client::Generators;
14049        pub struct Factory;
14050        impl crate::ClientFactory for Factory {
14051            type Client = Generators;
14052            type Credentials = gaxi::options::Credentials;
14053            async fn build(
14054                self,
14055                config: gaxi::options::ClientConfig,
14056            ) -> crate::ClientBuilderResult<Self::Client> {
14057                Self::Client::new(config).await
14058            }
14059        }
14060    }
14061
14062    /// Common implementation for [crate::client::Generators] request builders.
14063    #[derive(Clone, Debug)]
14064    pub(crate) struct RequestBuilder<R: std::default::Default> {
14065        stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14066        request: R,
14067        options: crate::RequestOptions,
14068    }
14069
14070    impl<R> RequestBuilder<R>
14071    where
14072        R: std::default::Default,
14073    {
14074        pub(crate) fn new(
14075            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14076        ) -> Self {
14077            Self {
14078                stub,
14079                request: R::default(),
14080                options: crate::RequestOptions::default(),
14081            }
14082        }
14083    }
14084
14085    /// The request builder for [Generators::create_generator][crate::client::Generators::create_generator] calls.
14086    ///
14087    /// # Example
14088    /// ```
14089    /// # use google_cloud_dialogflow_v2::builder::generators::CreateGenerator;
14090    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14091    ///
14092    /// let builder = prepare_request_builder();
14093    /// let response = builder.send().await?;
14094    /// # Ok(()) }
14095    ///
14096    /// fn prepare_request_builder() -> CreateGenerator {
14097    ///   # panic!();
14098    ///   // ... details omitted ...
14099    /// }
14100    /// ```
14101    #[derive(Clone, Debug)]
14102    pub struct CreateGenerator(RequestBuilder<crate::model::CreateGeneratorRequest>);
14103
14104    impl CreateGenerator {
14105        pub(crate) fn new(
14106            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14107        ) -> Self {
14108            Self(RequestBuilder::new(stub))
14109        }
14110
14111        /// Sets the full request, replacing any prior values.
14112        pub fn with_request<V: Into<crate::model::CreateGeneratorRequest>>(mut self, v: V) -> Self {
14113            self.0.request = v.into();
14114            self
14115        }
14116
14117        /// Sets all the options, replacing any prior values.
14118        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14119            self.0.options = v.into();
14120            self
14121        }
14122
14123        /// Sends the request.
14124        pub async fn send(self) -> Result<crate::model::Generator> {
14125            (*self.0.stub)
14126                .create_generator(self.0.request, self.0.options)
14127                .await
14128                .map(crate::Response::into_body)
14129        }
14130
14131        /// Sets the value of [parent][crate::model::CreateGeneratorRequest::parent].
14132        ///
14133        /// This is a **required** field for requests.
14134        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14135            self.0.request.parent = v.into();
14136            self
14137        }
14138
14139        /// Sets the value of [generator][crate::model::CreateGeneratorRequest::generator].
14140        ///
14141        /// This is a **required** field for requests.
14142        pub fn set_generator<T>(mut self, v: T) -> Self
14143        where
14144            T: std::convert::Into<crate::model::Generator>,
14145        {
14146            self.0.request.generator = std::option::Option::Some(v.into());
14147            self
14148        }
14149
14150        /// Sets or clears the value of [generator][crate::model::CreateGeneratorRequest::generator].
14151        ///
14152        /// This is a **required** field for requests.
14153        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
14154        where
14155            T: std::convert::Into<crate::model::Generator>,
14156        {
14157            self.0.request.generator = v.map(|x| x.into());
14158            self
14159        }
14160
14161        /// Sets the value of [generator_id][crate::model::CreateGeneratorRequest::generator_id].
14162        pub fn set_generator_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14163            self.0.request.generator_id = v.into();
14164            self
14165        }
14166    }
14167
14168    #[doc(hidden)]
14169    impl crate::RequestBuilder for CreateGenerator {
14170        fn request_options(&mut self) -> &mut crate::RequestOptions {
14171            &mut self.0.options
14172        }
14173    }
14174
14175    /// The request builder for [Generators::get_generator][crate::client::Generators::get_generator] calls.
14176    ///
14177    /// # Example
14178    /// ```
14179    /// # use google_cloud_dialogflow_v2::builder::generators::GetGenerator;
14180    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14181    ///
14182    /// let builder = prepare_request_builder();
14183    /// let response = builder.send().await?;
14184    /// # Ok(()) }
14185    ///
14186    /// fn prepare_request_builder() -> GetGenerator {
14187    ///   # panic!();
14188    ///   // ... details omitted ...
14189    /// }
14190    /// ```
14191    #[derive(Clone, Debug)]
14192    pub struct GetGenerator(RequestBuilder<crate::model::GetGeneratorRequest>);
14193
14194    impl GetGenerator {
14195        pub(crate) fn new(
14196            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14197        ) -> Self {
14198            Self(RequestBuilder::new(stub))
14199        }
14200
14201        /// Sets the full request, replacing any prior values.
14202        pub fn with_request<V: Into<crate::model::GetGeneratorRequest>>(mut self, v: V) -> Self {
14203            self.0.request = v.into();
14204            self
14205        }
14206
14207        /// Sets all the options, replacing any prior values.
14208        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14209            self.0.options = v.into();
14210            self
14211        }
14212
14213        /// Sends the request.
14214        pub async fn send(self) -> Result<crate::model::Generator> {
14215            (*self.0.stub)
14216                .get_generator(self.0.request, self.0.options)
14217                .await
14218                .map(crate::Response::into_body)
14219        }
14220
14221        /// Sets the value of [name][crate::model::GetGeneratorRequest::name].
14222        ///
14223        /// This is a **required** field for requests.
14224        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14225            self.0.request.name = v.into();
14226            self
14227        }
14228    }
14229
14230    #[doc(hidden)]
14231    impl crate::RequestBuilder for GetGenerator {
14232        fn request_options(&mut self) -> &mut crate::RequestOptions {
14233            &mut self.0.options
14234        }
14235    }
14236
14237    /// The request builder for [Generators::list_generators][crate::client::Generators::list_generators] calls.
14238    ///
14239    /// # Example
14240    /// ```
14241    /// # use google_cloud_dialogflow_v2::builder::generators::ListGenerators;
14242    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14243    /// use google_cloud_gax::paginator::ItemPaginator;
14244    ///
14245    /// let builder = prepare_request_builder();
14246    /// let mut items = builder.by_item();
14247    /// while let Some(result) = items.next().await {
14248    ///   let item = result?;
14249    /// }
14250    /// # Ok(()) }
14251    ///
14252    /// fn prepare_request_builder() -> ListGenerators {
14253    ///   # panic!();
14254    ///   // ... details omitted ...
14255    /// }
14256    /// ```
14257    #[derive(Clone, Debug)]
14258    pub struct ListGenerators(RequestBuilder<crate::model::ListGeneratorsRequest>);
14259
14260    impl ListGenerators {
14261        pub(crate) fn new(
14262            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14263        ) -> Self {
14264            Self(RequestBuilder::new(stub))
14265        }
14266
14267        /// Sets the full request, replacing any prior values.
14268        pub fn with_request<V: Into<crate::model::ListGeneratorsRequest>>(mut self, v: V) -> Self {
14269            self.0.request = v.into();
14270            self
14271        }
14272
14273        /// Sets all the options, replacing any prior values.
14274        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14275            self.0.options = v.into();
14276            self
14277        }
14278
14279        /// Sends the request.
14280        pub async fn send(self) -> Result<crate::model::ListGeneratorsResponse> {
14281            (*self.0.stub)
14282                .list_generators(self.0.request, self.0.options)
14283                .await
14284                .map(crate::Response::into_body)
14285        }
14286
14287        /// Streams each page in the collection.
14288        pub fn by_page(
14289            self,
14290        ) -> impl google_cloud_gax::paginator::Paginator<
14291            crate::model::ListGeneratorsResponse,
14292            crate::Error,
14293        > {
14294            use std::clone::Clone;
14295            let token = self.0.request.page_token.clone();
14296            let execute = move |token: String| {
14297                let mut builder = self.clone();
14298                builder.0.request = builder.0.request.set_page_token(token);
14299                builder.send()
14300            };
14301            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14302        }
14303
14304        /// Streams each item in the collection.
14305        pub fn by_item(
14306            self,
14307        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14308            crate::model::ListGeneratorsResponse,
14309            crate::Error,
14310        > {
14311            use google_cloud_gax::paginator::Paginator;
14312            self.by_page().items()
14313        }
14314
14315        /// Sets the value of [parent][crate::model::ListGeneratorsRequest::parent].
14316        ///
14317        /// This is a **required** field for requests.
14318        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14319            self.0.request.parent = v.into();
14320            self
14321        }
14322
14323        /// Sets the value of [page_size][crate::model::ListGeneratorsRequest::page_size].
14324        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14325            self.0.request.page_size = v.into();
14326            self
14327        }
14328
14329        /// Sets the value of [page_token][crate::model::ListGeneratorsRequest::page_token].
14330        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14331            self.0.request.page_token = v.into();
14332            self
14333        }
14334    }
14335
14336    #[doc(hidden)]
14337    impl crate::RequestBuilder for ListGenerators {
14338        fn request_options(&mut self) -> &mut crate::RequestOptions {
14339            &mut self.0.options
14340        }
14341    }
14342
14343    /// The request builder for [Generators::delete_generator][crate::client::Generators::delete_generator] calls.
14344    ///
14345    /// # Example
14346    /// ```
14347    /// # use google_cloud_dialogflow_v2::builder::generators::DeleteGenerator;
14348    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14349    ///
14350    /// let builder = prepare_request_builder();
14351    /// let response = builder.send().await?;
14352    /// # Ok(()) }
14353    ///
14354    /// fn prepare_request_builder() -> DeleteGenerator {
14355    ///   # panic!();
14356    ///   // ... details omitted ...
14357    /// }
14358    /// ```
14359    #[derive(Clone, Debug)]
14360    pub struct DeleteGenerator(RequestBuilder<crate::model::DeleteGeneratorRequest>);
14361
14362    impl DeleteGenerator {
14363        pub(crate) fn new(
14364            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14365        ) -> Self {
14366            Self(RequestBuilder::new(stub))
14367        }
14368
14369        /// Sets the full request, replacing any prior values.
14370        pub fn with_request<V: Into<crate::model::DeleteGeneratorRequest>>(mut self, v: V) -> Self {
14371            self.0.request = v.into();
14372            self
14373        }
14374
14375        /// Sets all the options, replacing any prior values.
14376        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14377            self.0.options = v.into();
14378            self
14379        }
14380
14381        /// Sends the request.
14382        pub async fn send(self) -> Result<()> {
14383            (*self.0.stub)
14384                .delete_generator(self.0.request, self.0.options)
14385                .await
14386                .map(crate::Response::into_body)
14387        }
14388
14389        /// Sets the value of [name][crate::model::DeleteGeneratorRequest::name].
14390        ///
14391        /// This is a **required** field for requests.
14392        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14393            self.0.request.name = v.into();
14394            self
14395        }
14396    }
14397
14398    #[doc(hidden)]
14399    impl crate::RequestBuilder for DeleteGenerator {
14400        fn request_options(&mut self) -> &mut crate::RequestOptions {
14401            &mut self.0.options
14402        }
14403    }
14404
14405    /// The request builder for [Generators::update_generator][crate::client::Generators::update_generator] calls.
14406    ///
14407    /// # Example
14408    /// ```
14409    /// # use google_cloud_dialogflow_v2::builder::generators::UpdateGenerator;
14410    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14411    ///
14412    /// let builder = prepare_request_builder();
14413    /// let response = builder.send().await?;
14414    /// # Ok(()) }
14415    ///
14416    /// fn prepare_request_builder() -> UpdateGenerator {
14417    ///   # panic!();
14418    ///   // ... details omitted ...
14419    /// }
14420    /// ```
14421    #[derive(Clone, Debug)]
14422    pub struct UpdateGenerator(RequestBuilder<crate::model::UpdateGeneratorRequest>);
14423
14424    impl UpdateGenerator {
14425        pub(crate) fn new(
14426            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14427        ) -> Self {
14428            Self(RequestBuilder::new(stub))
14429        }
14430
14431        /// Sets the full request, replacing any prior values.
14432        pub fn with_request<V: Into<crate::model::UpdateGeneratorRequest>>(mut self, v: V) -> Self {
14433            self.0.request = v.into();
14434            self
14435        }
14436
14437        /// Sets all the options, replacing any prior values.
14438        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14439            self.0.options = v.into();
14440            self
14441        }
14442
14443        /// Sends the request.
14444        pub async fn send(self) -> Result<crate::model::Generator> {
14445            (*self.0.stub)
14446                .update_generator(self.0.request, self.0.options)
14447                .await
14448                .map(crate::Response::into_body)
14449        }
14450
14451        /// Sets the value of [generator][crate::model::UpdateGeneratorRequest::generator].
14452        ///
14453        /// This is a **required** field for requests.
14454        pub fn set_generator<T>(mut self, v: T) -> Self
14455        where
14456            T: std::convert::Into<crate::model::Generator>,
14457        {
14458            self.0.request.generator = std::option::Option::Some(v.into());
14459            self
14460        }
14461
14462        /// Sets or clears the value of [generator][crate::model::UpdateGeneratorRequest::generator].
14463        ///
14464        /// This is a **required** field for requests.
14465        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
14466        where
14467            T: std::convert::Into<crate::model::Generator>,
14468        {
14469            self.0.request.generator = v.map(|x| x.into());
14470            self
14471        }
14472
14473        /// Sets the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
14474        pub fn set_update_mask<T>(mut self, v: T) -> Self
14475        where
14476            T: std::convert::Into<wkt::FieldMask>,
14477        {
14478            self.0.request.update_mask = std::option::Option::Some(v.into());
14479            self
14480        }
14481
14482        /// Sets or clears the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
14483        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14484        where
14485            T: std::convert::Into<wkt::FieldMask>,
14486        {
14487            self.0.request.update_mask = v.map(|x| x.into());
14488            self
14489        }
14490    }
14491
14492    #[doc(hidden)]
14493    impl crate::RequestBuilder for UpdateGenerator {
14494        fn request_options(&mut self) -> &mut crate::RequestOptions {
14495            &mut self.0.options
14496        }
14497    }
14498
14499    /// The request builder for [Generators::list_locations][crate::client::Generators::list_locations] calls.
14500    ///
14501    /// # Example
14502    /// ```
14503    /// # use google_cloud_dialogflow_v2::builder::generators::ListLocations;
14504    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14505    /// use google_cloud_gax::paginator::ItemPaginator;
14506    ///
14507    /// let builder = prepare_request_builder();
14508    /// let mut items = builder.by_item();
14509    /// while let Some(result) = items.next().await {
14510    ///   let item = result?;
14511    /// }
14512    /// # Ok(()) }
14513    ///
14514    /// fn prepare_request_builder() -> ListLocations {
14515    ///   # panic!();
14516    ///   // ... details omitted ...
14517    /// }
14518    /// ```
14519    #[derive(Clone, Debug)]
14520    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14521
14522    impl ListLocations {
14523        pub(crate) fn new(
14524            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14525        ) -> Self {
14526            Self(RequestBuilder::new(stub))
14527        }
14528
14529        /// Sets the full request, replacing any prior values.
14530        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14531            mut self,
14532            v: V,
14533        ) -> Self {
14534            self.0.request = v.into();
14535            self
14536        }
14537
14538        /// Sets all the options, replacing any prior values.
14539        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14540            self.0.options = v.into();
14541            self
14542        }
14543
14544        /// Sends the request.
14545        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14546            (*self.0.stub)
14547                .list_locations(self.0.request, self.0.options)
14548                .await
14549                .map(crate::Response::into_body)
14550        }
14551
14552        /// Streams each page in the collection.
14553        pub fn by_page(
14554            self,
14555        ) -> impl google_cloud_gax::paginator::Paginator<
14556            google_cloud_location::model::ListLocationsResponse,
14557            crate::Error,
14558        > {
14559            use std::clone::Clone;
14560            let token = self.0.request.page_token.clone();
14561            let execute = move |token: String| {
14562                let mut builder = self.clone();
14563                builder.0.request = builder.0.request.set_page_token(token);
14564                builder.send()
14565            };
14566            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14567        }
14568
14569        /// Streams each item in the collection.
14570        pub fn by_item(
14571            self,
14572        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14573            google_cloud_location::model::ListLocationsResponse,
14574            crate::Error,
14575        > {
14576            use google_cloud_gax::paginator::Paginator;
14577            self.by_page().items()
14578        }
14579
14580        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
14581        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14582            self.0.request.name = v.into();
14583            self
14584        }
14585
14586        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
14587        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14588            self.0.request.filter = v.into();
14589            self
14590        }
14591
14592        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
14593        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14594            self.0.request.page_size = v.into();
14595            self
14596        }
14597
14598        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
14599        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14600            self.0.request.page_token = v.into();
14601            self
14602        }
14603    }
14604
14605    #[doc(hidden)]
14606    impl crate::RequestBuilder for ListLocations {
14607        fn request_options(&mut self) -> &mut crate::RequestOptions {
14608            &mut self.0.options
14609        }
14610    }
14611
14612    /// The request builder for [Generators::get_location][crate::client::Generators::get_location] calls.
14613    ///
14614    /// # Example
14615    /// ```
14616    /// # use google_cloud_dialogflow_v2::builder::generators::GetLocation;
14617    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14618    ///
14619    /// let builder = prepare_request_builder();
14620    /// let response = builder.send().await?;
14621    /// # Ok(()) }
14622    ///
14623    /// fn prepare_request_builder() -> GetLocation {
14624    ///   # panic!();
14625    ///   // ... details omitted ...
14626    /// }
14627    /// ```
14628    #[derive(Clone, Debug)]
14629    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14630
14631    impl GetLocation {
14632        pub(crate) fn new(
14633            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14634        ) -> Self {
14635            Self(RequestBuilder::new(stub))
14636        }
14637
14638        /// Sets the full request, replacing any prior values.
14639        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14640            mut self,
14641            v: V,
14642        ) -> Self {
14643            self.0.request = v.into();
14644            self
14645        }
14646
14647        /// Sets all the options, replacing any prior values.
14648        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14649            self.0.options = v.into();
14650            self
14651        }
14652
14653        /// Sends the request.
14654        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14655            (*self.0.stub)
14656                .get_location(self.0.request, self.0.options)
14657                .await
14658                .map(crate::Response::into_body)
14659        }
14660
14661        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
14662        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14663            self.0.request.name = v.into();
14664            self
14665        }
14666    }
14667
14668    #[doc(hidden)]
14669    impl crate::RequestBuilder for GetLocation {
14670        fn request_options(&mut self) -> &mut crate::RequestOptions {
14671            &mut self.0.options
14672        }
14673    }
14674
14675    /// The request builder for [Generators::list_operations][crate::client::Generators::list_operations] calls.
14676    ///
14677    /// # Example
14678    /// ```
14679    /// # use google_cloud_dialogflow_v2::builder::generators::ListOperations;
14680    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14681    /// use google_cloud_gax::paginator::ItemPaginator;
14682    ///
14683    /// let builder = prepare_request_builder();
14684    /// let mut items = builder.by_item();
14685    /// while let Some(result) = items.next().await {
14686    ///   let item = result?;
14687    /// }
14688    /// # Ok(()) }
14689    ///
14690    /// fn prepare_request_builder() -> ListOperations {
14691    ///   # panic!();
14692    ///   // ... details omitted ...
14693    /// }
14694    /// ```
14695    #[derive(Clone, Debug)]
14696    pub struct ListOperations(
14697        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14698    );
14699
14700    impl ListOperations {
14701        pub(crate) fn new(
14702            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14703        ) -> Self {
14704            Self(RequestBuilder::new(stub))
14705        }
14706
14707        /// Sets the full request, replacing any prior values.
14708        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14709            mut self,
14710            v: V,
14711        ) -> Self {
14712            self.0.request = v.into();
14713            self
14714        }
14715
14716        /// Sets all the options, replacing any prior values.
14717        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14718            self.0.options = v.into();
14719            self
14720        }
14721
14722        /// Sends the request.
14723        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14724            (*self.0.stub)
14725                .list_operations(self.0.request, self.0.options)
14726                .await
14727                .map(crate::Response::into_body)
14728        }
14729
14730        /// Streams each page in the collection.
14731        pub fn by_page(
14732            self,
14733        ) -> impl google_cloud_gax::paginator::Paginator<
14734            google_cloud_longrunning::model::ListOperationsResponse,
14735            crate::Error,
14736        > {
14737            use std::clone::Clone;
14738            let token = self.0.request.page_token.clone();
14739            let execute = move |token: String| {
14740                let mut builder = self.clone();
14741                builder.0.request = builder.0.request.set_page_token(token);
14742                builder.send()
14743            };
14744            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14745        }
14746
14747        /// Streams each item in the collection.
14748        pub fn by_item(
14749            self,
14750        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14751            google_cloud_longrunning::model::ListOperationsResponse,
14752            crate::Error,
14753        > {
14754            use google_cloud_gax::paginator::Paginator;
14755            self.by_page().items()
14756        }
14757
14758        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
14759        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14760            self.0.request.name = v.into();
14761            self
14762        }
14763
14764        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
14765        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14766            self.0.request.filter = v.into();
14767            self
14768        }
14769
14770        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
14771        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14772            self.0.request.page_size = v.into();
14773            self
14774        }
14775
14776        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
14777        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14778            self.0.request.page_token = v.into();
14779            self
14780        }
14781
14782        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
14783        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14784            self.0.request.return_partial_success = v.into();
14785            self
14786        }
14787    }
14788
14789    #[doc(hidden)]
14790    impl crate::RequestBuilder for ListOperations {
14791        fn request_options(&mut self) -> &mut crate::RequestOptions {
14792            &mut self.0.options
14793        }
14794    }
14795
14796    /// The request builder for [Generators::get_operation][crate::client::Generators::get_operation] calls.
14797    ///
14798    /// # Example
14799    /// ```
14800    /// # use google_cloud_dialogflow_v2::builder::generators::GetOperation;
14801    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14802    ///
14803    /// let builder = prepare_request_builder();
14804    /// let response = builder.send().await?;
14805    /// # Ok(()) }
14806    ///
14807    /// fn prepare_request_builder() -> GetOperation {
14808    ///   # panic!();
14809    ///   // ... details omitted ...
14810    /// }
14811    /// ```
14812    #[derive(Clone, Debug)]
14813    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14814
14815    impl GetOperation {
14816        pub(crate) fn new(
14817            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14818        ) -> Self {
14819            Self(RequestBuilder::new(stub))
14820        }
14821
14822        /// Sets the full request, replacing any prior values.
14823        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14824            mut self,
14825            v: V,
14826        ) -> Self {
14827            self.0.request = v.into();
14828            self
14829        }
14830
14831        /// Sets all the options, replacing any prior values.
14832        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14833            self.0.options = v.into();
14834            self
14835        }
14836
14837        /// Sends the request.
14838        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14839            (*self.0.stub)
14840                .get_operation(self.0.request, self.0.options)
14841                .await
14842                .map(crate::Response::into_body)
14843        }
14844
14845        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
14846        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14847            self.0.request.name = v.into();
14848            self
14849        }
14850    }
14851
14852    #[doc(hidden)]
14853    impl crate::RequestBuilder for GetOperation {
14854        fn request_options(&mut self) -> &mut crate::RequestOptions {
14855            &mut self.0.options
14856        }
14857    }
14858
14859    /// The request builder for [Generators::cancel_operation][crate::client::Generators::cancel_operation] calls.
14860    ///
14861    /// # Example
14862    /// ```
14863    /// # use google_cloud_dialogflow_v2::builder::generators::CancelOperation;
14864    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14865    ///
14866    /// let builder = prepare_request_builder();
14867    /// let response = builder.send().await?;
14868    /// # Ok(()) }
14869    ///
14870    /// fn prepare_request_builder() -> CancelOperation {
14871    ///   # panic!();
14872    ///   // ... details omitted ...
14873    /// }
14874    /// ```
14875    #[derive(Clone, Debug)]
14876    pub struct CancelOperation(
14877        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14878    );
14879
14880    impl CancelOperation {
14881        pub(crate) fn new(
14882            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14883        ) -> Self {
14884            Self(RequestBuilder::new(stub))
14885        }
14886
14887        /// Sets the full request, replacing any prior values.
14888        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14889            mut self,
14890            v: V,
14891        ) -> Self {
14892            self.0.request = v.into();
14893            self
14894        }
14895
14896        /// Sets all the options, replacing any prior values.
14897        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14898            self.0.options = v.into();
14899            self
14900        }
14901
14902        /// Sends the request.
14903        pub async fn send(self) -> Result<()> {
14904            (*self.0.stub)
14905                .cancel_operation(self.0.request, self.0.options)
14906                .await
14907                .map(crate::Response::into_body)
14908        }
14909
14910        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
14911        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14912            self.0.request.name = v.into();
14913            self
14914        }
14915    }
14916
14917    #[doc(hidden)]
14918    impl crate::RequestBuilder for CancelOperation {
14919        fn request_options(&mut self) -> &mut crate::RequestOptions {
14920            &mut self.0.options
14921        }
14922    }
14923}
14924
14925/// Request and client builders for [GeneratorEvaluations][crate::client::GeneratorEvaluations].
14926#[cfg(feature = "generator-evaluations")]
14927#[cfg_attr(docsrs, doc(cfg(feature = "generator-evaluations")))]
14928pub mod generator_evaluations {
14929    use crate::Result;
14930
14931    /// A builder for [GeneratorEvaluations][crate::client::GeneratorEvaluations].
14932    ///
14933    /// ```
14934    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14935    /// # use google_cloud_dialogflow_v2::*;
14936    /// # use builder::generator_evaluations::ClientBuilder;
14937    /// # use client::GeneratorEvaluations;
14938    /// let builder : ClientBuilder = GeneratorEvaluations::builder();
14939    /// let client = builder
14940    ///     .with_endpoint("https://dialogflow.googleapis.com")
14941    ///     .build().await?;
14942    /// # Ok(()) }
14943    /// ```
14944    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14945
14946    pub(crate) mod client {
14947        use super::super::super::client::GeneratorEvaluations;
14948        pub struct Factory;
14949        impl crate::ClientFactory for Factory {
14950            type Client = GeneratorEvaluations;
14951            type Credentials = gaxi::options::Credentials;
14952            async fn build(
14953                self,
14954                config: gaxi::options::ClientConfig,
14955            ) -> crate::ClientBuilderResult<Self::Client> {
14956                Self::Client::new(config).await
14957            }
14958        }
14959    }
14960
14961    /// Common implementation for [crate::client::GeneratorEvaluations] request builders.
14962    #[derive(Clone, Debug)]
14963    pub(crate) struct RequestBuilder<R: std::default::Default> {
14964        stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14965        request: R,
14966        options: crate::RequestOptions,
14967    }
14968
14969    impl<R> RequestBuilder<R>
14970    where
14971        R: std::default::Default,
14972    {
14973        pub(crate) fn new(
14974            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14975        ) -> Self {
14976            Self {
14977                stub,
14978                request: R::default(),
14979                options: crate::RequestOptions::default(),
14980            }
14981        }
14982    }
14983
14984    /// The request builder for [GeneratorEvaluations::create_generator_evaluation][crate::client::GeneratorEvaluations::create_generator_evaluation] calls.
14985    ///
14986    /// # Example
14987    /// ```
14988    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::CreateGeneratorEvaluation;
14989    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14990    /// use google_cloud_lro::Poller;
14991    ///
14992    /// let builder = prepare_request_builder();
14993    /// let response = builder.poller().until_done().await?;
14994    /// # Ok(()) }
14995    ///
14996    /// fn prepare_request_builder() -> CreateGeneratorEvaluation {
14997    ///   # panic!();
14998    ///   // ... details omitted ...
14999    /// }
15000    /// ```
15001    #[derive(Clone, Debug)]
15002    pub struct CreateGeneratorEvaluation(
15003        RequestBuilder<crate::model::CreateGeneratorEvaluationRequest>,
15004    );
15005
15006    impl CreateGeneratorEvaluation {
15007        pub(crate) fn new(
15008            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15009        ) -> Self {
15010            Self(RequestBuilder::new(stub))
15011        }
15012
15013        /// Sets the full request, replacing any prior values.
15014        pub fn with_request<V: Into<crate::model::CreateGeneratorEvaluationRequest>>(
15015            mut self,
15016            v: V,
15017        ) -> Self {
15018            self.0.request = v.into();
15019            self
15020        }
15021
15022        /// Sets all the options, replacing any prior values.
15023        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15024            self.0.options = v.into();
15025            self
15026        }
15027
15028        /// Sends the request.
15029        ///
15030        /// # Long running operations
15031        ///
15032        /// This starts, but does not poll, a longrunning operation. More information
15033        /// on [create_generator_evaluation][crate::client::GeneratorEvaluations::create_generator_evaluation].
15034        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15035            (*self.0.stub)
15036                .create_generator_evaluation(self.0.request, self.0.options)
15037                .await
15038                .map(crate::Response::into_body)
15039        }
15040
15041        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_generator_evaluation`.
15042        pub fn poller(
15043            self,
15044        ) -> impl google_cloud_lro::Poller<
15045            crate::model::GeneratorEvaluation,
15046            crate::model::GeneratorEvaluationOperationMetadata,
15047        > {
15048            type Operation = google_cloud_lro::internal::Operation<
15049                crate::model::GeneratorEvaluation,
15050                crate::model::GeneratorEvaluationOperationMetadata,
15051            >;
15052            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15053            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15054            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15055            if let Some(ref mut details) = poller_options.tracing {
15056                details.method_name = "google_cloud_dialogflow_v2::client::GeneratorEvaluations::create_generator_evaluation::until_done";
15057            }
15058
15059            let stub = self.0.stub.clone();
15060            let mut options = self.0.options.clone();
15061            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15062            let query = move |name| {
15063                let stub = stub.clone();
15064                let options = options.clone();
15065                async {
15066                    let op = GetOperation::new(stub)
15067                        .set_name(name)
15068                        .with_options(options)
15069                        .send()
15070                        .await?;
15071                    Ok(Operation::new(op))
15072                }
15073            };
15074
15075            let start = move || async {
15076                let op = self.send().await?;
15077                Ok(Operation::new(op))
15078            };
15079
15080            use google_cloud_lro::internal::PollerExt;
15081            {
15082                google_cloud_lro::internal::new_poller(
15083                    polling_error_policy,
15084                    polling_backoff_policy,
15085                    start,
15086                    query,
15087                )
15088            }
15089            .with_options(poller_options)
15090        }
15091
15092        /// Sets the value of [parent][crate::model::CreateGeneratorEvaluationRequest::parent].
15093        ///
15094        /// This is a **required** field for requests.
15095        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15096            self.0.request.parent = v.into();
15097            self
15098        }
15099
15100        /// Sets the value of [generator_evaluation][crate::model::CreateGeneratorEvaluationRequest::generator_evaluation].
15101        ///
15102        /// This is a **required** field for requests.
15103        pub fn set_generator_evaluation<T>(mut self, v: T) -> Self
15104        where
15105            T: std::convert::Into<crate::model::GeneratorEvaluation>,
15106        {
15107            self.0.request.generator_evaluation = std::option::Option::Some(v.into());
15108            self
15109        }
15110
15111        /// Sets or clears the value of [generator_evaluation][crate::model::CreateGeneratorEvaluationRequest::generator_evaluation].
15112        ///
15113        /// This is a **required** field for requests.
15114        pub fn set_or_clear_generator_evaluation<T>(mut self, v: std::option::Option<T>) -> Self
15115        where
15116            T: std::convert::Into<crate::model::GeneratorEvaluation>,
15117        {
15118            self.0.request.generator_evaluation = v.map(|x| x.into());
15119            self
15120        }
15121    }
15122
15123    #[doc(hidden)]
15124    impl crate::RequestBuilder for CreateGeneratorEvaluation {
15125        fn request_options(&mut self) -> &mut crate::RequestOptions {
15126            &mut self.0.options
15127        }
15128    }
15129
15130    /// The request builder for [GeneratorEvaluations::get_generator_evaluation][crate::client::GeneratorEvaluations::get_generator_evaluation] calls.
15131    ///
15132    /// # Example
15133    /// ```
15134    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetGeneratorEvaluation;
15135    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15136    ///
15137    /// let builder = prepare_request_builder();
15138    /// let response = builder.send().await?;
15139    /// # Ok(()) }
15140    ///
15141    /// fn prepare_request_builder() -> GetGeneratorEvaluation {
15142    ///   # panic!();
15143    ///   // ... details omitted ...
15144    /// }
15145    /// ```
15146    #[derive(Clone, Debug)]
15147    pub struct GetGeneratorEvaluation(RequestBuilder<crate::model::GetGeneratorEvaluationRequest>);
15148
15149    impl GetGeneratorEvaluation {
15150        pub(crate) fn new(
15151            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15152        ) -> Self {
15153            Self(RequestBuilder::new(stub))
15154        }
15155
15156        /// Sets the full request, replacing any prior values.
15157        pub fn with_request<V: Into<crate::model::GetGeneratorEvaluationRequest>>(
15158            mut self,
15159            v: V,
15160        ) -> Self {
15161            self.0.request = v.into();
15162            self
15163        }
15164
15165        /// Sets all the options, replacing any prior values.
15166        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15167            self.0.options = v.into();
15168            self
15169        }
15170
15171        /// Sends the request.
15172        pub async fn send(self) -> Result<crate::model::GeneratorEvaluation> {
15173            (*self.0.stub)
15174                .get_generator_evaluation(self.0.request, self.0.options)
15175                .await
15176                .map(crate::Response::into_body)
15177        }
15178
15179        /// Sets the value of [name][crate::model::GetGeneratorEvaluationRequest::name].
15180        ///
15181        /// This is a **required** field for requests.
15182        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15183            self.0.request.name = v.into();
15184            self
15185        }
15186    }
15187
15188    #[doc(hidden)]
15189    impl crate::RequestBuilder for GetGeneratorEvaluation {
15190        fn request_options(&mut self) -> &mut crate::RequestOptions {
15191            &mut self.0.options
15192        }
15193    }
15194
15195    /// The request builder for [GeneratorEvaluations::list_generator_evaluations][crate::client::GeneratorEvaluations::list_generator_evaluations] calls.
15196    ///
15197    /// # Example
15198    /// ```
15199    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListGeneratorEvaluations;
15200    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15201    /// use google_cloud_gax::paginator::ItemPaginator;
15202    ///
15203    /// let builder = prepare_request_builder();
15204    /// let mut items = builder.by_item();
15205    /// while let Some(result) = items.next().await {
15206    ///   let item = result?;
15207    /// }
15208    /// # Ok(()) }
15209    ///
15210    /// fn prepare_request_builder() -> ListGeneratorEvaluations {
15211    ///   # panic!();
15212    ///   // ... details omitted ...
15213    /// }
15214    /// ```
15215    #[derive(Clone, Debug)]
15216    pub struct ListGeneratorEvaluations(
15217        RequestBuilder<crate::model::ListGeneratorEvaluationsRequest>,
15218    );
15219
15220    impl ListGeneratorEvaluations {
15221        pub(crate) fn new(
15222            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15223        ) -> Self {
15224            Self(RequestBuilder::new(stub))
15225        }
15226
15227        /// Sets the full request, replacing any prior values.
15228        pub fn with_request<V: Into<crate::model::ListGeneratorEvaluationsRequest>>(
15229            mut self,
15230            v: V,
15231        ) -> Self {
15232            self.0.request = v.into();
15233            self
15234        }
15235
15236        /// Sets all the options, replacing any prior values.
15237        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15238            self.0.options = v.into();
15239            self
15240        }
15241
15242        /// Sends the request.
15243        pub async fn send(self) -> Result<crate::model::ListGeneratorEvaluationsResponse> {
15244            (*self.0.stub)
15245                .list_generator_evaluations(self.0.request, self.0.options)
15246                .await
15247                .map(crate::Response::into_body)
15248        }
15249
15250        /// Streams each page in the collection.
15251        pub fn by_page(
15252            self,
15253        ) -> impl google_cloud_gax::paginator::Paginator<
15254            crate::model::ListGeneratorEvaluationsResponse,
15255            crate::Error,
15256        > {
15257            use std::clone::Clone;
15258            let token = self.0.request.page_token.clone();
15259            let execute = move |token: String| {
15260                let mut builder = self.clone();
15261                builder.0.request = builder.0.request.set_page_token(token);
15262                builder.send()
15263            };
15264            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15265        }
15266
15267        /// Streams each item in the collection.
15268        pub fn by_item(
15269            self,
15270        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15271            crate::model::ListGeneratorEvaluationsResponse,
15272            crate::Error,
15273        > {
15274            use google_cloud_gax::paginator::Paginator;
15275            self.by_page().items()
15276        }
15277
15278        /// Sets the value of [parent][crate::model::ListGeneratorEvaluationsRequest::parent].
15279        ///
15280        /// This is a **required** field for requests.
15281        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15282            self.0.request.parent = v.into();
15283            self
15284        }
15285
15286        /// Sets the value of [page_size][crate::model::ListGeneratorEvaluationsRequest::page_size].
15287        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15288            self.0.request.page_size = v.into();
15289            self
15290        }
15291
15292        /// Sets the value of [page_token][crate::model::ListGeneratorEvaluationsRequest::page_token].
15293        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15294            self.0.request.page_token = v.into();
15295            self
15296        }
15297    }
15298
15299    #[doc(hidden)]
15300    impl crate::RequestBuilder for ListGeneratorEvaluations {
15301        fn request_options(&mut self) -> &mut crate::RequestOptions {
15302            &mut self.0.options
15303        }
15304    }
15305
15306    /// The request builder for [GeneratorEvaluations::delete_generator_evaluation][crate::client::GeneratorEvaluations::delete_generator_evaluation] calls.
15307    ///
15308    /// # Example
15309    /// ```
15310    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::DeleteGeneratorEvaluation;
15311    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15312    ///
15313    /// let builder = prepare_request_builder();
15314    /// let response = builder.send().await?;
15315    /// # Ok(()) }
15316    ///
15317    /// fn prepare_request_builder() -> DeleteGeneratorEvaluation {
15318    ///   # panic!();
15319    ///   // ... details omitted ...
15320    /// }
15321    /// ```
15322    #[derive(Clone, Debug)]
15323    pub struct DeleteGeneratorEvaluation(
15324        RequestBuilder<crate::model::DeleteGeneratorEvaluationRequest>,
15325    );
15326
15327    impl DeleteGeneratorEvaluation {
15328        pub(crate) fn new(
15329            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15330        ) -> Self {
15331            Self(RequestBuilder::new(stub))
15332        }
15333
15334        /// Sets the full request, replacing any prior values.
15335        pub fn with_request<V: Into<crate::model::DeleteGeneratorEvaluationRequest>>(
15336            mut self,
15337            v: V,
15338        ) -> Self {
15339            self.0.request = v.into();
15340            self
15341        }
15342
15343        /// Sets all the options, replacing any prior values.
15344        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15345            self.0.options = v.into();
15346            self
15347        }
15348
15349        /// Sends the request.
15350        pub async fn send(self) -> Result<()> {
15351            (*self.0.stub)
15352                .delete_generator_evaluation(self.0.request, self.0.options)
15353                .await
15354                .map(crate::Response::into_body)
15355        }
15356
15357        /// Sets the value of [name][crate::model::DeleteGeneratorEvaluationRequest::name].
15358        ///
15359        /// This is a **required** field for requests.
15360        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15361            self.0.request.name = v.into();
15362            self
15363        }
15364    }
15365
15366    #[doc(hidden)]
15367    impl crate::RequestBuilder for DeleteGeneratorEvaluation {
15368        fn request_options(&mut self) -> &mut crate::RequestOptions {
15369            &mut self.0.options
15370        }
15371    }
15372
15373    /// The request builder for [GeneratorEvaluations::list_locations][crate::client::GeneratorEvaluations::list_locations] calls.
15374    ///
15375    /// # Example
15376    /// ```
15377    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListLocations;
15378    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15379    /// use google_cloud_gax::paginator::ItemPaginator;
15380    ///
15381    /// let builder = prepare_request_builder();
15382    /// let mut items = builder.by_item();
15383    /// while let Some(result) = items.next().await {
15384    ///   let item = result?;
15385    /// }
15386    /// # Ok(()) }
15387    ///
15388    /// fn prepare_request_builder() -> ListLocations {
15389    ///   # panic!();
15390    ///   // ... details omitted ...
15391    /// }
15392    /// ```
15393    #[derive(Clone, Debug)]
15394    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
15395
15396    impl ListLocations {
15397        pub(crate) fn new(
15398            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15399        ) -> Self {
15400            Self(RequestBuilder::new(stub))
15401        }
15402
15403        /// Sets the full request, replacing any prior values.
15404        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
15405            mut self,
15406            v: V,
15407        ) -> Self {
15408            self.0.request = v.into();
15409            self
15410        }
15411
15412        /// Sets all the options, replacing any prior values.
15413        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15414            self.0.options = v.into();
15415            self
15416        }
15417
15418        /// Sends the request.
15419        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
15420            (*self.0.stub)
15421                .list_locations(self.0.request, self.0.options)
15422                .await
15423                .map(crate::Response::into_body)
15424        }
15425
15426        /// Streams each page in the collection.
15427        pub fn by_page(
15428            self,
15429        ) -> impl google_cloud_gax::paginator::Paginator<
15430            google_cloud_location::model::ListLocationsResponse,
15431            crate::Error,
15432        > {
15433            use std::clone::Clone;
15434            let token = self.0.request.page_token.clone();
15435            let execute = move |token: String| {
15436                let mut builder = self.clone();
15437                builder.0.request = builder.0.request.set_page_token(token);
15438                builder.send()
15439            };
15440            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15441        }
15442
15443        /// Streams each item in the collection.
15444        pub fn by_item(
15445            self,
15446        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15447            google_cloud_location::model::ListLocationsResponse,
15448            crate::Error,
15449        > {
15450            use google_cloud_gax::paginator::Paginator;
15451            self.by_page().items()
15452        }
15453
15454        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
15455        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15456            self.0.request.name = v.into();
15457            self
15458        }
15459
15460        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
15461        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15462            self.0.request.filter = v.into();
15463            self
15464        }
15465
15466        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
15467        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15468            self.0.request.page_size = v.into();
15469            self
15470        }
15471
15472        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
15473        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15474            self.0.request.page_token = v.into();
15475            self
15476        }
15477    }
15478
15479    #[doc(hidden)]
15480    impl crate::RequestBuilder for ListLocations {
15481        fn request_options(&mut self) -> &mut crate::RequestOptions {
15482            &mut self.0.options
15483        }
15484    }
15485
15486    /// The request builder for [GeneratorEvaluations::get_location][crate::client::GeneratorEvaluations::get_location] calls.
15487    ///
15488    /// # Example
15489    /// ```
15490    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetLocation;
15491    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15492    ///
15493    /// let builder = prepare_request_builder();
15494    /// let response = builder.send().await?;
15495    /// # Ok(()) }
15496    ///
15497    /// fn prepare_request_builder() -> GetLocation {
15498    ///   # panic!();
15499    ///   // ... details omitted ...
15500    /// }
15501    /// ```
15502    #[derive(Clone, Debug)]
15503    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15504
15505    impl GetLocation {
15506        pub(crate) fn new(
15507            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15508        ) -> Self {
15509            Self(RequestBuilder::new(stub))
15510        }
15511
15512        /// Sets the full request, replacing any prior values.
15513        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15514            mut self,
15515            v: V,
15516        ) -> Self {
15517            self.0.request = v.into();
15518            self
15519        }
15520
15521        /// Sets all the options, replacing any prior values.
15522        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15523            self.0.options = v.into();
15524            self
15525        }
15526
15527        /// Sends the request.
15528        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15529            (*self.0.stub)
15530                .get_location(self.0.request, self.0.options)
15531                .await
15532                .map(crate::Response::into_body)
15533        }
15534
15535        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
15536        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15537            self.0.request.name = v.into();
15538            self
15539        }
15540    }
15541
15542    #[doc(hidden)]
15543    impl crate::RequestBuilder for GetLocation {
15544        fn request_options(&mut self) -> &mut crate::RequestOptions {
15545            &mut self.0.options
15546        }
15547    }
15548
15549    /// The request builder for [GeneratorEvaluations::list_operations][crate::client::GeneratorEvaluations::list_operations] calls.
15550    ///
15551    /// # Example
15552    /// ```
15553    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListOperations;
15554    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15555    /// use google_cloud_gax::paginator::ItemPaginator;
15556    ///
15557    /// let builder = prepare_request_builder();
15558    /// let mut items = builder.by_item();
15559    /// while let Some(result) = items.next().await {
15560    ///   let item = result?;
15561    /// }
15562    /// # Ok(()) }
15563    ///
15564    /// fn prepare_request_builder() -> ListOperations {
15565    ///   # panic!();
15566    ///   // ... details omitted ...
15567    /// }
15568    /// ```
15569    #[derive(Clone, Debug)]
15570    pub struct ListOperations(
15571        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15572    );
15573
15574    impl ListOperations {
15575        pub(crate) fn new(
15576            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15577        ) -> Self {
15578            Self(RequestBuilder::new(stub))
15579        }
15580
15581        /// Sets the full request, replacing any prior values.
15582        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15583            mut self,
15584            v: V,
15585        ) -> Self {
15586            self.0.request = v.into();
15587            self
15588        }
15589
15590        /// Sets all the options, replacing any prior values.
15591        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15592            self.0.options = v.into();
15593            self
15594        }
15595
15596        /// Sends the request.
15597        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15598            (*self.0.stub)
15599                .list_operations(self.0.request, self.0.options)
15600                .await
15601                .map(crate::Response::into_body)
15602        }
15603
15604        /// Streams each page in the collection.
15605        pub fn by_page(
15606            self,
15607        ) -> impl google_cloud_gax::paginator::Paginator<
15608            google_cloud_longrunning::model::ListOperationsResponse,
15609            crate::Error,
15610        > {
15611            use std::clone::Clone;
15612            let token = self.0.request.page_token.clone();
15613            let execute = move |token: String| {
15614                let mut builder = self.clone();
15615                builder.0.request = builder.0.request.set_page_token(token);
15616                builder.send()
15617            };
15618            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15619        }
15620
15621        /// Streams each item in the collection.
15622        pub fn by_item(
15623            self,
15624        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15625            google_cloud_longrunning::model::ListOperationsResponse,
15626            crate::Error,
15627        > {
15628            use google_cloud_gax::paginator::Paginator;
15629            self.by_page().items()
15630        }
15631
15632        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
15633        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15634            self.0.request.name = v.into();
15635            self
15636        }
15637
15638        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
15639        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15640            self.0.request.filter = v.into();
15641            self
15642        }
15643
15644        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
15645        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15646            self.0.request.page_size = v.into();
15647            self
15648        }
15649
15650        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
15651        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15652            self.0.request.page_token = v.into();
15653            self
15654        }
15655
15656        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
15657        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15658            self.0.request.return_partial_success = v.into();
15659            self
15660        }
15661    }
15662
15663    #[doc(hidden)]
15664    impl crate::RequestBuilder for ListOperations {
15665        fn request_options(&mut self) -> &mut crate::RequestOptions {
15666            &mut self.0.options
15667        }
15668    }
15669
15670    /// The request builder for [GeneratorEvaluations::get_operation][crate::client::GeneratorEvaluations::get_operation] calls.
15671    ///
15672    /// # Example
15673    /// ```
15674    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetOperation;
15675    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15676    ///
15677    /// let builder = prepare_request_builder();
15678    /// let response = builder.send().await?;
15679    /// # Ok(()) }
15680    ///
15681    /// fn prepare_request_builder() -> GetOperation {
15682    ///   # panic!();
15683    ///   // ... details omitted ...
15684    /// }
15685    /// ```
15686    #[derive(Clone, Debug)]
15687    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15688
15689    impl GetOperation {
15690        pub(crate) fn new(
15691            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15692        ) -> Self {
15693            Self(RequestBuilder::new(stub))
15694        }
15695
15696        /// Sets the full request, replacing any prior values.
15697        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15698            mut self,
15699            v: V,
15700        ) -> Self {
15701            self.0.request = v.into();
15702            self
15703        }
15704
15705        /// Sets all the options, replacing any prior values.
15706        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15707            self.0.options = v.into();
15708            self
15709        }
15710
15711        /// Sends the request.
15712        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15713            (*self.0.stub)
15714                .get_operation(self.0.request, self.0.options)
15715                .await
15716                .map(crate::Response::into_body)
15717        }
15718
15719        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
15720        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15721            self.0.request.name = v.into();
15722            self
15723        }
15724    }
15725
15726    #[doc(hidden)]
15727    impl crate::RequestBuilder for GetOperation {
15728        fn request_options(&mut self) -> &mut crate::RequestOptions {
15729            &mut self.0.options
15730        }
15731    }
15732
15733    /// The request builder for [GeneratorEvaluations::cancel_operation][crate::client::GeneratorEvaluations::cancel_operation] calls.
15734    ///
15735    /// # Example
15736    /// ```
15737    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::CancelOperation;
15738    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15739    ///
15740    /// let builder = prepare_request_builder();
15741    /// let response = builder.send().await?;
15742    /// # Ok(()) }
15743    ///
15744    /// fn prepare_request_builder() -> CancelOperation {
15745    ///   # panic!();
15746    ///   // ... details omitted ...
15747    /// }
15748    /// ```
15749    #[derive(Clone, Debug)]
15750    pub struct CancelOperation(
15751        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15752    );
15753
15754    impl CancelOperation {
15755        pub(crate) fn new(
15756            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15757        ) -> Self {
15758            Self(RequestBuilder::new(stub))
15759        }
15760
15761        /// Sets the full request, replacing any prior values.
15762        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15763            mut self,
15764            v: V,
15765        ) -> Self {
15766            self.0.request = v.into();
15767            self
15768        }
15769
15770        /// Sets all the options, replacing any prior values.
15771        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15772            self.0.options = v.into();
15773            self
15774        }
15775
15776        /// Sends the request.
15777        pub async fn send(self) -> Result<()> {
15778            (*self.0.stub)
15779                .cancel_operation(self.0.request, self.0.options)
15780                .await
15781                .map(crate::Response::into_body)
15782        }
15783
15784        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
15785        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15786            self.0.request.name = v.into();
15787            self
15788        }
15789    }
15790
15791    #[doc(hidden)]
15792    impl crate::RequestBuilder for CancelOperation {
15793        fn request_options(&mut self) -> &mut crate::RequestOptions {
15794            &mut self.0.options
15795        }
15796    }
15797}
15798
15799/// Request and client builders for [Intents][crate::client::Intents].
15800#[cfg(feature = "intents")]
15801#[cfg_attr(docsrs, doc(cfg(feature = "intents")))]
15802pub mod intents {
15803    use crate::Result;
15804
15805    /// A builder for [Intents][crate::client::Intents].
15806    ///
15807    /// ```
15808    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15809    /// # use google_cloud_dialogflow_v2::*;
15810    /// # use builder::intents::ClientBuilder;
15811    /// # use client::Intents;
15812    /// let builder : ClientBuilder = Intents::builder();
15813    /// let client = builder
15814    ///     .with_endpoint("https://dialogflow.googleapis.com")
15815    ///     .build().await?;
15816    /// # Ok(()) }
15817    /// ```
15818    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15819
15820    pub(crate) mod client {
15821        use super::super::super::client::Intents;
15822        pub struct Factory;
15823        impl crate::ClientFactory for Factory {
15824            type Client = Intents;
15825            type Credentials = gaxi::options::Credentials;
15826            async fn build(
15827                self,
15828                config: gaxi::options::ClientConfig,
15829            ) -> crate::ClientBuilderResult<Self::Client> {
15830                Self::Client::new(config).await
15831            }
15832        }
15833    }
15834
15835    /// Common implementation for [crate::client::Intents] request builders.
15836    #[derive(Clone, Debug)]
15837    pub(crate) struct RequestBuilder<R: std::default::Default> {
15838        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>,
15839        request: R,
15840        options: crate::RequestOptions,
15841    }
15842
15843    impl<R> RequestBuilder<R>
15844    where
15845        R: std::default::Default,
15846    {
15847        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15848            Self {
15849                stub,
15850                request: R::default(),
15851                options: crate::RequestOptions::default(),
15852            }
15853        }
15854    }
15855
15856    /// The request builder for [Intents::list_intents][crate::client::Intents::list_intents] calls.
15857    ///
15858    /// # Example
15859    /// ```
15860    /// # use google_cloud_dialogflow_v2::builder::intents::ListIntents;
15861    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15862    /// use google_cloud_gax::paginator::ItemPaginator;
15863    ///
15864    /// let builder = prepare_request_builder();
15865    /// let mut items = builder.by_item();
15866    /// while let Some(result) = items.next().await {
15867    ///   let item = result?;
15868    /// }
15869    /// # Ok(()) }
15870    ///
15871    /// fn prepare_request_builder() -> ListIntents {
15872    ///   # panic!();
15873    ///   // ... details omitted ...
15874    /// }
15875    /// ```
15876    #[derive(Clone, Debug)]
15877    pub struct ListIntents(RequestBuilder<crate::model::ListIntentsRequest>);
15878
15879    impl ListIntents {
15880        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15881            Self(RequestBuilder::new(stub))
15882        }
15883
15884        /// Sets the full request, replacing any prior values.
15885        pub fn with_request<V: Into<crate::model::ListIntentsRequest>>(mut self, v: V) -> Self {
15886            self.0.request = v.into();
15887            self
15888        }
15889
15890        /// Sets all the options, replacing any prior values.
15891        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15892            self.0.options = v.into();
15893            self
15894        }
15895
15896        /// Sends the request.
15897        pub async fn send(self) -> Result<crate::model::ListIntentsResponse> {
15898            (*self.0.stub)
15899                .list_intents(self.0.request, self.0.options)
15900                .await
15901                .map(crate::Response::into_body)
15902        }
15903
15904        /// Streams each page in the collection.
15905        pub fn by_page(
15906            self,
15907        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIntentsResponse, crate::Error>
15908        {
15909            use std::clone::Clone;
15910            let token = self.0.request.page_token.clone();
15911            let execute = move |token: String| {
15912                let mut builder = self.clone();
15913                builder.0.request = builder.0.request.set_page_token(token);
15914                builder.send()
15915            };
15916            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15917        }
15918
15919        /// Streams each item in the collection.
15920        pub fn by_item(
15921            self,
15922        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15923            crate::model::ListIntentsResponse,
15924            crate::Error,
15925        > {
15926            use google_cloud_gax::paginator::Paginator;
15927            self.by_page().items()
15928        }
15929
15930        /// Sets the value of [parent][crate::model::ListIntentsRequest::parent].
15931        ///
15932        /// This is a **required** field for requests.
15933        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15934            self.0.request.parent = v.into();
15935            self
15936        }
15937
15938        /// Sets the value of [language_code][crate::model::ListIntentsRequest::language_code].
15939        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15940            self.0.request.language_code = v.into();
15941            self
15942        }
15943
15944        /// Sets the value of [intent_view][crate::model::ListIntentsRequest::intent_view].
15945        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15946            self.0.request.intent_view = v.into();
15947            self
15948        }
15949
15950        /// Sets the value of [page_size][crate::model::ListIntentsRequest::page_size].
15951        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15952            self.0.request.page_size = v.into();
15953            self
15954        }
15955
15956        /// Sets the value of [page_token][crate::model::ListIntentsRequest::page_token].
15957        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15958            self.0.request.page_token = v.into();
15959            self
15960        }
15961    }
15962
15963    #[doc(hidden)]
15964    impl crate::RequestBuilder for ListIntents {
15965        fn request_options(&mut self) -> &mut crate::RequestOptions {
15966            &mut self.0.options
15967        }
15968    }
15969
15970    /// The request builder for [Intents::get_intent][crate::client::Intents::get_intent] calls.
15971    ///
15972    /// # Example
15973    /// ```
15974    /// # use google_cloud_dialogflow_v2::builder::intents::GetIntent;
15975    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15976    ///
15977    /// let builder = prepare_request_builder();
15978    /// let response = builder.send().await?;
15979    /// # Ok(()) }
15980    ///
15981    /// fn prepare_request_builder() -> GetIntent {
15982    ///   # panic!();
15983    ///   // ... details omitted ...
15984    /// }
15985    /// ```
15986    #[derive(Clone, Debug)]
15987    pub struct GetIntent(RequestBuilder<crate::model::GetIntentRequest>);
15988
15989    impl GetIntent {
15990        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15991            Self(RequestBuilder::new(stub))
15992        }
15993
15994        /// Sets the full request, replacing any prior values.
15995        pub fn with_request<V: Into<crate::model::GetIntentRequest>>(mut self, v: V) -> Self {
15996            self.0.request = v.into();
15997            self
15998        }
15999
16000        /// Sets all the options, replacing any prior values.
16001        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16002            self.0.options = v.into();
16003            self
16004        }
16005
16006        /// Sends the request.
16007        pub async fn send(self) -> Result<crate::model::Intent> {
16008            (*self.0.stub)
16009                .get_intent(self.0.request, self.0.options)
16010                .await
16011                .map(crate::Response::into_body)
16012        }
16013
16014        /// Sets the value of [name][crate::model::GetIntentRequest::name].
16015        ///
16016        /// This is a **required** field for requests.
16017        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16018            self.0.request.name = v.into();
16019            self
16020        }
16021
16022        /// Sets the value of [language_code][crate::model::GetIntentRequest::language_code].
16023        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16024            self.0.request.language_code = v.into();
16025            self
16026        }
16027
16028        /// Sets the value of [intent_view][crate::model::GetIntentRequest::intent_view].
16029        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16030            self.0.request.intent_view = v.into();
16031            self
16032        }
16033    }
16034
16035    #[doc(hidden)]
16036    impl crate::RequestBuilder for GetIntent {
16037        fn request_options(&mut self) -> &mut crate::RequestOptions {
16038            &mut self.0.options
16039        }
16040    }
16041
16042    /// The request builder for [Intents::create_intent][crate::client::Intents::create_intent] calls.
16043    ///
16044    /// # Example
16045    /// ```
16046    /// # use google_cloud_dialogflow_v2::builder::intents::CreateIntent;
16047    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16048    ///
16049    /// let builder = prepare_request_builder();
16050    /// let response = builder.send().await?;
16051    /// # Ok(()) }
16052    ///
16053    /// fn prepare_request_builder() -> CreateIntent {
16054    ///   # panic!();
16055    ///   // ... details omitted ...
16056    /// }
16057    /// ```
16058    #[derive(Clone, Debug)]
16059    pub struct CreateIntent(RequestBuilder<crate::model::CreateIntentRequest>);
16060
16061    impl CreateIntent {
16062        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16063            Self(RequestBuilder::new(stub))
16064        }
16065
16066        /// Sets the full request, replacing any prior values.
16067        pub fn with_request<V: Into<crate::model::CreateIntentRequest>>(mut self, v: V) -> Self {
16068            self.0.request = v.into();
16069            self
16070        }
16071
16072        /// Sets all the options, replacing any prior values.
16073        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16074            self.0.options = v.into();
16075            self
16076        }
16077
16078        /// Sends the request.
16079        pub async fn send(self) -> Result<crate::model::Intent> {
16080            (*self.0.stub)
16081                .create_intent(self.0.request, self.0.options)
16082                .await
16083                .map(crate::Response::into_body)
16084        }
16085
16086        /// Sets the value of [parent][crate::model::CreateIntentRequest::parent].
16087        ///
16088        /// This is a **required** field for requests.
16089        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16090            self.0.request.parent = v.into();
16091            self
16092        }
16093
16094        /// Sets the value of [intent][crate::model::CreateIntentRequest::intent].
16095        ///
16096        /// This is a **required** field for requests.
16097        pub fn set_intent<T>(mut self, v: T) -> Self
16098        where
16099            T: std::convert::Into<crate::model::Intent>,
16100        {
16101            self.0.request.intent = std::option::Option::Some(v.into());
16102            self
16103        }
16104
16105        /// Sets or clears the value of [intent][crate::model::CreateIntentRequest::intent].
16106        ///
16107        /// This is a **required** field for requests.
16108        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
16109        where
16110            T: std::convert::Into<crate::model::Intent>,
16111        {
16112            self.0.request.intent = v.map(|x| x.into());
16113            self
16114        }
16115
16116        /// Sets the value of [language_code][crate::model::CreateIntentRequest::language_code].
16117        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16118            self.0.request.language_code = v.into();
16119            self
16120        }
16121
16122        /// Sets the value of [intent_view][crate::model::CreateIntentRequest::intent_view].
16123        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16124            self.0.request.intent_view = v.into();
16125            self
16126        }
16127    }
16128
16129    #[doc(hidden)]
16130    impl crate::RequestBuilder for CreateIntent {
16131        fn request_options(&mut self) -> &mut crate::RequestOptions {
16132            &mut self.0.options
16133        }
16134    }
16135
16136    /// The request builder for [Intents::update_intent][crate::client::Intents::update_intent] calls.
16137    ///
16138    /// # Example
16139    /// ```
16140    /// # use google_cloud_dialogflow_v2::builder::intents::UpdateIntent;
16141    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16142    ///
16143    /// let builder = prepare_request_builder();
16144    /// let response = builder.send().await?;
16145    /// # Ok(()) }
16146    ///
16147    /// fn prepare_request_builder() -> UpdateIntent {
16148    ///   # panic!();
16149    ///   // ... details omitted ...
16150    /// }
16151    /// ```
16152    #[derive(Clone, Debug)]
16153    pub struct UpdateIntent(RequestBuilder<crate::model::UpdateIntentRequest>);
16154
16155    impl UpdateIntent {
16156        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16157            Self(RequestBuilder::new(stub))
16158        }
16159
16160        /// Sets the full request, replacing any prior values.
16161        pub fn with_request<V: Into<crate::model::UpdateIntentRequest>>(mut self, v: V) -> Self {
16162            self.0.request = v.into();
16163            self
16164        }
16165
16166        /// Sets all the options, replacing any prior values.
16167        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16168            self.0.options = v.into();
16169            self
16170        }
16171
16172        /// Sends the request.
16173        pub async fn send(self) -> Result<crate::model::Intent> {
16174            (*self.0.stub)
16175                .update_intent(self.0.request, self.0.options)
16176                .await
16177                .map(crate::Response::into_body)
16178        }
16179
16180        /// Sets the value of [intent][crate::model::UpdateIntentRequest::intent].
16181        ///
16182        /// This is a **required** field for requests.
16183        pub fn set_intent<T>(mut self, v: T) -> Self
16184        where
16185            T: std::convert::Into<crate::model::Intent>,
16186        {
16187            self.0.request.intent = std::option::Option::Some(v.into());
16188            self
16189        }
16190
16191        /// Sets or clears the value of [intent][crate::model::UpdateIntentRequest::intent].
16192        ///
16193        /// This is a **required** field for requests.
16194        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
16195        where
16196            T: std::convert::Into<crate::model::Intent>,
16197        {
16198            self.0.request.intent = v.map(|x| x.into());
16199            self
16200        }
16201
16202        /// Sets the value of [language_code][crate::model::UpdateIntentRequest::language_code].
16203        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16204            self.0.request.language_code = v.into();
16205            self
16206        }
16207
16208        /// Sets the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
16209        pub fn set_update_mask<T>(mut self, v: T) -> Self
16210        where
16211            T: std::convert::Into<wkt::FieldMask>,
16212        {
16213            self.0.request.update_mask = std::option::Option::Some(v.into());
16214            self
16215        }
16216
16217        /// Sets or clears the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
16218        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16219        where
16220            T: std::convert::Into<wkt::FieldMask>,
16221        {
16222            self.0.request.update_mask = v.map(|x| x.into());
16223            self
16224        }
16225
16226        /// Sets the value of [intent_view][crate::model::UpdateIntentRequest::intent_view].
16227        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16228            self.0.request.intent_view = v.into();
16229            self
16230        }
16231    }
16232
16233    #[doc(hidden)]
16234    impl crate::RequestBuilder for UpdateIntent {
16235        fn request_options(&mut self) -> &mut crate::RequestOptions {
16236            &mut self.0.options
16237        }
16238    }
16239
16240    /// The request builder for [Intents::delete_intent][crate::client::Intents::delete_intent] calls.
16241    ///
16242    /// # Example
16243    /// ```
16244    /// # use google_cloud_dialogflow_v2::builder::intents::DeleteIntent;
16245    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16246    ///
16247    /// let builder = prepare_request_builder();
16248    /// let response = builder.send().await?;
16249    /// # Ok(()) }
16250    ///
16251    /// fn prepare_request_builder() -> DeleteIntent {
16252    ///   # panic!();
16253    ///   // ... details omitted ...
16254    /// }
16255    /// ```
16256    #[derive(Clone, Debug)]
16257    pub struct DeleteIntent(RequestBuilder<crate::model::DeleteIntentRequest>);
16258
16259    impl DeleteIntent {
16260        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16261            Self(RequestBuilder::new(stub))
16262        }
16263
16264        /// Sets the full request, replacing any prior values.
16265        pub fn with_request<V: Into<crate::model::DeleteIntentRequest>>(mut self, v: V) -> Self {
16266            self.0.request = v.into();
16267            self
16268        }
16269
16270        /// Sets all the options, replacing any prior values.
16271        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16272            self.0.options = v.into();
16273            self
16274        }
16275
16276        /// Sends the request.
16277        pub async fn send(self) -> Result<()> {
16278            (*self.0.stub)
16279                .delete_intent(self.0.request, self.0.options)
16280                .await
16281                .map(crate::Response::into_body)
16282        }
16283
16284        /// Sets the value of [name][crate::model::DeleteIntentRequest::name].
16285        ///
16286        /// This is a **required** field for requests.
16287        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16288            self.0.request.name = v.into();
16289            self
16290        }
16291    }
16292
16293    #[doc(hidden)]
16294    impl crate::RequestBuilder for DeleteIntent {
16295        fn request_options(&mut self) -> &mut crate::RequestOptions {
16296            &mut self.0.options
16297        }
16298    }
16299
16300    /// The request builder for [Intents::batch_update_intents][crate::client::Intents::batch_update_intents] calls.
16301    ///
16302    /// # Example
16303    /// ```
16304    /// # use google_cloud_dialogflow_v2::builder::intents::BatchUpdateIntents;
16305    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16306    /// use google_cloud_lro::Poller;
16307    ///
16308    /// let builder = prepare_request_builder();
16309    /// let response = builder.poller().until_done().await?;
16310    /// # Ok(()) }
16311    ///
16312    /// fn prepare_request_builder() -> BatchUpdateIntents {
16313    ///   # panic!();
16314    ///   // ... details omitted ...
16315    /// }
16316    /// ```
16317    #[derive(Clone, Debug)]
16318    pub struct BatchUpdateIntents(RequestBuilder<crate::model::BatchUpdateIntentsRequest>);
16319
16320    impl BatchUpdateIntents {
16321        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16322            Self(RequestBuilder::new(stub))
16323        }
16324
16325        /// Sets the full request, replacing any prior values.
16326        pub fn with_request<V: Into<crate::model::BatchUpdateIntentsRequest>>(
16327            mut self,
16328            v: V,
16329        ) -> Self {
16330            self.0.request = v.into();
16331            self
16332        }
16333
16334        /// Sets all the options, replacing any prior values.
16335        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16336            self.0.options = v.into();
16337            self
16338        }
16339
16340        /// Sends the request.
16341        ///
16342        /// # Long running operations
16343        ///
16344        /// This starts, but does not poll, a longrunning operation. More information
16345        /// on [batch_update_intents][crate::client::Intents::batch_update_intents].
16346        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16347            (*self.0.stub)
16348                .batch_update_intents(self.0.request, self.0.options)
16349                .await
16350                .map(crate::Response::into_body)
16351        }
16352
16353        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_intents`.
16354        pub fn poller(
16355            self,
16356        ) -> impl google_cloud_lro::Poller<crate::model::BatchUpdateIntentsResponse, wkt::Struct>
16357        {
16358            type Operation = google_cloud_lro::internal::Operation<
16359                crate::model::BatchUpdateIntentsResponse,
16360                wkt::Struct,
16361            >;
16362            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16363            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16364            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16365            if let Some(ref mut details) = poller_options.tracing {
16366                details.method_name =
16367                    "google_cloud_dialogflow_v2::client::Intents::batch_update_intents::until_done";
16368            }
16369
16370            let stub = self.0.stub.clone();
16371            let mut options = self.0.options.clone();
16372            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16373            let query = move |name| {
16374                let stub = stub.clone();
16375                let options = options.clone();
16376                async {
16377                    let op = GetOperation::new(stub)
16378                        .set_name(name)
16379                        .with_options(options)
16380                        .send()
16381                        .await?;
16382                    Ok(Operation::new(op))
16383                }
16384            };
16385
16386            let start = move || async {
16387                let op = self.send().await?;
16388                Ok(Operation::new(op))
16389            };
16390
16391            use google_cloud_lro::internal::PollerExt;
16392            {
16393                google_cloud_lro::internal::new_poller(
16394                    polling_error_policy,
16395                    polling_backoff_policy,
16396                    start,
16397                    query,
16398                )
16399            }
16400            .with_options(poller_options)
16401        }
16402
16403        /// Sets the value of [parent][crate::model::BatchUpdateIntentsRequest::parent].
16404        ///
16405        /// This is a **required** field for requests.
16406        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16407            self.0.request.parent = v.into();
16408            self
16409        }
16410
16411        /// Sets the value of [language_code][crate::model::BatchUpdateIntentsRequest::language_code].
16412        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16413            self.0.request.language_code = v.into();
16414            self
16415        }
16416
16417        /// Sets the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
16418        pub fn set_update_mask<T>(mut self, v: T) -> Self
16419        where
16420            T: std::convert::Into<wkt::FieldMask>,
16421        {
16422            self.0.request.update_mask = std::option::Option::Some(v.into());
16423            self
16424        }
16425
16426        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
16427        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16428        where
16429            T: std::convert::Into<wkt::FieldMask>,
16430        {
16431            self.0.request.update_mask = v.map(|x| x.into());
16432            self
16433        }
16434
16435        /// Sets the value of [intent_view][crate::model::BatchUpdateIntentsRequest::intent_view].
16436        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16437            self.0.request.intent_view = v.into();
16438            self
16439        }
16440
16441        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch].
16442        ///
16443        /// Note that all the setters affecting `intent_batch` are
16444        /// mutually exclusive.
16445        pub fn set_intent_batch<
16446            T: Into<Option<crate::model::batch_update_intents_request::IntentBatch>>,
16447        >(
16448            mut self,
16449            v: T,
16450        ) -> Self {
16451            self.0.request.intent_batch = v.into();
16452            self
16453        }
16454
16455        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
16456        /// to hold a `IntentBatchUri`.
16457        ///
16458        /// Note that all the setters affecting `intent_batch` are
16459        /// mutually exclusive.
16460        pub fn set_intent_batch_uri<T: std::convert::Into<std::string::String>>(
16461            mut self,
16462            v: T,
16463        ) -> Self {
16464            self.0.request = self.0.request.set_intent_batch_uri(v);
16465            self
16466        }
16467
16468        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
16469        /// to hold a `IntentBatchInline`.
16470        ///
16471        /// Note that all the setters affecting `intent_batch` are
16472        /// mutually exclusive.
16473        pub fn set_intent_batch_inline<
16474            T: std::convert::Into<std::boxed::Box<crate::model::IntentBatch>>,
16475        >(
16476            mut self,
16477            v: T,
16478        ) -> Self {
16479            self.0.request = self.0.request.set_intent_batch_inline(v);
16480            self
16481        }
16482    }
16483
16484    #[doc(hidden)]
16485    impl crate::RequestBuilder for BatchUpdateIntents {
16486        fn request_options(&mut self) -> &mut crate::RequestOptions {
16487            &mut self.0.options
16488        }
16489    }
16490
16491    /// The request builder for [Intents::batch_delete_intents][crate::client::Intents::batch_delete_intents] calls.
16492    ///
16493    /// # Example
16494    /// ```
16495    /// # use google_cloud_dialogflow_v2::builder::intents::BatchDeleteIntents;
16496    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16497    /// use google_cloud_lro::Poller;
16498    ///
16499    /// let builder = prepare_request_builder();
16500    /// let response = builder.poller().until_done().await?;
16501    /// # Ok(()) }
16502    ///
16503    /// fn prepare_request_builder() -> BatchDeleteIntents {
16504    ///   # panic!();
16505    ///   // ... details omitted ...
16506    /// }
16507    /// ```
16508    #[derive(Clone, Debug)]
16509    pub struct BatchDeleteIntents(RequestBuilder<crate::model::BatchDeleteIntentsRequest>);
16510
16511    impl BatchDeleteIntents {
16512        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16513            Self(RequestBuilder::new(stub))
16514        }
16515
16516        /// Sets the full request, replacing any prior values.
16517        pub fn with_request<V: Into<crate::model::BatchDeleteIntentsRequest>>(
16518            mut self,
16519            v: V,
16520        ) -> Self {
16521            self.0.request = v.into();
16522            self
16523        }
16524
16525        /// Sets all the options, replacing any prior values.
16526        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16527            self.0.options = v.into();
16528            self
16529        }
16530
16531        /// Sends the request.
16532        ///
16533        /// # Long running operations
16534        ///
16535        /// This starts, but does not poll, a longrunning operation. More information
16536        /// on [batch_delete_intents][crate::client::Intents::batch_delete_intents].
16537        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16538            (*self.0.stub)
16539                .batch_delete_intents(self.0.request, self.0.options)
16540                .await
16541                .map(crate::Response::into_body)
16542        }
16543
16544        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_intents`.
16545        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
16546            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
16547            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16548            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16549            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16550            if let Some(ref mut details) = poller_options.tracing {
16551                details.method_name =
16552                    "google_cloud_dialogflow_v2::client::Intents::batch_delete_intents::until_done";
16553            }
16554
16555            let stub = self.0.stub.clone();
16556            let mut options = self.0.options.clone();
16557            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16558            let query = move |name| {
16559                let stub = stub.clone();
16560                let options = options.clone();
16561                async {
16562                    let op = GetOperation::new(stub)
16563                        .set_name(name)
16564                        .with_options(options)
16565                        .send()
16566                        .await?;
16567                    Ok(Operation::new(op))
16568                }
16569            };
16570
16571            let start = move || async {
16572                let op = self.send().await?;
16573                Ok(Operation::new(op))
16574            };
16575
16576            use google_cloud_lro::internal::PollerExt;
16577            {
16578                google_cloud_lro::internal::new_unit_response_poller(
16579                    polling_error_policy,
16580                    polling_backoff_policy,
16581                    start,
16582                    query,
16583                )
16584            }
16585            .with_options(poller_options)
16586        }
16587
16588        /// Sets the value of [parent][crate::model::BatchDeleteIntentsRequest::parent].
16589        ///
16590        /// This is a **required** field for requests.
16591        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16592            self.0.request.parent = v.into();
16593            self
16594        }
16595
16596        /// Sets the value of [intents][crate::model::BatchDeleteIntentsRequest::intents].
16597        ///
16598        /// This is a **required** field for requests.
16599        pub fn set_intents<T, V>(mut self, v: T) -> Self
16600        where
16601            T: std::iter::IntoIterator<Item = V>,
16602            V: std::convert::Into<crate::model::Intent>,
16603        {
16604            use std::iter::Iterator;
16605            self.0.request.intents = v.into_iter().map(|i| i.into()).collect();
16606            self
16607        }
16608    }
16609
16610    #[doc(hidden)]
16611    impl crate::RequestBuilder for BatchDeleteIntents {
16612        fn request_options(&mut self) -> &mut crate::RequestOptions {
16613            &mut self.0.options
16614        }
16615    }
16616
16617    /// The request builder for [Intents::list_locations][crate::client::Intents::list_locations] calls.
16618    ///
16619    /// # Example
16620    /// ```
16621    /// # use google_cloud_dialogflow_v2::builder::intents::ListLocations;
16622    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16623    /// use google_cloud_gax::paginator::ItemPaginator;
16624    ///
16625    /// let builder = prepare_request_builder();
16626    /// let mut items = builder.by_item();
16627    /// while let Some(result) = items.next().await {
16628    ///   let item = result?;
16629    /// }
16630    /// # Ok(()) }
16631    ///
16632    /// fn prepare_request_builder() -> ListLocations {
16633    ///   # panic!();
16634    ///   // ... details omitted ...
16635    /// }
16636    /// ```
16637    #[derive(Clone, Debug)]
16638    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
16639
16640    impl ListLocations {
16641        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16642            Self(RequestBuilder::new(stub))
16643        }
16644
16645        /// Sets the full request, replacing any prior values.
16646        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
16647            mut self,
16648            v: V,
16649        ) -> Self {
16650            self.0.request = v.into();
16651            self
16652        }
16653
16654        /// Sets all the options, replacing any prior values.
16655        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16656            self.0.options = v.into();
16657            self
16658        }
16659
16660        /// Sends the request.
16661        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
16662            (*self.0.stub)
16663                .list_locations(self.0.request, self.0.options)
16664                .await
16665                .map(crate::Response::into_body)
16666        }
16667
16668        /// Streams each page in the collection.
16669        pub fn by_page(
16670            self,
16671        ) -> impl google_cloud_gax::paginator::Paginator<
16672            google_cloud_location::model::ListLocationsResponse,
16673            crate::Error,
16674        > {
16675            use std::clone::Clone;
16676            let token = self.0.request.page_token.clone();
16677            let execute = move |token: String| {
16678                let mut builder = self.clone();
16679                builder.0.request = builder.0.request.set_page_token(token);
16680                builder.send()
16681            };
16682            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16683        }
16684
16685        /// Streams each item in the collection.
16686        pub fn by_item(
16687            self,
16688        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16689            google_cloud_location::model::ListLocationsResponse,
16690            crate::Error,
16691        > {
16692            use google_cloud_gax::paginator::Paginator;
16693            self.by_page().items()
16694        }
16695
16696        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
16697        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16698            self.0.request.name = v.into();
16699            self
16700        }
16701
16702        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
16703        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16704            self.0.request.filter = v.into();
16705            self
16706        }
16707
16708        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
16709        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16710            self.0.request.page_size = v.into();
16711            self
16712        }
16713
16714        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
16715        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16716            self.0.request.page_token = v.into();
16717            self
16718        }
16719    }
16720
16721    #[doc(hidden)]
16722    impl crate::RequestBuilder for ListLocations {
16723        fn request_options(&mut self) -> &mut crate::RequestOptions {
16724            &mut self.0.options
16725        }
16726    }
16727
16728    /// The request builder for [Intents::get_location][crate::client::Intents::get_location] calls.
16729    ///
16730    /// # Example
16731    /// ```
16732    /// # use google_cloud_dialogflow_v2::builder::intents::GetLocation;
16733    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16734    ///
16735    /// let builder = prepare_request_builder();
16736    /// let response = builder.send().await?;
16737    /// # Ok(()) }
16738    ///
16739    /// fn prepare_request_builder() -> GetLocation {
16740    ///   # panic!();
16741    ///   // ... details omitted ...
16742    /// }
16743    /// ```
16744    #[derive(Clone, Debug)]
16745    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
16746
16747    impl GetLocation {
16748        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16749            Self(RequestBuilder::new(stub))
16750        }
16751
16752        /// Sets the full request, replacing any prior values.
16753        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
16754            mut self,
16755            v: V,
16756        ) -> Self {
16757            self.0.request = v.into();
16758            self
16759        }
16760
16761        /// Sets all the options, replacing any prior values.
16762        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16763            self.0.options = v.into();
16764            self
16765        }
16766
16767        /// Sends the request.
16768        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
16769            (*self.0.stub)
16770                .get_location(self.0.request, self.0.options)
16771                .await
16772                .map(crate::Response::into_body)
16773        }
16774
16775        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
16776        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16777            self.0.request.name = v.into();
16778            self
16779        }
16780    }
16781
16782    #[doc(hidden)]
16783    impl crate::RequestBuilder for GetLocation {
16784        fn request_options(&mut self) -> &mut crate::RequestOptions {
16785            &mut self.0.options
16786        }
16787    }
16788
16789    /// The request builder for [Intents::list_operations][crate::client::Intents::list_operations] calls.
16790    ///
16791    /// # Example
16792    /// ```
16793    /// # use google_cloud_dialogflow_v2::builder::intents::ListOperations;
16794    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16795    /// use google_cloud_gax::paginator::ItemPaginator;
16796    ///
16797    /// let builder = prepare_request_builder();
16798    /// let mut items = builder.by_item();
16799    /// while let Some(result) = items.next().await {
16800    ///   let item = result?;
16801    /// }
16802    /// # Ok(()) }
16803    ///
16804    /// fn prepare_request_builder() -> ListOperations {
16805    ///   # panic!();
16806    ///   // ... details omitted ...
16807    /// }
16808    /// ```
16809    #[derive(Clone, Debug)]
16810    pub struct ListOperations(
16811        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
16812    );
16813
16814    impl ListOperations {
16815        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16816            Self(RequestBuilder::new(stub))
16817        }
16818
16819        /// Sets the full request, replacing any prior values.
16820        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
16821            mut self,
16822            v: V,
16823        ) -> Self {
16824            self.0.request = v.into();
16825            self
16826        }
16827
16828        /// Sets all the options, replacing any prior values.
16829        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16830            self.0.options = v.into();
16831            self
16832        }
16833
16834        /// Sends the request.
16835        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
16836            (*self.0.stub)
16837                .list_operations(self.0.request, self.0.options)
16838                .await
16839                .map(crate::Response::into_body)
16840        }
16841
16842        /// Streams each page in the collection.
16843        pub fn by_page(
16844            self,
16845        ) -> impl google_cloud_gax::paginator::Paginator<
16846            google_cloud_longrunning::model::ListOperationsResponse,
16847            crate::Error,
16848        > {
16849            use std::clone::Clone;
16850            let token = self.0.request.page_token.clone();
16851            let execute = move |token: String| {
16852                let mut builder = self.clone();
16853                builder.0.request = builder.0.request.set_page_token(token);
16854                builder.send()
16855            };
16856            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16857        }
16858
16859        /// Streams each item in the collection.
16860        pub fn by_item(
16861            self,
16862        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16863            google_cloud_longrunning::model::ListOperationsResponse,
16864            crate::Error,
16865        > {
16866            use google_cloud_gax::paginator::Paginator;
16867            self.by_page().items()
16868        }
16869
16870        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
16871        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16872            self.0.request.name = v.into();
16873            self
16874        }
16875
16876        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
16877        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16878            self.0.request.filter = v.into();
16879            self
16880        }
16881
16882        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
16883        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16884            self.0.request.page_size = v.into();
16885            self
16886        }
16887
16888        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
16889        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16890            self.0.request.page_token = v.into();
16891            self
16892        }
16893
16894        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
16895        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16896            self.0.request.return_partial_success = v.into();
16897            self
16898        }
16899    }
16900
16901    #[doc(hidden)]
16902    impl crate::RequestBuilder for ListOperations {
16903        fn request_options(&mut self) -> &mut crate::RequestOptions {
16904            &mut self.0.options
16905        }
16906    }
16907
16908    /// The request builder for [Intents::get_operation][crate::client::Intents::get_operation] calls.
16909    ///
16910    /// # Example
16911    /// ```
16912    /// # use google_cloud_dialogflow_v2::builder::intents::GetOperation;
16913    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16914    ///
16915    /// let builder = prepare_request_builder();
16916    /// let response = builder.send().await?;
16917    /// # Ok(()) }
16918    ///
16919    /// fn prepare_request_builder() -> GetOperation {
16920    ///   # panic!();
16921    ///   // ... details omitted ...
16922    /// }
16923    /// ```
16924    #[derive(Clone, Debug)]
16925    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
16926
16927    impl GetOperation {
16928        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16929            Self(RequestBuilder::new(stub))
16930        }
16931
16932        /// Sets the full request, replacing any prior values.
16933        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
16934            mut self,
16935            v: V,
16936        ) -> Self {
16937            self.0.request = v.into();
16938            self
16939        }
16940
16941        /// Sets all the options, replacing any prior values.
16942        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16943            self.0.options = v.into();
16944            self
16945        }
16946
16947        /// Sends the request.
16948        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16949            (*self.0.stub)
16950                .get_operation(self.0.request, self.0.options)
16951                .await
16952                .map(crate::Response::into_body)
16953        }
16954
16955        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
16956        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16957            self.0.request.name = v.into();
16958            self
16959        }
16960    }
16961
16962    #[doc(hidden)]
16963    impl crate::RequestBuilder for GetOperation {
16964        fn request_options(&mut self) -> &mut crate::RequestOptions {
16965            &mut self.0.options
16966        }
16967    }
16968
16969    /// The request builder for [Intents::cancel_operation][crate::client::Intents::cancel_operation] calls.
16970    ///
16971    /// # Example
16972    /// ```
16973    /// # use google_cloud_dialogflow_v2::builder::intents::CancelOperation;
16974    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16975    ///
16976    /// let builder = prepare_request_builder();
16977    /// let response = builder.send().await?;
16978    /// # Ok(()) }
16979    ///
16980    /// fn prepare_request_builder() -> CancelOperation {
16981    ///   # panic!();
16982    ///   // ... details omitted ...
16983    /// }
16984    /// ```
16985    #[derive(Clone, Debug)]
16986    pub struct CancelOperation(
16987        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
16988    );
16989
16990    impl CancelOperation {
16991        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16992            Self(RequestBuilder::new(stub))
16993        }
16994
16995        /// Sets the full request, replacing any prior values.
16996        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
16997            mut self,
16998            v: V,
16999        ) -> Self {
17000            self.0.request = v.into();
17001            self
17002        }
17003
17004        /// Sets all the options, replacing any prior values.
17005        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17006            self.0.options = v.into();
17007            self
17008        }
17009
17010        /// Sends the request.
17011        pub async fn send(self) -> Result<()> {
17012            (*self.0.stub)
17013                .cancel_operation(self.0.request, self.0.options)
17014                .await
17015                .map(crate::Response::into_body)
17016        }
17017
17018        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
17019        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17020            self.0.request.name = v.into();
17021            self
17022        }
17023    }
17024
17025    #[doc(hidden)]
17026    impl crate::RequestBuilder for CancelOperation {
17027        fn request_options(&mut self) -> &mut crate::RequestOptions {
17028            &mut self.0.options
17029        }
17030    }
17031}
17032
17033/// Request and client builders for [KnowledgeBases][crate::client::KnowledgeBases].
17034#[cfg(feature = "knowledge-bases")]
17035#[cfg_attr(docsrs, doc(cfg(feature = "knowledge-bases")))]
17036pub mod knowledge_bases {
17037    use crate::Result;
17038
17039    /// A builder for [KnowledgeBases][crate::client::KnowledgeBases].
17040    ///
17041    /// ```
17042    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17043    /// # use google_cloud_dialogflow_v2::*;
17044    /// # use builder::knowledge_bases::ClientBuilder;
17045    /// # use client::KnowledgeBases;
17046    /// let builder : ClientBuilder = KnowledgeBases::builder();
17047    /// let client = builder
17048    ///     .with_endpoint("https://dialogflow.googleapis.com")
17049    ///     .build().await?;
17050    /// # Ok(()) }
17051    /// ```
17052    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17053
17054    pub(crate) mod client {
17055        use super::super::super::client::KnowledgeBases;
17056        pub struct Factory;
17057        impl crate::ClientFactory for Factory {
17058            type Client = KnowledgeBases;
17059            type Credentials = gaxi::options::Credentials;
17060            async fn build(
17061                self,
17062                config: gaxi::options::ClientConfig,
17063            ) -> crate::ClientBuilderResult<Self::Client> {
17064                Self::Client::new(config).await
17065            }
17066        }
17067    }
17068
17069    /// Common implementation for [crate::client::KnowledgeBases] request builders.
17070    #[derive(Clone, Debug)]
17071    pub(crate) struct RequestBuilder<R: std::default::Default> {
17072        stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17073        request: R,
17074        options: crate::RequestOptions,
17075    }
17076
17077    impl<R> RequestBuilder<R>
17078    where
17079        R: std::default::Default,
17080    {
17081        pub(crate) fn new(
17082            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17083        ) -> Self {
17084            Self {
17085                stub,
17086                request: R::default(),
17087                options: crate::RequestOptions::default(),
17088            }
17089        }
17090    }
17091
17092    /// The request builder for [KnowledgeBases::list_knowledge_bases][crate::client::KnowledgeBases::list_knowledge_bases] calls.
17093    ///
17094    /// # Example
17095    /// ```
17096    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListKnowledgeBases;
17097    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17098    /// use google_cloud_gax::paginator::ItemPaginator;
17099    ///
17100    /// let builder = prepare_request_builder();
17101    /// let mut items = builder.by_item();
17102    /// while let Some(result) = items.next().await {
17103    ///   let item = result?;
17104    /// }
17105    /// # Ok(()) }
17106    ///
17107    /// fn prepare_request_builder() -> ListKnowledgeBases {
17108    ///   # panic!();
17109    ///   // ... details omitted ...
17110    /// }
17111    /// ```
17112    #[derive(Clone, Debug)]
17113    pub struct ListKnowledgeBases(RequestBuilder<crate::model::ListKnowledgeBasesRequest>);
17114
17115    impl ListKnowledgeBases {
17116        pub(crate) fn new(
17117            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17118        ) -> Self {
17119            Self(RequestBuilder::new(stub))
17120        }
17121
17122        /// Sets the full request, replacing any prior values.
17123        pub fn with_request<V: Into<crate::model::ListKnowledgeBasesRequest>>(
17124            mut self,
17125            v: V,
17126        ) -> Self {
17127            self.0.request = v.into();
17128            self
17129        }
17130
17131        /// Sets all the options, replacing any prior values.
17132        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17133            self.0.options = v.into();
17134            self
17135        }
17136
17137        /// Sends the request.
17138        pub async fn send(self) -> Result<crate::model::ListKnowledgeBasesResponse> {
17139            (*self.0.stub)
17140                .list_knowledge_bases(self.0.request, self.0.options)
17141                .await
17142                .map(crate::Response::into_body)
17143        }
17144
17145        /// Streams each page in the collection.
17146        pub fn by_page(
17147            self,
17148        ) -> impl google_cloud_gax::paginator::Paginator<
17149            crate::model::ListKnowledgeBasesResponse,
17150            crate::Error,
17151        > {
17152            use std::clone::Clone;
17153            let token = self.0.request.page_token.clone();
17154            let execute = move |token: String| {
17155                let mut builder = self.clone();
17156                builder.0.request = builder.0.request.set_page_token(token);
17157                builder.send()
17158            };
17159            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17160        }
17161
17162        /// Streams each item in the collection.
17163        pub fn by_item(
17164            self,
17165        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17166            crate::model::ListKnowledgeBasesResponse,
17167            crate::Error,
17168        > {
17169            use google_cloud_gax::paginator::Paginator;
17170            self.by_page().items()
17171        }
17172
17173        /// Sets the value of [parent][crate::model::ListKnowledgeBasesRequest::parent].
17174        ///
17175        /// This is a **required** field for requests.
17176        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17177            self.0.request.parent = v.into();
17178            self
17179        }
17180
17181        /// Sets the value of [page_size][crate::model::ListKnowledgeBasesRequest::page_size].
17182        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17183            self.0.request.page_size = v.into();
17184            self
17185        }
17186
17187        /// Sets the value of [page_token][crate::model::ListKnowledgeBasesRequest::page_token].
17188        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17189            self.0.request.page_token = v.into();
17190            self
17191        }
17192
17193        /// Sets the value of [filter][crate::model::ListKnowledgeBasesRequest::filter].
17194        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17195            self.0.request.filter = v.into();
17196            self
17197        }
17198    }
17199
17200    #[doc(hidden)]
17201    impl crate::RequestBuilder for ListKnowledgeBases {
17202        fn request_options(&mut self) -> &mut crate::RequestOptions {
17203            &mut self.0.options
17204        }
17205    }
17206
17207    /// The request builder for [KnowledgeBases::get_knowledge_base][crate::client::KnowledgeBases::get_knowledge_base] calls.
17208    ///
17209    /// # Example
17210    /// ```
17211    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetKnowledgeBase;
17212    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17213    ///
17214    /// let builder = prepare_request_builder();
17215    /// let response = builder.send().await?;
17216    /// # Ok(()) }
17217    ///
17218    /// fn prepare_request_builder() -> GetKnowledgeBase {
17219    ///   # panic!();
17220    ///   // ... details omitted ...
17221    /// }
17222    /// ```
17223    #[derive(Clone, Debug)]
17224    pub struct GetKnowledgeBase(RequestBuilder<crate::model::GetKnowledgeBaseRequest>);
17225
17226    impl GetKnowledgeBase {
17227        pub(crate) fn new(
17228            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17229        ) -> Self {
17230            Self(RequestBuilder::new(stub))
17231        }
17232
17233        /// Sets the full request, replacing any prior values.
17234        pub fn with_request<V: Into<crate::model::GetKnowledgeBaseRequest>>(
17235            mut self,
17236            v: V,
17237        ) -> Self {
17238            self.0.request = v.into();
17239            self
17240        }
17241
17242        /// Sets all the options, replacing any prior values.
17243        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17244            self.0.options = v.into();
17245            self
17246        }
17247
17248        /// Sends the request.
17249        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17250            (*self.0.stub)
17251                .get_knowledge_base(self.0.request, self.0.options)
17252                .await
17253                .map(crate::Response::into_body)
17254        }
17255
17256        /// Sets the value of [name][crate::model::GetKnowledgeBaseRequest::name].
17257        ///
17258        /// This is a **required** field for requests.
17259        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17260            self.0.request.name = v.into();
17261            self
17262        }
17263    }
17264
17265    #[doc(hidden)]
17266    impl crate::RequestBuilder for GetKnowledgeBase {
17267        fn request_options(&mut self) -> &mut crate::RequestOptions {
17268            &mut self.0.options
17269        }
17270    }
17271
17272    /// The request builder for [KnowledgeBases::create_knowledge_base][crate::client::KnowledgeBases::create_knowledge_base] calls.
17273    ///
17274    /// # Example
17275    /// ```
17276    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::CreateKnowledgeBase;
17277    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17278    ///
17279    /// let builder = prepare_request_builder();
17280    /// let response = builder.send().await?;
17281    /// # Ok(()) }
17282    ///
17283    /// fn prepare_request_builder() -> CreateKnowledgeBase {
17284    ///   # panic!();
17285    ///   // ... details omitted ...
17286    /// }
17287    /// ```
17288    #[derive(Clone, Debug)]
17289    pub struct CreateKnowledgeBase(RequestBuilder<crate::model::CreateKnowledgeBaseRequest>);
17290
17291    impl CreateKnowledgeBase {
17292        pub(crate) fn new(
17293            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17294        ) -> Self {
17295            Self(RequestBuilder::new(stub))
17296        }
17297
17298        /// Sets the full request, replacing any prior values.
17299        pub fn with_request<V: Into<crate::model::CreateKnowledgeBaseRequest>>(
17300            mut self,
17301            v: V,
17302        ) -> Self {
17303            self.0.request = v.into();
17304            self
17305        }
17306
17307        /// Sets all the options, replacing any prior values.
17308        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17309            self.0.options = v.into();
17310            self
17311        }
17312
17313        /// Sends the request.
17314        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17315            (*self.0.stub)
17316                .create_knowledge_base(self.0.request, self.0.options)
17317                .await
17318                .map(crate::Response::into_body)
17319        }
17320
17321        /// Sets the value of [parent][crate::model::CreateKnowledgeBaseRequest::parent].
17322        ///
17323        /// This is a **required** field for requests.
17324        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17325            self.0.request.parent = v.into();
17326            self
17327        }
17328
17329        /// Sets the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
17330        ///
17331        /// This is a **required** field for requests.
17332        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
17333        where
17334            T: std::convert::Into<crate::model::KnowledgeBase>,
17335        {
17336            self.0.request.knowledge_base = std::option::Option::Some(v.into());
17337            self
17338        }
17339
17340        /// Sets or clears the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
17341        ///
17342        /// This is a **required** field for requests.
17343        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
17344        where
17345            T: std::convert::Into<crate::model::KnowledgeBase>,
17346        {
17347            self.0.request.knowledge_base = v.map(|x| x.into());
17348            self
17349        }
17350    }
17351
17352    #[doc(hidden)]
17353    impl crate::RequestBuilder for CreateKnowledgeBase {
17354        fn request_options(&mut self) -> &mut crate::RequestOptions {
17355            &mut self.0.options
17356        }
17357    }
17358
17359    /// The request builder for [KnowledgeBases::delete_knowledge_base][crate::client::KnowledgeBases::delete_knowledge_base] calls.
17360    ///
17361    /// # Example
17362    /// ```
17363    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::DeleteKnowledgeBase;
17364    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17365    ///
17366    /// let builder = prepare_request_builder();
17367    /// let response = builder.send().await?;
17368    /// # Ok(()) }
17369    ///
17370    /// fn prepare_request_builder() -> DeleteKnowledgeBase {
17371    ///   # panic!();
17372    ///   // ... details omitted ...
17373    /// }
17374    /// ```
17375    #[derive(Clone, Debug)]
17376    pub struct DeleteKnowledgeBase(RequestBuilder<crate::model::DeleteKnowledgeBaseRequest>);
17377
17378    impl DeleteKnowledgeBase {
17379        pub(crate) fn new(
17380            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17381        ) -> Self {
17382            Self(RequestBuilder::new(stub))
17383        }
17384
17385        /// Sets the full request, replacing any prior values.
17386        pub fn with_request<V: Into<crate::model::DeleteKnowledgeBaseRequest>>(
17387            mut self,
17388            v: V,
17389        ) -> Self {
17390            self.0.request = v.into();
17391            self
17392        }
17393
17394        /// Sets all the options, replacing any prior values.
17395        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17396            self.0.options = v.into();
17397            self
17398        }
17399
17400        /// Sends the request.
17401        pub async fn send(self) -> Result<()> {
17402            (*self.0.stub)
17403                .delete_knowledge_base(self.0.request, self.0.options)
17404                .await
17405                .map(crate::Response::into_body)
17406        }
17407
17408        /// Sets the value of [name][crate::model::DeleteKnowledgeBaseRequest::name].
17409        ///
17410        /// This is a **required** field for requests.
17411        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17412            self.0.request.name = v.into();
17413            self
17414        }
17415
17416        /// Sets the value of [force][crate::model::DeleteKnowledgeBaseRequest::force].
17417        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
17418            self.0.request.force = v.into();
17419            self
17420        }
17421    }
17422
17423    #[doc(hidden)]
17424    impl crate::RequestBuilder for DeleteKnowledgeBase {
17425        fn request_options(&mut self) -> &mut crate::RequestOptions {
17426            &mut self.0.options
17427        }
17428    }
17429
17430    /// The request builder for [KnowledgeBases::update_knowledge_base][crate::client::KnowledgeBases::update_knowledge_base] calls.
17431    ///
17432    /// # Example
17433    /// ```
17434    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::UpdateKnowledgeBase;
17435    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17436    ///
17437    /// let builder = prepare_request_builder();
17438    /// let response = builder.send().await?;
17439    /// # Ok(()) }
17440    ///
17441    /// fn prepare_request_builder() -> UpdateKnowledgeBase {
17442    ///   # panic!();
17443    ///   // ... details omitted ...
17444    /// }
17445    /// ```
17446    #[derive(Clone, Debug)]
17447    pub struct UpdateKnowledgeBase(RequestBuilder<crate::model::UpdateKnowledgeBaseRequest>);
17448
17449    impl UpdateKnowledgeBase {
17450        pub(crate) fn new(
17451            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17452        ) -> Self {
17453            Self(RequestBuilder::new(stub))
17454        }
17455
17456        /// Sets the full request, replacing any prior values.
17457        pub fn with_request<V: Into<crate::model::UpdateKnowledgeBaseRequest>>(
17458            mut self,
17459            v: V,
17460        ) -> Self {
17461            self.0.request = v.into();
17462            self
17463        }
17464
17465        /// Sets all the options, replacing any prior values.
17466        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17467            self.0.options = v.into();
17468            self
17469        }
17470
17471        /// Sends the request.
17472        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17473            (*self.0.stub)
17474                .update_knowledge_base(self.0.request, self.0.options)
17475                .await
17476                .map(crate::Response::into_body)
17477        }
17478
17479        /// Sets the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
17480        ///
17481        /// This is a **required** field for requests.
17482        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
17483        where
17484            T: std::convert::Into<crate::model::KnowledgeBase>,
17485        {
17486            self.0.request.knowledge_base = std::option::Option::Some(v.into());
17487            self
17488        }
17489
17490        /// Sets or clears the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
17491        ///
17492        /// This is a **required** field for requests.
17493        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
17494        where
17495            T: std::convert::Into<crate::model::KnowledgeBase>,
17496        {
17497            self.0.request.knowledge_base = v.map(|x| x.into());
17498            self
17499        }
17500
17501        /// Sets the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
17502        pub fn set_update_mask<T>(mut self, v: T) -> Self
17503        where
17504            T: std::convert::Into<wkt::FieldMask>,
17505        {
17506            self.0.request.update_mask = std::option::Option::Some(v.into());
17507            self
17508        }
17509
17510        /// Sets or clears the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
17511        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17512        where
17513            T: std::convert::Into<wkt::FieldMask>,
17514        {
17515            self.0.request.update_mask = v.map(|x| x.into());
17516            self
17517        }
17518    }
17519
17520    #[doc(hidden)]
17521    impl crate::RequestBuilder for UpdateKnowledgeBase {
17522        fn request_options(&mut self) -> &mut crate::RequestOptions {
17523            &mut self.0.options
17524        }
17525    }
17526
17527    /// The request builder for [KnowledgeBases::list_locations][crate::client::KnowledgeBases::list_locations] calls.
17528    ///
17529    /// # Example
17530    /// ```
17531    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListLocations;
17532    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17533    /// use google_cloud_gax::paginator::ItemPaginator;
17534    ///
17535    /// let builder = prepare_request_builder();
17536    /// let mut items = builder.by_item();
17537    /// while let Some(result) = items.next().await {
17538    ///   let item = result?;
17539    /// }
17540    /// # Ok(()) }
17541    ///
17542    /// fn prepare_request_builder() -> ListLocations {
17543    ///   # panic!();
17544    ///   // ... details omitted ...
17545    /// }
17546    /// ```
17547    #[derive(Clone, Debug)]
17548    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
17549
17550    impl ListLocations {
17551        pub(crate) fn new(
17552            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17553        ) -> Self {
17554            Self(RequestBuilder::new(stub))
17555        }
17556
17557        /// Sets the full request, replacing any prior values.
17558        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
17559            mut self,
17560            v: V,
17561        ) -> Self {
17562            self.0.request = v.into();
17563            self
17564        }
17565
17566        /// Sets all the options, replacing any prior values.
17567        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17568            self.0.options = v.into();
17569            self
17570        }
17571
17572        /// Sends the request.
17573        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
17574            (*self.0.stub)
17575                .list_locations(self.0.request, self.0.options)
17576                .await
17577                .map(crate::Response::into_body)
17578        }
17579
17580        /// Streams each page in the collection.
17581        pub fn by_page(
17582            self,
17583        ) -> impl google_cloud_gax::paginator::Paginator<
17584            google_cloud_location::model::ListLocationsResponse,
17585            crate::Error,
17586        > {
17587            use std::clone::Clone;
17588            let token = self.0.request.page_token.clone();
17589            let execute = move |token: String| {
17590                let mut builder = self.clone();
17591                builder.0.request = builder.0.request.set_page_token(token);
17592                builder.send()
17593            };
17594            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17595        }
17596
17597        /// Streams each item in the collection.
17598        pub fn by_item(
17599            self,
17600        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17601            google_cloud_location::model::ListLocationsResponse,
17602            crate::Error,
17603        > {
17604            use google_cloud_gax::paginator::Paginator;
17605            self.by_page().items()
17606        }
17607
17608        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
17609        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17610            self.0.request.name = v.into();
17611            self
17612        }
17613
17614        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
17615        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17616            self.0.request.filter = v.into();
17617            self
17618        }
17619
17620        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
17621        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17622            self.0.request.page_size = v.into();
17623            self
17624        }
17625
17626        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
17627        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17628            self.0.request.page_token = v.into();
17629            self
17630        }
17631    }
17632
17633    #[doc(hidden)]
17634    impl crate::RequestBuilder for ListLocations {
17635        fn request_options(&mut self) -> &mut crate::RequestOptions {
17636            &mut self.0.options
17637        }
17638    }
17639
17640    /// The request builder for [KnowledgeBases::get_location][crate::client::KnowledgeBases::get_location] calls.
17641    ///
17642    /// # Example
17643    /// ```
17644    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetLocation;
17645    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17646    ///
17647    /// let builder = prepare_request_builder();
17648    /// let response = builder.send().await?;
17649    /// # Ok(()) }
17650    ///
17651    /// fn prepare_request_builder() -> GetLocation {
17652    ///   # panic!();
17653    ///   // ... details omitted ...
17654    /// }
17655    /// ```
17656    #[derive(Clone, Debug)]
17657    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
17658
17659    impl GetLocation {
17660        pub(crate) fn new(
17661            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17662        ) -> Self {
17663            Self(RequestBuilder::new(stub))
17664        }
17665
17666        /// Sets the full request, replacing any prior values.
17667        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
17668            mut self,
17669            v: V,
17670        ) -> Self {
17671            self.0.request = v.into();
17672            self
17673        }
17674
17675        /// Sets all the options, replacing any prior values.
17676        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17677            self.0.options = v.into();
17678            self
17679        }
17680
17681        /// Sends the request.
17682        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
17683            (*self.0.stub)
17684                .get_location(self.0.request, self.0.options)
17685                .await
17686                .map(crate::Response::into_body)
17687        }
17688
17689        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
17690        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17691            self.0.request.name = v.into();
17692            self
17693        }
17694    }
17695
17696    #[doc(hidden)]
17697    impl crate::RequestBuilder for GetLocation {
17698        fn request_options(&mut self) -> &mut crate::RequestOptions {
17699            &mut self.0.options
17700        }
17701    }
17702
17703    /// The request builder for [KnowledgeBases::list_operations][crate::client::KnowledgeBases::list_operations] calls.
17704    ///
17705    /// # Example
17706    /// ```
17707    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListOperations;
17708    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17709    /// use google_cloud_gax::paginator::ItemPaginator;
17710    ///
17711    /// let builder = prepare_request_builder();
17712    /// let mut items = builder.by_item();
17713    /// while let Some(result) = items.next().await {
17714    ///   let item = result?;
17715    /// }
17716    /// # Ok(()) }
17717    ///
17718    /// fn prepare_request_builder() -> ListOperations {
17719    ///   # panic!();
17720    ///   // ... details omitted ...
17721    /// }
17722    /// ```
17723    #[derive(Clone, Debug)]
17724    pub struct ListOperations(
17725        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
17726    );
17727
17728    impl ListOperations {
17729        pub(crate) fn new(
17730            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17731        ) -> Self {
17732            Self(RequestBuilder::new(stub))
17733        }
17734
17735        /// Sets the full request, replacing any prior values.
17736        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
17737            mut self,
17738            v: V,
17739        ) -> Self {
17740            self.0.request = v.into();
17741            self
17742        }
17743
17744        /// Sets all the options, replacing any prior values.
17745        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17746            self.0.options = v.into();
17747            self
17748        }
17749
17750        /// Sends the request.
17751        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
17752            (*self.0.stub)
17753                .list_operations(self.0.request, self.0.options)
17754                .await
17755                .map(crate::Response::into_body)
17756        }
17757
17758        /// Streams each page in the collection.
17759        pub fn by_page(
17760            self,
17761        ) -> impl google_cloud_gax::paginator::Paginator<
17762            google_cloud_longrunning::model::ListOperationsResponse,
17763            crate::Error,
17764        > {
17765            use std::clone::Clone;
17766            let token = self.0.request.page_token.clone();
17767            let execute = move |token: String| {
17768                let mut builder = self.clone();
17769                builder.0.request = builder.0.request.set_page_token(token);
17770                builder.send()
17771            };
17772            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17773        }
17774
17775        /// Streams each item in the collection.
17776        pub fn by_item(
17777            self,
17778        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17779            google_cloud_longrunning::model::ListOperationsResponse,
17780            crate::Error,
17781        > {
17782            use google_cloud_gax::paginator::Paginator;
17783            self.by_page().items()
17784        }
17785
17786        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
17787        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17788            self.0.request.name = v.into();
17789            self
17790        }
17791
17792        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
17793        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17794            self.0.request.filter = v.into();
17795            self
17796        }
17797
17798        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
17799        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17800            self.0.request.page_size = v.into();
17801            self
17802        }
17803
17804        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
17805        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17806            self.0.request.page_token = v.into();
17807            self
17808        }
17809
17810        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
17811        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17812            self.0.request.return_partial_success = v.into();
17813            self
17814        }
17815    }
17816
17817    #[doc(hidden)]
17818    impl crate::RequestBuilder for ListOperations {
17819        fn request_options(&mut self) -> &mut crate::RequestOptions {
17820            &mut self.0.options
17821        }
17822    }
17823
17824    /// The request builder for [KnowledgeBases::get_operation][crate::client::KnowledgeBases::get_operation] calls.
17825    ///
17826    /// # Example
17827    /// ```
17828    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetOperation;
17829    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17830    ///
17831    /// let builder = prepare_request_builder();
17832    /// let response = builder.send().await?;
17833    /// # Ok(()) }
17834    ///
17835    /// fn prepare_request_builder() -> GetOperation {
17836    ///   # panic!();
17837    ///   // ... details omitted ...
17838    /// }
17839    /// ```
17840    #[derive(Clone, Debug)]
17841    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17842
17843    impl GetOperation {
17844        pub(crate) fn new(
17845            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17846        ) -> Self {
17847            Self(RequestBuilder::new(stub))
17848        }
17849
17850        /// Sets the full request, replacing any prior values.
17851        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17852            mut self,
17853            v: V,
17854        ) -> Self {
17855            self.0.request = v.into();
17856            self
17857        }
17858
17859        /// Sets all the options, replacing any prior values.
17860        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17861            self.0.options = v.into();
17862            self
17863        }
17864
17865        /// Sends the request.
17866        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17867            (*self.0.stub)
17868                .get_operation(self.0.request, self.0.options)
17869                .await
17870                .map(crate::Response::into_body)
17871        }
17872
17873        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
17874        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17875            self.0.request.name = v.into();
17876            self
17877        }
17878    }
17879
17880    #[doc(hidden)]
17881    impl crate::RequestBuilder for GetOperation {
17882        fn request_options(&mut self) -> &mut crate::RequestOptions {
17883            &mut self.0.options
17884        }
17885    }
17886
17887    /// The request builder for [KnowledgeBases::cancel_operation][crate::client::KnowledgeBases::cancel_operation] calls.
17888    ///
17889    /// # Example
17890    /// ```
17891    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::CancelOperation;
17892    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17893    ///
17894    /// let builder = prepare_request_builder();
17895    /// let response = builder.send().await?;
17896    /// # Ok(()) }
17897    ///
17898    /// fn prepare_request_builder() -> CancelOperation {
17899    ///   # panic!();
17900    ///   // ... details omitted ...
17901    /// }
17902    /// ```
17903    #[derive(Clone, Debug)]
17904    pub struct CancelOperation(
17905        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17906    );
17907
17908    impl CancelOperation {
17909        pub(crate) fn new(
17910            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17911        ) -> Self {
17912            Self(RequestBuilder::new(stub))
17913        }
17914
17915        /// Sets the full request, replacing any prior values.
17916        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17917            mut self,
17918            v: V,
17919        ) -> Self {
17920            self.0.request = v.into();
17921            self
17922        }
17923
17924        /// Sets all the options, replacing any prior values.
17925        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17926            self.0.options = v.into();
17927            self
17928        }
17929
17930        /// Sends the request.
17931        pub async fn send(self) -> Result<()> {
17932            (*self.0.stub)
17933                .cancel_operation(self.0.request, self.0.options)
17934                .await
17935                .map(crate::Response::into_body)
17936        }
17937
17938        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
17939        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17940            self.0.request.name = v.into();
17941            self
17942        }
17943    }
17944
17945    #[doc(hidden)]
17946    impl crate::RequestBuilder for CancelOperation {
17947        fn request_options(&mut self) -> &mut crate::RequestOptions {
17948            &mut self.0.options
17949        }
17950    }
17951}
17952
17953/// Request and client builders for [Participants][crate::client::Participants].
17954#[cfg(feature = "participants")]
17955#[cfg_attr(docsrs, doc(cfg(feature = "participants")))]
17956pub mod participants {
17957    use crate::Result;
17958
17959    /// A builder for [Participants][crate::client::Participants].
17960    ///
17961    /// ```
17962    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17963    /// # use google_cloud_dialogflow_v2::*;
17964    /// # use builder::participants::ClientBuilder;
17965    /// # use client::Participants;
17966    /// let builder : ClientBuilder = Participants::builder();
17967    /// let client = builder
17968    ///     .with_endpoint("https://dialogflow.googleapis.com")
17969    ///     .build().await?;
17970    /// # Ok(()) }
17971    /// ```
17972    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17973
17974    pub(crate) mod client {
17975        use super::super::super::client::Participants;
17976        pub struct Factory;
17977        impl crate::ClientFactory for Factory {
17978            type Client = Participants;
17979            type Credentials = gaxi::options::Credentials;
17980            async fn build(
17981                self,
17982                config: gaxi::options::ClientConfig,
17983            ) -> crate::ClientBuilderResult<Self::Client> {
17984                Self::Client::new(config).await
17985            }
17986        }
17987    }
17988
17989    /// Common implementation for [crate::client::Participants] request builders.
17990    #[derive(Clone, Debug)]
17991    pub(crate) struct RequestBuilder<R: std::default::Default> {
17992        stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17993        request: R,
17994        options: crate::RequestOptions,
17995    }
17996
17997    impl<R> RequestBuilder<R>
17998    where
17999        R: std::default::Default,
18000    {
18001        pub(crate) fn new(
18002            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18003        ) -> Self {
18004            Self {
18005                stub,
18006                request: R::default(),
18007                options: crate::RequestOptions::default(),
18008            }
18009        }
18010    }
18011
18012    /// The request builder for [Participants::create_participant][crate::client::Participants::create_participant] calls.
18013    ///
18014    /// # Example
18015    /// ```
18016    /// # use google_cloud_dialogflow_v2::builder::participants::CreateParticipant;
18017    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18018    ///
18019    /// let builder = prepare_request_builder();
18020    /// let response = builder.send().await?;
18021    /// # Ok(()) }
18022    ///
18023    /// fn prepare_request_builder() -> CreateParticipant {
18024    ///   # panic!();
18025    ///   // ... details omitted ...
18026    /// }
18027    /// ```
18028    #[derive(Clone, Debug)]
18029    pub struct CreateParticipant(RequestBuilder<crate::model::CreateParticipantRequest>);
18030
18031    impl CreateParticipant {
18032        pub(crate) fn new(
18033            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18034        ) -> Self {
18035            Self(RequestBuilder::new(stub))
18036        }
18037
18038        /// Sets the full request, replacing any prior values.
18039        pub fn with_request<V: Into<crate::model::CreateParticipantRequest>>(
18040            mut self,
18041            v: V,
18042        ) -> Self {
18043            self.0.request = v.into();
18044            self
18045        }
18046
18047        /// Sets all the options, replacing any prior values.
18048        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18049            self.0.options = v.into();
18050            self
18051        }
18052
18053        /// Sends the request.
18054        pub async fn send(self) -> Result<crate::model::Participant> {
18055            (*self.0.stub)
18056                .create_participant(self.0.request, self.0.options)
18057                .await
18058                .map(crate::Response::into_body)
18059        }
18060
18061        /// Sets the value of [parent][crate::model::CreateParticipantRequest::parent].
18062        ///
18063        /// This is a **required** field for requests.
18064        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18065            self.0.request.parent = v.into();
18066            self
18067        }
18068
18069        /// Sets the value of [participant][crate::model::CreateParticipantRequest::participant].
18070        ///
18071        /// This is a **required** field for requests.
18072        pub fn set_participant<T>(mut self, v: T) -> Self
18073        where
18074            T: std::convert::Into<crate::model::Participant>,
18075        {
18076            self.0.request.participant = std::option::Option::Some(v.into());
18077            self
18078        }
18079
18080        /// Sets or clears the value of [participant][crate::model::CreateParticipantRequest::participant].
18081        ///
18082        /// This is a **required** field for requests.
18083        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
18084        where
18085            T: std::convert::Into<crate::model::Participant>,
18086        {
18087            self.0.request.participant = v.map(|x| x.into());
18088            self
18089        }
18090    }
18091
18092    #[doc(hidden)]
18093    impl crate::RequestBuilder for CreateParticipant {
18094        fn request_options(&mut self) -> &mut crate::RequestOptions {
18095            &mut self.0.options
18096        }
18097    }
18098
18099    /// The request builder for [Participants::get_participant][crate::client::Participants::get_participant] calls.
18100    ///
18101    /// # Example
18102    /// ```
18103    /// # use google_cloud_dialogflow_v2::builder::participants::GetParticipant;
18104    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18105    ///
18106    /// let builder = prepare_request_builder();
18107    /// let response = builder.send().await?;
18108    /// # Ok(()) }
18109    ///
18110    /// fn prepare_request_builder() -> GetParticipant {
18111    ///   # panic!();
18112    ///   // ... details omitted ...
18113    /// }
18114    /// ```
18115    #[derive(Clone, Debug)]
18116    pub struct GetParticipant(RequestBuilder<crate::model::GetParticipantRequest>);
18117
18118    impl GetParticipant {
18119        pub(crate) fn new(
18120            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18121        ) -> Self {
18122            Self(RequestBuilder::new(stub))
18123        }
18124
18125        /// Sets the full request, replacing any prior values.
18126        pub fn with_request<V: Into<crate::model::GetParticipantRequest>>(mut self, v: V) -> Self {
18127            self.0.request = v.into();
18128            self
18129        }
18130
18131        /// Sets all the options, replacing any prior values.
18132        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18133            self.0.options = v.into();
18134            self
18135        }
18136
18137        /// Sends the request.
18138        pub async fn send(self) -> Result<crate::model::Participant> {
18139            (*self.0.stub)
18140                .get_participant(self.0.request, self.0.options)
18141                .await
18142                .map(crate::Response::into_body)
18143        }
18144
18145        /// Sets the value of [name][crate::model::GetParticipantRequest::name].
18146        ///
18147        /// This is a **required** field for requests.
18148        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18149            self.0.request.name = v.into();
18150            self
18151        }
18152    }
18153
18154    #[doc(hidden)]
18155    impl crate::RequestBuilder for GetParticipant {
18156        fn request_options(&mut self) -> &mut crate::RequestOptions {
18157            &mut self.0.options
18158        }
18159    }
18160
18161    /// The request builder for [Participants::list_participants][crate::client::Participants::list_participants] calls.
18162    ///
18163    /// # Example
18164    /// ```
18165    /// # use google_cloud_dialogflow_v2::builder::participants::ListParticipants;
18166    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18167    /// use google_cloud_gax::paginator::ItemPaginator;
18168    ///
18169    /// let builder = prepare_request_builder();
18170    /// let mut items = builder.by_item();
18171    /// while let Some(result) = items.next().await {
18172    ///   let item = result?;
18173    /// }
18174    /// # Ok(()) }
18175    ///
18176    /// fn prepare_request_builder() -> ListParticipants {
18177    ///   # panic!();
18178    ///   // ... details omitted ...
18179    /// }
18180    /// ```
18181    #[derive(Clone, Debug)]
18182    pub struct ListParticipants(RequestBuilder<crate::model::ListParticipantsRequest>);
18183
18184    impl ListParticipants {
18185        pub(crate) fn new(
18186            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18187        ) -> Self {
18188            Self(RequestBuilder::new(stub))
18189        }
18190
18191        /// Sets the full request, replacing any prior values.
18192        pub fn with_request<V: Into<crate::model::ListParticipantsRequest>>(
18193            mut self,
18194            v: V,
18195        ) -> Self {
18196            self.0.request = v.into();
18197            self
18198        }
18199
18200        /// Sets all the options, replacing any prior values.
18201        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18202            self.0.options = v.into();
18203            self
18204        }
18205
18206        /// Sends the request.
18207        pub async fn send(self) -> Result<crate::model::ListParticipantsResponse> {
18208            (*self.0.stub)
18209                .list_participants(self.0.request, self.0.options)
18210                .await
18211                .map(crate::Response::into_body)
18212        }
18213
18214        /// Streams each page in the collection.
18215        pub fn by_page(
18216            self,
18217        ) -> impl google_cloud_gax::paginator::Paginator<
18218            crate::model::ListParticipantsResponse,
18219            crate::Error,
18220        > {
18221            use std::clone::Clone;
18222            let token = self.0.request.page_token.clone();
18223            let execute = move |token: String| {
18224                let mut builder = self.clone();
18225                builder.0.request = builder.0.request.set_page_token(token);
18226                builder.send()
18227            };
18228            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18229        }
18230
18231        /// Streams each item in the collection.
18232        pub fn by_item(
18233            self,
18234        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18235            crate::model::ListParticipantsResponse,
18236            crate::Error,
18237        > {
18238            use google_cloud_gax::paginator::Paginator;
18239            self.by_page().items()
18240        }
18241
18242        /// Sets the value of [parent][crate::model::ListParticipantsRequest::parent].
18243        ///
18244        /// This is a **required** field for requests.
18245        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18246            self.0.request.parent = v.into();
18247            self
18248        }
18249
18250        /// Sets the value of [page_size][crate::model::ListParticipantsRequest::page_size].
18251        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18252            self.0.request.page_size = v.into();
18253            self
18254        }
18255
18256        /// Sets the value of [page_token][crate::model::ListParticipantsRequest::page_token].
18257        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18258            self.0.request.page_token = v.into();
18259            self
18260        }
18261    }
18262
18263    #[doc(hidden)]
18264    impl crate::RequestBuilder for ListParticipants {
18265        fn request_options(&mut self) -> &mut crate::RequestOptions {
18266            &mut self.0.options
18267        }
18268    }
18269
18270    /// The request builder for [Participants::update_participant][crate::client::Participants::update_participant] calls.
18271    ///
18272    /// # Example
18273    /// ```
18274    /// # use google_cloud_dialogflow_v2::builder::participants::UpdateParticipant;
18275    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18276    ///
18277    /// let builder = prepare_request_builder();
18278    /// let response = builder.send().await?;
18279    /// # Ok(()) }
18280    ///
18281    /// fn prepare_request_builder() -> UpdateParticipant {
18282    ///   # panic!();
18283    ///   // ... details omitted ...
18284    /// }
18285    /// ```
18286    #[derive(Clone, Debug)]
18287    pub struct UpdateParticipant(RequestBuilder<crate::model::UpdateParticipantRequest>);
18288
18289    impl UpdateParticipant {
18290        pub(crate) fn new(
18291            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18292        ) -> Self {
18293            Self(RequestBuilder::new(stub))
18294        }
18295
18296        /// Sets the full request, replacing any prior values.
18297        pub fn with_request<V: Into<crate::model::UpdateParticipantRequest>>(
18298            mut self,
18299            v: V,
18300        ) -> Self {
18301            self.0.request = v.into();
18302            self
18303        }
18304
18305        /// Sets all the options, replacing any prior values.
18306        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18307            self.0.options = v.into();
18308            self
18309        }
18310
18311        /// Sends the request.
18312        pub async fn send(self) -> Result<crate::model::Participant> {
18313            (*self.0.stub)
18314                .update_participant(self.0.request, self.0.options)
18315                .await
18316                .map(crate::Response::into_body)
18317        }
18318
18319        /// Sets the value of [participant][crate::model::UpdateParticipantRequest::participant].
18320        ///
18321        /// This is a **required** field for requests.
18322        pub fn set_participant<T>(mut self, v: T) -> Self
18323        where
18324            T: std::convert::Into<crate::model::Participant>,
18325        {
18326            self.0.request.participant = std::option::Option::Some(v.into());
18327            self
18328        }
18329
18330        /// Sets or clears the value of [participant][crate::model::UpdateParticipantRequest::participant].
18331        ///
18332        /// This is a **required** field for requests.
18333        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
18334        where
18335            T: std::convert::Into<crate::model::Participant>,
18336        {
18337            self.0.request.participant = v.map(|x| x.into());
18338            self
18339        }
18340
18341        /// Sets the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
18342        ///
18343        /// This is a **required** field for requests.
18344        pub fn set_update_mask<T>(mut self, v: T) -> Self
18345        where
18346            T: std::convert::Into<wkt::FieldMask>,
18347        {
18348            self.0.request.update_mask = std::option::Option::Some(v.into());
18349            self
18350        }
18351
18352        /// Sets or clears the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
18353        ///
18354        /// This is a **required** field for requests.
18355        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18356        where
18357            T: std::convert::Into<wkt::FieldMask>,
18358        {
18359            self.0.request.update_mask = v.map(|x| x.into());
18360            self
18361        }
18362    }
18363
18364    #[doc(hidden)]
18365    impl crate::RequestBuilder for UpdateParticipant {
18366        fn request_options(&mut self) -> &mut crate::RequestOptions {
18367            &mut self.0.options
18368        }
18369    }
18370
18371    /// The request builder for [Participants::analyze_content][crate::client::Participants::analyze_content] calls.
18372    ///
18373    /// # Example
18374    /// ```
18375    /// # use google_cloud_dialogflow_v2::builder::participants::AnalyzeContent;
18376    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18377    ///
18378    /// let builder = prepare_request_builder();
18379    /// let response = builder.send().await?;
18380    /// # Ok(()) }
18381    ///
18382    /// fn prepare_request_builder() -> AnalyzeContent {
18383    ///   # panic!();
18384    ///   // ... details omitted ...
18385    /// }
18386    /// ```
18387    #[derive(Clone, Debug)]
18388    pub struct AnalyzeContent(RequestBuilder<crate::model::AnalyzeContentRequest>);
18389
18390    impl AnalyzeContent {
18391        pub(crate) fn new(
18392            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18393        ) -> Self {
18394            Self(RequestBuilder::new(stub))
18395        }
18396
18397        /// Sets the full request, replacing any prior values.
18398        pub fn with_request<V: Into<crate::model::AnalyzeContentRequest>>(mut self, v: V) -> Self {
18399            self.0.request = v.into();
18400            self
18401        }
18402
18403        /// Sets all the options, replacing any prior values.
18404        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18405            self.0.options = v.into();
18406            self
18407        }
18408
18409        /// Sends the request.
18410        pub async fn send(self) -> Result<crate::model::AnalyzeContentResponse> {
18411            (*self.0.stub)
18412                .analyze_content(self.0.request, self.0.options)
18413                .await
18414                .map(crate::Response::into_body)
18415        }
18416
18417        /// Sets the value of [participant][crate::model::AnalyzeContentRequest::participant].
18418        ///
18419        /// This is a **required** field for requests.
18420        pub fn set_participant<T: Into<std::string::String>>(mut self, v: T) -> Self {
18421            self.0.request.participant = v.into();
18422            self
18423        }
18424
18425        /// Sets the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
18426        pub fn set_reply_audio_config<T>(mut self, v: T) -> Self
18427        where
18428            T: std::convert::Into<crate::model::OutputAudioConfig>,
18429        {
18430            self.0.request.reply_audio_config = std::option::Option::Some(v.into());
18431            self
18432        }
18433
18434        /// Sets or clears the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
18435        pub fn set_or_clear_reply_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
18436        where
18437            T: std::convert::Into<crate::model::OutputAudioConfig>,
18438        {
18439            self.0.request.reply_audio_config = v.map(|x| x.into());
18440            self
18441        }
18442
18443        /// Sets the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
18444        pub fn set_query_params<T>(mut self, v: T) -> Self
18445        where
18446            T: std::convert::Into<crate::model::QueryParameters>,
18447        {
18448            self.0.request.query_params = std::option::Option::Some(v.into());
18449            self
18450        }
18451
18452        /// Sets or clears the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
18453        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18454        where
18455            T: std::convert::Into<crate::model::QueryParameters>,
18456        {
18457            self.0.request.query_params = v.map(|x| x.into());
18458            self
18459        }
18460
18461        /// Sets the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
18462        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18463        where
18464            T: std::convert::Into<crate::model::AssistQueryParameters>,
18465        {
18466            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18467            self
18468        }
18469
18470        /// Sets or clears the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
18471        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18472        where
18473            T: std::convert::Into<crate::model::AssistQueryParameters>,
18474        {
18475            self.0.request.assist_query_params = v.map(|x| x.into());
18476            self
18477        }
18478
18479        /// Sets the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
18480        pub fn set_cx_parameters<T>(mut self, v: T) -> Self
18481        where
18482            T: std::convert::Into<wkt::Struct>,
18483        {
18484            self.0.request.cx_parameters = std::option::Option::Some(v.into());
18485            self
18486        }
18487
18488        /// Sets or clears the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
18489        pub fn set_or_clear_cx_parameters<T>(mut self, v: std::option::Option<T>) -> Self
18490        where
18491            T: std::convert::Into<wkt::Struct>,
18492        {
18493            self.0.request.cx_parameters = v.map(|x| x.into());
18494            self
18495        }
18496
18497        /// Sets the value of [request_id][crate::model::AnalyzeContentRequest::request_id].
18498        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18499            self.0.request.request_id = v.into();
18500            self
18501        }
18502
18503        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input].
18504        ///
18505        /// Note that all the setters affecting `input` are
18506        /// mutually exclusive.
18507        pub fn set_input<T: Into<Option<crate::model::analyze_content_request::Input>>>(
18508            mut self,
18509            v: T,
18510        ) -> Self {
18511            self.0.request.input = v.into();
18512            self
18513        }
18514
18515        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18516        /// to hold a `TextInput`.
18517        ///
18518        /// Note that all the setters affecting `input` are
18519        /// mutually exclusive.
18520        pub fn set_text_input<T: std::convert::Into<std::boxed::Box<crate::model::TextInput>>>(
18521            mut self,
18522            v: T,
18523        ) -> Self {
18524            self.0.request = self.0.request.set_text_input(v);
18525            self
18526        }
18527
18528        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18529        /// to hold a `AudioInput`.
18530        ///
18531        /// Note that all the setters affecting `input` are
18532        /// mutually exclusive.
18533        pub fn set_audio_input<T: std::convert::Into<std::boxed::Box<crate::model::AudioInput>>>(
18534            mut self,
18535            v: T,
18536        ) -> Self {
18537            self.0.request = self.0.request.set_audio_input(v);
18538            self
18539        }
18540
18541        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18542        /// to hold a `EventInput`.
18543        ///
18544        /// Note that all the setters affecting `input` are
18545        /// mutually exclusive.
18546        pub fn set_event_input<T: std::convert::Into<std::boxed::Box<crate::model::EventInput>>>(
18547            mut self,
18548            v: T,
18549        ) -> Self {
18550            self.0.request = self.0.request.set_event_input(v);
18551            self
18552        }
18553
18554        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18555        /// to hold a `SuggestionInput`.
18556        ///
18557        /// Note that all the setters affecting `input` are
18558        /// mutually exclusive.
18559        pub fn set_suggestion_input<
18560            T: std::convert::Into<std::boxed::Box<crate::model::SuggestionInput>>,
18561        >(
18562            mut self,
18563            v: T,
18564        ) -> Self {
18565            self.0.request = self.0.request.set_suggestion_input(v);
18566            self
18567        }
18568    }
18569
18570    #[doc(hidden)]
18571    impl crate::RequestBuilder for AnalyzeContent {
18572        fn request_options(&mut self) -> &mut crate::RequestOptions {
18573            &mut self.0.options
18574        }
18575    }
18576
18577    /// The request builder for [Participants::suggest_articles][crate::client::Participants::suggest_articles] calls.
18578    ///
18579    /// # Example
18580    /// ```
18581    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestArticles;
18582    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18583    ///
18584    /// let builder = prepare_request_builder();
18585    /// let response = builder.send().await?;
18586    /// # Ok(()) }
18587    ///
18588    /// fn prepare_request_builder() -> SuggestArticles {
18589    ///   # panic!();
18590    ///   // ... details omitted ...
18591    /// }
18592    /// ```
18593    #[derive(Clone, Debug)]
18594    pub struct SuggestArticles(RequestBuilder<crate::model::SuggestArticlesRequest>);
18595
18596    impl SuggestArticles {
18597        pub(crate) fn new(
18598            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18599        ) -> Self {
18600            Self(RequestBuilder::new(stub))
18601        }
18602
18603        /// Sets the full request, replacing any prior values.
18604        pub fn with_request<V: Into<crate::model::SuggestArticlesRequest>>(mut self, v: V) -> Self {
18605            self.0.request = v.into();
18606            self
18607        }
18608
18609        /// Sets all the options, replacing any prior values.
18610        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18611            self.0.options = v.into();
18612            self
18613        }
18614
18615        /// Sends the request.
18616        pub async fn send(self) -> Result<crate::model::SuggestArticlesResponse> {
18617            (*self.0.stub)
18618                .suggest_articles(self.0.request, self.0.options)
18619                .await
18620                .map(crate::Response::into_body)
18621        }
18622
18623        /// Sets the value of [parent][crate::model::SuggestArticlesRequest::parent].
18624        ///
18625        /// This is a **required** field for requests.
18626        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18627            self.0.request.parent = v.into();
18628            self
18629        }
18630
18631        /// Sets the value of [latest_message][crate::model::SuggestArticlesRequest::latest_message].
18632        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18633            self.0.request.latest_message = v.into();
18634            self
18635        }
18636
18637        /// Sets the value of [context_size][crate::model::SuggestArticlesRequest::context_size].
18638        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18639            self.0.request.context_size = v.into();
18640            self
18641        }
18642
18643        /// Sets the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
18644        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18645        where
18646            T: std::convert::Into<crate::model::AssistQueryParameters>,
18647        {
18648            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18649            self
18650        }
18651
18652        /// Sets or clears the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
18653        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18654        where
18655            T: std::convert::Into<crate::model::AssistQueryParameters>,
18656        {
18657            self.0.request.assist_query_params = v.map(|x| x.into());
18658            self
18659        }
18660    }
18661
18662    #[doc(hidden)]
18663    impl crate::RequestBuilder for SuggestArticles {
18664        fn request_options(&mut self) -> &mut crate::RequestOptions {
18665            &mut self.0.options
18666        }
18667    }
18668
18669    /// The request builder for [Participants::suggest_faq_answers][crate::client::Participants::suggest_faq_answers] calls.
18670    ///
18671    /// # Example
18672    /// ```
18673    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestFaqAnswers;
18674    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18675    ///
18676    /// let builder = prepare_request_builder();
18677    /// let response = builder.send().await?;
18678    /// # Ok(()) }
18679    ///
18680    /// fn prepare_request_builder() -> SuggestFaqAnswers {
18681    ///   # panic!();
18682    ///   // ... details omitted ...
18683    /// }
18684    /// ```
18685    #[derive(Clone, Debug)]
18686    pub struct SuggestFaqAnswers(RequestBuilder<crate::model::SuggestFaqAnswersRequest>);
18687
18688    impl SuggestFaqAnswers {
18689        pub(crate) fn new(
18690            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18691        ) -> Self {
18692            Self(RequestBuilder::new(stub))
18693        }
18694
18695        /// Sets the full request, replacing any prior values.
18696        pub fn with_request<V: Into<crate::model::SuggestFaqAnswersRequest>>(
18697            mut self,
18698            v: V,
18699        ) -> Self {
18700            self.0.request = v.into();
18701            self
18702        }
18703
18704        /// Sets all the options, replacing any prior values.
18705        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18706            self.0.options = v.into();
18707            self
18708        }
18709
18710        /// Sends the request.
18711        pub async fn send(self) -> Result<crate::model::SuggestFaqAnswersResponse> {
18712            (*self.0.stub)
18713                .suggest_faq_answers(self.0.request, self.0.options)
18714                .await
18715                .map(crate::Response::into_body)
18716        }
18717
18718        /// Sets the value of [parent][crate::model::SuggestFaqAnswersRequest::parent].
18719        ///
18720        /// This is a **required** field for requests.
18721        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18722            self.0.request.parent = v.into();
18723            self
18724        }
18725
18726        /// Sets the value of [latest_message][crate::model::SuggestFaqAnswersRequest::latest_message].
18727        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18728            self.0.request.latest_message = v.into();
18729            self
18730        }
18731
18732        /// Sets the value of [context_size][crate::model::SuggestFaqAnswersRequest::context_size].
18733        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18734            self.0.request.context_size = v.into();
18735            self
18736        }
18737
18738        /// Sets the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
18739        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18740        where
18741            T: std::convert::Into<crate::model::AssistQueryParameters>,
18742        {
18743            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18744            self
18745        }
18746
18747        /// Sets or clears the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
18748        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18749        where
18750            T: std::convert::Into<crate::model::AssistQueryParameters>,
18751        {
18752            self.0.request.assist_query_params = v.map(|x| x.into());
18753            self
18754        }
18755    }
18756
18757    #[doc(hidden)]
18758    impl crate::RequestBuilder for SuggestFaqAnswers {
18759        fn request_options(&mut self) -> &mut crate::RequestOptions {
18760            &mut self.0.options
18761        }
18762    }
18763
18764    /// The request builder for [Participants::suggest_smart_replies][crate::client::Participants::suggest_smart_replies] calls.
18765    ///
18766    /// # Example
18767    /// ```
18768    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestSmartReplies;
18769    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18770    ///
18771    /// let builder = prepare_request_builder();
18772    /// let response = builder.send().await?;
18773    /// # Ok(()) }
18774    ///
18775    /// fn prepare_request_builder() -> SuggestSmartReplies {
18776    ///   # panic!();
18777    ///   // ... details omitted ...
18778    /// }
18779    /// ```
18780    #[derive(Clone, Debug)]
18781    pub struct SuggestSmartReplies(RequestBuilder<crate::model::SuggestSmartRepliesRequest>);
18782
18783    impl SuggestSmartReplies {
18784        pub(crate) fn new(
18785            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18786        ) -> Self {
18787            Self(RequestBuilder::new(stub))
18788        }
18789
18790        /// Sets the full request, replacing any prior values.
18791        pub fn with_request<V: Into<crate::model::SuggestSmartRepliesRequest>>(
18792            mut self,
18793            v: V,
18794        ) -> Self {
18795            self.0.request = v.into();
18796            self
18797        }
18798
18799        /// Sets all the options, replacing any prior values.
18800        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18801            self.0.options = v.into();
18802            self
18803        }
18804
18805        /// Sends the request.
18806        pub async fn send(self) -> Result<crate::model::SuggestSmartRepliesResponse> {
18807            (*self.0.stub)
18808                .suggest_smart_replies(self.0.request, self.0.options)
18809                .await
18810                .map(crate::Response::into_body)
18811        }
18812
18813        /// Sets the value of [parent][crate::model::SuggestSmartRepliesRequest::parent].
18814        ///
18815        /// This is a **required** field for requests.
18816        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18817            self.0.request.parent = v.into();
18818            self
18819        }
18820
18821        /// Sets the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
18822        pub fn set_current_text_input<T>(mut self, v: T) -> Self
18823        where
18824            T: std::convert::Into<crate::model::TextInput>,
18825        {
18826            self.0.request.current_text_input = std::option::Option::Some(v.into());
18827            self
18828        }
18829
18830        /// Sets or clears the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
18831        pub fn set_or_clear_current_text_input<T>(mut self, v: std::option::Option<T>) -> Self
18832        where
18833            T: std::convert::Into<crate::model::TextInput>,
18834        {
18835            self.0.request.current_text_input = v.map(|x| x.into());
18836            self
18837        }
18838
18839        /// Sets the value of [latest_message][crate::model::SuggestSmartRepliesRequest::latest_message].
18840        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18841            self.0.request.latest_message = v.into();
18842            self
18843        }
18844
18845        /// Sets the value of [context_size][crate::model::SuggestSmartRepliesRequest::context_size].
18846        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18847            self.0.request.context_size = v.into();
18848            self
18849        }
18850    }
18851
18852    #[doc(hidden)]
18853    impl crate::RequestBuilder for SuggestSmartReplies {
18854        fn request_options(&mut self) -> &mut crate::RequestOptions {
18855            &mut self.0.options
18856        }
18857    }
18858
18859    /// The request builder for [Participants::suggest_knowledge_assist][crate::client::Participants::suggest_knowledge_assist] calls.
18860    ///
18861    /// # Example
18862    /// ```
18863    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestKnowledgeAssist;
18864    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18865    ///
18866    /// let builder = prepare_request_builder();
18867    /// let response = builder.send().await?;
18868    /// # Ok(()) }
18869    ///
18870    /// fn prepare_request_builder() -> SuggestKnowledgeAssist {
18871    ///   # panic!();
18872    ///   // ... details omitted ...
18873    /// }
18874    /// ```
18875    #[derive(Clone, Debug)]
18876    pub struct SuggestKnowledgeAssist(RequestBuilder<crate::model::SuggestKnowledgeAssistRequest>);
18877
18878    impl SuggestKnowledgeAssist {
18879        pub(crate) fn new(
18880            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18881        ) -> Self {
18882            Self(RequestBuilder::new(stub))
18883        }
18884
18885        /// Sets the full request, replacing any prior values.
18886        pub fn with_request<V: Into<crate::model::SuggestKnowledgeAssistRequest>>(
18887            mut self,
18888            v: V,
18889        ) -> Self {
18890            self.0.request = v.into();
18891            self
18892        }
18893
18894        /// Sets all the options, replacing any prior values.
18895        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18896            self.0.options = v.into();
18897            self
18898        }
18899
18900        /// Sends the request.
18901        pub async fn send(self) -> Result<crate::model::SuggestKnowledgeAssistResponse> {
18902            (*self.0.stub)
18903                .suggest_knowledge_assist(self.0.request, self.0.options)
18904                .await
18905                .map(crate::Response::into_body)
18906        }
18907
18908        /// Sets the value of [parent][crate::model::SuggestKnowledgeAssistRequest::parent].
18909        ///
18910        /// This is a **required** field for requests.
18911        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18912            self.0.request.parent = v.into();
18913            self
18914        }
18915
18916        /// Sets the value of [latest_message][crate::model::SuggestKnowledgeAssistRequest::latest_message].
18917        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18918            self.0.request.latest_message = v.into();
18919            self
18920        }
18921
18922        /// Sets the value of [context_size][crate::model::SuggestKnowledgeAssistRequest::context_size].
18923        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18924            self.0.request.context_size = v.into();
18925            self
18926        }
18927
18928        /// Sets the value of [previous_suggested_query][crate::model::SuggestKnowledgeAssistRequest::previous_suggested_query].
18929        pub fn set_previous_suggested_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
18930            self.0.request.previous_suggested_query = v.into();
18931            self
18932        }
18933    }
18934
18935    #[doc(hidden)]
18936    impl crate::RequestBuilder for SuggestKnowledgeAssist {
18937        fn request_options(&mut self) -> &mut crate::RequestOptions {
18938            &mut self.0.options
18939        }
18940    }
18941
18942    /// The request builder for [Participants::list_locations][crate::client::Participants::list_locations] calls.
18943    ///
18944    /// # Example
18945    /// ```
18946    /// # use google_cloud_dialogflow_v2::builder::participants::ListLocations;
18947    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18948    /// use google_cloud_gax::paginator::ItemPaginator;
18949    ///
18950    /// let builder = prepare_request_builder();
18951    /// let mut items = builder.by_item();
18952    /// while let Some(result) = items.next().await {
18953    ///   let item = result?;
18954    /// }
18955    /// # Ok(()) }
18956    ///
18957    /// fn prepare_request_builder() -> ListLocations {
18958    ///   # panic!();
18959    ///   // ... details omitted ...
18960    /// }
18961    /// ```
18962    #[derive(Clone, Debug)]
18963    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18964
18965    impl ListLocations {
18966        pub(crate) fn new(
18967            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18968        ) -> Self {
18969            Self(RequestBuilder::new(stub))
18970        }
18971
18972        /// Sets the full request, replacing any prior values.
18973        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18974            mut self,
18975            v: V,
18976        ) -> Self {
18977            self.0.request = v.into();
18978            self
18979        }
18980
18981        /// Sets all the options, replacing any prior values.
18982        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18983            self.0.options = v.into();
18984            self
18985        }
18986
18987        /// Sends the request.
18988        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
18989            (*self.0.stub)
18990                .list_locations(self.0.request, self.0.options)
18991                .await
18992                .map(crate::Response::into_body)
18993        }
18994
18995        /// Streams each page in the collection.
18996        pub fn by_page(
18997            self,
18998        ) -> impl google_cloud_gax::paginator::Paginator<
18999            google_cloud_location::model::ListLocationsResponse,
19000            crate::Error,
19001        > {
19002            use std::clone::Clone;
19003            let token = self.0.request.page_token.clone();
19004            let execute = move |token: String| {
19005                let mut builder = self.clone();
19006                builder.0.request = builder.0.request.set_page_token(token);
19007                builder.send()
19008            };
19009            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19010        }
19011
19012        /// Streams each item in the collection.
19013        pub fn by_item(
19014            self,
19015        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19016            google_cloud_location::model::ListLocationsResponse,
19017            crate::Error,
19018        > {
19019            use google_cloud_gax::paginator::Paginator;
19020            self.by_page().items()
19021        }
19022
19023        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
19024        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19025            self.0.request.name = v.into();
19026            self
19027        }
19028
19029        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
19030        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19031            self.0.request.filter = v.into();
19032            self
19033        }
19034
19035        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
19036        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19037            self.0.request.page_size = v.into();
19038            self
19039        }
19040
19041        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
19042        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19043            self.0.request.page_token = v.into();
19044            self
19045        }
19046    }
19047
19048    #[doc(hidden)]
19049    impl crate::RequestBuilder for ListLocations {
19050        fn request_options(&mut self) -> &mut crate::RequestOptions {
19051            &mut self.0.options
19052        }
19053    }
19054
19055    /// The request builder for [Participants::get_location][crate::client::Participants::get_location] calls.
19056    ///
19057    /// # Example
19058    /// ```
19059    /// # use google_cloud_dialogflow_v2::builder::participants::GetLocation;
19060    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19061    ///
19062    /// let builder = prepare_request_builder();
19063    /// let response = builder.send().await?;
19064    /// # Ok(()) }
19065    ///
19066    /// fn prepare_request_builder() -> GetLocation {
19067    ///   # panic!();
19068    ///   // ... details omitted ...
19069    /// }
19070    /// ```
19071    #[derive(Clone, Debug)]
19072    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19073
19074    impl GetLocation {
19075        pub(crate) fn new(
19076            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19077        ) -> Self {
19078            Self(RequestBuilder::new(stub))
19079        }
19080
19081        /// Sets the full request, replacing any prior values.
19082        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19083            mut self,
19084            v: V,
19085        ) -> Self {
19086            self.0.request = v.into();
19087            self
19088        }
19089
19090        /// Sets all the options, replacing any prior values.
19091        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19092            self.0.options = v.into();
19093            self
19094        }
19095
19096        /// Sends the request.
19097        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19098            (*self.0.stub)
19099                .get_location(self.0.request, self.0.options)
19100                .await
19101                .map(crate::Response::into_body)
19102        }
19103
19104        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
19105        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19106            self.0.request.name = v.into();
19107            self
19108        }
19109    }
19110
19111    #[doc(hidden)]
19112    impl crate::RequestBuilder for GetLocation {
19113        fn request_options(&mut self) -> &mut crate::RequestOptions {
19114            &mut self.0.options
19115        }
19116    }
19117
19118    /// The request builder for [Participants::list_operations][crate::client::Participants::list_operations] calls.
19119    ///
19120    /// # Example
19121    /// ```
19122    /// # use google_cloud_dialogflow_v2::builder::participants::ListOperations;
19123    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19124    /// use google_cloud_gax::paginator::ItemPaginator;
19125    ///
19126    /// let builder = prepare_request_builder();
19127    /// let mut items = builder.by_item();
19128    /// while let Some(result) = items.next().await {
19129    ///   let item = result?;
19130    /// }
19131    /// # Ok(()) }
19132    ///
19133    /// fn prepare_request_builder() -> ListOperations {
19134    ///   # panic!();
19135    ///   // ... details omitted ...
19136    /// }
19137    /// ```
19138    #[derive(Clone, Debug)]
19139    pub struct ListOperations(
19140        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19141    );
19142
19143    impl ListOperations {
19144        pub(crate) fn new(
19145            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19146        ) -> Self {
19147            Self(RequestBuilder::new(stub))
19148        }
19149
19150        /// Sets the full request, replacing any prior values.
19151        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19152            mut self,
19153            v: V,
19154        ) -> Self {
19155            self.0.request = v.into();
19156            self
19157        }
19158
19159        /// Sets all the options, replacing any prior values.
19160        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19161            self.0.options = v.into();
19162            self
19163        }
19164
19165        /// Sends the request.
19166        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19167            (*self.0.stub)
19168                .list_operations(self.0.request, self.0.options)
19169                .await
19170                .map(crate::Response::into_body)
19171        }
19172
19173        /// Streams each page in the collection.
19174        pub fn by_page(
19175            self,
19176        ) -> impl google_cloud_gax::paginator::Paginator<
19177            google_cloud_longrunning::model::ListOperationsResponse,
19178            crate::Error,
19179        > {
19180            use std::clone::Clone;
19181            let token = self.0.request.page_token.clone();
19182            let execute = move |token: String| {
19183                let mut builder = self.clone();
19184                builder.0.request = builder.0.request.set_page_token(token);
19185                builder.send()
19186            };
19187            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19188        }
19189
19190        /// Streams each item in the collection.
19191        pub fn by_item(
19192            self,
19193        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19194            google_cloud_longrunning::model::ListOperationsResponse,
19195            crate::Error,
19196        > {
19197            use google_cloud_gax::paginator::Paginator;
19198            self.by_page().items()
19199        }
19200
19201        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
19202        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19203            self.0.request.name = v.into();
19204            self
19205        }
19206
19207        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
19208        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19209            self.0.request.filter = v.into();
19210            self
19211        }
19212
19213        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
19214        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19215            self.0.request.page_size = v.into();
19216            self
19217        }
19218
19219        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
19220        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19221            self.0.request.page_token = v.into();
19222            self
19223        }
19224
19225        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
19226        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19227            self.0.request.return_partial_success = v.into();
19228            self
19229        }
19230    }
19231
19232    #[doc(hidden)]
19233    impl crate::RequestBuilder for ListOperations {
19234        fn request_options(&mut self) -> &mut crate::RequestOptions {
19235            &mut self.0.options
19236        }
19237    }
19238
19239    /// The request builder for [Participants::get_operation][crate::client::Participants::get_operation] calls.
19240    ///
19241    /// # Example
19242    /// ```
19243    /// # use google_cloud_dialogflow_v2::builder::participants::GetOperation;
19244    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19245    ///
19246    /// let builder = prepare_request_builder();
19247    /// let response = builder.send().await?;
19248    /// # Ok(()) }
19249    ///
19250    /// fn prepare_request_builder() -> GetOperation {
19251    ///   # panic!();
19252    ///   // ... details omitted ...
19253    /// }
19254    /// ```
19255    #[derive(Clone, Debug)]
19256    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19257
19258    impl GetOperation {
19259        pub(crate) fn new(
19260            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19261        ) -> Self {
19262            Self(RequestBuilder::new(stub))
19263        }
19264
19265        /// Sets the full request, replacing any prior values.
19266        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19267            mut self,
19268            v: V,
19269        ) -> Self {
19270            self.0.request = v.into();
19271            self
19272        }
19273
19274        /// Sets all the options, replacing any prior values.
19275        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19276            self.0.options = v.into();
19277            self
19278        }
19279
19280        /// Sends the request.
19281        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19282            (*self.0.stub)
19283                .get_operation(self.0.request, self.0.options)
19284                .await
19285                .map(crate::Response::into_body)
19286        }
19287
19288        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19289        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19290            self.0.request.name = v.into();
19291            self
19292        }
19293    }
19294
19295    #[doc(hidden)]
19296    impl crate::RequestBuilder for GetOperation {
19297        fn request_options(&mut self) -> &mut crate::RequestOptions {
19298            &mut self.0.options
19299        }
19300    }
19301
19302    /// The request builder for [Participants::cancel_operation][crate::client::Participants::cancel_operation] calls.
19303    ///
19304    /// # Example
19305    /// ```
19306    /// # use google_cloud_dialogflow_v2::builder::participants::CancelOperation;
19307    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19308    ///
19309    /// let builder = prepare_request_builder();
19310    /// let response = builder.send().await?;
19311    /// # Ok(()) }
19312    ///
19313    /// fn prepare_request_builder() -> CancelOperation {
19314    ///   # panic!();
19315    ///   // ... details omitted ...
19316    /// }
19317    /// ```
19318    #[derive(Clone, Debug)]
19319    pub struct CancelOperation(
19320        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19321    );
19322
19323    impl CancelOperation {
19324        pub(crate) fn new(
19325            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19326        ) -> Self {
19327            Self(RequestBuilder::new(stub))
19328        }
19329
19330        /// Sets the full request, replacing any prior values.
19331        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19332            mut self,
19333            v: V,
19334        ) -> Self {
19335            self.0.request = v.into();
19336            self
19337        }
19338
19339        /// Sets all the options, replacing any prior values.
19340        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19341            self.0.options = v.into();
19342            self
19343        }
19344
19345        /// Sends the request.
19346        pub async fn send(self) -> Result<()> {
19347            (*self.0.stub)
19348                .cancel_operation(self.0.request, self.0.options)
19349                .await
19350                .map(crate::Response::into_body)
19351        }
19352
19353        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19354        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19355            self.0.request.name = v.into();
19356            self
19357        }
19358    }
19359
19360    #[doc(hidden)]
19361    impl crate::RequestBuilder for CancelOperation {
19362        fn request_options(&mut self) -> &mut crate::RequestOptions {
19363            &mut self.0.options
19364        }
19365    }
19366}
19367
19368/// Request and client builders for [Sessions][crate::client::Sessions].
19369#[cfg(feature = "sessions")]
19370#[cfg_attr(docsrs, doc(cfg(feature = "sessions")))]
19371pub mod sessions {
19372    use crate::Result;
19373
19374    /// A builder for [Sessions][crate::client::Sessions].
19375    ///
19376    /// ```
19377    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19378    /// # use google_cloud_dialogflow_v2::*;
19379    /// # use builder::sessions::ClientBuilder;
19380    /// # use client::Sessions;
19381    /// let builder : ClientBuilder = Sessions::builder();
19382    /// let client = builder
19383    ///     .with_endpoint("https://dialogflow.googleapis.com")
19384    ///     .build().await?;
19385    /// # Ok(()) }
19386    /// ```
19387    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19388
19389    pub(crate) mod client {
19390        use super::super::super::client::Sessions;
19391        pub struct Factory;
19392        impl crate::ClientFactory for Factory {
19393            type Client = Sessions;
19394            type Credentials = gaxi::options::Credentials;
19395            async fn build(
19396                self,
19397                config: gaxi::options::ClientConfig,
19398            ) -> crate::ClientBuilderResult<Self::Client> {
19399                Self::Client::new(config).await
19400            }
19401        }
19402    }
19403
19404    /// Common implementation for [crate::client::Sessions] request builders.
19405    #[derive(Clone, Debug)]
19406    pub(crate) struct RequestBuilder<R: std::default::Default> {
19407        stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>,
19408        request: R,
19409        options: crate::RequestOptions,
19410    }
19411
19412    impl<R> RequestBuilder<R>
19413    where
19414        R: std::default::Default,
19415    {
19416        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19417            Self {
19418                stub,
19419                request: R::default(),
19420                options: crate::RequestOptions::default(),
19421            }
19422        }
19423    }
19424
19425    /// The request builder for [Sessions::detect_intent][crate::client::Sessions::detect_intent] calls.
19426    ///
19427    /// # Example
19428    /// ```
19429    /// # use google_cloud_dialogflow_v2::builder::sessions::DetectIntent;
19430    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19431    ///
19432    /// let builder = prepare_request_builder();
19433    /// let response = builder.send().await?;
19434    /// # Ok(()) }
19435    ///
19436    /// fn prepare_request_builder() -> DetectIntent {
19437    ///   # panic!();
19438    ///   // ... details omitted ...
19439    /// }
19440    /// ```
19441    #[derive(Clone, Debug)]
19442    pub struct DetectIntent(RequestBuilder<crate::model::DetectIntentRequest>);
19443
19444    impl DetectIntent {
19445        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19446            Self(RequestBuilder::new(stub))
19447        }
19448
19449        /// Sets the full request, replacing any prior values.
19450        pub fn with_request<V: Into<crate::model::DetectIntentRequest>>(mut self, v: V) -> Self {
19451            self.0.request = v.into();
19452            self
19453        }
19454
19455        /// Sets all the options, replacing any prior values.
19456        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19457            self.0.options = v.into();
19458            self
19459        }
19460
19461        /// Sends the request.
19462        pub async fn send(self) -> Result<crate::model::DetectIntentResponse> {
19463            (*self.0.stub)
19464                .detect_intent(self.0.request, self.0.options)
19465                .await
19466                .map(crate::Response::into_body)
19467        }
19468
19469        /// Sets the value of [session][crate::model::DetectIntentRequest::session].
19470        ///
19471        /// This is a **required** field for requests.
19472        pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
19473            self.0.request.session = v.into();
19474            self
19475        }
19476
19477        /// Sets the value of [query_params][crate::model::DetectIntentRequest::query_params].
19478        pub fn set_query_params<T>(mut self, v: T) -> Self
19479        where
19480            T: std::convert::Into<crate::model::QueryParameters>,
19481        {
19482            self.0.request.query_params = std::option::Option::Some(v.into());
19483            self
19484        }
19485
19486        /// Sets or clears the value of [query_params][crate::model::DetectIntentRequest::query_params].
19487        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
19488        where
19489            T: std::convert::Into<crate::model::QueryParameters>,
19490        {
19491            self.0.request.query_params = v.map(|x| x.into());
19492            self
19493        }
19494
19495        /// Sets the value of [query_input][crate::model::DetectIntentRequest::query_input].
19496        ///
19497        /// This is a **required** field for requests.
19498        pub fn set_query_input<T>(mut self, v: T) -> Self
19499        where
19500            T: std::convert::Into<crate::model::QueryInput>,
19501        {
19502            self.0.request.query_input = std::option::Option::Some(v.into());
19503            self
19504        }
19505
19506        /// Sets or clears the value of [query_input][crate::model::DetectIntentRequest::query_input].
19507        ///
19508        /// This is a **required** field for requests.
19509        pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
19510        where
19511            T: std::convert::Into<crate::model::QueryInput>,
19512        {
19513            self.0.request.query_input = v.map(|x| x.into());
19514            self
19515        }
19516
19517        /// Sets the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
19518        pub fn set_output_audio_config<T>(mut self, v: T) -> Self
19519        where
19520            T: std::convert::Into<crate::model::OutputAudioConfig>,
19521        {
19522            self.0.request.output_audio_config = std::option::Option::Some(v.into());
19523            self
19524        }
19525
19526        /// Sets or clears the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
19527        pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
19528        where
19529            T: std::convert::Into<crate::model::OutputAudioConfig>,
19530        {
19531            self.0.request.output_audio_config = v.map(|x| x.into());
19532            self
19533        }
19534
19535        /// Sets the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
19536        pub fn set_output_audio_config_mask<T>(mut self, v: T) -> Self
19537        where
19538            T: std::convert::Into<wkt::FieldMask>,
19539        {
19540            self.0.request.output_audio_config_mask = std::option::Option::Some(v.into());
19541            self
19542        }
19543
19544        /// Sets or clears the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
19545        pub fn set_or_clear_output_audio_config_mask<T>(mut self, v: std::option::Option<T>) -> Self
19546        where
19547            T: std::convert::Into<wkt::FieldMask>,
19548        {
19549            self.0.request.output_audio_config_mask = v.map(|x| x.into());
19550            self
19551        }
19552
19553        /// Sets the value of [input_audio][crate::model::DetectIntentRequest::input_audio].
19554        pub fn set_input_audio<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
19555            self.0.request.input_audio = v.into();
19556            self
19557        }
19558    }
19559
19560    #[doc(hidden)]
19561    impl crate::RequestBuilder for DetectIntent {
19562        fn request_options(&mut self) -> &mut crate::RequestOptions {
19563            &mut self.0.options
19564        }
19565    }
19566
19567    /// The request builder for [Sessions::list_locations][crate::client::Sessions::list_locations] calls.
19568    ///
19569    /// # Example
19570    /// ```
19571    /// # use google_cloud_dialogflow_v2::builder::sessions::ListLocations;
19572    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19573    /// use google_cloud_gax::paginator::ItemPaginator;
19574    ///
19575    /// let builder = prepare_request_builder();
19576    /// let mut items = builder.by_item();
19577    /// while let Some(result) = items.next().await {
19578    ///   let item = result?;
19579    /// }
19580    /// # Ok(()) }
19581    ///
19582    /// fn prepare_request_builder() -> ListLocations {
19583    ///   # panic!();
19584    ///   // ... details omitted ...
19585    /// }
19586    /// ```
19587    #[derive(Clone, Debug)]
19588    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
19589
19590    impl ListLocations {
19591        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19592            Self(RequestBuilder::new(stub))
19593        }
19594
19595        /// Sets the full request, replacing any prior values.
19596        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19597            mut self,
19598            v: V,
19599        ) -> Self {
19600            self.0.request = v.into();
19601            self
19602        }
19603
19604        /// Sets all the options, replacing any prior values.
19605        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19606            self.0.options = v.into();
19607            self
19608        }
19609
19610        /// Sends the request.
19611        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19612            (*self.0.stub)
19613                .list_locations(self.0.request, self.0.options)
19614                .await
19615                .map(crate::Response::into_body)
19616        }
19617
19618        /// Streams each page in the collection.
19619        pub fn by_page(
19620            self,
19621        ) -> impl google_cloud_gax::paginator::Paginator<
19622            google_cloud_location::model::ListLocationsResponse,
19623            crate::Error,
19624        > {
19625            use std::clone::Clone;
19626            let token = self.0.request.page_token.clone();
19627            let execute = move |token: String| {
19628                let mut builder = self.clone();
19629                builder.0.request = builder.0.request.set_page_token(token);
19630                builder.send()
19631            };
19632            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19633        }
19634
19635        /// Streams each item in the collection.
19636        pub fn by_item(
19637            self,
19638        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19639            google_cloud_location::model::ListLocationsResponse,
19640            crate::Error,
19641        > {
19642            use google_cloud_gax::paginator::Paginator;
19643            self.by_page().items()
19644        }
19645
19646        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
19647        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19648            self.0.request.name = v.into();
19649            self
19650        }
19651
19652        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
19653        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19654            self.0.request.filter = v.into();
19655            self
19656        }
19657
19658        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
19659        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19660            self.0.request.page_size = v.into();
19661            self
19662        }
19663
19664        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
19665        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19666            self.0.request.page_token = v.into();
19667            self
19668        }
19669    }
19670
19671    #[doc(hidden)]
19672    impl crate::RequestBuilder for ListLocations {
19673        fn request_options(&mut self) -> &mut crate::RequestOptions {
19674            &mut self.0.options
19675        }
19676    }
19677
19678    /// The request builder for [Sessions::get_location][crate::client::Sessions::get_location] calls.
19679    ///
19680    /// # Example
19681    /// ```
19682    /// # use google_cloud_dialogflow_v2::builder::sessions::GetLocation;
19683    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19684    ///
19685    /// let builder = prepare_request_builder();
19686    /// let response = builder.send().await?;
19687    /// # Ok(()) }
19688    ///
19689    /// fn prepare_request_builder() -> GetLocation {
19690    ///   # panic!();
19691    ///   // ... details omitted ...
19692    /// }
19693    /// ```
19694    #[derive(Clone, Debug)]
19695    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19696
19697    impl GetLocation {
19698        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19699            Self(RequestBuilder::new(stub))
19700        }
19701
19702        /// Sets the full request, replacing any prior values.
19703        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19704            mut self,
19705            v: V,
19706        ) -> Self {
19707            self.0.request = v.into();
19708            self
19709        }
19710
19711        /// Sets all the options, replacing any prior values.
19712        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19713            self.0.options = v.into();
19714            self
19715        }
19716
19717        /// Sends the request.
19718        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19719            (*self.0.stub)
19720                .get_location(self.0.request, self.0.options)
19721                .await
19722                .map(crate::Response::into_body)
19723        }
19724
19725        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
19726        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19727            self.0.request.name = v.into();
19728            self
19729        }
19730    }
19731
19732    #[doc(hidden)]
19733    impl crate::RequestBuilder for GetLocation {
19734        fn request_options(&mut self) -> &mut crate::RequestOptions {
19735            &mut self.0.options
19736        }
19737    }
19738
19739    /// The request builder for [Sessions::list_operations][crate::client::Sessions::list_operations] calls.
19740    ///
19741    /// # Example
19742    /// ```
19743    /// # use google_cloud_dialogflow_v2::builder::sessions::ListOperations;
19744    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19745    /// use google_cloud_gax::paginator::ItemPaginator;
19746    ///
19747    /// let builder = prepare_request_builder();
19748    /// let mut items = builder.by_item();
19749    /// while let Some(result) = items.next().await {
19750    ///   let item = result?;
19751    /// }
19752    /// # Ok(()) }
19753    ///
19754    /// fn prepare_request_builder() -> ListOperations {
19755    ///   # panic!();
19756    ///   // ... details omitted ...
19757    /// }
19758    /// ```
19759    #[derive(Clone, Debug)]
19760    pub struct ListOperations(
19761        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19762    );
19763
19764    impl ListOperations {
19765        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19766            Self(RequestBuilder::new(stub))
19767        }
19768
19769        /// Sets the full request, replacing any prior values.
19770        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19771            mut self,
19772            v: V,
19773        ) -> Self {
19774            self.0.request = v.into();
19775            self
19776        }
19777
19778        /// Sets all the options, replacing any prior values.
19779        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19780            self.0.options = v.into();
19781            self
19782        }
19783
19784        /// Sends the request.
19785        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19786            (*self.0.stub)
19787                .list_operations(self.0.request, self.0.options)
19788                .await
19789                .map(crate::Response::into_body)
19790        }
19791
19792        /// Streams each page in the collection.
19793        pub fn by_page(
19794            self,
19795        ) -> impl google_cloud_gax::paginator::Paginator<
19796            google_cloud_longrunning::model::ListOperationsResponse,
19797            crate::Error,
19798        > {
19799            use std::clone::Clone;
19800            let token = self.0.request.page_token.clone();
19801            let execute = move |token: String| {
19802                let mut builder = self.clone();
19803                builder.0.request = builder.0.request.set_page_token(token);
19804                builder.send()
19805            };
19806            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19807        }
19808
19809        /// Streams each item in the collection.
19810        pub fn by_item(
19811            self,
19812        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19813            google_cloud_longrunning::model::ListOperationsResponse,
19814            crate::Error,
19815        > {
19816            use google_cloud_gax::paginator::Paginator;
19817            self.by_page().items()
19818        }
19819
19820        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
19821        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19822            self.0.request.name = v.into();
19823            self
19824        }
19825
19826        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
19827        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19828            self.0.request.filter = v.into();
19829            self
19830        }
19831
19832        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
19833        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19834            self.0.request.page_size = v.into();
19835            self
19836        }
19837
19838        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
19839        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19840            self.0.request.page_token = v.into();
19841            self
19842        }
19843
19844        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
19845        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19846            self.0.request.return_partial_success = v.into();
19847            self
19848        }
19849    }
19850
19851    #[doc(hidden)]
19852    impl crate::RequestBuilder for ListOperations {
19853        fn request_options(&mut self) -> &mut crate::RequestOptions {
19854            &mut self.0.options
19855        }
19856    }
19857
19858    /// The request builder for [Sessions::get_operation][crate::client::Sessions::get_operation] calls.
19859    ///
19860    /// # Example
19861    /// ```
19862    /// # use google_cloud_dialogflow_v2::builder::sessions::GetOperation;
19863    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19864    ///
19865    /// let builder = prepare_request_builder();
19866    /// let response = builder.send().await?;
19867    /// # Ok(()) }
19868    ///
19869    /// fn prepare_request_builder() -> GetOperation {
19870    ///   # panic!();
19871    ///   // ... details omitted ...
19872    /// }
19873    /// ```
19874    #[derive(Clone, Debug)]
19875    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19876
19877    impl GetOperation {
19878        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19879            Self(RequestBuilder::new(stub))
19880        }
19881
19882        /// Sets the full request, replacing any prior values.
19883        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19884            mut self,
19885            v: V,
19886        ) -> Self {
19887            self.0.request = v.into();
19888            self
19889        }
19890
19891        /// Sets all the options, replacing any prior values.
19892        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19893            self.0.options = v.into();
19894            self
19895        }
19896
19897        /// Sends the request.
19898        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19899            (*self.0.stub)
19900                .get_operation(self.0.request, self.0.options)
19901                .await
19902                .map(crate::Response::into_body)
19903        }
19904
19905        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19906        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19907            self.0.request.name = v.into();
19908            self
19909        }
19910    }
19911
19912    #[doc(hidden)]
19913    impl crate::RequestBuilder for GetOperation {
19914        fn request_options(&mut self) -> &mut crate::RequestOptions {
19915            &mut self.0.options
19916        }
19917    }
19918
19919    /// The request builder for [Sessions::cancel_operation][crate::client::Sessions::cancel_operation] calls.
19920    ///
19921    /// # Example
19922    /// ```
19923    /// # use google_cloud_dialogflow_v2::builder::sessions::CancelOperation;
19924    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19925    ///
19926    /// let builder = prepare_request_builder();
19927    /// let response = builder.send().await?;
19928    /// # Ok(()) }
19929    ///
19930    /// fn prepare_request_builder() -> CancelOperation {
19931    ///   # panic!();
19932    ///   // ... details omitted ...
19933    /// }
19934    /// ```
19935    #[derive(Clone, Debug)]
19936    pub struct CancelOperation(
19937        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19938    );
19939
19940    impl CancelOperation {
19941        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19942            Self(RequestBuilder::new(stub))
19943        }
19944
19945        /// Sets the full request, replacing any prior values.
19946        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19947            mut self,
19948            v: V,
19949        ) -> Self {
19950            self.0.request = v.into();
19951            self
19952        }
19953
19954        /// Sets all the options, replacing any prior values.
19955        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19956            self.0.options = v.into();
19957            self
19958        }
19959
19960        /// Sends the request.
19961        pub async fn send(self) -> Result<()> {
19962            (*self.0.stub)
19963                .cancel_operation(self.0.request, self.0.options)
19964                .await
19965                .map(crate::Response::into_body)
19966        }
19967
19968        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19969        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19970            self.0.request.name = v.into();
19971            self
19972        }
19973    }
19974
19975    #[doc(hidden)]
19976    impl crate::RequestBuilder for CancelOperation {
19977        fn request_options(&mut self) -> &mut crate::RequestOptions {
19978            &mut self.0.options
19979        }
19980    }
19981}
19982
19983/// Request and client builders for [SessionEntityTypes][crate::client::SessionEntityTypes].
19984#[cfg(feature = "session-entity-types")]
19985#[cfg_attr(docsrs, doc(cfg(feature = "session-entity-types")))]
19986pub mod session_entity_types {
19987    use crate::Result;
19988
19989    /// A builder for [SessionEntityTypes][crate::client::SessionEntityTypes].
19990    ///
19991    /// ```
19992    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19993    /// # use google_cloud_dialogflow_v2::*;
19994    /// # use builder::session_entity_types::ClientBuilder;
19995    /// # use client::SessionEntityTypes;
19996    /// let builder : ClientBuilder = SessionEntityTypes::builder();
19997    /// let client = builder
19998    ///     .with_endpoint("https://dialogflow.googleapis.com")
19999    ///     .build().await?;
20000    /// # Ok(()) }
20001    /// ```
20002    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20003
20004    pub(crate) mod client {
20005        use super::super::super::client::SessionEntityTypes;
20006        pub struct Factory;
20007        impl crate::ClientFactory for Factory {
20008            type Client = SessionEntityTypes;
20009            type Credentials = gaxi::options::Credentials;
20010            async fn build(
20011                self,
20012                config: gaxi::options::ClientConfig,
20013            ) -> crate::ClientBuilderResult<Self::Client> {
20014                Self::Client::new(config).await
20015            }
20016        }
20017    }
20018
20019    /// Common implementation for [crate::client::SessionEntityTypes] request builders.
20020    #[derive(Clone, Debug)]
20021    pub(crate) struct RequestBuilder<R: std::default::Default> {
20022        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20023        request: R,
20024        options: crate::RequestOptions,
20025    }
20026
20027    impl<R> RequestBuilder<R>
20028    where
20029        R: std::default::Default,
20030    {
20031        pub(crate) fn new(
20032            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20033        ) -> Self {
20034            Self {
20035                stub,
20036                request: R::default(),
20037                options: crate::RequestOptions::default(),
20038            }
20039        }
20040    }
20041
20042    /// The request builder for [SessionEntityTypes::list_session_entity_types][crate::client::SessionEntityTypes::list_session_entity_types] calls.
20043    ///
20044    /// # Example
20045    /// ```
20046    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListSessionEntityTypes;
20047    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20048    /// use google_cloud_gax::paginator::ItemPaginator;
20049    ///
20050    /// let builder = prepare_request_builder();
20051    /// let mut items = builder.by_item();
20052    /// while let Some(result) = items.next().await {
20053    ///   let item = result?;
20054    /// }
20055    /// # Ok(()) }
20056    ///
20057    /// fn prepare_request_builder() -> ListSessionEntityTypes {
20058    ///   # panic!();
20059    ///   // ... details omitted ...
20060    /// }
20061    /// ```
20062    #[derive(Clone, Debug)]
20063    pub struct ListSessionEntityTypes(RequestBuilder<crate::model::ListSessionEntityTypesRequest>);
20064
20065    impl ListSessionEntityTypes {
20066        pub(crate) fn new(
20067            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20068        ) -> Self {
20069            Self(RequestBuilder::new(stub))
20070        }
20071
20072        /// Sets the full request, replacing any prior values.
20073        pub fn with_request<V: Into<crate::model::ListSessionEntityTypesRequest>>(
20074            mut self,
20075            v: V,
20076        ) -> Self {
20077            self.0.request = v.into();
20078            self
20079        }
20080
20081        /// Sets all the options, replacing any prior values.
20082        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20083            self.0.options = v.into();
20084            self
20085        }
20086
20087        /// Sends the request.
20088        pub async fn send(self) -> Result<crate::model::ListSessionEntityTypesResponse> {
20089            (*self.0.stub)
20090                .list_session_entity_types(self.0.request, self.0.options)
20091                .await
20092                .map(crate::Response::into_body)
20093        }
20094
20095        /// Streams each page in the collection.
20096        pub fn by_page(
20097            self,
20098        ) -> impl google_cloud_gax::paginator::Paginator<
20099            crate::model::ListSessionEntityTypesResponse,
20100            crate::Error,
20101        > {
20102            use std::clone::Clone;
20103            let token = self.0.request.page_token.clone();
20104            let execute = move |token: String| {
20105                let mut builder = self.clone();
20106                builder.0.request = builder.0.request.set_page_token(token);
20107                builder.send()
20108            };
20109            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20110        }
20111
20112        /// Streams each item in the collection.
20113        pub fn by_item(
20114            self,
20115        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20116            crate::model::ListSessionEntityTypesResponse,
20117            crate::Error,
20118        > {
20119            use google_cloud_gax::paginator::Paginator;
20120            self.by_page().items()
20121        }
20122
20123        /// Sets the value of [parent][crate::model::ListSessionEntityTypesRequest::parent].
20124        ///
20125        /// This is a **required** field for requests.
20126        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20127            self.0.request.parent = v.into();
20128            self
20129        }
20130
20131        /// Sets the value of [page_size][crate::model::ListSessionEntityTypesRequest::page_size].
20132        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20133            self.0.request.page_size = v.into();
20134            self
20135        }
20136
20137        /// Sets the value of [page_token][crate::model::ListSessionEntityTypesRequest::page_token].
20138        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20139            self.0.request.page_token = v.into();
20140            self
20141        }
20142    }
20143
20144    #[doc(hidden)]
20145    impl crate::RequestBuilder for ListSessionEntityTypes {
20146        fn request_options(&mut self) -> &mut crate::RequestOptions {
20147            &mut self.0.options
20148        }
20149    }
20150
20151    /// The request builder for [SessionEntityTypes::get_session_entity_type][crate::client::SessionEntityTypes::get_session_entity_type] calls.
20152    ///
20153    /// # Example
20154    /// ```
20155    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetSessionEntityType;
20156    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20157    ///
20158    /// let builder = prepare_request_builder();
20159    /// let response = builder.send().await?;
20160    /// # Ok(()) }
20161    ///
20162    /// fn prepare_request_builder() -> GetSessionEntityType {
20163    ///   # panic!();
20164    ///   // ... details omitted ...
20165    /// }
20166    /// ```
20167    #[derive(Clone, Debug)]
20168    pub struct GetSessionEntityType(RequestBuilder<crate::model::GetSessionEntityTypeRequest>);
20169
20170    impl GetSessionEntityType {
20171        pub(crate) fn new(
20172            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20173        ) -> Self {
20174            Self(RequestBuilder::new(stub))
20175        }
20176
20177        /// Sets the full request, replacing any prior values.
20178        pub fn with_request<V: Into<crate::model::GetSessionEntityTypeRequest>>(
20179            mut self,
20180            v: V,
20181        ) -> Self {
20182            self.0.request = v.into();
20183            self
20184        }
20185
20186        /// Sets all the options, replacing any prior values.
20187        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20188            self.0.options = v.into();
20189            self
20190        }
20191
20192        /// Sends the request.
20193        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20194            (*self.0.stub)
20195                .get_session_entity_type(self.0.request, self.0.options)
20196                .await
20197                .map(crate::Response::into_body)
20198        }
20199
20200        /// Sets the value of [name][crate::model::GetSessionEntityTypeRequest::name].
20201        ///
20202        /// This is a **required** field for requests.
20203        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20204            self.0.request.name = v.into();
20205            self
20206        }
20207    }
20208
20209    #[doc(hidden)]
20210    impl crate::RequestBuilder for GetSessionEntityType {
20211        fn request_options(&mut self) -> &mut crate::RequestOptions {
20212            &mut self.0.options
20213        }
20214    }
20215
20216    /// The request builder for [SessionEntityTypes::create_session_entity_type][crate::client::SessionEntityTypes::create_session_entity_type] calls.
20217    ///
20218    /// # Example
20219    /// ```
20220    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::CreateSessionEntityType;
20221    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20222    ///
20223    /// let builder = prepare_request_builder();
20224    /// let response = builder.send().await?;
20225    /// # Ok(()) }
20226    ///
20227    /// fn prepare_request_builder() -> CreateSessionEntityType {
20228    ///   # panic!();
20229    ///   // ... details omitted ...
20230    /// }
20231    /// ```
20232    #[derive(Clone, Debug)]
20233    pub struct CreateSessionEntityType(
20234        RequestBuilder<crate::model::CreateSessionEntityTypeRequest>,
20235    );
20236
20237    impl CreateSessionEntityType {
20238        pub(crate) fn new(
20239            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20240        ) -> Self {
20241            Self(RequestBuilder::new(stub))
20242        }
20243
20244        /// Sets the full request, replacing any prior values.
20245        pub fn with_request<V: Into<crate::model::CreateSessionEntityTypeRequest>>(
20246            mut self,
20247            v: V,
20248        ) -> Self {
20249            self.0.request = v.into();
20250            self
20251        }
20252
20253        /// Sets all the options, replacing any prior values.
20254        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20255            self.0.options = v.into();
20256            self
20257        }
20258
20259        /// Sends the request.
20260        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20261            (*self.0.stub)
20262                .create_session_entity_type(self.0.request, self.0.options)
20263                .await
20264                .map(crate::Response::into_body)
20265        }
20266
20267        /// Sets the value of [parent][crate::model::CreateSessionEntityTypeRequest::parent].
20268        ///
20269        /// This is a **required** field for requests.
20270        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20271            self.0.request.parent = v.into();
20272            self
20273        }
20274
20275        /// Sets the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
20276        ///
20277        /// This is a **required** field for requests.
20278        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
20279        where
20280            T: std::convert::Into<crate::model::SessionEntityType>,
20281        {
20282            self.0.request.session_entity_type = std::option::Option::Some(v.into());
20283            self
20284        }
20285
20286        /// Sets or clears the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
20287        ///
20288        /// This is a **required** field for requests.
20289        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
20290        where
20291            T: std::convert::Into<crate::model::SessionEntityType>,
20292        {
20293            self.0.request.session_entity_type = v.map(|x| x.into());
20294            self
20295        }
20296    }
20297
20298    #[doc(hidden)]
20299    impl crate::RequestBuilder for CreateSessionEntityType {
20300        fn request_options(&mut self) -> &mut crate::RequestOptions {
20301            &mut self.0.options
20302        }
20303    }
20304
20305    /// The request builder for [SessionEntityTypes::update_session_entity_type][crate::client::SessionEntityTypes::update_session_entity_type] calls.
20306    ///
20307    /// # Example
20308    /// ```
20309    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::UpdateSessionEntityType;
20310    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20311    ///
20312    /// let builder = prepare_request_builder();
20313    /// let response = builder.send().await?;
20314    /// # Ok(()) }
20315    ///
20316    /// fn prepare_request_builder() -> UpdateSessionEntityType {
20317    ///   # panic!();
20318    ///   // ... details omitted ...
20319    /// }
20320    /// ```
20321    #[derive(Clone, Debug)]
20322    pub struct UpdateSessionEntityType(
20323        RequestBuilder<crate::model::UpdateSessionEntityTypeRequest>,
20324    );
20325
20326    impl UpdateSessionEntityType {
20327        pub(crate) fn new(
20328            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20329        ) -> Self {
20330            Self(RequestBuilder::new(stub))
20331        }
20332
20333        /// Sets the full request, replacing any prior values.
20334        pub fn with_request<V: Into<crate::model::UpdateSessionEntityTypeRequest>>(
20335            mut self,
20336            v: V,
20337        ) -> Self {
20338            self.0.request = v.into();
20339            self
20340        }
20341
20342        /// Sets all the options, replacing any prior values.
20343        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20344            self.0.options = v.into();
20345            self
20346        }
20347
20348        /// Sends the request.
20349        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20350            (*self.0.stub)
20351                .update_session_entity_type(self.0.request, self.0.options)
20352                .await
20353                .map(crate::Response::into_body)
20354        }
20355
20356        /// Sets the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
20357        ///
20358        /// This is a **required** field for requests.
20359        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
20360        where
20361            T: std::convert::Into<crate::model::SessionEntityType>,
20362        {
20363            self.0.request.session_entity_type = std::option::Option::Some(v.into());
20364            self
20365        }
20366
20367        /// Sets or clears the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
20368        ///
20369        /// This is a **required** field for requests.
20370        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
20371        where
20372            T: std::convert::Into<crate::model::SessionEntityType>,
20373        {
20374            self.0.request.session_entity_type = v.map(|x| x.into());
20375            self
20376        }
20377
20378        /// Sets the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
20379        pub fn set_update_mask<T>(mut self, v: T) -> Self
20380        where
20381            T: std::convert::Into<wkt::FieldMask>,
20382        {
20383            self.0.request.update_mask = std::option::Option::Some(v.into());
20384            self
20385        }
20386
20387        /// Sets or clears the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
20388        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20389        where
20390            T: std::convert::Into<wkt::FieldMask>,
20391        {
20392            self.0.request.update_mask = v.map(|x| x.into());
20393            self
20394        }
20395    }
20396
20397    #[doc(hidden)]
20398    impl crate::RequestBuilder for UpdateSessionEntityType {
20399        fn request_options(&mut self) -> &mut crate::RequestOptions {
20400            &mut self.0.options
20401        }
20402    }
20403
20404    /// The request builder for [SessionEntityTypes::delete_session_entity_type][crate::client::SessionEntityTypes::delete_session_entity_type] calls.
20405    ///
20406    /// # Example
20407    /// ```
20408    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::DeleteSessionEntityType;
20409    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20410    ///
20411    /// let builder = prepare_request_builder();
20412    /// let response = builder.send().await?;
20413    /// # Ok(()) }
20414    ///
20415    /// fn prepare_request_builder() -> DeleteSessionEntityType {
20416    ///   # panic!();
20417    ///   // ... details omitted ...
20418    /// }
20419    /// ```
20420    #[derive(Clone, Debug)]
20421    pub struct DeleteSessionEntityType(
20422        RequestBuilder<crate::model::DeleteSessionEntityTypeRequest>,
20423    );
20424
20425    impl DeleteSessionEntityType {
20426        pub(crate) fn new(
20427            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20428        ) -> Self {
20429            Self(RequestBuilder::new(stub))
20430        }
20431
20432        /// Sets the full request, replacing any prior values.
20433        pub fn with_request<V: Into<crate::model::DeleteSessionEntityTypeRequest>>(
20434            mut self,
20435            v: V,
20436        ) -> Self {
20437            self.0.request = v.into();
20438            self
20439        }
20440
20441        /// Sets all the options, replacing any prior values.
20442        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20443            self.0.options = v.into();
20444            self
20445        }
20446
20447        /// Sends the request.
20448        pub async fn send(self) -> Result<()> {
20449            (*self.0.stub)
20450                .delete_session_entity_type(self.0.request, self.0.options)
20451                .await
20452                .map(crate::Response::into_body)
20453        }
20454
20455        /// Sets the value of [name][crate::model::DeleteSessionEntityTypeRequest::name].
20456        ///
20457        /// This is a **required** field for requests.
20458        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20459            self.0.request.name = v.into();
20460            self
20461        }
20462    }
20463
20464    #[doc(hidden)]
20465    impl crate::RequestBuilder for DeleteSessionEntityType {
20466        fn request_options(&mut self) -> &mut crate::RequestOptions {
20467            &mut self.0.options
20468        }
20469    }
20470
20471    /// The request builder for [SessionEntityTypes::list_locations][crate::client::SessionEntityTypes::list_locations] calls.
20472    ///
20473    /// # Example
20474    /// ```
20475    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListLocations;
20476    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20477    /// use google_cloud_gax::paginator::ItemPaginator;
20478    ///
20479    /// let builder = prepare_request_builder();
20480    /// let mut items = builder.by_item();
20481    /// while let Some(result) = items.next().await {
20482    ///   let item = result?;
20483    /// }
20484    /// # Ok(()) }
20485    ///
20486    /// fn prepare_request_builder() -> ListLocations {
20487    ///   # panic!();
20488    ///   // ... details omitted ...
20489    /// }
20490    /// ```
20491    #[derive(Clone, Debug)]
20492    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20493
20494    impl ListLocations {
20495        pub(crate) fn new(
20496            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20497        ) -> Self {
20498            Self(RequestBuilder::new(stub))
20499        }
20500
20501        /// Sets the full request, replacing any prior values.
20502        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20503            mut self,
20504            v: V,
20505        ) -> Self {
20506            self.0.request = v.into();
20507            self
20508        }
20509
20510        /// Sets all the options, replacing any prior values.
20511        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20512            self.0.options = v.into();
20513            self
20514        }
20515
20516        /// Sends the request.
20517        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20518            (*self.0.stub)
20519                .list_locations(self.0.request, self.0.options)
20520                .await
20521                .map(crate::Response::into_body)
20522        }
20523
20524        /// Streams each page in the collection.
20525        pub fn by_page(
20526            self,
20527        ) -> impl google_cloud_gax::paginator::Paginator<
20528            google_cloud_location::model::ListLocationsResponse,
20529            crate::Error,
20530        > {
20531            use std::clone::Clone;
20532            let token = self.0.request.page_token.clone();
20533            let execute = move |token: String| {
20534                let mut builder = self.clone();
20535                builder.0.request = builder.0.request.set_page_token(token);
20536                builder.send()
20537            };
20538            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20539        }
20540
20541        /// Streams each item in the collection.
20542        pub fn by_item(
20543            self,
20544        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20545            google_cloud_location::model::ListLocationsResponse,
20546            crate::Error,
20547        > {
20548            use google_cloud_gax::paginator::Paginator;
20549            self.by_page().items()
20550        }
20551
20552        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
20553        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20554            self.0.request.name = v.into();
20555            self
20556        }
20557
20558        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
20559        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20560            self.0.request.filter = v.into();
20561            self
20562        }
20563
20564        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
20565        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20566            self.0.request.page_size = v.into();
20567            self
20568        }
20569
20570        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
20571        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20572            self.0.request.page_token = v.into();
20573            self
20574        }
20575    }
20576
20577    #[doc(hidden)]
20578    impl crate::RequestBuilder for ListLocations {
20579        fn request_options(&mut self) -> &mut crate::RequestOptions {
20580            &mut self.0.options
20581        }
20582    }
20583
20584    /// The request builder for [SessionEntityTypes::get_location][crate::client::SessionEntityTypes::get_location] calls.
20585    ///
20586    /// # Example
20587    /// ```
20588    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetLocation;
20589    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20590    ///
20591    /// let builder = prepare_request_builder();
20592    /// let response = builder.send().await?;
20593    /// # Ok(()) }
20594    ///
20595    /// fn prepare_request_builder() -> GetLocation {
20596    ///   # panic!();
20597    ///   // ... details omitted ...
20598    /// }
20599    /// ```
20600    #[derive(Clone, Debug)]
20601    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20602
20603    impl GetLocation {
20604        pub(crate) fn new(
20605            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20606        ) -> Self {
20607            Self(RequestBuilder::new(stub))
20608        }
20609
20610        /// Sets the full request, replacing any prior values.
20611        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20612            mut self,
20613            v: V,
20614        ) -> Self {
20615            self.0.request = v.into();
20616            self
20617        }
20618
20619        /// Sets all the options, replacing any prior values.
20620        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20621            self.0.options = v.into();
20622            self
20623        }
20624
20625        /// Sends the request.
20626        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20627            (*self.0.stub)
20628                .get_location(self.0.request, self.0.options)
20629                .await
20630                .map(crate::Response::into_body)
20631        }
20632
20633        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
20634        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20635            self.0.request.name = v.into();
20636            self
20637        }
20638    }
20639
20640    #[doc(hidden)]
20641    impl crate::RequestBuilder for GetLocation {
20642        fn request_options(&mut self) -> &mut crate::RequestOptions {
20643            &mut self.0.options
20644        }
20645    }
20646
20647    /// The request builder for [SessionEntityTypes::list_operations][crate::client::SessionEntityTypes::list_operations] calls.
20648    ///
20649    /// # Example
20650    /// ```
20651    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListOperations;
20652    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20653    /// use google_cloud_gax::paginator::ItemPaginator;
20654    ///
20655    /// let builder = prepare_request_builder();
20656    /// let mut items = builder.by_item();
20657    /// while let Some(result) = items.next().await {
20658    ///   let item = result?;
20659    /// }
20660    /// # Ok(()) }
20661    ///
20662    /// fn prepare_request_builder() -> ListOperations {
20663    ///   # panic!();
20664    ///   // ... details omitted ...
20665    /// }
20666    /// ```
20667    #[derive(Clone, Debug)]
20668    pub struct ListOperations(
20669        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20670    );
20671
20672    impl ListOperations {
20673        pub(crate) fn new(
20674            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20675        ) -> Self {
20676            Self(RequestBuilder::new(stub))
20677        }
20678
20679        /// Sets the full request, replacing any prior values.
20680        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20681            mut self,
20682            v: V,
20683        ) -> Self {
20684            self.0.request = v.into();
20685            self
20686        }
20687
20688        /// Sets all the options, replacing any prior values.
20689        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20690            self.0.options = v.into();
20691            self
20692        }
20693
20694        /// Sends the request.
20695        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20696            (*self.0.stub)
20697                .list_operations(self.0.request, self.0.options)
20698                .await
20699                .map(crate::Response::into_body)
20700        }
20701
20702        /// Streams each page in the collection.
20703        pub fn by_page(
20704            self,
20705        ) -> impl google_cloud_gax::paginator::Paginator<
20706            google_cloud_longrunning::model::ListOperationsResponse,
20707            crate::Error,
20708        > {
20709            use std::clone::Clone;
20710            let token = self.0.request.page_token.clone();
20711            let execute = move |token: String| {
20712                let mut builder = self.clone();
20713                builder.0.request = builder.0.request.set_page_token(token);
20714                builder.send()
20715            };
20716            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20717        }
20718
20719        /// Streams each item in the collection.
20720        pub fn by_item(
20721            self,
20722        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20723            google_cloud_longrunning::model::ListOperationsResponse,
20724            crate::Error,
20725        > {
20726            use google_cloud_gax::paginator::Paginator;
20727            self.by_page().items()
20728        }
20729
20730        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
20731        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20732            self.0.request.name = v.into();
20733            self
20734        }
20735
20736        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
20737        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20738            self.0.request.filter = v.into();
20739            self
20740        }
20741
20742        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
20743        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20744            self.0.request.page_size = v.into();
20745            self
20746        }
20747
20748        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
20749        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20750            self.0.request.page_token = v.into();
20751            self
20752        }
20753
20754        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
20755        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20756            self.0.request.return_partial_success = v.into();
20757            self
20758        }
20759    }
20760
20761    #[doc(hidden)]
20762    impl crate::RequestBuilder for ListOperations {
20763        fn request_options(&mut self) -> &mut crate::RequestOptions {
20764            &mut self.0.options
20765        }
20766    }
20767
20768    /// The request builder for [SessionEntityTypes::get_operation][crate::client::SessionEntityTypes::get_operation] calls.
20769    ///
20770    /// # Example
20771    /// ```
20772    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetOperation;
20773    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20774    ///
20775    /// let builder = prepare_request_builder();
20776    /// let response = builder.send().await?;
20777    /// # Ok(()) }
20778    ///
20779    /// fn prepare_request_builder() -> GetOperation {
20780    ///   # panic!();
20781    ///   // ... details omitted ...
20782    /// }
20783    /// ```
20784    #[derive(Clone, Debug)]
20785    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20786
20787    impl GetOperation {
20788        pub(crate) fn new(
20789            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20790        ) -> Self {
20791            Self(RequestBuilder::new(stub))
20792        }
20793
20794        /// Sets the full request, replacing any prior values.
20795        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20796            mut self,
20797            v: V,
20798        ) -> Self {
20799            self.0.request = v.into();
20800            self
20801        }
20802
20803        /// Sets all the options, replacing any prior values.
20804        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20805            self.0.options = v.into();
20806            self
20807        }
20808
20809        /// Sends the request.
20810        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20811            (*self.0.stub)
20812                .get_operation(self.0.request, self.0.options)
20813                .await
20814                .map(crate::Response::into_body)
20815        }
20816
20817        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
20818        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20819            self.0.request.name = v.into();
20820            self
20821        }
20822    }
20823
20824    #[doc(hidden)]
20825    impl crate::RequestBuilder for GetOperation {
20826        fn request_options(&mut self) -> &mut crate::RequestOptions {
20827            &mut self.0.options
20828        }
20829    }
20830
20831    /// The request builder for [SessionEntityTypes::cancel_operation][crate::client::SessionEntityTypes::cancel_operation] calls.
20832    ///
20833    /// # Example
20834    /// ```
20835    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::CancelOperation;
20836    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20837    ///
20838    /// let builder = prepare_request_builder();
20839    /// let response = builder.send().await?;
20840    /// # Ok(()) }
20841    ///
20842    /// fn prepare_request_builder() -> CancelOperation {
20843    ///   # panic!();
20844    ///   // ... details omitted ...
20845    /// }
20846    /// ```
20847    #[derive(Clone, Debug)]
20848    pub struct CancelOperation(
20849        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20850    );
20851
20852    impl CancelOperation {
20853        pub(crate) fn new(
20854            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20855        ) -> Self {
20856            Self(RequestBuilder::new(stub))
20857        }
20858
20859        /// Sets the full request, replacing any prior values.
20860        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20861            mut self,
20862            v: V,
20863        ) -> Self {
20864            self.0.request = v.into();
20865            self
20866        }
20867
20868        /// Sets all the options, replacing any prior values.
20869        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20870            self.0.options = v.into();
20871            self
20872        }
20873
20874        /// Sends the request.
20875        pub async fn send(self) -> Result<()> {
20876            (*self.0.stub)
20877                .cancel_operation(self.0.request, self.0.options)
20878                .await
20879                .map(crate::Response::into_body)
20880        }
20881
20882        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
20883        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20884            self.0.request.name = v.into();
20885            self
20886        }
20887    }
20888
20889    #[doc(hidden)]
20890    impl crate::RequestBuilder for CancelOperation {
20891        fn request_options(&mut self) -> &mut crate::RequestOptions {
20892            &mut self.0.options
20893        }
20894    }
20895}
20896
20897/// Request and client builders for [SipTrunks][crate::client::SipTrunks].
20898#[cfg(feature = "sip-trunks")]
20899#[cfg_attr(docsrs, doc(cfg(feature = "sip-trunks")))]
20900pub mod sip_trunks {
20901    use crate::Result;
20902
20903    /// A builder for [SipTrunks][crate::client::SipTrunks].
20904    ///
20905    /// ```
20906    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20907    /// # use google_cloud_dialogflow_v2::*;
20908    /// # use builder::sip_trunks::ClientBuilder;
20909    /// # use client::SipTrunks;
20910    /// let builder : ClientBuilder = SipTrunks::builder();
20911    /// let client = builder
20912    ///     .with_endpoint("https://dialogflow.googleapis.com")
20913    ///     .build().await?;
20914    /// # Ok(()) }
20915    /// ```
20916    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20917
20918    pub(crate) mod client {
20919        use super::super::super::client::SipTrunks;
20920        pub struct Factory;
20921        impl crate::ClientFactory for Factory {
20922            type Client = SipTrunks;
20923            type Credentials = gaxi::options::Credentials;
20924            async fn build(
20925                self,
20926                config: gaxi::options::ClientConfig,
20927            ) -> crate::ClientBuilderResult<Self::Client> {
20928                Self::Client::new(config).await
20929            }
20930        }
20931    }
20932
20933    /// Common implementation for [crate::client::SipTrunks] request builders.
20934    #[derive(Clone, Debug)]
20935    pub(crate) struct RequestBuilder<R: std::default::Default> {
20936        stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20937        request: R,
20938        options: crate::RequestOptions,
20939    }
20940
20941    impl<R> RequestBuilder<R>
20942    where
20943        R: std::default::Default,
20944    {
20945        pub(crate) fn new(
20946            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20947        ) -> Self {
20948            Self {
20949                stub,
20950                request: R::default(),
20951                options: crate::RequestOptions::default(),
20952            }
20953        }
20954    }
20955
20956    /// The request builder for [SipTrunks::create_sip_trunk][crate::client::SipTrunks::create_sip_trunk] calls.
20957    ///
20958    /// # Example
20959    /// ```
20960    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::CreateSipTrunk;
20961    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20962    ///
20963    /// let builder = prepare_request_builder();
20964    /// let response = builder.send().await?;
20965    /// # Ok(()) }
20966    ///
20967    /// fn prepare_request_builder() -> CreateSipTrunk {
20968    ///   # panic!();
20969    ///   // ... details omitted ...
20970    /// }
20971    /// ```
20972    #[derive(Clone, Debug)]
20973    pub struct CreateSipTrunk(RequestBuilder<crate::model::CreateSipTrunkRequest>);
20974
20975    impl CreateSipTrunk {
20976        pub(crate) fn new(
20977            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20978        ) -> Self {
20979            Self(RequestBuilder::new(stub))
20980        }
20981
20982        /// Sets the full request, replacing any prior values.
20983        pub fn with_request<V: Into<crate::model::CreateSipTrunkRequest>>(mut self, v: V) -> Self {
20984            self.0.request = v.into();
20985            self
20986        }
20987
20988        /// Sets all the options, replacing any prior values.
20989        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20990            self.0.options = v.into();
20991            self
20992        }
20993
20994        /// Sends the request.
20995        pub async fn send(self) -> Result<crate::model::SipTrunk> {
20996            (*self.0.stub)
20997                .create_sip_trunk(self.0.request, self.0.options)
20998                .await
20999                .map(crate::Response::into_body)
21000        }
21001
21002        /// Sets the value of [parent][crate::model::CreateSipTrunkRequest::parent].
21003        ///
21004        /// This is a **required** field for requests.
21005        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21006            self.0.request.parent = v.into();
21007            self
21008        }
21009
21010        /// Sets the value of [sip_trunk][crate::model::CreateSipTrunkRequest::sip_trunk].
21011        ///
21012        /// This is a **required** field for requests.
21013        pub fn set_sip_trunk<T>(mut self, v: T) -> Self
21014        where
21015            T: std::convert::Into<crate::model::SipTrunk>,
21016        {
21017            self.0.request.sip_trunk = std::option::Option::Some(v.into());
21018            self
21019        }
21020
21021        /// Sets or clears the value of [sip_trunk][crate::model::CreateSipTrunkRequest::sip_trunk].
21022        ///
21023        /// This is a **required** field for requests.
21024        pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
21025        where
21026            T: std::convert::Into<crate::model::SipTrunk>,
21027        {
21028            self.0.request.sip_trunk = v.map(|x| x.into());
21029            self
21030        }
21031    }
21032
21033    #[doc(hidden)]
21034    impl crate::RequestBuilder for CreateSipTrunk {
21035        fn request_options(&mut self) -> &mut crate::RequestOptions {
21036            &mut self.0.options
21037        }
21038    }
21039
21040    /// The request builder for [SipTrunks::delete_sip_trunk][crate::client::SipTrunks::delete_sip_trunk] calls.
21041    ///
21042    /// # Example
21043    /// ```
21044    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::DeleteSipTrunk;
21045    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21046    ///
21047    /// let builder = prepare_request_builder();
21048    /// let response = builder.send().await?;
21049    /// # Ok(()) }
21050    ///
21051    /// fn prepare_request_builder() -> DeleteSipTrunk {
21052    ///   # panic!();
21053    ///   // ... details omitted ...
21054    /// }
21055    /// ```
21056    #[derive(Clone, Debug)]
21057    pub struct DeleteSipTrunk(RequestBuilder<crate::model::DeleteSipTrunkRequest>);
21058
21059    impl DeleteSipTrunk {
21060        pub(crate) fn new(
21061            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21062        ) -> Self {
21063            Self(RequestBuilder::new(stub))
21064        }
21065
21066        /// Sets the full request, replacing any prior values.
21067        pub fn with_request<V: Into<crate::model::DeleteSipTrunkRequest>>(mut self, v: V) -> Self {
21068            self.0.request = v.into();
21069            self
21070        }
21071
21072        /// Sets all the options, replacing any prior values.
21073        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21074            self.0.options = v.into();
21075            self
21076        }
21077
21078        /// Sends the request.
21079        pub async fn send(self) -> Result<()> {
21080            (*self.0.stub)
21081                .delete_sip_trunk(self.0.request, self.0.options)
21082                .await
21083                .map(crate::Response::into_body)
21084        }
21085
21086        /// Sets the value of [name][crate::model::DeleteSipTrunkRequest::name].
21087        ///
21088        /// This is a **required** field for requests.
21089        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21090            self.0.request.name = v.into();
21091            self
21092        }
21093    }
21094
21095    #[doc(hidden)]
21096    impl crate::RequestBuilder for DeleteSipTrunk {
21097        fn request_options(&mut self) -> &mut crate::RequestOptions {
21098            &mut self.0.options
21099        }
21100    }
21101
21102    /// The request builder for [SipTrunks::list_sip_trunks][crate::client::SipTrunks::list_sip_trunks] calls.
21103    ///
21104    /// # Example
21105    /// ```
21106    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListSipTrunks;
21107    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21108    /// use google_cloud_gax::paginator::ItemPaginator;
21109    ///
21110    /// let builder = prepare_request_builder();
21111    /// let mut items = builder.by_item();
21112    /// while let Some(result) = items.next().await {
21113    ///   let item = result?;
21114    /// }
21115    /// # Ok(()) }
21116    ///
21117    /// fn prepare_request_builder() -> ListSipTrunks {
21118    ///   # panic!();
21119    ///   // ... details omitted ...
21120    /// }
21121    /// ```
21122    #[derive(Clone, Debug)]
21123    pub struct ListSipTrunks(RequestBuilder<crate::model::ListSipTrunksRequest>);
21124
21125    impl ListSipTrunks {
21126        pub(crate) fn new(
21127            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21128        ) -> Self {
21129            Self(RequestBuilder::new(stub))
21130        }
21131
21132        /// Sets the full request, replacing any prior values.
21133        pub fn with_request<V: Into<crate::model::ListSipTrunksRequest>>(mut self, v: V) -> Self {
21134            self.0.request = v.into();
21135            self
21136        }
21137
21138        /// Sets all the options, replacing any prior values.
21139        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21140            self.0.options = v.into();
21141            self
21142        }
21143
21144        /// Sends the request.
21145        pub async fn send(self) -> Result<crate::model::ListSipTrunksResponse> {
21146            (*self.0.stub)
21147                .list_sip_trunks(self.0.request, self.0.options)
21148                .await
21149                .map(crate::Response::into_body)
21150        }
21151
21152        /// Streams each page in the collection.
21153        pub fn by_page(
21154            self,
21155        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSipTrunksResponse, crate::Error>
21156        {
21157            use std::clone::Clone;
21158            let token = self.0.request.page_token.clone();
21159            let execute = move |token: String| {
21160                let mut builder = self.clone();
21161                builder.0.request = builder.0.request.set_page_token(token);
21162                builder.send()
21163            };
21164            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21165        }
21166
21167        /// Streams each item in the collection.
21168        pub fn by_item(
21169            self,
21170        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21171            crate::model::ListSipTrunksResponse,
21172            crate::Error,
21173        > {
21174            use google_cloud_gax::paginator::Paginator;
21175            self.by_page().items()
21176        }
21177
21178        /// Sets the value of [parent][crate::model::ListSipTrunksRequest::parent].
21179        ///
21180        /// This is a **required** field for requests.
21181        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21182            self.0.request.parent = v.into();
21183            self
21184        }
21185
21186        /// Sets the value of [page_size][crate::model::ListSipTrunksRequest::page_size].
21187        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21188            self.0.request.page_size = v.into();
21189            self
21190        }
21191
21192        /// Sets the value of [page_token][crate::model::ListSipTrunksRequest::page_token].
21193        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21194            self.0.request.page_token = v.into();
21195            self
21196        }
21197    }
21198
21199    #[doc(hidden)]
21200    impl crate::RequestBuilder for ListSipTrunks {
21201        fn request_options(&mut self) -> &mut crate::RequestOptions {
21202            &mut self.0.options
21203        }
21204    }
21205
21206    /// The request builder for [SipTrunks::get_sip_trunk][crate::client::SipTrunks::get_sip_trunk] calls.
21207    ///
21208    /// # Example
21209    /// ```
21210    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetSipTrunk;
21211    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21212    ///
21213    /// let builder = prepare_request_builder();
21214    /// let response = builder.send().await?;
21215    /// # Ok(()) }
21216    ///
21217    /// fn prepare_request_builder() -> GetSipTrunk {
21218    ///   # panic!();
21219    ///   // ... details omitted ...
21220    /// }
21221    /// ```
21222    #[derive(Clone, Debug)]
21223    pub struct GetSipTrunk(RequestBuilder<crate::model::GetSipTrunkRequest>);
21224
21225    impl GetSipTrunk {
21226        pub(crate) fn new(
21227            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21228        ) -> Self {
21229            Self(RequestBuilder::new(stub))
21230        }
21231
21232        /// Sets the full request, replacing any prior values.
21233        pub fn with_request<V: Into<crate::model::GetSipTrunkRequest>>(mut self, v: V) -> Self {
21234            self.0.request = v.into();
21235            self
21236        }
21237
21238        /// Sets all the options, replacing any prior values.
21239        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21240            self.0.options = v.into();
21241            self
21242        }
21243
21244        /// Sends the request.
21245        pub async fn send(self) -> Result<crate::model::SipTrunk> {
21246            (*self.0.stub)
21247                .get_sip_trunk(self.0.request, self.0.options)
21248                .await
21249                .map(crate::Response::into_body)
21250        }
21251
21252        /// Sets the value of [name][crate::model::GetSipTrunkRequest::name].
21253        ///
21254        /// This is a **required** field for requests.
21255        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21256            self.0.request.name = v.into();
21257            self
21258        }
21259    }
21260
21261    #[doc(hidden)]
21262    impl crate::RequestBuilder for GetSipTrunk {
21263        fn request_options(&mut self) -> &mut crate::RequestOptions {
21264            &mut self.0.options
21265        }
21266    }
21267
21268    /// The request builder for [SipTrunks::update_sip_trunk][crate::client::SipTrunks::update_sip_trunk] calls.
21269    ///
21270    /// # Example
21271    /// ```
21272    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::UpdateSipTrunk;
21273    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21274    ///
21275    /// let builder = prepare_request_builder();
21276    /// let response = builder.send().await?;
21277    /// # Ok(()) }
21278    ///
21279    /// fn prepare_request_builder() -> UpdateSipTrunk {
21280    ///   # panic!();
21281    ///   // ... details omitted ...
21282    /// }
21283    /// ```
21284    #[derive(Clone, Debug)]
21285    pub struct UpdateSipTrunk(RequestBuilder<crate::model::UpdateSipTrunkRequest>);
21286
21287    impl UpdateSipTrunk {
21288        pub(crate) fn new(
21289            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21290        ) -> Self {
21291            Self(RequestBuilder::new(stub))
21292        }
21293
21294        /// Sets the full request, replacing any prior values.
21295        pub fn with_request<V: Into<crate::model::UpdateSipTrunkRequest>>(mut self, v: V) -> Self {
21296            self.0.request = v.into();
21297            self
21298        }
21299
21300        /// Sets all the options, replacing any prior values.
21301        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21302            self.0.options = v.into();
21303            self
21304        }
21305
21306        /// Sends the request.
21307        pub async fn send(self) -> Result<crate::model::SipTrunk> {
21308            (*self.0.stub)
21309                .update_sip_trunk(self.0.request, self.0.options)
21310                .await
21311                .map(crate::Response::into_body)
21312        }
21313
21314        /// Sets the value of [sip_trunk][crate::model::UpdateSipTrunkRequest::sip_trunk].
21315        ///
21316        /// This is a **required** field for requests.
21317        pub fn set_sip_trunk<T>(mut self, v: T) -> Self
21318        where
21319            T: std::convert::Into<crate::model::SipTrunk>,
21320        {
21321            self.0.request.sip_trunk = std::option::Option::Some(v.into());
21322            self
21323        }
21324
21325        /// Sets or clears the value of [sip_trunk][crate::model::UpdateSipTrunkRequest::sip_trunk].
21326        ///
21327        /// This is a **required** field for requests.
21328        pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
21329        where
21330            T: std::convert::Into<crate::model::SipTrunk>,
21331        {
21332            self.0.request.sip_trunk = v.map(|x| x.into());
21333            self
21334        }
21335
21336        /// Sets the value of [update_mask][crate::model::UpdateSipTrunkRequest::update_mask].
21337        pub fn set_update_mask<T>(mut self, v: T) -> Self
21338        where
21339            T: std::convert::Into<wkt::FieldMask>,
21340        {
21341            self.0.request.update_mask = std::option::Option::Some(v.into());
21342            self
21343        }
21344
21345        /// Sets or clears the value of [update_mask][crate::model::UpdateSipTrunkRequest::update_mask].
21346        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21347        where
21348            T: std::convert::Into<wkt::FieldMask>,
21349        {
21350            self.0.request.update_mask = v.map(|x| x.into());
21351            self
21352        }
21353    }
21354
21355    #[doc(hidden)]
21356    impl crate::RequestBuilder for UpdateSipTrunk {
21357        fn request_options(&mut self) -> &mut crate::RequestOptions {
21358            &mut self.0.options
21359        }
21360    }
21361
21362    /// The request builder for [SipTrunks::list_locations][crate::client::SipTrunks::list_locations] calls.
21363    ///
21364    /// # Example
21365    /// ```
21366    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListLocations;
21367    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21368    /// use google_cloud_gax::paginator::ItemPaginator;
21369    ///
21370    /// let builder = prepare_request_builder();
21371    /// let mut items = builder.by_item();
21372    /// while let Some(result) = items.next().await {
21373    ///   let item = result?;
21374    /// }
21375    /// # Ok(()) }
21376    ///
21377    /// fn prepare_request_builder() -> ListLocations {
21378    ///   # panic!();
21379    ///   // ... details omitted ...
21380    /// }
21381    /// ```
21382    #[derive(Clone, Debug)]
21383    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21384
21385    impl ListLocations {
21386        pub(crate) fn new(
21387            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21388        ) -> Self {
21389            Self(RequestBuilder::new(stub))
21390        }
21391
21392        /// Sets the full request, replacing any prior values.
21393        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21394            mut self,
21395            v: V,
21396        ) -> Self {
21397            self.0.request = v.into();
21398            self
21399        }
21400
21401        /// Sets all the options, replacing any prior values.
21402        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21403            self.0.options = v.into();
21404            self
21405        }
21406
21407        /// Sends the request.
21408        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21409            (*self.0.stub)
21410                .list_locations(self.0.request, self.0.options)
21411                .await
21412                .map(crate::Response::into_body)
21413        }
21414
21415        /// Streams each page in the collection.
21416        pub fn by_page(
21417            self,
21418        ) -> impl google_cloud_gax::paginator::Paginator<
21419            google_cloud_location::model::ListLocationsResponse,
21420            crate::Error,
21421        > {
21422            use std::clone::Clone;
21423            let token = self.0.request.page_token.clone();
21424            let execute = move |token: String| {
21425                let mut builder = self.clone();
21426                builder.0.request = builder.0.request.set_page_token(token);
21427                builder.send()
21428            };
21429            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21430        }
21431
21432        /// Streams each item in the collection.
21433        pub fn by_item(
21434            self,
21435        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21436            google_cloud_location::model::ListLocationsResponse,
21437            crate::Error,
21438        > {
21439            use google_cloud_gax::paginator::Paginator;
21440            self.by_page().items()
21441        }
21442
21443        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
21444        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21445            self.0.request.name = v.into();
21446            self
21447        }
21448
21449        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
21450        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21451            self.0.request.filter = v.into();
21452            self
21453        }
21454
21455        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
21456        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21457            self.0.request.page_size = v.into();
21458            self
21459        }
21460
21461        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
21462        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21463            self.0.request.page_token = v.into();
21464            self
21465        }
21466    }
21467
21468    #[doc(hidden)]
21469    impl crate::RequestBuilder for ListLocations {
21470        fn request_options(&mut self) -> &mut crate::RequestOptions {
21471            &mut self.0.options
21472        }
21473    }
21474
21475    /// The request builder for [SipTrunks::get_location][crate::client::SipTrunks::get_location] calls.
21476    ///
21477    /// # Example
21478    /// ```
21479    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetLocation;
21480    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21481    ///
21482    /// let builder = prepare_request_builder();
21483    /// let response = builder.send().await?;
21484    /// # Ok(()) }
21485    ///
21486    /// fn prepare_request_builder() -> GetLocation {
21487    ///   # panic!();
21488    ///   // ... details omitted ...
21489    /// }
21490    /// ```
21491    #[derive(Clone, Debug)]
21492    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21493
21494    impl GetLocation {
21495        pub(crate) fn new(
21496            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21497        ) -> Self {
21498            Self(RequestBuilder::new(stub))
21499        }
21500
21501        /// Sets the full request, replacing any prior values.
21502        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21503            mut self,
21504            v: V,
21505        ) -> Self {
21506            self.0.request = v.into();
21507            self
21508        }
21509
21510        /// Sets all the options, replacing any prior values.
21511        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21512            self.0.options = v.into();
21513            self
21514        }
21515
21516        /// Sends the request.
21517        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21518            (*self.0.stub)
21519                .get_location(self.0.request, self.0.options)
21520                .await
21521                .map(crate::Response::into_body)
21522        }
21523
21524        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
21525        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21526            self.0.request.name = v.into();
21527            self
21528        }
21529    }
21530
21531    #[doc(hidden)]
21532    impl crate::RequestBuilder for GetLocation {
21533        fn request_options(&mut self) -> &mut crate::RequestOptions {
21534            &mut self.0.options
21535        }
21536    }
21537
21538    /// The request builder for [SipTrunks::list_operations][crate::client::SipTrunks::list_operations] calls.
21539    ///
21540    /// # Example
21541    /// ```
21542    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListOperations;
21543    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21544    /// use google_cloud_gax::paginator::ItemPaginator;
21545    ///
21546    /// let builder = prepare_request_builder();
21547    /// let mut items = builder.by_item();
21548    /// while let Some(result) = items.next().await {
21549    ///   let item = result?;
21550    /// }
21551    /// # Ok(()) }
21552    ///
21553    /// fn prepare_request_builder() -> ListOperations {
21554    ///   # panic!();
21555    ///   // ... details omitted ...
21556    /// }
21557    /// ```
21558    #[derive(Clone, Debug)]
21559    pub struct ListOperations(
21560        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21561    );
21562
21563    impl ListOperations {
21564        pub(crate) fn new(
21565            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21566        ) -> Self {
21567            Self(RequestBuilder::new(stub))
21568        }
21569
21570        /// Sets the full request, replacing any prior values.
21571        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21572            mut self,
21573            v: V,
21574        ) -> Self {
21575            self.0.request = v.into();
21576            self
21577        }
21578
21579        /// Sets all the options, replacing any prior values.
21580        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21581            self.0.options = v.into();
21582            self
21583        }
21584
21585        /// Sends the request.
21586        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21587            (*self.0.stub)
21588                .list_operations(self.0.request, self.0.options)
21589                .await
21590                .map(crate::Response::into_body)
21591        }
21592
21593        /// Streams each page in the collection.
21594        pub fn by_page(
21595            self,
21596        ) -> impl google_cloud_gax::paginator::Paginator<
21597            google_cloud_longrunning::model::ListOperationsResponse,
21598            crate::Error,
21599        > {
21600            use std::clone::Clone;
21601            let token = self.0.request.page_token.clone();
21602            let execute = move |token: String| {
21603                let mut builder = self.clone();
21604                builder.0.request = builder.0.request.set_page_token(token);
21605                builder.send()
21606            };
21607            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21608        }
21609
21610        /// Streams each item in the collection.
21611        pub fn by_item(
21612            self,
21613        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21614            google_cloud_longrunning::model::ListOperationsResponse,
21615            crate::Error,
21616        > {
21617            use google_cloud_gax::paginator::Paginator;
21618            self.by_page().items()
21619        }
21620
21621        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
21622        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21623            self.0.request.name = v.into();
21624            self
21625        }
21626
21627        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
21628        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21629            self.0.request.filter = v.into();
21630            self
21631        }
21632
21633        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
21634        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21635            self.0.request.page_size = v.into();
21636            self
21637        }
21638
21639        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
21640        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21641            self.0.request.page_token = v.into();
21642            self
21643        }
21644
21645        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
21646        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21647            self.0.request.return_partial_success = v.into();
21648            self
21649        }
21650    }
21651
21652    #[doc(hidden)]
21653    impl crate::RequestBuilder for ListOperations {
21654        fn request_options(&mut self) -> &mut crate::RequestOptions {
21655            &mut self.0.options
21656        }
21657    }
21658
21659    /// The request builder for [SipTrunks::get_operation][crate::client::SipTrunks::get_operation] calls.
21660    ///
21661    /// # Example
21662    /// ```
21663    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetOperation;
21664    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21665    ///
21666    /// let builder = prepare_request_builder();
21667    /// let response = builder.send().await?;
21668    /// # Ok(()) }
21669    ///
21670    /// fn prepare_request_builder() -> GetOperation {
21671    ///   # panic!();
21672    ///   // ... details omitted ...
21673    /// }
21674    /// ```
21675    #[derive(Clone, Debug)]
21676    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21677
21678    impl GetOperation {
21679        pub(crate) fn new(
21680            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21681        ) -> Self {
21682            Self(RequestBuilder::new(stub))
21683        }
21684
21685        /// Sets the full request, replacing any prior values.
21686        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21687            mut self,
21688            v: V,
21689        ) -> Self {
21690            self.0.request = v.into();
21691            self
21692        }
21693
21694        /// Sets all the options, replacing any prior values.
21695        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21696            self.0.options = v.into();
21697            self
21698        }
21699
21700        /// Sends the request.
21701        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21702            (*self.0.stub)
21703                .get_operation(self.0.request, self.0.options)
21704                .await
21705                .map(crate::Response::into_body)
21706        }
21707
21708        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
21709        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21710            self.0.request.name = v.into();
21711            self
21712        }
21713    }
21714
21715    #[doc(hidden)]
21716    impl crate::RequestBuilder for GetOperation {
21717        fn request_options(&mut self) -> &mut crate::RequestOptions {
21718            &mut self.0.options
21719        }
21720    }
21721
21722    /// The request builder for [SipTrunks::cancel_operation][crate::client::SipTrunks::cancel_operation] calls.
21723    ///
21724    /// # Example
21725    /// ```
21726    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::CancelOperation;
21727    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21728    ///
21729    /// let builder = prepare_request_builder();
21730    /// let response = builder.send().await?;
21731    /// # Ok(()) }
21732    ///
21733    /// fn prepare_request_builder() -> CancelOperation {
21734    ///   # panic!();
21735    ///   // ... details omitted ...
21736    /// }
21737    /// ```
21738    #[derive(Clone, Debug)]
21739    pub struct CancelOperation(
21740        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21741    );
21742
21743    impl CancelOperation {
21744        pub(crate) fn new(
21745            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21746        ) -> Self {
21747            Self(RequestBuilder::new(stub))
21748        }
21749
21750        /// Sets the full request, replacing any prior values.
21751        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21752            mut self,
21753            v: V,
21754        ) -> Self {
21755            self.0.request = v.into();
21756            self
21757        }
21758
21759        /// Sets all the options, replacing any prior values.
21760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21761            self.0.options = v.into();
21762            self
21763        }
21764
21765        /// Sends the request.
21766        pub async fn send(self) -> Result<()> {
21767            (*self.0.stub)
21768                .cancel_operation(self.0.request, self.0.options)
21769                .await
21770                .map(crate::Response::into_body)
21771        }
21772
21773        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
21774        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21775            self.0.request.name = v.into();
21776            self
21777        }
21778    }
21779
21780    #[doc(hidden)]
21781    impl crate::RequestBuilder for CancelOperation {
21782        fn request_options(&mut self) -> &mut crate::RequestOptions {
21783            &mut self.0.options
21784        }
21785    }
21786}
21787
21788/// Request and client builders for [Tools][crate::client::Tools].
21789#[cfg(feature = "tools")]
21790#[cfg_attr(docsrs, doc(cfg(feature = "tools")))]
21791pub mod tools {
21792    use crate::Result;
21793
21794    /// A builder for [Tools][crate::client::Tools].
21795    ///
21796    /// ```
21797    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
21798    /// # use google_cloud_dialogflow_v2::*;
21799    /// # use builder::tools::ClientBuilder;
21800    /// # use client::Tools;
21801    /// let builder : ClientBuilder = Tools::builder();
21802    /// let client = builder
21803    ///     .with_endpoint("https://dialogflow.googleapis.com")
21804    ///     .build().await?;
21805    /// # Ok(()) }
21806    /// ```
21807    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
21808
21809    pub(crate) mod client {
21810        use super::super::super::client::Tools;
21811        pub struct Factory;
21812        impl crate::ClientFactory for Factory {
21813            type Client = Tools;
21814            type Credentials = gaxi::options::Credentials;
21815            async fn build(
21816                self,
21817                config: gaxi::options::ClientConfig,
21818            ) -> crate::ClientBuilderResult<Self::Client> {
21819                Self::Client::new(config).await
21820            }
21821        }
21822    }
21823
21824    /// Common implementation for [crate::client::Tools] request builders.
21825    #[derive(Clone, Debug)]
21826    pub(crate) struct RequestBuilder<R: std::default::Default> {
21827        stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>,
21828        request: R,
21829        options: crate::RequestOptions,
21830    }
21831
21832    impl<R> RequestBuilder<R>
21833    where
21834        R: std::default::Default,
21835    {
21836        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21837            Self {
21838                stub,
21839                request: R::default(),
21840                options: crate::RequestOptions::default(),
21841            }
21842        }
21843    }
21844
21845    /// The request builder for [Tools::create_tool][crate::client::Tools::create_tool] calls.
21846    ///
21847    /// # Example
21848    /// ```
21849    /// # use google_cloud_dialogflow_v2::builder::tools::CreateTool;
21850    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21851    ///
21852    /// let builder = prepare_request_builder();
21853    /// let response = builder.send().await?;
21854    /// # Ok(()) }
21855    ///
21856    /// fn prepare_request_builder() -> CreateTool {
21857    ///   # panic!();
21858    ///   // ... details omitted ...
21859    /// }
21860    /// ```
21861    #[derive(Clone, Debug)]
21862    pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
21863
21864    impl CreateTool {
21865        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21866            Self(RequestBuilder::new(stub))
21867        }
21868
21869        /// Sets the full request, replacing any prior values.
21870        pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> Self {
21871            self.0.request = v.into();
21872            self
21873        }
21874
21875        /// Sets all the options, replacing any prior values.
21876        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21877            self.0.options = v.into();
21878            self
21879        }
21880
21881        /// Sends the request.
21882        pub async fn send(self) -> Result<crate::model::Tool> {
21883            (*self.0.stub)
21884                .create_tool(self.0.request, self.0.options)
21885                .await
21886                .map(crate::Response::into_body)
21887        }
21888
21889        /// Sets the value of [parent][crate::model::CreateToolRequest::parent].
21890        ///
21891        /// This is a **required** field for requests.
21892        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21893            self.0.request.parent = v.into();
21894            self
21895        }
21896
21897        /// Sets the value of [tool][crate::model::CreateToolRequest::tool].
21898        ///
21899        /// This is a **required** field for requests.
21900        pub fn set_tool<T>(mut self, v: T) -> Self
21901        where
21902            T: std::convert::Into<crate::model::Tool>,
21903        {
21904            self.0.request.tool = std::option::Option::Some(v.into());
21905            self
21906        }
21907
21908        /// Sets or clears the value of [tool][crate::model::CreateToolRequest::tool].
21909        ///
21910        /// This is a **required** field for requests.
21911        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
21912        where
21913            T: std::convert::Into<crate::model::Tool>,
21914        {
21915            self.0.request.tool = v.map(|x| x.into());
21916            self
21917        }
21918
21919        /// Sets the value of [tool_id][crate::model::CreateToolRequest::tool_id].
21920        pub fn set_tool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21921            self.0.request.tool_id = v.into();
21922            self
21923        }
21924    }
21925
21926    #[doc(hidden)]
21927    impl crate::RequestBuilder for CreateTool {
21928        fn request_options(&mut self) -> &mut crate::RequestOptions {
21929            &mut self.0.options
21930        }
21931    }
21932
21933    /// The request builder for [Tools::get_tool][crate::client::Tools::get_tool] calls.
21934    ///
21935    /// # Example
21936    /// ```
21937    /// # use google_cloud_dialogflow_v2::builder::tools::GetTool;
21938    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21939    ///
21940    /// let builder = prepare_request_builder();
21941    /// let response = builder.send().await?;
21942    /// # Ok(()) }
21943    ///
21944    /// fn prepare_request_builder() -> GetTool {
21945    ///   # panic!();
21946    ///   // ... details omitted ...
21947    /// }
21948    /// ```
21949    #[derive(Clone, Debug)]
21950    pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
21951
21952    impl GetTool {
21953        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21954            Self(RequestBuilder::new(stub))
21955        }
21956
21957        /// Sets the full request, replacing any prior values.
21958        pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> Self {
21959            self.0.request = v.into();
21960            self
21961        }
21962
21963        /// Sets all the options, replacing any prior values.
21964        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21965            self.0.options = v.into();
21966            self
21967        }
21968
21969        /// Sends the request.
21970        pub async fn send(self) -> Result<crate::model::Tool> {
21971            (*self.0.stub)
21972                .get_tool(self.0.request, self.0.options)
21973                .await
21974                .map(crate::Response::into_body)
21975        }
21976
21977        /// Sets the value of [name][crate::model::GetToolRequest::name].
21978        ///
21979        /// This is a **required** field for requests.
21980        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21981            self.0.request.name = v.into();
21982            self
21983        }
21984    }
21985
21986    #[doc(hidden)]
21987    impl crate::RequestBuilder for GetTool {
21988        fn request_options(&mut self) -> &mut crate::RequestOptions {
21989            &mut self.0.options
21990        }
21991    }
21992
21993    /// The request builder for [Tools::list_tools][crate::client::Tools::list_tools] calls.
21994    ///
21995    /// # Example
21996    /// ```
21997    /// # use google_cloud_dialogflow_v2::builder::tools::ListTools;
21998    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21999    /// use google_cloud_gax::paginator::ItemPaginator;
22000    ///
22001    /// let builder = prepare_request_builder();
22002    /// let mut items = builder.by_item();
22003    /// while let Some(result) = items.next().await {
22004    ///   let item = result?;
22005    /// }
22006    /// # Ok(()) }
22007    ///
22008    /// fn prepare_request_builder() -> ListTools {
22009    ///   # panic!();
22010    ///   // ... details omitted ...
22011    /// }
22012    /// ```
22013    #[derive(Clone, Debug)]
22014    pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
22015
22016    impl ListTools {
22017        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22018            Self(RequestBuilder::new(stub))
22019        }
22020
22021        /// Sets the full request, replacing any prior values.
22022        pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
22023            self.0.request = v.into();
22024            self
22025        }
22026
22027        /// Sets all the options, replacing any prior values.
22028        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22029            self.0.options = v.into();
22030            self
22031        }
22032
22033        /// Sends the request.
22034        pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
22035            (*self.0.stub)
22036                .list_tools(self.0.request, self.0.options)
22037                .await
22038                .map(crate::Response::into_body)
22039        }
22040
22041        /// Streams each page in the collection.
22042        pub fn by_page(
22043            self,
22044        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsResponse, crate::Error>
22045        {
22046            use std::clone::Clone;
22047            let token = self.0.request.page_token.clone();
22048            let execute = move |token: String| {
22049                let mut builder = self.clone();
22050                builder.0.request = builder.0.request.set_page_token(token);
22051                builder.send()
22052            };
22053            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22054        }
22055
22056        /// Streams each item in the collection.
22057        pub fn by_item(
22058            self,
22059        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListToolsResponse, crate::Error>
22060        {
22061            use google_cloud_gax::paginator::Paginator;
22062            self.by_page().items()
22063        }
22064
22065        /// Sets the value of [parent][crate::model::ListToolsRequest::parent].
22066        ///
22067        /// This is a **required** field for requests.
22068        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22069            self.0.request.parent = v.into();
22070            self
22071        }
22072
22073        /// Sets the value of [page_size][crate::model::ListToolsRequest::page_size].
22074        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22075            self.0.request.page_size = v.into();
22076            self
22077        }
22078
22079        /// Sets the value of [page_token][crate::model::ListToolsRequest::page_token].
22080        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22081            self.0.request.page_token = v.into();
22082            self
22083        }
22084    }
22085
22086    #[doc(hidden)]
22087    impl crate::RequestBuilder for ListTools {
22088        fn request_options(&mut self) -> &mut crate::RequestOptions {
22089            &mut self.0.options
22090        }
22091    }
22092
22093    /// The request builder for [Tools::delete_tool][crate::client::Tools::delete_tool] calls.
22094    ///
22095    /// # Example
22096    /// ```
22097    /// # use google_cloud_dialogflow_v2::builder::tools::DeleteTool;
22098    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22099    ///
22100    /// let builder = prepare_request_builder();
22101    /// let response = builder.send().await?;
22102    /// # Ok(()) }
22103    ///
22104    /// fn prepare_request_builder() -> DeleteTool {
22105    ///   # panic!();
22106    ///   // ... details omitted ...
22107    /// }
22108    /// ```
22109    #[derive(Clone, Debug)]
22110    pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
22111
22112    impl DeleteTool {
22113        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22114            Self(RequestBuilder::new(stub))
22115        }
22116
22117        /// Sets the full request, replacing any prior values.
22118        pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
22119            self.0.request = v.into();
22120            self
22121        }
22122
22123        /// Sets all the options, replacing any prior values.
22124        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22125            self.0.options = v.into();
22126            self
22127        }
22128
22129        /// Sends the request.
22130        pub async fn send(self) -> Result<()> {
22131            (*self.0.stub)
22132                .delete_tool(self.0.request, self.0.options)
22133                .await
22134                .map(crate::Response::into_body)
22135        }
22136
22137        /// Sets the value of [name][crate::model::DeleteToolRequest::name].
22138        ///
22139        /// This is a **required** field for requests.
22140        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22141            self.0.request.name = v.into();
22142            self
22143        }
22144    }
22145
22146    #[doc(hidden)]
22147    impl crate::RequestBuilder for DeleteTool {
22148        fn request_options(&mut self) -> &mut crate::RequestOptions {
22149            &mut self.0.options
22150        }
22151    }
22152
22153    /// The request builder for [Tools::update_tool][crate::client::Tools::update_tool] calls.
22154    ///
22155    /// # Example
22156    /// ```
22157    /// # use google_cloud_dialogflow_v2::builder::tools::UpdateTool;
22158    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22159    ///
22160    /// let builder = prepare_request_builder();
22161    /// let response = builder.send().await?;
22162    /// # Ok(()) }
22163    ///
22164    /// fn prepare_request_builder() -> UpdateTool {
22165    ///   # panic!();
22166    ///   // ... details omitted ...
22167    /// }
22168    /// ```
22169    #[derive(Clone, Debug)]
22170    pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
22171
22172    impl UpdateTool {
22173        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22174            Self(RequestBuilder::new(stub))
22175        }
22176
22177        /// Sets the full request, replacing any prior values.
22178        pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
22179            self.0.request = v.into();
22180            self
22181        }
22182
22183        /// Sets all the options, replacing any prior values.
22184        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22185            self.0.options = v.into();
22186            self
22187        }
22188
22189        /// Sends the request.
22190        pub async fn send(self) -> Result<crate::model::Tool> {
22191            (*self.0.stub)
22192                .update_tool(self.0.request, self.0.options)
22193                .await
22194                .map(crate::Response::into_body)
22195        }
22196
22197        /// Sets the value of [tool][crate::model::UpdateToolRequest::tool].
22198        ///
22199        /// This is a **required** field for requests.
22200        pub fn set_tool<T>(mut self, v: T) -> Self
22201        where
22202            T: std::convert::Into<crate::model::Tool>,
22203        {
22204            self.0.request.tool = std::option::Option::Some(v.into());
22205            self
22206        }
22207
22208        /// Sets or clears the value of [tool][crate::model::UpdateToolRequest::tool].
22209        ///
22210        /// This is a **required** field for requests.
22211        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
22212        where
22213            T: std::convert::Into<crate::model::Tool>,
22214        {
22215            self.0.request.tool = v.map(|x| x.into());
22216            self
22217        }
22218
22219        /// Sets the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
22220        pub fn set_update_mask<T>(mut self, v: T) -> Self
22221        where
22222            T: std::convert::Into<wkt::FieldMask>,
22223        {
22224            self.0.request.update_mask = std::option::Option::Some(v.into());
22225            self
22226        }
22227
22228        /// Sets or clears the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
22229        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22230        where
22231            T: std::convert::Into<wkt::FieldMask>,
22232        {
22233            self.0.request.update_mask = v.map(|x| x.into());
22234            self
22235        }
22236    }
22237
22238    #[doc(hidden)]
22239    impl crate::RequestBuilder for UpdateTool {
22240        fn request_options(&mut self) -> &mut crate::RequestOptions {
22241            &mut self.0.options
22242        }
22243    }
22244
22245    /// The request builder for [Tools::list_locations][crate::client::Tools::list_locations] calls.
22246    ///
22247    /// # Example
22248    /// ```
22249    /// # use google_cloud_dialogflow_v2::builder::tools::ListLocations;
22250    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22251    /// use google_cloud_gax::paginator::ItemPaginator;
22252    ///
22253    /// let builder = prepare_request_builder();
22254    /// let mut items = builder.by_item();
22255    /// while let Some(result) = items.next().await {
22256    ///   let item = result?;
22257    /// }
22258    /// # Ok(()) }
22259    ///
22260    /// fn prepare_request_builder() -> ListLocations {
22261    ///   # panic!();
22262    ///   // ... details omitted ...
22263    /// }
22264    /// ```
22265    #[derive(Clone, Debug)]
22266    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
22267
22268    impl ListLocations {
22269        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22270            Self(RequestBuilder::new(stub))
22271        }
22272
22273        /// Sets the full request, replacing any prior values.
22274        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
22275            mut self,
22276            v: V,
22277        ) -> Self {
22278            self.0.request = v.into();
22279            self
22280        }
22281
22282        /// Sets all the options, replacing any prior values.
22283        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22284            self.0.options = v.into();
22285            self
22286        }
22287
22288        /// Sends the request.
22289        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
22290            (*self.0.stub)
22291                .list_locations(self.0.request, self.0.options)
22292                .await
22293                .map(crate::Response::into_body)
22294        }
22295
22296        /// Streams each page in the collection.
22297        pub fn by_page(
22298            self,
22299        ) -> impl google_cloud_gax::paginator::Paginator<
22300            google_cloud_location::model::ListLocationsResponse,
22301            crate::Error,
22302        > {
22303            use std::clone::Clone;
22304            let token = self.0.request.page_token.clone();
22305            let execute = move |token: String| {
22306                let mut builder = self.clone();
22307                builder.0.request = builder.0.request.set_page_token(token);
22308                builder.send()
22309            };
22310            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22311        }
22312
22313        /// Streams each item in the collection.
22314        pub fn by_item(
22315            self,
22316        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22317            google_cloud_location::model::ListLocationsResponse,
22318            crate::Error,
22319        > {
22320            use google_cloud_gax::paginator::Paginator;
22321            self.by_page().items()
22322        }
22323
22324        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
22325        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22326            self.0.request.name = v.into();
22327            self
22328        }
22329
22330        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
22331        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22332            self.0.request.filter = v.into();
22333            self
22334        }
22335
22336        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
22337        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22338            self.0.request.page_size = v.into();
22339            self
22340        }
22341
22342        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
22343        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22344            self.0.request.page_token = v.into();
22345            self
22346        }
22347    }
22348
22349    #[doc(hidden)]
22350    impl crate::RequestBuilder for ListLocations {
22351        fn request_options(&mut self) -> &mut crate::RequestOptions {
22352            &mut self.0.options
22353        }
22354    }
22355
22356    /// The request builder for [Tools::get_location][crate::client::Tools::get_location] calls.
22357    ///
22358    /// # Example
22359    /// ```
22360    /// # use google_cloud_dialogflow_v2::builder::tools::GetLocation;
22361    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22362    ///
22363    /// let builder = prepare_request_builder();
22364    /// let response = builder.send().await?;
22365    /// # Ok(()) }
22366    ///
22367    /// fn prepare_request_builder() -> GetLocation {
22368    ///   # panic!();
22369    ///   // ... details omitted ...
22370    /// }
22371    /// ```
22372    #[derive(Clone, Debug)]
22373    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
22374
22375    impl GetLocation {
22376        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22377            Self(RequestBuilder::new(stub))
22378        }
22379
22380        /// Sets the full request, replacing any prior values.
22381        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
22382            mut self,
22383            v: V,
22384        ) -> Self {
22385            self.0.request = v.into();
22386            self
22387        }
22388
22389        /// Sets all the options, replacing any prior values.
22390        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22391            self.0.options = v.into();
22392            self
22393        }
22394
22395        /// Sends the request.
22396        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
22397            (*self.0.stub)
22398                .get_location(self.0.request, self.0.options)
22399                .await
22400                .map(crate::Response::into_body)
22401        }
22402
22403        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
22404        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22405            self.0.request.name = v.into();
22406            self
22407        }
22408    }
22409
22410    #[doc(hidden)]
22411    impl crate::RequestBuilder for GetLocation {
22412        fn request_options(&mut self) -> &mut crate::RequestOptions {
22413            &mut self.0.options
22414        }
22415    }
22416
22417    /// The request builder for [Tools::list_operations][crate::client::Tools::list_operations] calls.
22418    ///
22419    /// # Example
22420    /// ```
22421    /// # use google_cloud_dialogflow_v2::builder::tools::ListOperations;
22422    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22423    /// use google_cloud_gax::paginator::ItemPaginator;
22424    ///
22425    /// let builder = prepare_request_builder();
22426    /// let mut items = builder.by_item();
22427    /// while let Some(result) = items.next().await {
22428    ///   let item = result?;
22429    /// }
22430    /// # Ok(()) }
22431    ///
22432    /// fn prepare_request_builder() -> ListOperations {
22433    ///   # panic!();
22434    ///   // ... details omitted ...
22435    /// }
22436    /// ```
22437    #[derive(Clone, Debug)]
22438    pub struct ListOperations(
22439        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
22440    );
22441
22442    impl ListOperations {
22443        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22444            Self(RequestBuilder::new(stub))
22445        }
22446
22447        /// Sets the full request, replacing any prior values.
22448        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
22449            mut self,
22450            v: V,
22451        ) -> Self {
22452            self.0.request = v.into();
22453            self
22454        }
22455
22456        /// Sets all the options, replacing any prior values.
22457        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22458            self.0.options = v.into();
22459            self
22460        }
22461
22462        /// Sends the request.
22463        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
22464            (*self.0.stub)
22465                .list_operations(self.0.request, self.0.options)
22466                .await
22467                .map(crate::Response::into_body)
22468        }
22469
22470        /// Streams each page in the collection.
22471        pub fn by_page(
22472            self,
22473        ) -> impl google_cloud_gax::paginator::Paginator<
22474            google_cloud_longrunning::model::ListOperationsResponse,
22475            crate::Error,
22476        > {
22477            use std::clone::Clone;
22478            let token = self.0.request.page_token.clone();
22479            let execute = move |token: String| {
22480                let mut builder = self.clone();
22481                builder.0.request = builder.0.request.set_page_token(token);
22482                builder.send()
22483            };
22484            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22485        }
22486
22487        /// Streams each item in the collection.
22488        pub fn by_item(
22489            self,
22490        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22491            google_cloud_longrunning::model::ListOperationsResponse,
22492            crate::Error,
22493        > {
22494            use google_cloud_gax::paginator::Paginator;
22495            self.by_page().items()
22496        }
22497
22498        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
22499        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22500            self.0.request.name = v.into();
22501            self
22502        }
22503
22504        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
22505        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22506            self.0.request.filter = v.into();
22507            self
22508        }
22509
22510        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
22511        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22512            self.0.request.page_size = v.into();
22513            self
22514        }
22515
22516        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
22517        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22518            self.0.request.page_token = v.into();
22519            self
22520        }
22521
22522        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
22523        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22524            self.0.request.return_partial_success = v.into();
22525            self
22526        }
22527    }
22528
22529    #[doc(hidden)]
22530    impl crate::RequestBuilder for ListOperations {
22531        fn request_options(&mut self) -> &mut crate::RequestOptions {
22532            &mut self.0.options
22533        }
22534    }
22535
22536    /// The request builder for [Tools::get_operation][crate::client::Tools::get_operation] calls.
22537    ///
22538    /// # Example
22539    /// ```
22540    /// # use google_cloud_dialogflow_v2::builder::tools::GetOperation;
22541    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22542    ///
22543    /// let builder = prepare_request_builder();
22544    /// let response = builder.send().await?;
22545    /// # Ok(()) }
22546    ///
22547    /// fn prepare_request_builder() -> GetOperation {
22548    ///   # panic!();
22549    ///   // ... details omitted ...
22550    /// }
22551    /// ```
22552    #[derive(Clone, Debug)]
22553    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22554
22555    impl GetOperation {
22556        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22557            Self(RequestBuilder::new(stub))
22558        }
22559
22560        /// Sets the full request, replacing any prior values.
22561        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22562            mut self,
22563            v: V,
22564        ) -> Self {
22565            self.0.request = v.into();
22566            self
22567        }
22568
22569        /// Sets all the options, replacing any prior values.
22570        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22571            self.0.options = v.into();
22572            self
22573        }
22574
22575        /// Sends the request.
22576        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22577            (*self.0.stub)
22578                .get_operation(self.0.request, self.0.options)
22579                .await
22580                .map(crate::Response::into_body)
22581        }
22582
22583        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
22584        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22585            self.0.request.name = v.into();
22586            self
22587        }
22588    }
22589
22590    #[doc(hidden)]
22591    impl crate::RequestBuilder for GetOperation {
22592        fn request_options(&mut self) -> &mut crate::RequestOptions {
22593            &mut self.0.options
22594        }
22595    }
22596
22597    /// The request builder for [Tools::cancel_operation][crate::client::Tools::cancel_operation] calls.
22598    ///
22599    /// # Example
22600    /// ```
22601    /// # use google_cloud_dialogflow_v2::builder::tools::CancelOperation;
22602    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22603    ///
22604    /// let builder = prepare_request_builder();
22605    /// let response = builder.send().await?;
22606    /// # Ok(()) }
22607    ///
22608    /// fn prepare_request_builder() -> CancelOperation {
22609    ///   # panic!();
22610    ///   // ... details omitted ...
22611    /// }
22612    /// ```
22613    #[derive(Clone, Debug)]
22614    pub struct CancelOperation(
22615        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22616    );
22617
22618    impl CancelOperation {
22619        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22620            Self(RequestBuilder::new(stub))
22621        }
22622
22623        /// Sets the full request, replacing any prior values.
22624        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22625            mut self,
22626            v: V,
22627        ) -> Self {
22628            self.0.request = v.into();
22629            self
22630        }
22631
22632        /// Sets all the options, replacing any prior values.
22633        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22634            self.0.options = v.into();
22635            self
22636        }
22637
22638        /// Sends the request.
22639        pub async fn send(self) -> Result<()> {
22640            (*self.0.stub)
22641                .cancel_operation(self.0.request, self.0.options)
22642                .await
22643                .map(crate::Response::into_body)
22644        }
22645
22646        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
22647        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22648            self.0.request.name = v.into();
22649            self
22650        }
22651    }
22652
22653    #[doc(hidden)]
22654    impl crate::RequestBuilder for CancelOperation {
22655        fn request_options(&mut self) -> &mut crate::RequestOptions {
22656            &mut self.0.options
22657        }
22658    }
22659}
22660
22661/// Request and client builders for [Versions][crate::client::Versions].
22662#[cfg(feature = "versions")]
22663#[cfg_attr(docsrs, doc(cfg(feature = "versions")))]
22664pub mod versions {
22665    use crate::Result;
22666
22667    /// A builder for [Versions][crate::client::Versions].
22668    ///
22669    /// ```
22670    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
22671    /// # use google_cloud_dialogflow_v2::*;
22672    /// # use builder::versions::ClientBuilder;
22673    /// # use client::Versions;
22674    /// let builder : ClientBuilder = Versions::builder();
22675    /// let client = builder
22676    ///     .with_endpoint("https://dialogflow.googleapis.com")
22677    ///     .build().await?;
22678    /// # Ok(()) }
22679    /// ```
22680    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22681
22682    pub(crate) mod client {
22683        use super::super::super::client::Versions;
22684        pub struct Factory;
22685        impl crate::ClientFactory for Factory {
22686            type Client = Versions;
22687            type Credentials = gaxi::options::Credentials;
22688            async fn build(
22689                self,
22690                config: gaxi::options::ClientConfig,
22691            ) -> crate::ClientBuilderResult<Self::Client> {
22692                Self::Client::new(config).await
22693            }
22694        }
22695    }
22696
22697    /// Common implementation for [crate::client::Versions] request builders.
22698    #[derive(Clone, Debug)]
22699    pub(crate) struct RequestBuilder<R: std::default::Default> {
22700        stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
22701        request: R,
22702        options: crate::RequestOptions,
22703    }
22704
22705    impl<R> RequestBuilder<R>
22706    where
22707        R: std::default::Default,
22708    {
22709        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22710            Self {
22711                stub,
22712                request: R::default(),
22713                options: crate::RequestOptions::default(),
22714            }
22715        }
22716    }
22717
22718    /// The request builder for [Versions::list_versions][crate::client::Versions::list_versions] calls.
22719    ///
22720    /// # Example
22721    /// ```
22722    /// # use google_cloud_dialogflow_v2::builder::versions::ListVersions;
22723    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22724    /// use google_cloud_gax::paginator::ItemPaginator;
22725    ///
22726    /// let builder = prepare_request_builder();
22727    /// let mut items = builder.by_item();
22728    /// while let Some(result) = items.next().await {
22729    ///   let item = result?;
22730    /// }
22731    /// # Ok(()) }
22732    ///
22733    /// fn prepare_request_builder() -> ListVersions {
22734    ///   # panic!();
22735    ///   // ... details omitted ...
22736    /// }
22737    /// ```
22738    #[derive(Clone, Debug)]
22739    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
22740
22741    impl ListVersions {
22742        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22743            Self(RequestBuilder::new(stub))
22744        }
22745
22746        /// Sets the full request, replacing any prior values.
22747        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
22748            self.0.request = v.into();
22749            self
22750        }
22751
22752        /// Sets all the options, replacing any prior values.
22753        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22754            self.0.options = v.into();
22755            self
22756        }
22757
22758        /// Sends the request.
22759        pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
22760            (*self.0.stub)
22761                .list_versions(self.0.request, self.0.options)
22762                .await
22763                .map(crate::Response::into_body)
22764        }
22765
22766        /// Streams each page in the collection.
22767        pub fn by_page(
22768            self,
22769        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
22770        {
22771            use std::clone::Clone;
22772            let token = self.0.request.page_token.clone();
22773            let execute = move |token: String| {
22774                let mut builder = self.clone();
22775                builder.0.request = builder.0.request.set_page_token(token);
22776                builder.send()
22777            };
22778            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22779        }
22780
22781        /// Streams each item in the collection.
22782        pub fn by_item(
22783            self,
22784        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22785            crate::model::ListVersionsResponse,
22786            crate::Error,
22787        > {
22788            use google_cloud_gax::paginator::Paginator;
22789            self.by_page().items()
22790        }
22791
22792        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
22793        ///
22794        /// This is a **required** field for requests.
22795        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22796            self.0.request.parent = v.into();
22797            self
22798        }
22799
22800        /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
22801        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22802            self.0.request.page_size = v.into();
22803            self
22804        }
22805
22806        /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
22807        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22808            self.0.request.page_token = v.into();
22809            self
22810        }
22811    }
22812
22813    #[doc(hidden)]
22814    impl crate::RequestBuilder for ListVersions {
22815        fn request_options(&mut self) -> &mut crate::RequestOptions {
22816            &mut self.0.options
22817        }
22818    }
22819
22820    /// The request builder for [Versions::get_version][crate::client::Versions::get_version] calls.
22821    ///
22822    /// # Example
22823    /// ```
22824    /// # use google_cloud_dialogflow_v2::builder::versions::GetVersion;
22825    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22826    ///
22827    /// let builder = prepare_request_builder();
22828    /// let response = builder.send().await?;
22829    /// # Ok(()) }
22830    ///
22831    /// fn prepare_request_builder() -> GetVersion {
22832    ///   # panic!();
22833    ///   // ... details omitted ...
22834    /// }
22835    /// ```
22836    #[derive(Clone, Debug)]
22837    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
22838
22839    impl GetVersion {
22840        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22841            Self(RequestBuilder::new(stub))
22842        }
22843
22844        /// Sets the full request, replacing any prior values.
22845        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
22846            self.0.request = v.into();
22847            self
22848        }
22849
22850        /// Sets all the options, replacing any prior values.
22851        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22852            self.0.options = v.into();
22853            self
22854        }
22855
22856        /// Sends the request.
22857        pub async fn send(self) -> Result<crate::model::Version> {
22858            (*self.0.stub)
22859                .get_version(self.0.request, self.0.options)
22860                .await
22861                .map(crate::Response::into_body)
22862        }
22863
22864        /// Sets the value of [name][crate::model::GetVersionRequest::name].
22865        ///
22866        /// This is a **required** field for requests.
22867        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22868            self.0.request.name = v.into();
22869            self
22870        }
22871    }
22872
22873    #[doc(hidden)]
22874    impl crate::RequestBuilder for GetVersion {
22875        fn request_options(&mut self) -> &mut crate::RequestOptions {
22876            &mut self.0.options
22877        }
22878    }
22879
22880    /// The request builder for [Versions::create_version][crate::client::Versions::create_version] calls.
22881    ///
22882    /// # Example
22883    /// ```
22884    /// # use google_cloud_dialogflow_v2::builder::versions::CreateVersion;
22885    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22886    ///
22887    /// let builder = prepare_request_builder();
22888    /// let response = builder.send().await?;
22889    /// # Ok(()) }
22890    ///
22891    /// fn prepare_request_builder() -> CreateVersion {
22892    ///   # panic!();
22893    ///   // ... details omitted ...
22894    /// }
22895    /// ```
22896    #[derive(Clone, Debug)]
22897    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
22898
22899    impl CreateVersion {
22900        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22901            Self(RequestBuilder::new(stub))
22902        }
22903
22904        /// Sets the full request, replacing any prior values.
22905        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
22906            self.0.request = v.into();
22907            self
22908        }
22909
22910        /// Sets all the options, replacing any prior values.
22911        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22912            self.0.options = v.into();
22913            self
22914        }
22915
22916        /// Sends the request.
22917        pub async fn send(self) -> Result<crate::model::Version> {
22918            (*self.0.stub)
22919                .create_version(self.0.request, self.0.options)
22920                .await
22921                .map(crate::Response::into_body)
22922        }
22923
22924        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
22925        ///
22926        /// This is a **required** field for requests.
22927        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22928            self.0.request.parent = v.into();
22929            self
22930        }
22931
22932        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
22933        ///
22934        /// This is a **required** field for requests.
22935        pub fn set_version<T>(mut self, v: T) -> Self
22936        where
22937            T: std::convert::Into<crate::model::Version>,
22938        {
22939            self.0.request.version = std::option::Option::Some(v.into());
22940            self
22941        }
22942
22943        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
22944        ///
22945        /// This is a **required** field for requests.
22946        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
22947        where
22948            T: std::convert::Into<crate::model::Version>,
22949        {
22950            self.0.request.version = v.map(|x| x.into());
22951            self
22952        }
22953    }
22954
22955    #[doc(hidden)]
22956    impl crate::RequestBuilder for CreateVersion {
22957        fn request_options(&mut self) -> &mut crate::RequestOptions {
22958            &mut self.0.options
22959        }
22960    }
22961
22962    /// The request builder for [Versions::update_version][crate::client::Versions::update_version] calls.
22963    ///
22964    /// # Example
22965    /// ```
22966    /// # use google_cloud_dialogflow_v2::builder::versions::UpdateVersion;
22967    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22968    ///
22969    /// let builder = prepare_request_builder();
22970    /// let response = builder.send().await?;
22971    /// # Ok(()) }
22972    ///
22973    /// fn prepare_request_builder() -> UpdateVersion {
22974    ///   # panic!();
22975    ///   // ... details omitted ...
22976    /// }
22977    /// ```
22978    #[derive(Clone, Debug)]
22979    pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
22980
22981    impl UpdateVersion {
22982        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22983            Self(RequestBuilder::new(stub))
22984        }
22985
22986        /// Sets the full request, replacing any prior values.
22987        pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
22988            self.0.request = v.into();
22989            self
22990        }
22991
22992        /// Sets all the options, replacing any prior values.
22993        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22994            self.0.options = v.into();
22995            self
22996        }
22997
22998        /// Sends the request.
22999        pub async fn send(self) -> Result<crate::model::Version> {
23000            (*self.0.stub)
23001                .update_version(self.0.request, self.0.options)
23002                .await
23003                .map(crate::Response::into_body)
23004        }
23005
23006        /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
23007        ///
23008        /// This is a **required** field for requests.
23009        pub fn set_version<T>(mut self, v: T) -> Self
23010        where
23011            T: std::convert::Into<crate::model::Version>,
23012        {
23013            self.0.request.version = std::option::Option::Some(v.into());
23014            self
23015        }
23016
23017        /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
23018        ///
23019        /// This is a **required** field for requests.
23020        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
23021        where
23022            T: std::convert::Into<crate::model::Version>,
23023        {
23024            self.0.request.version = v.map(|x| x.into());
23025            self
23026        }
23027
23028        /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
23029        ///
23030        /// This is a **required** field for requests.
23031        pub fn set_update_mask<T>(mut self, v: T) -> Self
23032        where
23033            T: std::convert::Into<wkt::FieldMask>,
23034        {
23035            self.0.request.update_mask = std::option::Option::Some(v.into());
23036            self
23037        }
23038
23039        /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
23040        ///
23041        /// This is a **required** field for requests.
23042        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23043        where
23044            T: std::convert::Into<wkt::FieldMask>,
23045        {
23046            self.0.request.update_mask = v.map(|x| x.into());
23047            self
23048        }
23049    }
23050
23051    #[doc(hidden)]
23052    impl crate::RequestBuilder for UpdateVersion {
23053        fn request_options(&mut self) -> &mut crate::RequestOptions {
23054            &mut self.0.options
23055        }
23056    }
23057
23058    /// The request builder for [Versions::delete_version][crate::client::Versions::delete_version] calls.
23059    ///
23060    /// # Example
23061    /// ```
23062    /// # use google_cloud_dialogflow_v2::builder::versions::DeleteVersion;
23063    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23064    ///
23065    /// let builder = prepare_request_builder();
23066    /// let response = builder.send().await?;
23067    /// # Ok(()) }
23068    ///
23069    /// fn prepare_request_builder() -> DeleteVersion {
23070    ///   # panic!();
23071    ///   // ... details omitted ...
23072    /// }
23073    /// ```
23074    #[derive(Clone, Debug)]
23075    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
23076
23077    impl DeleteVersion {
23078        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23079            Self(RequestBuilder::new(stub))
23080        }
23081
23082        /// Sets the full request, replacing any prior values.
23083        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
23084            self.0.request = v.into();
23085            self
23086        }
23087
23088        /// Sets all the options, replacing any prior values.
23089        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23090            self.0.options = v.into();
23091            self
23092        }
23093
23094        /// Sends the request.
23095        pub async fn send(self) -> Result<()> {
23096            (*self.0.stub)
23097                .delete_version(self.0.request, self.0.options)
23098                .await
23099                .map(crate::Response::into_body)
23100        }
23101
23102        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
23103        ///
23104        /// This is a **required** field for requests.
23105        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23106            self.0.request.name = v.into();
23107            self
23108        }
23109    }
23110
23111    #[doc(hidden)]
23112    impl crate::RequestBuilder for DeleteVersion {
23113        fn request_options(&mut self) -> &mut crate::RequestOptions {
23114            &mut self.0.options
23115        }
23116    }
23117
23118    /// The request builder for [Versions::list_locations][crate::client::Versions::list_locations] calls.
23119    ///
23120    /// # Example
23121    /// ```
23122    /// # use google_cloud_dialogflow_v2::builder::versions::ListLocations;
23123    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23124    /// use google_cloud_gax::paginator::ItemPaginator;
23125    ///
23126    /// let builder = prepare_request_builder();
23127    /// let mut items = builder.by_item();
23128    /// while let Some(result) = items.next().await {
23129    ///   let item = result?;
23130    /// }
23131    /// # Ok(()) }
23132    ///
23133    /// fn prepare_request_builder() -> ListLocations {
23134    ///   # panic!();
23135    ///   // ... details omitted ...
23136    /// }
23137    /// ```
23138    #[derive(Clone, Debug)]
23139    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
23140
23141    impl ListLocations {
23142        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23143            Self(RequestBuilder::new(stub))
23144        }
23145
23146        /// Sets the full request, replacing any prior values.
23147        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
23148            mut self,
23149            v: V,
23150        ) -> Self {
23151            self.0.request = v.into();
23152            self
23153        }
23154
23155        /// Sets all the options, replacing any prior values.
23156        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23157            self.0.options = v.into();
23158            self
23159        }
23160
23161        /// Sends the request.
23162        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
23163            (*self.0.stub)
23164                .list_locations(self.0.request, self.0.options)
23165                .await
23166                .map(crate::Response::into_body)
23167        }
23168
23169        /// Streams each page in the collection.
23170        pub fn by_page(
23171            self,
23172        ) -> impl google_cloud_gax::paginator::Paginator<
23173            google_cloud_location::model::ListLocationsResponse,
23174            crate::Error,
23175        > {
23176            use std::clone::Clone;
23177            let token = self.0.request.page_token.clone();
23178            let execute = move |token: String| {
23179                let mut builder = self.clone();
23180                builder.0.request = builder.0.request.set_page_token(token);
23181                builder.send()
23182            };
23183            google_cloud_gax::paginator::internal::new_paginator(token, execute)
23184        }
23185
23186        /// Streams each item in the collection.
23187        pub fn by_item(
23188            self,
23189        ) -> impl google_cloud_gax::paginator::ItemPaginator<
23190            google_cloud_location::model::ListLocationsResponse,
23191            crate::Error,
23192        > {
23193            use google_cloud_gax::paginator::Paginator;
23194            self.by_page().items()
23195        }
23196
23197        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
23198        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23199            self.0.request.name = v.into();
23200            self
23201        }
23202
23203        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
23204        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
23205            self.0.request.filter = v.into();
23206            self
23207        }
23208
23209        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
23210        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23211            self.0.request.page_size = v.into();
23212            self
23213        }
23214
23215        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
23216        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23217            self.0.request.page_token = v.into();
23218            self
23219        }
23220    }
23221
23222    #[doc(hidden)]
23223    impl crate::RequestBuilder for ListLocations {
23224        fn request_options(&mut self) -> &mut crate::RequestOptions {
23225            &mut self.0.options
23226        }
23227    }
23228
23229    /// The request builder for [Versions::get_location][crate::client::Versions::get_location] calls.
23230    ///
23231    /// # Example
23232    /// ```
23233    /// # use google_cloud_dialogflow_v2::builder::versions::GetLocation;
23234    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23235    ///
23236    /// let builder = prepare_request_builder();
23237    /// let response = builder.send().await?;
23238    /// # Ok(()) }
23239    ///
23240    /// fn prepare_request_builder() -> GetLocation {
23241    ///   # panic!();
23242    ///   // ... details omitted ...
23243    /// }
23244    /// ```
23245    #[derive(Clone, Debug)]
23246    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
23247
23248    impl GetLocation {
23249        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23250            Self(RequestBuilder::new(stub))
23251        }
23252
23253        /// Sets the full request, replacing any prior values.
23254        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
23255            mut self,
23256            v: V,
23257        ) -> Self {
23258            self.0.request = v.into();
23259            self
23260        }
23261
23262        /// Sets all the options, replacing any prior values.
23263        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23264            self.0.options = v.into();
23265            self
23266        }
23267
23268        /// Sends the request.
23269        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
23270            (*self.0.stub)
23271                .get_location(self.0.request, self.0.options)
23272                .await
23273                .map(crate::Response::into_body)
23274        }
23275
23276        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
23277        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23278            self.0.request.name = v.into();
23279            self
23280        }
23281    }
23282
23283    #[doc(hidden)]
23284    impl crate::RequestBuilder for GetLocation {
23285        fn request_options(&mut self) -> &mut crate::RequestOptions {
23286            &mut self.0.options
23287        }
23288    }
23289
23290    /// The request builder for [Versions::list_operations][crate::client::Versions::list_operations] calls.
23291    ///
23292    /// # Example
23293    /// ```
23294    /// # use google_cloud_dialogflow_v2::builder::versions::ListOperations;
23295    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23296    /// use google_cloud_gax::paginator::ItemPaginator;
23297    ///
23298    /// let builder = prepare_request_builder();
23299    /// let mut items = builder.by_item();
23300    /// while let Some(result) = items.next().await {
23301    ///   let item = result?;
23302    /// }
23303    /// # Ok(()) }
23304    ///
23305    /// fn prepare_request_builder() -> ListOperations {
23306    ///   # panic!();
23307    ///   // ... details omitted ...
23308    /// }
23309    /// ```
23310    #[derive(Clone, Debug)]
23311    pub struct ListOperations(
23312        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
23313    );
23314
23315    impl ListOperations {
23316        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23317            Self(RequestBuilder::new(stub))
23318        }
23319
23320        /// Sets the full request, replacing any prior values.
23321        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
23322            mut self,
23323            v: V,
23324        ) -> Self {
23325            self.0.request = v.into();
23326            self
23327        }
23328
23329        /// Sets all the options, replacing any prior values.
23330        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23331            self.0.options = v.into();
23332            self
23333        }
23334
23335        /// Sends the request.
23336        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
23337            (*self.0.stub)
23338                .list_operations(self.0.request, self.0.options)
23339                .await
23340                .map(crate::Response::into_body)
23341        }
23342
23343        /// Streams each page in the collection.
23344        pub fn by_page(
23345            self,
23346        ) -> impl google_cloud_gax::paginator::Paginator<
23347            google_cloud_longrunning::model::ListOperationsResponse,
23348            crate::Error,
23349        > {
23350            use std::clone::Clone;
23351            let token = self.0.request.page_token.clone();
23352            let execute = move |token: String| {
23353                let mut builder = self.clone();
23354                builder.0.request = builder.0.request.set_page_token(token);
23355                builder.send()
23356            };
23357            google_cloud_gax::paginator::internal::new_paginator(token, execute)
23358        }
23359
23360        /// Streams each item in the collection.
23361        pub fn by_item(
23362            self,
23363        ) -> impl google_cloud_gax::paginator::ItemPaginator<
23364            google_cloud_longrunning::model::ListOperationsResponse,
23365            crate::Error,
23366        > {
23367            use google_cloud_gax::paginator::Paginator;
23368            self.by_page().items()
23369        }
23370
23371        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
23372        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23373            self.0.request.name = v.into();
23374            self
23375        }
23376
23377        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
23378        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
23379            self.0.request.filter = v.into();
23380            self
23381        }
23382
23383        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
23384        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23385            self.0.request.page_size = v.into();
23386            self
23387        }
23388
23389        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
23390        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23391            self.0.request.page_token = v.into();
23392            self
23393        }
23394
23395        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
23396        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
23397            self.0.request.return_partial_success = v.into();
23398            self
23399        }
23400    }
23401
23402    #[doc(hidden)]
23403    impl crate::RequestBuilder for ListOperations {
23404        fn request_options(&mut self) -> &mut crate::RequestOptions {
23405            &mut self.0.options
23406        }
23407    }
23408
23409    /// The request builder for [Versions::get_operation][crate::client::Versions::get_operation] calls.
23410    ///
23411    /// # Example
23412    /// ```
23413    /// # use google_cloud_dialogflow_v2::builder::versions::GetOperation;
23414    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23415    ///
23416    /// let builder = prepare_request_builder();
23417    /// let response = builder.send().await?;
23418    /// # Ok(()) }
23419    ///
23420    /// fn prepare_request_builder() -> GetOperation {
23421    ///   # panic!();
23422    ///   // ... details omitted ...
23423    /// }
23424    /// ```
23425    #[derive(Clone, Debug)]
23426    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
23427
23428    impl GetOperation {
23429        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23430            Self(RequestBuilder::new(stub))
23431        }
23432
23433        /// Sets the full request, replacing any prior values.
23434        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
23435            mut self,
23436            v: V,
23437        ) -> Self {
23438            self.0.request = v.into();
23439            self
23440        }
23441
23442        /// Sets all the options, replacing any prior values.
23443        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23444            self.0.options = v.into();
23445            self
23446        }
23447
23448        /// Sends the request.
23449        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23450            (*self.0.stub)
23451                .get_operation(self.0.request, self.0.options)
23452                .await
23453                .map(crate::Response::into_body)
23454        }
23455
23456        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
23457        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23458            self.0.request.name = v.into();
23459            self
23460        }
23461    }
23462
23463    #[doc(hidden)]
23464    impl crate::RequestBuilder for GetOperation {
23465        fn request_options(&mut self) -> &mut crate::RequestOptions {
23466            &mut self.0.options
23467        }
23468    }
23469
23470    /// The request builder for [Versions::cancel_operation][crate::client::Versions::cancel_operation] calls.
23471    ///
23472    /// # Example
23473    /// ```
23474    /// # use google_cloud_dialogflow_v2::builder::versions::CancelOperation;
23475    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23476    ///
23477    /// let builder = prepare_request_builder();
23478    /// let response = builder.send().await?;
23479    /// # Ok(()) }
23480    ///
23481    /// fn prepare_request_builder() -> CancelOperation {
23482    ///   # panic!();
23483    ///   // ... details omitted ...
23484    /// }
23485    /// ```
23486    #[derive(Clone, Debug)]
23487    pub struct CancelOperation(
23488        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
23489    );
23490
23491    impl CancelOperation {
23492        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23493            Self(RequestBuilder::new(stub))
23494        }
23495
23496        /// Sets the full request, replacing any prior values.
23497        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
23498            mut self,
23499            v: V,
23500        ) -> Self {
23501            self.0.request = v.into();
23502            self
23503        }
23504
23505        /// Sets all the options, replacing any prior values.
23506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23507            self.0.options = v.into();
23508            self
23509        }
23510
23511        /// Sends the request.
23512        pub async fn send(self) -> Result<()> {
23513            (*self.0.stub)
23514                .cancel_operation(self.0.request, self.0.options)
23515                .await
23516                .map(crate::Response::into_body)
23517        }
23518
23519        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
23520        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23521            self.0.request.name = v.into();
23522            self
23523        }
23524    }
23525
23526    #[doc(hidden)]
23527    impl crate::RequestBuilder for CancelOperation {
23528        fn request_options(&mut self) -> &mut crate::RequestOptions {
23529            &mut self.0.options
23530        }
23531    }
23532}