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
444            let stub = self.0.stub.clone();
445            let mut options = self.0.options.clone();
446            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
447            let query = move |name| {
448                let stub = stub.clone();
449                let options = options.clone();
450                async {
451                    let op = GetOperation::new(stub)
452                        .set_name(name)
453                        .with_options(options)
454                        .send()
455                        .await?;
456                    Ok(Operation::new(op))
457                }
458            };
459
460            let start = move || async {
461                let op = self.send().await?;
462                Ok(Operation::new(op))
463            };
464
465            google_cloud_lro::internal::new_unit_response_poller(
466                polling_error_policy,
467                polling_backoff_policy,
468                start,
469                query,
470            )
471        }
472
473        /// Sets the value of [parent][crate::model::TrainAgentRequest::parent].
474        ///
475        /// This is a **required** field for requests.
476        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
477            self.0.request.parent = v.into();
478            self
479        }
480    }
481
482    #[doc(hidden)]
483    impl crate::RequestBuilder for TrainAgent {
484        fn request_options(&mut self) -> &mut crate::RequestOptions {
485            &mut self.0.options
486        }
487    }
488
489    /// The request builder for [Agents::export_agent][crate::client::Agents::export_agent] calls.
490    ///
491    /// # Example
492    /// ```
493    /// # use google_cloud_dialogflow_v2::builder::agents::ExportAgent;
494    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
495    /// use google_cloud_lro::Poller;
496    ///
497    /// let builder = prepare_request_builder();
498    /// let response = builder.poller().until_done().await?;
499    /// # Ok(()) }
500    ///
501    /// fn prepare_request_builder() -> ExportAgent {
502    ///   # panic!();
503    ///   // ... details omitted ...
504    /// }
505    /// ```
506    #[derive(Clone, Debug)]
507    pub struct ExportAgent(RequestBuilder<crate::model::ExportAgentRequest>);
508
509    impl ExportAgent {
510        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
511            Self(RequestBuilder::new(stub))
512        }
513
514        /// Sets the full request, replacing any prior values.
515        pub fn with_request<V: Into<crate::model::ExportAgentRequest>>(mut self, v: V) -> Self {
516            self.0.request = v.into();
517            self
518        }
519
520        /// Sets all the options, replacing any prior values.
521        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
522            self.0.options = v.into();
523            self
524        }
525
526        /// Sends the request.
527        ///
528        /// # Long running operations
529        ///
530        /// This starts, but does not poll, a longrunning operation. More information
531        /// on [export_agent][crate::client::Agents::export_agent].
532        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
533            (*self.0.stub)
534                .export_agent(self.0.request, self.0.options)
535                .await
536                .map(crate::Response::into_body)
537        }
538
539        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_agent`.
540        pub fn poller(
541            self,
542        ) -> impl google_cloud_lro::Poller<crate::model::ExportAgentResponse, wkt::Struct> {
543            type Operation = google_cloud_lro::internal::Operation<
544                crate::model::ExportAgentResponse,
545                wkt::Struct,
546            >;
547            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
548            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
549
550            let stub = self.0.stub.clone();
551            let mut options = self.0.options.clone();
552            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
553            let query = move |name| {
554                let stub = stub.clone();
555                let options = options.clone();
556                async {
557                    let op = GetOperation::new(stub)
558                        .set_name(name)
559                        .with_options(options)
560                        .send()
561                        .await?;
562                    Ok(Operation::new(op))
563                }
564            };
565
566            let start = move || async {
567                let op = self.send().await?;
568                Ok(Operation::new(op))
569            };
570
571            google_cloud_lro::internal::new_poller(
572                polling_error_policy,
573                polling_backoff_policy,
574                start,
575                query,
576            )
577        }
578
579        /// Sets the value of [parent][crate::model::ExportAgentRequest::parent].
580        ///
581        /// This is a **required** field for requests.
582        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
583            self.0.request.parent = v.into();
584            self
585        }
586
587        /// Sets the value of [agent_uri][crate::model::ExportAgentRequest::agent_uri].
588        ///
589        /// This is a **required** field for requests.
590        pub fn set_agent_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
591            self.0.request.agent_uri = v.into();
592            self
593        }
594    }
595
596    #[doc(hidden)]
597    impl crate::RequestBuilder for ExportAgent {
598        fn request_options(&mut self) -> &mut crate::RequestOptions {
599            &mut self.0.options
600        }
601    }
602
603    /// The request builder for [Agents::import_agent][crate::client::Agents::import_agent] calls.
604    ///
605    /// # Example
606    /// ```
607    /// # use google_cloud_dialogflow_v2::builder::agents::ImportAgent;
608    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
609    /// use google_cloud_lro::Poller;
610    ///
611    /// let builder = prepare_request_builder();
612    /// let response = builder.poller().until_done().await?;
613    /// # Ok(()) }
614    ///
615    /// fn prepare_request_builder() -> ImportAgent {
616    ///   # panic!();
617    ///   // ... details omitted ...
618    /// }
619    /// ```
620    #[derive(Clone, Debug)]
621    pub struct ImportAgent(RequestBuilder<crate::model::ImportAgentRequest>);
622
623    impl ImportAgent {
624        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
625            Self(RequestBuilder::new(stub))
626        }
627
628        /// Sets the full request, replacing any prior values.
629        pub fn with_request<V: Into<crate::model::ImportAgentRequest>>(mut self, v: V) -> Self {
630            self.0.request = v.into();
631            self
632        }
633
634        /// Sets all the options, replacing any prior values.
635        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
636            self.0.options = v.into();
637            self
638        }
639
640        /// Sends the request.
641        ///
642        /// # Long running operations
643        ///
644        /// This starts, but does not poll, a longrunning operation. More information
645        /// on [import_agent][crate::client::Agents::import_agent].
646        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
647            (*self.0.stub)
648                .import_agent(self.0.request, self.0.options)
649                .await
650                .map(crate::Response::into_body)
651        }
652
653        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_agent`.
654        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
655            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
656            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
657            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
658
659            let stub = self.0.stub.clone();
660            let mut options = self.0.options.clone();
661            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
662            let query = move |name| {
663                let stub = stub.clone();
664                let options = options.clone();
665                async {
666                    let op = GetOperation::new(stub)
667                        .set_name(name)
668                        .with_options(options)
669                        .send()
670                        .await?;
671                    Ok(Operation::new(op))
672                }
673            };
674
675            let start = move || async {
676                let op = self.send().await?;
677                Ok(Operation::new(op))
678            };
679
680            google_cloud_lro::internal::new_unit_response_poller(
681                polling_error_policy,
682                polling_backoff_policy,
683                start,
684                query,
685            )
686        }
687
688        /// Sets the value of [parent][crate::model::ImportAgentRequest::parent].
689        ///
690        /// This is a **required** field for requests.
691        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
692            self.0.request.parent = v.into();
693            self
694        }
695
696        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent].
697        ///
698        /// Note that all the setters affecting `agent` are
699        /// mutually exclusive.
700        pub fn set_agent<T: Into<Option<crate::model::import_agent_request::Agent>>>(
701            mut self,
702            v: T,
703        ) -> Self {
704            self.0.request.agent = v.into();
705            self
706        }
707
708        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
709        /// to hold a `AgentUri`.
710        ///
711        /// Note that all the setters affecting `agent` are
712        /// mutually exclusive.
713        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
714            self.0.request = self.0.request.set_agent_uri(v);
715            self
716        }
717
718        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
719        /// to hold a `AgentContent`.
720        ///
721        /// Note that all the setters affecting `agent` are
722        /// mutually exclusive.
723        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
724            self.0.request = self.0.request.set_agent_content(v);
725            self
726        }
727    }
728
729    #[doc(hidden)]
730    impl crate::RequestBuilder for ImportAgent {
731        fn request_options(&mut self) -> &mut crate::RequestOptions {
732            &mut self.0.options
733        }
734    }
735
736    /// The request builder for [Agents::restore_agent][crate::client::Agents::restore_agent] calls.
737    ///
738    /// # Example
739    /// ```
740    /// # use google_cloud_dialogflow_v2::builder::agents::RestoreAgent;
741    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
742    /// use google_cloud_lro::Poller;
743    ///
744    /// let builder = prepare_request_builder();
745    /// let response = builder.poller().until_done().await?;
746    /// # Ok(()) }
747    ///
748    /// fn prepare_request_builder() -> RestoreAgent {
749    ///   # panic!();
750    ///   // ... details omitted ...
751    /// }
752    /// ```
753    #[derive(Clone, Debug)]
754    pub struct RestoreAgent(RequestBuilder<crate::model::RestoreAgentRequest>);
755
756    impl RestoreAgent {
757        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
758            Self(RequestBuilder::new(stub))
759        }
760
761        /// Sets the full request, replacing any prior values.
762        pub fn with_request<V: Into<crate::model::RestoreAgentRequest>>(mut self, v: V) -> Self {
763            self.0.request = v.into();
764            self
765        }
766
767        /// Sets all the options, replacing any prior values.
768        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
769            self.0.options = v.into();
770            self
771        }
772
773        /// Sends the request.
774        ///
775        /// # Long running operations
776        ///
777        /// This starts, but does not poll, a longrunning operation. More information
778        /// on [restore_agent][crate::client::Agents::restore_agent].
779        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
780            (*self.0.stub)
781                .restore_agent(self.0.request, self.0.options)
782                .await
783                .map(crate::Response::into_body)
784        }
785
786        /// Creates a [Poller][google_cloud_lro::Poller] to work with `restore_agent`.
787        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
788            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
789            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
790            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
791
792            let stub = self.0.stub.clone();
793            let mut options = self.0.options.clone();
794            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
795            let query = move |name| {
796                let stub = stub.clone();
797                let options = options.clone();
798                async {
799                    let op = GetOperation::new(stub)
800                        .set_name(name)
801                        .with_options(options)
802                        .send()
803                        .await?;
804                    Ok(Operation::new(op))
805                }
806            };
807
808            let start = move || async {
809                let op = self.send().await?;
810                Ok(Operation::new(op))
811            };
812
813            google_cloud_lro::internal::new_unit_response_poller(
814                polling_error_policy,
815                polling_backoff_policy,
816                start,
817                query,
818            )
819        }
820
821        /// Sets the value of [parent][crate::model::RestoreAgentRequest::parent].
822        ///
823        /// This is a **required** field for requests.
824        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
825            self.0.request.parent = v.into();
826            self
827        }
828
829        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent].
830        ///
831        /// Note that all the setters affecting `agent` are
832        /// mutually exclusive.
833        pub fn set_agent<T: Into<Option<crate::model::restore_agent_request::Agent>>>(
834            mut self,
835            v: T,
836        ) -> Self {
837            self.0.request.agent = v.into();
838            self
839        }
840
841        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
842        /// to hold a `AgentUri`.
843        ///
844        /// Note that all the setters affecting `agent` are
845        /// mutually exclusive.
846        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
847            self.0.request = self.0.request.set_agent_uri(v);
848            self
849        }
850
851        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
852        /// to hold a `AgentContent`.
853        ///
854        /// Note that all the setters affecting `agent` are
855        /// mutually exclusive.
856        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
857            self.0.request = self.0.request.set_agent_content(v);
858            self
859        }
860    }
861
862    #[doc(hidden)]
863    impl crate::RequestBuilder for RestoreAgent {
864        fn request_options(&mut self) -> &mut crate::RequestOptions {
865            &mut self.0.options
866        }
867    }
868
869    /// The request builder for [Agents::get_validation_result][crate::client::Agents::get_validation_result] calls.
870    ///
871    /// # Example
872    /// ```
873    /// # use google_cloud_dialogflow_v2::builder::agents::GetValidationResult;
874    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
875    ///
876    /// let builder = prepare_request_builder();
877    /// let response = builder.send().await?;
878    /// # Ok(()) }
879    ///
880    /// fn prepare_request_builder() -> GetValidationResult {
881    ///   # panic!();
882    ///   // ... details omitted ...
883    /// }
884    /// ```
885    #[derive(Clone, Debug)]
886    pub struct GetValidationResult(RequestBuilder<crate::model::GetValidationResultRequest>);
887
888    impl GetValidationResult {
889        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
890            Self(RequestBuilder::new(stub))
891        }
892
893        /// Sets the full request, replacing any prior values.
894        pub fn with_request<V: Into<crate::model::GetValidationResultRequest>>(
895            mut self,
896            v: V,
897        ) -> Self {
898            self.0.request = v.into();
899            self
900        }
901
902        /// Sets all the options, replacing any prior values.
903        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
904            self.0.options = v.into();
905            self
906        }
907
908        /// Sends the request.
909        pub async fn send(self) -> Result<crate::model::ValidationResult> {
910            (*self.0.stub)
911                .get_validation_result(self.0.request, self.0.options)
912                .await
913                .map(crate::Response::into_body)
914        }
915
916        /// Sets the value of [parent][crate::model::GetValidationResultRequest::parent].
917        ///
918        /// This is a **required** field for requests.
919        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
920            self.0.request.parent = v.into();
921            self
922        }
923
924        /// Sets the value of [language_code][crate::model::GetValidationResultRequest::language_code].
925        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
926            self.0.request.language_code = v.into();
927            self
928        }
929    }
930
931    #[doc(hidden)]
932    impl crate::RequestBuilder for GetValidationResult {
933        fn request_options(&mut self) -> &mut crate::RequestOptions {
934            &mut self.0.options
935        }
936    }
937
938    /// The request builder for [Agents::list_locations][crate::client::Agents::list_locations] calls.
939    ///
940    /// # Example
941    /// ```
942    /// # use google_cloud_dialogflow_v2::builder::agents::ListLocations;
943    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
944    /// use google_cloud_gax::paginator::ItemPaginator;
945    ///
946    /// let builder = prepare_request_builder();
947    /// let mut items = builder.by_item();
948    /// while let Some(result) = items.next().await {
949    ///   let item = result?;
950    /// }
951    /// # Ok(()) }
952    ///
953    /// fn prepare_request_builder() -> ListLocations {
954    ///   # panic!();
955    ///   // ... details omitted ...
956    /// }
957    /// ```
958    #[derive(Clone, Debug)]
959    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
960
961    impl ListLocations {
962        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
963            Self(RequestBuilder::new(stub))
964        }
965
966        /// Sets the full request, replacing any prior values.
967        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
968            mut self,
969            v: V,
970        ) -> Self {
971            self.0.request = v.into();
972            self
973        }
974
975        /// Sets all the options, replacing any prior values.
976        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
977            self.0.options = v.into();
978            self
979        }
980
981        /// Sends the request.
982        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
983            (*self.0.stub)
984                .list_locations(self.0.request, self.0.options)
985                .await
986                .map(crate::Response::into_body)
987        }
988
989        /// Streams each page in the collection.
990        pub fn by_page(
991            self,
992        ) -> impl google_cloud_gax::paginator::Paginator<
993            google_cloud_location::model::ListLocationsResponse,
994            crate::Error,
995        > {
996            use std::clone::Clone;
997            let token = self.0.request.page_token.clone();
998            let execute = move |token: String| {
999                let mut builder = self.clone();
1000                builder.0.request = builder.0.request.set_page_token(token);
1001                builder.send()
1002            };
1003            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1004        }
1005
1006        /// Streams each item in the collection.
1007        pub fn by_item(
1008            self,
1009        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1010            google_cloud_location::model::ListLocationsResponse,
1011            crate::Error,
1012        > {
1013            use google_cloud_gax::paginator::Paginator;
1014            self.by_page().items()
1015        }
1016
1017        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1018        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1019            self.0.request.name = v.into();
1020            self
1021        }
1022
1023        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1024        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1025            self.0.request.filter = v.into();
1026            self
1027        }
1028
1029        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1030        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1031            self.0.request.page_size = v.into();
1032            self
1033        }
1034
1035        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1036        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1037            self.0.request.page_token = v.into();
1038            self
1039        }
1040    }
1041
1042    #[doc(hidden)]
1043    impl crate::RequestBuilder for ListLocations {
1044        fn request_options(&mut self) -> &mut crate::RequestOptions {
1045            &mut self.0.options
1046        }
1047    }
1048
1049    /// The request builder for [Agents::get_location][crate::client::Agents::get_location] calls.
1050    ///
1051    /// # Example
1052    /// ```
1053    /// # use google_cloud_dialogflow_v2::builder::agents::GetLocation;
1054    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1055    ///
1056    /// let builder = prepare_request_builder();
1057    /// let response = builder.send().await?;
1058    /// # Ok(()) }
1059    ///
1060    /// fn prepare_request_builder() -> GetLocation {
1061    ///   # panic!();
1062    ///   // ... details omitted ...
1063    /// }
1064    /// ```
1065    #[derive(Clone, Debug)]
1066    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1067
1068    impl GetLocation {
1069        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1070            Self(RequestBuilder::new(stub))
1071        }
1072
1073        /// Sets the full request, replacing any prior values.
1074        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1075            mut self,
1076            v: V,
1077        ) -> Self {
1078            self.0.request = v.into();
1079            self
1080        }
1081
1082        /// Sets all the options, replacing any prior values.
1083        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1084            self.0.options = v.into();
1085            self
1086        }
1087
1088        /// Sends the request.
1089        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1090            (*self.0.stub)
1091                .get_location(self.0.request, self.0.options)
1092                .await
1093                .map(crate::Response::into_body)
1094        }
1095
1096        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1097        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1098            self.0.request.name = v.into();
1099            self
1100        }
1101    }
1102
1103    #[doc(hidden)]
1104    impl crate::RequestBuilder for GetLocation {
1105        fn request_options(&mut self) -> &mut crate::RequestOptions {
1106            &mut self.0.options
1107        }
1108    }
1109
1110    /// The request builder for [Agents::list_operations][crate::client::Agents::list_operations] calls.
1111    ///
1112    /// # Example
1113    /// ```
1114    /// # use google_cloud_dialogflow_v2::builder::agents::ListOperations;
1115    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1116    /// use google_cloud_gax::paginator::ItemPaginator;
1117    ///
1118    /// let builder = prepare_request_builder();
1119    /// let mut items = builder.by_item();
1120    /// while let Some(result) = items.next().await {
1121    ///   let item = result?;
1122    /// }
1123    /// # Ok(()) }
1124    ///
1125    /// fn prepare_request_builder() -> ListOperations {
1126    ///   # panic!();
1127    ///   // ... details omitted ...
1128    /// }
1129    /// ```
1130    #[derive(Clone, Debug)]
1131    pub struct ListOperations(
1132        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1133    );
1134
1135    impl ListOperations {
1136        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1137            Self(RequestBuilder::new(stub))
1138        }
1139
1140        /// Sets the full request, replacing any prior values.
1141        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1142            mut self,
1143            v: V,
1144        ) -> Self {
1145            self.0.request = v.into();
1146            self
1147        }
1148
1149        /// Sets all the options, replacing any prior values.
1150        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1151            self.0.options = v.into();
1152            self
1153        }
1154
1155        /// Sends the request.
1156        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1157            (*self.0.stub)
1158                .list_operations(self.0.request, self.0.options)
1159                .await
1160                .map(crate::Response::into_body)
1161        }
1162
1163        /// Streams each page in the collection.
1164        pub fn by_page(
1165            self,
1166        ) -> impl google_cloud_gax::paginator::Paginator<
1167            google_cloud_longrunning::model::ListOperationsResponse,
1168            crate::Error,
1169        > {
1170            use std::clone::Clone;
1171            let token = self.0.request.page_token.clone();
1172            let execute = move |token: String| {
1173                let mut builder = self.clone();
1174                builder.0.request = builder.0.request.set_page_token(token);
1175                builder.send()
1176            };
1177            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1178        }
1179
1180        /// Streams each item in the collection.
1181        pub fn by_item(
1182            self,
1183        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1184            google_cloud_longrunning::model::ListOperationsResponse,
1185            crate::Error,
1186        > {
1187            use google_cloud_gax::paginator::Paginator;
1188            self.by_page().items()
1189        }
1190
1191        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1192        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1193            self.0.request.name = v.into();
1194            self
1195        }
1196
1197        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1198        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1199            self.0.request.filter = v.into();
1200            self
1201        }
1202
1203        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1204        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1205            self.0.request.page_size = v.into();
1206            self
1207        }
1208
1209        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1210        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1211            self.0.request.page_token = v.into();
1212            self
1213        }
1214
1215        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1216        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1217            self.0.request.return_partial_success = v.into();
1218            self
1219        }
1220    }
1221
1222    #[doc(hidden)]
1223    impl crate::RequestBuilder for ListOperations {
1224        fn request_options(&mut self) -> &mut crate::RequestOptions {
1225            &mut self.0.options
1226        }
1227    }
1228
1229    /// The request builder for [Agents::get_operation][crate::client::Agents::get_operation] calls.
1230    ///
1231    /// # Example
1232    /// ```
1233    /// # use google_cloud_dialogflow_v2::builder::agents::GetOperation;
1234    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1235    ///
1236    /// let builder = prepare_request_builder();
1237    /// let response = builder.send().await?;
1238    /// # Ok(()) }
1239    ///
1240    /// fn prepare_request_builder() -> GetOperation {
1241    ///   # panic!();
1242    ///   // ... details omitted ...
1243    /// }
1244    /// ```
1245    #[derive(Clone, Debug)]
1246    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1247
1248    impl GetOperation {
1249        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1250            Self(RequestBuilder::new(stub))
1251        }
1252
1253        /// Sets the full request, replacing any prior values.
1254        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1255            mut self,
1256            v: V,
1257        ) -> Self {
1258            self.0.request = v.into();
1259            self
1260        }
1261
1262        /// Sets all the options, replacing any prior values.
1263        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1264            self.0.options = v.into();
1265            self
1266        }
1267
1268        /// Sends the request.
1269        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1270            (*self.0.stub)
1271                .get_operation(self.0.request, self.0.options)
1272                .await
1273                .map(crate::Response::into_body)
1274        }
1275
1276        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1277        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1278            self.0.request.name = v.into();
1279            self
1280        }
1281    }
1282
1283    #[doc(hidden)]
1284    impl crate::RequestBuilder for GetOperation {
1285        fn request_options(&mut self) -> &mut crate::RequestOptions {
1286            &mut self.0.options
1287        }
1288    }
1289
1290    /// The request builder for [Agents::cancel_operation][crate::client::Agents::cancel_operation] calls.
1291    ///
1292    /// # Example
1293    /// ```
1294    /// # use google_cloud_dialogflow_v2::builder::agents::CancelOperation;
1295    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1296    ///
1297    /// let builder = prepare_request_builder();
1298    /// let response = builder.send().await?;
1299    /// # Ok(()) }
1300    ///
1301    /// fn prepare_request_builder() -> CancelOperation {
1302    ///   # panic!();
1303    ///   // ... details omitted ...
1304    /// }
1305    /// ```
1306    #[derive(Clone, Debug)]
1307    pub struct CancelOperation(
1308        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1309    );
1310
1311    impl CancelOperation {
1312        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1313            Self(RequestBuilder::new(stub))
1314        }
1315
1316        /// Sets the full request, replacing any prior values.
1317        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1318            mut self,
1319            v: V,
1320        ) -> Self {
1321            self.0.request = v.into();
1322            self
1323        }
1324
1325        /// Sets all the options, replacing any prior values.
1326        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1327            self.0.options = v.into();
1328            self
1329        }
1330
1331        /// Sends the request.
1332        pub async fn send(self) -> Result<()> {
1333            (*self.0.stub)
1334                .cancel_operation(self.0.request, self.0.options)
1335                .await
1336                .map(crate::Response::into_body)
1337        }
1338
1339        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1340        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1341            self.0.request.name = v.into();
1342            self
1343        }
1344    }
1345
1346    #[doc(hidden)]
1347    impl crate::RequestBuilder for CancelOperation {
1348        fn request_options(&mut self) -> &mut crate::RequestOptions {
1349            &mut self.0.options
1350        }
1351    }
1352}
1353
1354/// Request and client builders for [AnswerRecords][crate::client::AnswerRecords].
1355#[cfg(feature = "answer-records")]
1356#[cfg_attr(docsrs, doc(cfg(feature = "answer-records")))]
1357pub mod answer_records {
1358    use crate::Result;
1359
1360    /// A builder for [AnswerRecords][crate::client::AnswerRecords].
1361    ///
1362    /// ```
1363    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1364    /// # use google_cloud_dialogflow_v2::*;
1365    /// # use builder::answer_records::ClientBuilder;
1366    /// # use client::AnswerRecords;
1367    /// let builder : ClientBuilder = AnswerRecords::builder();
1368    /// let client = builder
1369    ///     .with_endpoint("https://dialogflow.googleapis.com")
1370    ///     .build().await?;
1371    /// # Ok(()) }
1372    /// ```
1373    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1374
1375    pub(crate) mod client {
1376        use super::super::super::client::AnswerRecords;
1377        pub struct Factory;
1378        impl crate::ClientFactory for Factory {
1379            type Client = AnswerRecords;
1380            type Credentials = gaxi::options::Credentials;
1381            async fn build(
1382                self,
1383                config: gaxi::options::ClientConfig,
1384            ) -> crate::ClientBuilderResult<Self::Client> {
1385                Self::Client::new(config).await
1386            }
1387        }
1388    }
1389
1390    /// Common implementation for [crate::client::AnswerRecords] request builders.
1391    #[derive(Clone, Debug)]
1392    pub(crate) struct RequestBuilder<R: std::default::Default> {
1393        stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1394        request: R,
1395        options: crate::RequestOptions,
1396    }
1397
1398    impl<R> RequestBuilder<R>
1399    where
1400        R: std::default::Default,
1401    {
1402        pub(crate) fn new(
1403            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1404        ) -> Self {
1405            Self {
1406                stub,
1407                request: R::default(),
1408                options: crate::RequestOptions::default(),
1409            }
1410        }
1411    }
1412
1413    /// The request builder for [AnswerRecords::list_answer_records][crate::client::AnswerRecords::list_answer_records] calls.
1414    ///
1415    /// # Example
1416    /// ```
1417    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListAnswerRecords;
1418    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1419    /// use google_cloud_gax::paginator::ItemPaginator;
1420    ///
1421    /// let builder = prepare_request_builder();
1422    /// let mut items = builder.by_item();
1423    /// while let Some(result) = items.next().await {
1424    ///   let item = result?;
1425    /// }
1426    /// # Ok(()) }
1427    ///
1428    /// fn prepare_request_builder() -> ListAnswerRecords {
1429    ///   # panic!();
1430    ///   // ... details omitted ...
1431    /// }
1432    /// ```
1433    #[derive(Clone, Debug)]
1434    pub struct ListAnswerRecords(RequestBuilder<crate::model::ListAnswerRecordsRequest>);
1435
1436    impl ListAnswerRecords {
1437        pub(crate) fn new(
1438            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1439        ) -> Self {
1440            Self(RequestBuilder::new(stub))
1441        }
1442
1443        /// Sets the full request, replacing any prior values.
1444        pub fn with_request<V: Into<crate::model::ListAnswerRecordsRequest>>(
1445            mut self,
1446            v: V,
1447        ) -> Self {
1448            self.0.request = v.into();
1449            self
1450        }
1451
1452        /// Sets all the options, replacing any prior values.
1453        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1454            self.0.options = v.into();
1455            self
1456        }
1457
1458        /// Sends the request.
1459        pub async fn send(self) -> Result<crate::model::ListAnswerRecordsResponse> {
1460            (*self.0.stub)
1461                .list_answer_records(self.0.request, self.0.options)
1462                .await
1463                .map(crate::Response::into_body)
1464        }
1465
1466        /// Streams each page in the collection.
1467        pub fn by_page(
1468            self,
1469        ) -> impl google_cloud_gax::paginator::Paginator<
1470            crate::model::ListAnswerRecordsResponse,
1471            crate::Error,
1472        > {
1473            use std::clone::Clone;
1474            let token = self.0.request.page_token.clone();
1475            let execute = move |token: String| {
1476                let mut builder = self.clone();
1477                builder.0.request = builder.0.request.set_page_token(token);
1478                builder.send()
1479            };
1480            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1481        }
1482
1483        /// Streams each item in the collection.
1484        pub fn by_item(
1485            self,
1486        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1487            crate::model::ListAnswerRecordsResponse,
1488            crate::Error,
1489        > {
1490            use google_cloud_gax::paginator::Paginator;
1491            self.by_page().items()
1492        }
1493
1494        /// Sets the value of [parent][crate::model::ListAnswerRecordsRequest::parent].
1495        ///
1496        /// This is a **required** field for requests.
1497        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1498            self.0.request.parent = v.into();
1499            self
1500        }
1501
1502        /// Sets the value of [filter][crate::model::ListAnswerRecordsRequest::filter].
1503        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1504            self.0.request.filter = v.into();
1505            self
1506        }
1507
1508        /// Sets the value of [page_size][crate::model::ListAnswerRecordsRequest::page_size].
1509        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1510            self.0.request.page_size = v.into();
1511            self
1512        }
1513
1514        /// Sets the value of [page_token][crate::model::ListAnswerRecordsRequest::page_token].
1515        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1516            self.0.request.page_token = v.into();
1517            self
1518        }
1519    }
1520
1521    #[doc(hidden)]
1522    impl crate::RequestBuilder for ListAnswerRecords {
1523        fn request_options(&mut self) -> &mut crate::RequestOptions {
1524            &mut self.0.options
1525        }
1526    }
1527
1528    /// The request builder for [AnswerRecords::update_answer_record][crate::client::AnswerRecords::update_answer_record] calls.
1529    ///
1530    /// # Example
1531    /// ```
1532    /// # use google_cloud_dialogflow_v2::builder::answer_records::UpdateAnswerRecord;
1533    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1534    ///
1535    /// let builder = prepare_request_builder();
1536    /// let response = builder.send().await?;
1537    /// # Ok(()) }
1538    ///
1539    /// fn prepare_request_builder() -> UpdateAnswerRecord {
1540    ///   # panic!();
1541    ///   // ... details omitted ...
1542    /// }
1543    /// ```
1544    #[derive(Clone, Debug)]
1545    pub struct UpdateAnswerRecord(RequestBuilder<crate::model::UpdateAnswerRecordRequest>);
1546
1547    impl UpdateAnswerRecord {
1548        pub(crate) fn new(
1549            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1550        ) -> Self {
1551            Self(RequestBuilder::new(stub))
1552        }
1553
1554        /// Sets the full request, replacing any prior values.
1555        pub fn with_request<V: Into<crate::model::UpdateAnswerRecordRequest>>(
1556            mut self,
1557            v: V,
1558        ) -> Self {
1559            self.0.request = v.into();
1560            self
1561        }
1562
1563        /// Sets all the options, replacing any prior values.
1564        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1565            self.0.options = v.into();
1566            self
1567        }
1568
1569        /// Sends the request.
1570        pub async fn send(self) -> Result<crate::model::AnswerRecord> {
1571            (*self.0.stub)
1572                .update_answer_record(self.0.request, self.0.options)
1573                .await
1574                .map(crate::Response::into_body)
1575        }
1576
1577        /// Sets the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1578        ///
1579        /// This is a **required** field for requests.
1580        pub fn set_answer_record<T>(mut self, v: T) -> Self
1581        where
1582            T: std::convert::Into<crate::model::AnswerRecord>,
1583        {
1584            self.0.request.answer_record = std::option::Option::Some(v.into());
1585            self
1586        }
1587
1588        /// Sets or clears the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1589        ///
1590        /// This is a **required** field for requests.
1591        pub fn set_or_clear_answer_record<T>(mut self, v: std::option::Option<T>) -> Self
1592        where
1593            T: std::convert::Into<crate::model::AnswerRecord>,
1594        {
1595            self.0.request.answer_record = v.map(|x| x.into());
1596            self
1597        }
1598
1599        /// Sets the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1600        ///
1601        /// This is a **required** field for requests.
1602        pub fn set_update_mask<T>(mut self, v: T) -> Self
1603        where
1604            T: std::convert::Into<wkt::FieldMask>,
1605        {
1606            self.0.request.update_mask = std::option::Option::Some(v.into());
1607            self
1608        }
1609
1610        /// Sets or clears the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1611        ///
1612        /// This is a **required** field for requests.
1613        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1614        where
1615            T: std::convert::Into<wkt::FieldMask>,
1616        {
1617            self.0.request.update_mask = v.map(|x| x.into());
1618            self
1619        }
1620    }
1621
1622    #[doc(hidden)]
1623    impl crate::RequestBuilder for UpdateAnswerRecord {
1624        fn request_options(&mut self) -> &mut crate::RequestOptions {
1625            &mut self.0.options
1626        }
1627    }
1628
1629    /// The request builder for [AnswerRecords::list_locations][crate::client::AnswerRecords::list_locations] calls.
1630    ///
1631    /// # Example
1632    /// ```
1633    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListLocations;
1634    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1635    /// use google_cloud_gax::paginator::ItemPaginator;
1636    ///
1637    /// let builder = prepare_request_builder();
1638    /// let mut items = builder.by_item();
1639    /// while let Some(result) = items.next().await {
1640    ///   let item = result?;
1641    /// }
1642    /// # Ok(()) }
1643    ///
1644    /// fn prepare_request_builder() -> ListLocations {
1645    ///   # panic!();
1646    ///   // ... details omitted ...
1647    /// }
1648    /// ```
1649    #[derive(Clone, Debug)]
1650    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1651
1652    impl ListLocations {
1653        pub(crate) fn new(
1654            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1655        ) -> Self {
1656            Self(RequestBuilder::new(stub))
1657        }
1658
1659        /// Sets the full request, replacing any prior values.
1660        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1661            mut self,
1662            v: V,
1663        ) -> Self {
1664            self.0.request = v.into();
1665            self
1666        }
1667
1668        /// Sets all the options, replacing any prior values.
1669        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1670            self.0.options = v.into();
1671            self
1672        }
1673
1674        /// Sends the request.
1675        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1676            (*self.0.stub)
1677                .list_locations(self.0.request, self.0.options)
1678                .await
1679                .map(crate::Response::into_body)
1680        }
1681
1682        /// Streams each page in the collection.
1683        pub fn by_page(
1684            self,
1685        ) -> impl google_cloud_gax::paginator::Paginator<
1686            google_cloud_location::model::ListLocationsResponse,
1687            crate::Error,
1688        > {
1689            use std::clone::Clone;
1690            let token = self.0.request.page_token.clone();
1691            let execute = move |token: String| {
1692                let mut builder = self.clone();
1693                builder.0.request = builder.0.request.set_page_token(token);
1694                builder.send()
1695            };
1696            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1697        }
1698
1699        /// Streams each item in the collection.
1700        pub fn by_item(
1701            self,
1702        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1703            google_cloud_location::model::ListLocationsResponse,
1704            crate::Error,
1705        > {
1706            use google_cloud_gax::paginator::Paginator;
1707            self.by_page().items()
1708        }
1709
1710        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1711        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1712            self.0.request.name = v.into();
1713            self
1714        }
1715
1716        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1717        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1718            self.0.request.filter = v.into();
1719            self
1720        }
1721
1722        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1723        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1724            self.0.request.page_size = v.into();
1725            self
1726        }
1727
1728        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1729        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1730            self.0.request.page_token = v.into();
1731            self
1732        }
1733    }
1734
1735    #[doc(hidden)]
1736    impl crate::RequestBuilder for ListLocations {
1737        fn request_options(&mut self) -> &mut crate::RequestOptions {
1738            &mut self.0.options
1739        }
1740    }
1741
1742    /// The request builder for [AnswerRecords::get_location][crate::client::AnswerRecords::get_location] calls.
1743    ///
1744    /// # Example
1745    /// ```
1746    /// # use google_cloud_dialogflow_v2::builder::answer_records::GetLocation;
1747    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1748    ///
1749    /// let builder = prepare_request_builder();
1750    /// let response = builder.send().await?;
1751    /// # Ok(()) }
1752    ///
1753    /// fn prepare_request_builder() -> GetLocation {
1754    ///   # panic!();
1755    ///   // ... details omitted ...
1756    /// }
1757    /// ```
1758    #[derive(Clone, Debug)]
1759    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1760
1761    impl GetLocation {
1762        pub(crate) fn new(
1763            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1764        ) -> Self {
1765            Self(RequestBuilder::new(stub))
1766        }
1767
1768        /// Sets the full request, replacing any prior values.
1769        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1770            mut self,
1771            v: V,
1772        ) -> Self {
1773            self.0.request = v.into();
1774            self
1775        }
1776
1777        /// Sets all the options, replacing any prior values.
1778        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1779            self.0.options = v.into();
1780            self
1781        }
1782
1783        /// Sends the request.
1784        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1785            (*self.0.stub)
1786                .get_location(self.0.request, self.0.options)
1787                .await
1788                .map(crate::Response::into_body)
1789        }
1790
1791        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1792        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1793            self.0.request.name = v.into();
1794            self
1795        }
1796    }
1797
1798    #[doc(hidden)]
1799    impl crate::RequestBuilder for GetLocation {
1800        fn request_options(&mut self) -> &mut crate::RequestOptions {
1801            &mut self.0.options
1802        }
1803    }
1804
1805    /// The request builder for [AnswerRecords::list_operations][crate::client::AnswerRecords::list_operations] calls.
1806    ///
1807    /// # Example
1808    /// ```
1809    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListOperations;
1810    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1811    /// use google_cloud_gax::paginator::ItemPaginator;
1812    ///
1813    /// let builder = prepare_request_builder();
1814    /// let mut items = builder.by_item();
1815    /// while let Some(result) = items.next().await {
1816    ///   let item = result?;
1817    /// }
1818    /// # Ok(()) }
1819    ///
1820    /// fn prepare_request_builder() -> ListOperations {
1821    ///   # panic!();
1822    ///   // ... details omitted ...
1823    /// }
1824    /// ```
1825    #[derive(Clone, Debug)]
1826    pub struct ListOperations(
1827        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1828    );
1829
1830    impl ListOperations {
1831        pub(crate) fn new(
1832            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1833        ) -> Self {
1834            Self(RequestBuilder::new(stub))
1835        }
1836
1837        /// Sets the full request, replacing any prior values.
1838        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1839            mut self,
1840            v: V,
1841        ) -> Self {
1842            self.0.request = v.into();
1843            self
1844        }
1845
1846        /// Sets all the options, replacing any prior values.
1847        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1848            self.0.options = v.into();
1849            self
1850        }
1851
1852        /// Sends the request.
1853        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1854            (*self.0.stub)
1855                .list_operations(self.0.request, self.0.options)
1856                .await
1857                .map(crate::Response::into_body)
1858        }
1859
1860        /// Streams each page in the collection.
1861        pub fn by_page(
1862            self,
1863        ) -> impl google_cloud_gax::paginator::Paginator<
1864            google_cloud_longrunning::model::ListOperationsResponse,
1865            crate::Error,
1866        > {
1867            use std::clone::Clone;
1868            let token = self.0.request.page_token.clone();
1869            let execute = move |token: String| {
1870                let mut builder = self.clone();
1871                builder.0.request = builder.0.request.set_page_token(token);
1872                builder.send()
1873            };
1874            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1875        }
1876
1877        /// Streams each item in the collection.
1878        pub fn by_item(
1879            self,
1880        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1881            google_cloud_longrunning::model::ListOperationsResponse,
1882            crate::Error,
1883        > {
1884            use google_cloud_gax::paginator::Paginator;
1885            self.by_page().items()
1886        }
1887
1888        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1889        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1890            self.0.request.name = v.into();
1891            self
1892        }
1893
1894        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1895        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1896            self.0.request.filter = v.into();
1897            self
1898        }
1899
1900        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1901        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1902            self.0.request.page_size = v.into();
1903            self
1904        }
1905
1906        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1907        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1908            self.0.request.page_token = v.into();
1909            self
1910        }
1911
1912        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1913        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1914            self.0.request.return_partial_success = v.into();
1915            self
1916        }
1917    }
1918
1919    #[doc(hidden)]
1920    impl crate::RequestBuilder for ListOperations {
1921        fn request_options(&mut self) -> &mut crate::RequestOptions {
1922            &mut self.0.options
1923        }
1924    }
1925
1926    /// The request builder for [AnswerRecords::get_operation][crate::client::AnswerRecords::get_operation] calls.
1927    ///
1928    /// # Example
1929    /// ```
1930    /// # use google_cloud_dialogflow_v2::builder::answer_records::GetOperation;
1931    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1932    ///
1933    /// let builder = prepare_request_builder();
1934    /// let response = builder.send().await?;
1935    /// # Ok(()) }
1936    ///
1937    /// fn prepare_request_builder() -> GetOperation {
1938    ///   # panic!();
1939    ///   // ... details omitted ...
1940    /// }
1941    /// ```
1942    #[derive(Clone, Debug)]
1943    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1944
1945    impl GetOperation {
1946        pub(crate) fn new(
1947            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1948        ) -> Self {
1949            Self(RequestBuilder::new(stub))
1950        }
1951
1952        /// Sets the full request, replacing any prior values.
1953        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1954            mut self,
1955            v: V,
1956        ) -> Self {
1957            self.0.request = v.into();
1958            self
1959        }
1960
1961        /// Sets all the options, replacing any prior values.
1962        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1963            self.0.options = v.into();
1964            self
1965        }
1966
1967        /// Sends the request.
1968        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1969            (*self.0.stub)
1970                .get_operation(self.0.request, self.0.options)
1971                .await
1972                .map(crate::Response::into_body)
1973        }
1974
1975        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1976        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1977            self.0.request.name = v.into();
1978            self
1979        }
1980    }
1981
1982    #[doc(hidden)]
1983    impl crate::RequestBuilder for GetOperation {
1984        fn request_options(&mut self) -> &mut crate::RequestOptions {
1985            &mut self.0.options
1986        }
1987    }
1988
1989    /// The request builder for [AnswerRecords::cancel_operation][crate::client::AnswerRecords::cancel_operation] calls.
1990    ///
1991    /// # Example
1992    /// ```
1993    /// # use google_cloud_dialogflow_v2::builder::answer_records::CancelOperation;
1994    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1995    ///
1996    /// let builder = prepare_request_builder();
1997    /// let response = builder.send().await?;
1998    /// # Ok(()) }
1999    ///
2000    /// fn prepare_request_builder() -> CancelOperation {
2001    ///   # panic!();
2002    ///   // ... details omitted ...
2003    /// }
2004    /// ```
2005    #[derive(Clone, Debug)]
2006    pub struct CancelOperation(
2007        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2008    );
2009
2010    impl CancelOperation {
2011        pub(crate) fn new(
2012            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
2013        ) -> Self {
2014            Self(RequestBuilder::new(stub))
2015        }
2016
2017        /// Sets the full request, replacing any prior values.
2018        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2019            mut self,
2020            v: V,
2021        ) -> Self {
2022            self.0.request = v.into();
2023            self
2024        }
2025
2026        /// Sets all the options, replacing any prior values.
2027        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2028            self.0.options = v.into();
2029            self
2030        }
2031
2032        /// Sends the request.
2033        pub async fn send(self) -> Result<()> {
2034            (*self.0.stub)
2035                .cancel_operation(self.0.request, self.0.options)
2036                .await
2037                .map(crate::Response::into_body)
2038        }
2039
2040        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2041        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2042            self.0.request.name = v.into();
2043            self
2044        }
2045    }
2046
2047    #[doc(hidden)]
2048    impl crate::RequestBuilder for CancelOperation {
2049        fn request_options(&mut self) -> &mut crate::RequestOptions {
2050            &mut self.0.options
2051        }
2052    }
2053}
2054
2055/// Request and client builders for [Contexts][crate::client::Contexts].
2056#[cfg(feature = "contexts")]
2057#[cfg_attr(docsrs, doc(cfg(feature = "contexts")))]
2058pub mod contexts {
2059    use crate::Result;
2060
2061    /// A builder for [Contexts][crate::client::Contexts].
2062    ///
2063    /// ```
2064    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2065    /// # use google_cloud_dialogflow_v2::*;
2066    /// # use builder::contexts::ClientBuilder;
2067    /// # use client::Contexts;
2068    /// let builder : ClientBuilder = Contexts::builder();
2069    /// let client = builder
2070    ///     .with_endpoint("https://dialogflow.googleapis.com")
2071    ///     .build().await?;
2072    /// # Ok(()) }
2073    /// ```
2074    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2075
2076    pub(crate) mod client {
2077        use super::super::super::client::Contexts;
2078        pub struct Factory;
2079        impl crate::ClientFactory for Factory {
2080            type Client = Contexts;
2081            type Credentials = gaxi::options::Credentials;
2082            async fn build(
2083                self,
2084                config: gaxi::options::ClientConfig,
2085            ) -> crate::ClientBuilderResult<Self::Client> {
2086                Self::Client::new(config).await
2087            }
2088        }
2089    }
2090
2091    /// Common implementation for [crate::client::Contexts] request builders.
2092    #[derive(Clone, Debug)]
2093    pub(crate) struct RequestBuilder<R: std::default::Default> {
2094        stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>,
2095        request: R,
2096        options: crate::RequestOptions,
2097    }
2098
2099    impl<R> RequestBuilder<R>
2100    where
2101        R: std::default::Default,
2102    {
2103        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2104            Self {
2105                stub,
2106                request: R::default(),
2107                options: crate::RequestOptions::default(),
2108            }
2109        }
2110    }
2111
2112    /// The request builder for [Contexts::list_contexts][crate::client::Contexts::list_contexts] calls.
2113    ///
2114    /// # Example
2115    /// ```
2116    /// # use google_cloud_dialogflow_v2::builder::contexts::ListContexts;
2117    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2118    /// use google_cloud_gax::paginator::ItemPaginator;
2119    ///
2120    /// let builder = prepare_request_builder();
2121    /// let mut items = builder.by_item();
2122    /// while let Some(result) = items.next().await {
2123    ///   let item = result?;
2124    /// }
2125    /// # Ok(()) }
2126    ///
2127    /// fn prepare_request_builder() -> ListContexts {
2128    ///   # panic!();
2129    ///   // ... details omitted ...
2130    /// }
2131    /// ```
2132    #[derive(Clone, Debug)]
2133    pub struct ListContexts(RequestBuilder<crate::model::ListContextsRequest>);
2134
2135    impl ListContexts {
2136        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2137            Self(RequestBuilder::new(stub))
2138        }
2139
2140        /// Sets the full request, replacing any prior values.
2141        pub fn with_request<V: Into<crate::model::ListContextsRequest>>(mut self, v: V) -> Self {
2142            self.0.request = v.into();
2143            self
2144        }
2145
2146        /// Sets all the options, replacing any prior values.
2147        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2148            self.0.options = v.into();
2149            self
2150        }
2151
2152        /// Sends the request.
2153        pub async fn send(self) -> Result<crate::model::ListContextsResponse> {
2154            (*self.0.stub)
2155                .list_contexts(self.0.request, self.0.options)
2156                .await
2157                .map(crate::Response::into_body)
2158        }
2159
2160        /// Streams each page in the collection.
2161        pub fn by_page(
2162            self,
2163        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListContextsResponse, crate::Error>
2164        {
2165            use std::clone::Clone;
2166            let token = self.0.request.page_token.clone();
2167            let execute = move |token: String| {
2168                let mut builder = self.clone();
2169                builder.0.request = builder.0.request.set_page_token(token);
2170                builder.send()
2171            };
2172            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2173        }
2174
2175        /// Streams each item in the collection.
2176        pub fn by_item(
2177            self,
2178        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2179            crate::model::ListContextsResponse,
2180            crate::Error,
2181        > {
2182            use google_cloud_gax::paginator::Paginator;
2183            self.by_page().items()
2184        }
2185
2186        /// Sets the value of [parent][crate::model::ListContextsRequest::parent].
2187        ///
2188        /// This is a **required** field for requests.
2189        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2190            self.0.request.parent = v.into();
2191            self
2192        }
2193
2194        /// Sets the value of [page_size][crate::model::ListContextsRequest::page_size].
2195        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2196            self.0.request.page_size = v.into();
2197            self
2198        }
2199
2200        /// Sets the value of [page_token][crate::model::ListContextsRequest::page_token].
2201        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2202            self.0.request.page_token = v.into();
2203            self
2204        }
2205    }
2206
2207    #[doc(hidden)]
2208    impl crate::RequestBuilder for ListContexts {
2209        fn request_options(&mut self) -> &mut crate::RequestOptions {
2210            &mut self.0.options
2211        }
2212    }
2213
2214    /// The request builder for [Contexts::get_context][crate::client::Contexts::get_context] calls.
2215    ///
2216    /// # Example
2217    /// ```
2218    /// # use google_cloud_dialogflow_v2::builder::contexts::GetContext;
2219    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2220    ///
2221    /// let builder = prepare_request_builder();
2222    /// let response = builder.send().await?;
2223    /// # Ok(()) }
2224    ///
2225    /// fn prepare_request_builder() -> GetContext {
2226    ///   # panic!();
2227    ///   // ... details omitted ...
2228    /// }
2229    /// ```
2230    #[derive(Clone, Debug)]
2231    pub struct GetContext(RequestBuilder<crate::model::GetContextRequest>);
2232
2233    impl GetContext {
2234        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2235            Self(RequestBuilder::new(stub))
2236        }
2237
2238        /// Sets the full request, replacing any prior values.
2239        pub fn with_request<V: Into<crate::model::GetContextRequest>>(mut self, v: V) -> Self {
2240            self.0.request = v.into();
2241            self
2242        }
2243
2244        /// Sets all the options, replacing any prior values.
2245        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2246            self.0.options = v.into();
2247            self
2248        }
2249
2250        /// Sends the request.
2251        pub async fn send(self) -> Result<crate::model::Context> {
2252            (*self.0.stub)
2253                .get_context(self.0.request, self.0.options)
2254                .await
2255                .map(crate::Response::into_body)
2256        }
2257
2258        /// Sets the value of [name][crate::model::GetContextRequest::name].
2259        ///
2260        /// This is a **required** field for requests.
2261        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2262            self.0.request.name = v.into();
2263            self
2264        }
2265    }
2266
2267    #[doc(hidden)]
2268    impl crate::RequestBuilder for GetContext {
2269        fn request_options(&mut self) -> &mut crate::RequestOptions {
2270            &mut self.0.options
2271        }
2272    }
2273
2274    /// The request builder for [Contexts::create_context][crate::client::Contexts::create_context] calls.
2275    ///
2276    /// # Example
2277    /// ```
2278    /// # use google_cloud_dialogflow_v2::builder::contexts::CreateContext;
2279    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2280    ///
2281    /// let builder = prepare_request_builder();
2282    /// let response = builder.send().await?;
2283    /// # Ok(()) }
2284    ///
2285    /// fn prepare_request_builder() -> CreateContext {
2286    ///   # panic!();
2287    ///   // ... details omitted ...
2288    /// }
2289    /// ```
2290    #[derive(Clone, Debug)]
2291    pub struct CreateContext(RequestBuilder<crate::model::CreateContextRequest>);
2292
2293    impl CreateContext {
2294        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2295            Self(RequestBuilder::new(stub))
2296        }
2297
2298        /// Sets the full request, replacing any prior values.
2299        pub fn with_request<V: Into<crate::model::CreateContextRequest>>(mut self, v: V) -> Self {
2300            self.0.request = v.into();
2301            self
2302        }
2303
2304        /// Sets all the options, replacing any prior values.
2305        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2306            self.0.options = v.into();
2307            self
2308        }
2309
2310        /// Sends the request.
2311        pub async fn send(self) -> Result<crate::model::Context> {
2312            (*self.0.stub)
2313                .create_context(self.0.request, self.0.options)
2314                .await
2315                .map(crate::Response::into_body)
2316        }
2317
2318        /// Sets the value of [parent][crate::model::CreateContextRequest::parent].
2319        ///
2320        /// This is a **required** field for requests.
2321        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2322            self.0.request.parent = v.into();
2323            self
2324        }
2325
2326        /// Sets the value of [context][crate::model::CreateContextRequest::context].
2327        ///
2328        /// This is a **required** field for requests.
2329        pub fn set_context<T>(mut self, v: T) -> Self
2330        where
2331            T: std::convert::Into<crate::model::Context>,
2332        {
2333            self.0.request.context = std::option::Option::Some(v.into());
2334            self
2335        }
2336
2337        /// Sets or clears the value of [context][crate::model::CreateContextRequest::context].
2338        ///
2339        /// This is a **required** field for requests.
2340        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2341        where
2342            T: std::convert::Into<crate::model::Context>,
2343        {
2344            self.0.request.context = v.map(|x| x.into());
2345            self
2346        }
2347    }
2348
2349    #[doc(hidden)]
2350    impl crate::RequestBuilder for CreateContext {
2351        fn request_options(&mut self) -> &mut crate::RequestOptions {
2352            &mut self.0.options
2353        }
2354    }
2355
2356    /// The request builder for [Contexts::update_context][crate::client::Contexts::update_context] calls.
2357    ///
2358    /// # Example
2359    /// ```
2360    /// # use google_cloud_dialogflow_v2::builder::contexts::UpdateContext;
2361    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2362    ///
2363    /// let builder = prepare_request_builder();
2364    /// let response = builder.send().await?;
2365    /// # Ok(()) }
2366    ///
2367    /// fn prepare_request_builder() -> UpdateContext {
2368    ///   # panic!();
2369    ///   // ... details omitted ...
2370    /// }
2371    /// ```
2372    #[derive(Clone, Debug)]
2373    pub struct UpdateContext(RequestBuilder<crate::model::UpdateContextRequest>);
2374
2375    impl UpdateContext {
2376        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2377            Self(RequestBuilder::new(stub))
2378        }
2379
2380        /// Sets the full request, replacing any prior values.
2381        pub fn with_request<V: Into<crate::model::UpdateContextRequest>>(mut self, v: V) -> Self {
2382            self.0.request = v.into();
2383            self
2384        }
2385
2386        /// Sets all the options, replacing any prior values.
2387        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2388            self.0.options = v.into();
2389            self
2390        }
2391
2392        /// Sends the request.
2393        pub async fn send(self) -> Result<crate::model::Context> {
2394            (*self.0.stub)
2395                .update_context(self.0.request, self.0.options)
2396                .await
2397                .map(crate::Response::into_body)
2398        }
2399
2400        /// Sets the value of [context][crate::model::UpdateContextRequest::context].
2401        ///
2402        /// This is a **required** field for requests.
2403        pub fn set_context<T>(mut self, v: T) -> Self
2404        where
2405            T: std::convert::Into<crate::model::Context>,
2406        {
2407            self.0.request.context = std::option::Option::Some(v.into());
2408            self
2409        }
2410
2411        /// Sets or clears the value of [context][crate::model::UpdateContextRequest::context].
2412        ///
2413        /// This is a **required** field for requests.
2414        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2415        where
2416            T: std::convert::Into<crate::model::Context>,
2417        {
2418            self.0.request.context = v.map(|x| x.into());
2419            self
2420        }
2421
2422        /// Sets the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2423        pub fn set_update_mask<T>(mut self, v: T) -> Self
2424        where
2425            T: std::convert::Into<wkt::FieldMask>,
2426        {
2427            self.0.request.update_mask = std::option::Option::Some(v.into());
2428            self
2429        }
2430
2431        /// Sets or clears the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2432        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2433        where
2434            T: std::convert::Into<wkt::FieldMask>,
2435        {
2436            self.0.request.update_mask = v.map(|x| x.into());
2437            self
2438        }
2439    }
2440
2441    #[doc(hidden)]
2442    impl crate::RequestBuilder for UpdateContext {
2443        fn request_options(&mut self) -> &mut crate::RequestOptions {
2444            &mut self.0.options
2445        }
2446    }
2447
2448    /// The request builder for [Contexts::delete_context][crate::client::Contexts::delete_context] calls.
2449    ///
2450    /// # Example
2451    /// ```
2452    /// # use google_cloud_dialogflow_v2::builder::contexts::DeleteContext;
2453    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2454    ///
2455    /// let builder = prepare_request_builder();
2456    /// let response = builder.send().await?;
2457    /// # Ok(()) }
2458    ///
2459    /// fn prepare_request_builder() -> DeleteContext {
2460    ///   # panic!();
2461    ///   // ... details omitted ...
2462    /// }
2463    /// ```
2464    #[derive(Clone, Debug)]
2465    pub struct DeleteContext(RequestBuilder<crate::model::DeleteContextRequest>);
2466
2467    impl DeleteContext {
2468        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2469            Self(RequestBuilder::new(stub))
2470        }
2471
2472        /// Sets the full request, replacing any prior values.
2473        pub fn with_request<V: Into<crate::model::DeleteContextRequest>>(mut self, v: V) -> Self {
2474            self.0.request = v.into();
2475            self
2476        }
2477
2478        /// Sets all the options, replacing any prior values.
2479        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2480            self.0.options = v.into();
2481            self
2482        }
2483
2484        /// Sends the request.
2485        pub async fn send(self) -> Result<()> {
2486            (*self.0.stub)
2487                .delete_context(self.0.request, self.0.options)
2488                .await
2489                .map(crate::Response::into_body)
2490        }
2491
2492        /// Sets the value of [name][crate::model::DeleteContextRequest::name].
2493        ///
2494        /// This is a **required** field for requests.
2495        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2496            self.0.request.name = v.into();
2497            self
2498        }
2499    }
2500
2501    #[doc(hidden)]
2502    impl crate::RequestBuilder for DeleteContext {
2503        fn request_options(&mut self) -> &mut crate::RequestOptions {
2504            &mut self.0.options
2505        }
2506    }
2507
2508    /// The request builder for [Contexts::delete_all_contexts][crate::client::Contexts::delete_all_contexts] calls.
2509    ///
2510    /// # Example
2511    /// ```
2512    /// # use google_cloud_dialogflow_v2::builder::contexts::DeleteAllContexts;
2513    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2514    ///
2515    /// let builder = prepare_request_builder();
2516    /// let response = builder.send().await?;
2517    /// # Ok(()) }
2518    ///
2519    /// fn prepare_request_builder() -> DeleteAllContexts {
2520    ///   # panic!();
2521    ///   // ... details omitted ...
2522    /// }
2523    /// ```
2524    #[derive(Clone, Debug)]
2525    pub struct DeleteAllContexts(RequestBuilder<crate::model::DeleteAllContextsRequest>);
2526
2527    impl DeleteAllContexts {
2528        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2529            Self(RequestBuilder::new(stub))
2530        }
2531
2532        /// Sets the full request, replacing any prior values.
2533        pub fn with_request<V: Into<crate::model::DeleteAllContextsRequest>>(
2534            mut self,
2535            v: V,
2536        ) -> Self {
2537            self.0.request = v.into();
2538            self
2539        }
2540
2541        /// Sets all the options, replacing any prior values.
2542        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2543            self.0.options = v.into();
2544            self
2545        }
2546
2547        /// Sends the request.
2548        pub async fn send(self) -> Result<()> {
2549            (*self.0.stub)
2550                .delete_all_contexts(self.0.request, self.0.options)
2551                .await
2552                .map(crate::Response::into_body)
2553        }
2554
2555        /// Sets the value of [parent][crate::model::DeleteAllContextsRequest::parent].
2556        ///
2557        /// This is a **required** field for requests.
2558        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2559            self.0.request.parent = v.into();
2560            self
2561        }
2562    }
2563
2564    #[doc(hidden)]
2565    impl crate::RequestBuilder for DeleteAllContexts {
2566        fn request_options(&mut self) -> &mut crate::RequestOptions {
2567            &mut self.0.options
2568        }
2569    }
2570
2571    /// The request builder for [Contexts::list_locations][crate::client::Contexts::list_locations] calls.
2572    ///
2573    /// # Example
2574    /// ```
2575    /// # use google_cloud_dialogflow_v2::builder::contexts::ListLocations;
2576    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2577    /// use google_cloud_gax::paginator::ItemPaginator;
2578    ///
2579    /// let builder = prepare_request_builder();
2580    /// let mut items = builder.by_item();
2581    /// while let Some(result) = items.next().await {
2582    ///   let item = result?;
2583    /// }
2584    /// # Ok(()) }
2585    ///
2586    /// fn prepare_request_builder() -> ListLocations {
2587    ///   # panic!();
2588    ///   // ... details omitted ...
2589    /// }
2590    /// ```
2591    #[derive(Clone, Debug)]
2592    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2593
2594    impl ListLocations {
2595        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2596            Self(RequestBuilder::new(stub))
2597        }
2598
2599        /// Sets the full request, replacing any prior values.
2600        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2601            mut self,
2602            v: V,
2603        ) -> Self {
2604            self.0.request = v.into();
2605            self
2606        }
2607
2608        /// Sets all the options, replacing any prior values.
2609        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2610            self.0.options = v.into();
2611            self
2612        }
2613
2614        /// Sends the request.
2615        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2616            (*self.0.stub)
2617                .list_locations(self.0.request, self.0.options)
2618                .await
2619                .map(crate::Response::into_body)
2620        }
2621
2622        /// Streams each page in the collection.
2623        pub fn by_page(
2624            self,
2625        ) -> impl google_cloud_gax::paginator::Paginator<
2626            google_cloud_location::model::ListLocationsResponse,
2627            crate::Error,
2628        > {
2629            use std::clone::Clone;
2630            let token = self.0.request.page_token.clone();
2631            let execute = move |token: String| {
2632                let mut builder = self.clone();
2633                builder.0.request = builder.0.request.set_page_token(token);
2634                builder.send()
2635            };
2636            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2637        }
2638
2639        /// Streams each item in the collection.
2640        pub fn by_item(
2641            self,
2642        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2643            google_cloud_location::model::ListLocationsResponse,
2644            crate::Error,
2645        > {
2646            use google_cloud_gax::paginator::Paginator;
2647            self.by_page().items()
2648        }
2649
2650        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2651        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2652            self.0.request.name = v.into();
2653            self
2654        }
2655
2656        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2657        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2658            self.0.request.filter = v.into();
2659            self
2660        }
2661
2662        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2663        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2664            self.0.request.page_size = v.into();
2665            self
2666        }
2667
2668        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2669        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2670            self.0.request.page_token = v.into();
2671            self
2672        }
2673    }
2674
2675    #[doc(hidden)]
2676    impl crate::RequestBuilder for ListLocations {
2677        fn request_options(&mut self) -> &mut crate::RequestOptions {
2678            &mut self.0.options
2679        }
2680    }
2681
2682    /// The request builder for [Contexts::get_location][crate::client::Contexts::get_location] calls.
2683    ///
2684    /// # Example
2685    /// ```
2686    /// # use google_cloud_dialogflow_v2::builder::contexts::GetLocation;
2687    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2688    ///
2689    /// let builder = prepare_request_builder();
2690    /// let response = builder.send().await?;
2691    /// # Ok(()) }
2692    ///
2693    /// fn prepare_request_builder() -> GetLocation {
2694    ///   # panic!();
2695    ///   // ... details omitted ...
2696    /// }
2697    /// ```
2698    #[derive(Clone, Debug)]
2699    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2700
2701    impl GetLocation {
2702        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2703            Self(RequestBuilder::new(stub))
2704        }
2705
2706        /// Sets the full request, replacing any prior values.
2707        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2708            mut self,
2709            v: V,
2710        ) -> Self {
2711            self.0.request = v.into();
2712            self
2713        }
2714
2715        /// Sets all the options, replacing any prior values.
2716        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2717            self.0.options = v.into();
2718            self
2719        }
2720
2721        /// Sends the request.
2722        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2723            (*self.0.stub)
2724                .get_location(self.0.request, self.0.options)
2725                .await
2726                .map(crate::Response::into_body)
2727        }
2728
2729        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2730        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2731            self.0.request.name = v.into();
2732            self
2733        }
2734    }
2735
2736    #[doc(hidden)]
2737    impl crate::RequestBuilder for GetLocation {
2738        fn request_options(&mut self) -> &mut crate::RequestOptions {
2739            &mut self.0.options
2740        }
2741    }
2742
2743    /// The request builder for [Contexts::list_operations][crate::client::Contexts::list_operations] calls.
2744    ///
2745    /// # Example
2746    /// ```
2747    /// # use google_cloud_dialogflow_v2::builder::contexts::ListOperations;
2748    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2749    /// use google_cloud_gax::paginator::ItemPaginator;
2750    ///
2751    /// let builder = prepare_request_builder();
2752    /// let mut items = builder.by_item();
2753    /// while let Some(result) = items.next().await {
2754    ///   let item = result?;
2755    /// }
2756    /// # Ok(()) }
2757    ///
2758    /// fn prepare_request_builder() -> ListOperations {
2759    ///   # panic!();
2760    ///   // ... details omitted ...
2761    /// }
2762    /// ```
2763    #[derive(Clone, Debug)]
2764    pub struct ListOperations(
2765        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2766    );
2767
2768    impl ListOperations {
2769        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2770            Self(RequestBuilder::new(stub))
2771        }
2772
2773        /// Sets the full request, replacing any prior values.
2774        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2775            mut self,
2776            v: V,
2777        ) -> Self {
2778            self.0.request = v.into();
2779            self
2780        }
2781
2782        /// Sets all the options, replacing any prior values.
2783        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2784            self.0.options = v.into();
2785            self
2786        }
2787
2788        /// Sends the request.
2789        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2790            (*self.0.stub)
2791                .list_operations(self.0.request, self.0.options)
2792                .await
2793                .map(crate::Response::into_body)
2794        }
2795
2796        /// Streams each page in the collection.
2797        pub fn by_page(
2798            self,
2799        ) -> impl google_cloud_gax::paginator::Paginator<
2800            google_cloud_longrunning::model::ListOperationsResponse,
2801            crate::Error,
2802        > {
2803            use std::clone::Clone;
2804            let token = self.0.request.page_token.clone();
2805            let execute = move |token: String| {
2806                let mut builder = self.clone();
2807                builder.0.request = builder.0.request.set_page_token(token);
2808                builder.send()
2809            };
2810            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2811        }
2812
2813        /// Streams each item in the collection.
2814        pub fn by_item(
2815            self,
2816        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2817            google_cloud_longrunning::model::ListOperationsResponse,
2818            crate::Error,
2819        > {
2820            use google_cloud_gax::paginator::Paginator;
2821            self.by_page().items()
2822        }
2823
2824        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2825        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826            self.0.request.name = v.into();
2827            self
2828        }
2829
2830        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2831        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832            self.0.request.filter = v.into();
2833            self
2834        }
2835
2836        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2837        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2838            self.0.request.page_size = v.into();
2839            self
2840        }
2841
2842        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2843        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2844            self.0.request.page_token = v.into();
2845            self
2846        }
2847
2848        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2849        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2850            self.0.request.return_partial_success = v.into();
2851            self
2852        }
2853    }
2854
2855    #[doc(hidden)]
2856    impl crate::RequestBuilder for ListOperations {
2857        fn request_options(&mut self) -> &mut crate::RequestOptions {
2858            &mut self.0.options
2859        }
2860    }
2861
2862    /// The request builder for [Contexts::get_operation][crate::client::Contexts::get_operation] calls.
2863    ///
2864    /// # Example
2865    /// ```
2866    /// # use google_cloud_dialogflow_v2::builder::contexts::GetOperation;
2867    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2868    ///
2869    /// let builder = prepare_request_builder();
2870    /// let response = builder.send().await?;
2871    /// # Ok(()) }
2872    ///
2873    /// fn prepare_request_builder() -> GetOperation {
2874    ///   # panic!();
2875    ///   // ... details omitted ...
2876    /// }
2877    /// ```
2878    #[derive(Clone, Debug)]
2879    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2880
2881    impl GetOperation {
2882        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2883            Self(RequestBuilder::new(stub))
2884        }
2885
2886        /// Sets the full request, replacing any prior values.
2887        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2888            mut self,
2889            v: V,
2890        ) -> Self {
2891            self.0.request = v.into();
2892            self
2893        }
2894
2895        /// Sets all the options, replacing any prior values.
2896        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2897            self.0.options = v.into();
2898            self
2899        }
2900
2901        /// Sends the request.
2902        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2903            (*self.0.stub)
2904                .get_operation(self.0.request, self.0.options)
2905                .await
2906                .map(crate::Response::into_body)
2907        }
2908
2909        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2910        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2911            self.0.request.name = v.into();
2912            self
2913        }
2914    }
2915
2916    #[doc(hidden)]
2917    impl crate::RequestBuilder for GetOperation {
2918        fn request_options(&mut self) -> &mut crate::RequestOptions {
2919            &mut self.0.options
2920        }
2921    }
2922
2923    /// The request builder for [Contexts::cancel_operation][crate::client::Contexts::cancel_operation] calls.
2924    ///
2925    /// # Example
2926    /// ```
2927    /// # use google_cloud_dialogflow_v2::builder::contexts::CancelOperation;
2928    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2929    ///
2930    /// let builder = prepare_request_builder();
2931    /// let response = builder.send().await?;
2932    /// # Ok(()) }
2933    ///
2934    /// fn prepare_request_builder() -> CancelOperation {
2935    ///   # panic!();
2936    ///   // ... details omitted ...
2937    /// }
2938    /// ```
2939    #[derive(Clone, Debug)]
2940    pub struct CancelOperation(
2941        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2942    );
2943
2944    impl CancelOperation {
2945        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2946            Self(RequestBuilder::new(stub))
2947        }
2948
2949        /// Sets the full request, replacing any prior values.
2950        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2951            mut self,
2952            v: V,
2953        ) -> Self {
2954            self.0.request = v.into();
2955            self
2956        }
2957
2958        /// Sets all the options, replacing any prior values.
2959        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2960            self.0.options = v.into();
2961            self
2962        }
2963
2964        /// Sends the request.
2965        pub async fn send(self) -> Result<()> {
2966            (*self.0.stub)
2967                .cancel_operation(self.0.request, self.0.options)
2968                .await
2969                .map(crate::Response::into_body)
2970        }
2971
2972        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2973        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974            self.0.request.name = v.into();
2975            self
2976        }
2977    }
2978
2979    #[doc(hidden)]
2980    impl crate::RequestBuilder for CancelOperation {
2981        fn request_options(&mut self) -> &mut crate::RequestOptions {
2982            &mut self.0.options
2983        }
2984    }
2985}
2986
2987/// Request and client builders for [Conversations][crate::client::Conversations].
2988#[cfg(feature = "conversations")]
2989#[cfg_attr(docsrs, doc(cfg(feature = "conversations")))]
2990pub mod conversations {
2991    use crate::Result;
2992
2993    /// A builder for [Conversations][crate::client::Conversations].
2994    ///
2995    /// ```
2996    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2997    /// # use google_cloud_dialogflow_v2::*;
2998    /// # use builder::conversations::ClientBuilder;
2999    /// # use client::Conversations;
3000    /// let builder : ClientBuilder = Conversations::builder();
3001    /// let client = builder
3002    ///     .with_endpoint("https://dialogflow.googleapis.com")
3003    ///     .build().await?;
3004    /// # Ok(()) }
3005    /// ```
3006    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3007
3008    pub(crate) mod client {
3009        use super::super::super::client::Conversations;
3010        pub struct Factory;
3011        impl crate::ClientFactory for Factory {
3012            type Client = Conversations;
3013            type Credentials = gaxi::options::Credentials;
3014            async fn build(
3015                self,
3016                config: gaxi::options::ClientConfig,
3017            ) -> crate::ClientBuilderResult<Self::Client> {
3018                Self::Client::new(config).await
3019            }
3020        }
3021    }
3022
3023    /// Common implementation for [crate::client::Conversations] request builders.
3024    #[derive(Clone, Debug)]
3025    pub(crate) struct RequestBuilder<R: std::default::Default> {
3026        stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3027        request: R,
3028        options: crate::RequestOptions,
3029    }
3030
3031    impl<R> RequestBuilder<R>
3032    where
3033        R: std::default::Default,
3034    {
3035        pub(crate) fn new(
3036            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3037        ) -> Self {
3038            Self {
3039                stub,
3040                request: R::default(),
3041                options: crate::RequestOptions::default(),
3042            }
3043        }
3044    }
3045
3046    /// The request builder for [Conversations::create_conversation][crate::client::Conversations::create_conversation] calls.
3047    ///
3048    /// # Example
3049    /// ```
3050    /// # use google_cloud_dialogflow_v2::builder::conversations::CreateConversation;
3051    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3052    ///
3053    /// let builder = prepare_request_builder();
3054    /// let response = builder.send().await?;
3055    /// # Ok(()) }
3056    ///
3057    /// fn prepare_request_builder() -> CreateConversation {
3058    ///   # panic!();
3059    ///   // ... details omitted ...
3060    /// }
3061    /// ```
3062    #[derive(Clone, Debug)]
3063    pub struct CreateConversation(RequestBuilder<crate::model::CreateConversationRequest>);
3064
3065    impl CreateConversation {
3066        pub(crate) fn new(
3067            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3068        ) -> Self {
3069            Self(RequestBuilder::new(stub))
3070        }
3071
3072        /// Sets the full request, replacing any prior values.
3073        pub fn with_request<V: Into<crate::model::CreateConversationRequest>>(
3074            mut self,
3075            v: V,
3076        ) -> Self {
3077            self.0.request = v.into();
3078            self
3079        }
3080
3081        /// Sets all the options, replacing any prior values.
3082        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3083            self.0.options = v.into();
3084            self
3085        }
3086
3087        /// Sends the request.
3088        pub async fn send(self) -> Result<crate::model::Conversation> {
3089            (*self.0.stub)
3090                .create_conversation(self.0.request, self.0.options)
3091                .await
3092                .map(crate::Response::into_body)
3093        }
3094
3095        /// Sets the value of [parent][crate::model::CreateConversationRequest::parent].
3096        ///
3097        /// This is a **required** field for requests.
3098        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3099            self.0.request.parent = v.into();
3100            self
3101        }
3102
3103        /// Sets the value of [conversation][crate::model::CreateConversationRequest::conversation].
3104        ///
3105        /// This is a **required** field for requests.
3106        pub fn set_conversation<T>(mut self, v: T) -> Self
3107        where
3108            T: std::convert::Into<crate::model::Conversation>,
3109        {
3110            self.0.request.conversation = std::option::Option::Some(v.into());
3111            self
3112        }
3113
3114        /// Sets or clears the value of [conversation][crate::model::CreateConversationRequest::conversation].
3115        ///
3116        /// This is a **required** field for requests.
3117        pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3118        where
3119            T: std::convert::Into<crate::model::Conversation>,
3120        {
3121            self.0.request.conversation = v.map(|x| x.into());
3122            self
3123        }
3124
3125        /// Sets the value of [conversation_id][crate::model::CreateConversationRequest::conversation_id].
3126        pub fn set_conversation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3127            self.0.request.conversation_id = v.into();
3128            self
3129        }
3130    }
3131
3132    #[doc(hidden)]
3133    impl crate::RequestBuilder for CreateConversation {
3134        fn request_options(&mut self) -> &mut crate::RequestOptions {
3135            &mut self.0.options
3136        }
3137    }
3138
3139    /// The request builder for [Conversations::list_conversations][crate::client::Conversations::list_conversations] calls.
3140    ///
3141    /// # Example
3142    /// ```
3143    /// # use google_cloud_dialogflow_v2::builder::conversations::ListConversations;
3144    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3145    /// use google_cloud_gax::paginator::ItemPaginator;
3146    ///
3147    /// let builder = prepare_request_builder();
3148    /// let mut items = builder.by_item();
3149    /// while let Some(result) = items.next().await {
3150    ///   let item = result?;
3151    /// }
3152    /// # Ok(()) }
3153    ///
3154    /// fn prepare_request_builder() -> ListConversations {
3155    ///   # panic!();
3156    ///   // ... details omitted ...
3157    /// }
3158    /// ```
3159    #[derive(Clone, Debug)]
3160    pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);
3161
3162    impl ListConversations {
3163        pub(crate) fn new(
3164            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3165        ) -> Self {
3166            Self(RequestBuilder::new(stub))
3167        }
3168
3169        /// Sets the full request, replacing any prior values.
3170        pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
3171            mut self,
3172            v: V,
3173        ) -> Self {
3174            self.0.request = v.into();
3175            self
3176        }
3177
3178        /// Sets all the options, replacing any prior values.
3179        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3180            self.0.options = v.into();
3181            self
3182        }
3183
3184        /// Sends the request.
3185        pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
3186            (*self.0.stub)
3187                .list_conversations(self.0.request, self.0.options)
3188                .await
3189                .map(crate::Response::into_body)
3190        }
3191
3192        /// Streams each page in the collection.
3193        pub fn by_page(
3194            self,
3195        ) -> impl google_cloud_gax::paginator::Paginator<
3196            crate::model::ListConversationsResponse,
3197            crate::Error,
3198        > {
3199            use std::clone::Clone;
3200            let token = self.0.request.page_token.clone();
3201            let execute = move |token: String| {
3202                let mut builder = self.clone();
3203                builder.0.request = builder.0.request.set_page_token(token);
3204                builder.send()
3205            };
3206            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3207        }
3208
3209        /// Streams each item in the collection.
3210        pub fn by_item(
3211            self,
3212        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3213            crate::model::ListConversationsResponse,
3214            crate::Error,
3215        > {
3216            use google_cloud_gax::paginator::Paginator;
3217            self.by_page().items()
3218        }
3219
3220        /// Sets the value of [parent][crate::model::ListConversationsRequest::parent].
3221        ///
3222        /// This is a **required** field for requests.
3223        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3224            self.0.request.parent = v.into();
3225            self
3226        }
3227
3228        /// Sets the value of [page_size][crate::model::ListConversationsRequest::page_size].
3229        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3230            self.0.request.page_size = v.into();
3231            self
3232        }
3233
3234        /// Sets the value of [page_token][crate::model::ListConversationsRequest::page_token].
3235        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3236            self.0.request.page_token = v.into();
3237            self
3238        }
3239
3240        /// Sets the value of [filter][crate::model::ListConversationsRequest::filter].
3241        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3242            self.0.request.filter = v.into();
3243            self
3244        }
3245    }
3246
3247    #[doc(hidden)]
3248    impl crate::RequestBuilder for ListConversations {
3249        fn request_options(&mut self) -> &mut crate::RequestOptions {
3250            &mut self.0.options
3251        }
3252    }
3253
3254    /// The request builder for [Conversations::get_conversation][crate::client::Conversations::get_conversation] calls.
3255    ///
3256    /// # Example
3257    /// ```
3258    /// # use google_cloud_dialogflow_v2::builder::conversations::GetConversation;
3259    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3260    ///
3261    /// let builder = prepare_request_builder();
3262    /// let response = builder.send().await?;
3263    /// # Ok(()) }
3264    ///
3265    /// fn prepare_request_builder() -> GetConversation {
3266    ///   # panic!();
3267    ///   // ... details omitted ...
3268    /// }
3269    /// ```
3270    #[derive(Clone, Debug)]
3271    pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);
3272
3273    impl GetConversation {
3274        pub(crate) fn new(
3275            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3276        ) -> Self {
3277            Self(RequestBuilder::new(stub))
3278        }
3279
3280        /// Sets the full request, replacing any prior values.
3281        pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
3282            self.0.request = v.into();
3283            self
3284        }
3285
3286        /// Sets all the options, replacing any prior values.
3287        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3288            self.0.options = v.into();
3289            self
3290        }
3291
3292        /// Sends the request.
3293        pub async fn send(self) -> Result<crate::model::Conversation> {
3294            (*self.0.stub)
3295                .get_conversation(self.0.request, self.0.options)
3296                .await
3297                .map(crate::Response::into_body)
3298        }
3299
3300        /// Sets the value of [name][crate::model::GetConversationRequest::name].
3301        ///
3302        /// This is a **required** field for requests.
3303        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3304            self.0.request.name = v.into();
3305            self
3306        }
3307    }
3308
3309    #[doc(hidden)]
3310    impl crate::RequestBuilder for GetConversation {
3311        fn request_options(&mut self) -> &mut crate::RequestOptions {
3312            &mut self.0.options
3313        }
3314    }
3315
3316    /// The request builder for [Conversations::complete_conversation][crate::client::Conversations::complete_conversation] calls.
3317    ///
3318    /// # Example
3319    /// ```
3320    /// # use google_cloud_dialogflow_v2::builder::conversations::CompleteConversation;
3321    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3322    ///
3323    /// let builder = prepare_request_builder();
3324    /// let response = builder.send().await?;
3325    /// # Ok(()) }
3326    ///
3327    /// fn prepare_request_builder() -> CompleteConversation {
3328    ///   # panic!();
3329    ///   // ... details omitted ...
3330    /// }
3331    /// ```
3332    #[derive(Clone, Debug)]
3333    pub struct CompleteConversation(RequestBuilder<crate::model::CompleteConversationRequest>);
3334
3335    impl CompleteConversation {
3336        pub(crate) fn new(
3337            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3338        ) -> Self {
3339            Self(RequestBuilder::new(stub))
3340        }
3341
3342        /// Sets the full request, replacing any prior values.
3343        pub fn with_request<V: Into<crate::model::CompleteConversationRequest>>(
3344            mut self,
3345            v: V,
3346        ) -> Self {
3347            self.0.request = v.into();
3348            self
3349        }
3350
3351        /// Sets all the options, replacing any prior values.
3352        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3353            self.0.options = v.into();
3354            self
3355        }
3356
3357        /// Sends the request.
3358        pub async fn send(self) -> Result<crate::model::Conversation> {
3359            (*self.0.stub)
3360                .complete_conversation(self.0.request, self.0.options)
3361                .await
3362                .map(crate::Response::into_body)
3363        }
3364
3365        /// Sets the value of [name][crate::model::CompleteConversationRequest::name].
3366        ///
3367        /// This is a **required** field for requests.
3368        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3369            self.0.request.name = v.into();
3370            self
3371        }
3372    }
3373
3374    #[doc(hidden)]
3375    impl crate::RequestBuilder for CompleteConversation {
3376        fn request_options(&mut self) -> &mut crate::RequestOptions {
3377            &mut self.0.options
3378        }
3379    }
3380
3381    /// The request builder for [Conversations::ingest_context_references][crate::client::Conversations::ingest_context_references] calls.
3382    ///
3383    /// # Example
3384    /// ```
3385    /// # use google_cloud_dialogflow_v2::builder::conversations::IngestContextReferences;
3386    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3387    ///
3388    /// let builder = prepare_request_builder();
3389    /// let response = builder.send().await?;
3390    /// # Ok(()) }
3391    ///
3392    /// fn prepare_request_builder() -> IngestContextReferences {
3393    ///   # panic!();
3394    ///   // ... details omitted ...
3395    /// }
3396    /// ```
3397    #[derive(Clone, Debug)]
3398    pub struct IngestContextReferences(
3399        RequestBuilder<crate::model::IngestContextReferencesRequest>,
3400    );
3401
3402    impl IngestContextReferences {
3403        pub(crate) fn new(
3404            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3405        ) -> Self {
3406            Self(RequestBuilder::new(stub))
3407        }
3408
3409        /// Sets the full request, replacing any prior values.
3410        pub fn with_request<V: Into<crate::model::IngestContextReferencesRequest>>(
3411            mut self,
3412            v: V,
3413        ) -> Self {
3414            self.0.request = v.into();
3415            self
3416        }
3417
3418        /// Sets all the options, replacing any prior values.
3419        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3420            self.0.options = v.into();
3421            self
3422        }
3423
3424        /// Sends the request.
3425        pub async fn send(self) -> Result<crate::model::IngestContextReferencesResponse> {
3426            (*self.0.stub)
3427                .ingest_context_references(self.0.request, self.0.options)
3428                .await
3429                .map(crate::Response::into_body)
3430        }
3431
3432        /// Sets the value of [conversation][crate::model::IngestContextReferencesRequest::conversation].
3433        ///
3434        /// This is a **required** field for requests.
3435        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3436            self.0.request.conversation = v.into();
3437            self
3438        }
3439
3440        /// Sets the value of [context_references][crate::model::IngestContextReferencesRequest::context_references].
3441        ///
3442        /// This is a **required** field for requests.
3443        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3444        where
3445            T: std::iter::IntoIterator<Item = (K, V)>,
3446            K: std::convert::Into<std::string::String>,
3447            V: std::convert::Into<crate::model::conversation::ContextReference>,
3448        {
3449            self.0.request.context_references =
3450                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3451            self
3452        }
3453    }
3454
3455    #[doc(hidden)]
3456    impl crate::RequestBuilder for IngestContextReferences {
3457        fn request_options(&mut self) -> &mut crate::RequestOptions {
3458            &mut self.0.options
3459        }
3460    }
3461
3462    /// The request builder for [Conversations::list_messages][crate::client::Conversations::list_messages] calls.
3463    ///
3464    /// # Example
3465    /// ```
3466    /// # use google_cloud_dialogflow_v2::builder::conversations::ListMessages;
3467    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3468    /// use google_cloud_gax::paginator::ItemPaginator;
3469    ///
3470    /// let builder = prepare_request_builder();
3471    /// let mut items = builder.by_item();
3472    /// while let Some(result) = items.next().await {
3473    ///   let item = result?;
3474    /// }
3475    /// # Ok(()) }
3476    ///
3477    /// fn prepare_request_builder() -> ListMessages {
3478    ///   # panic!();
3479    ///   // ... details omitted ...
3480    /// }
3481    /// ```
3482    #[derive(Clone, Debug)]
3483    pub struct ListMessages(RequestBuilder<crate::model::ListMessagesRequest>);
3484
3485    impl ListMessages {
3486        pub(crate) fn new(
3487            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3488        ) -> Self {
3489            Self(RequestBuilder::new(stub))
3490        }
3491
3492        /// Sets the full request, replacing any prior values.
3493        pub fn with_request<V: Into<crate::model::ListMessagesRequest>>(mut self, v: V) -> Self {
3494            self.0.request = v.into();
3495            self
3496        }
3497
3498        /// Sets all the options, replacing any prior values.
3499        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3500            self.0.options = v.into();
3501            self
3502        }
3503
3504        /// Sends the request.
3505        pub async fn send(self) -> Result<crate::model::ListMessagesResponse> {
3506            (*self.0.stub)
3507                .list_messages(self.0.request, self.0.options)
3508                .await
3509                .map(crate::Response::into_body)
3510        }
3511
3512        /// Streams each page in the collection.
3513        pub fn by_page(
3514            self,
3515        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListMessagesResponse, crate::Error>
3516        {
3517            use std::clone::Clone;
3518            let token = self.0.request.page_token.clone();
3519            let execute = move |token: String| {
3520                let mut builder = self.clone();
3521                builder.0.request = builder.0.request.set_page_token(token);
3522                builder.send()
3523            };
3524            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3525        }
3526
3527        /// Streams each item in the collection.
3528        pub fn by_item(
3529            self,
3530        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3531            crate::model::ListMessagesResponse,
3532            crate::Error,
3533        > {
3534            use google_cloud_gax::paginator::Paginator;
3535            self.by_page().items()
3536        }
3537
3538        /// Sets the value of [parent][crate::model::ListMessagesRequest::parent].
3539        ///
3540        /// This is a **required** field for requests.
3541        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3542            self.0.request.parent = v.into();
3543            self
3544        }
3545
3546        /// Sets the value of [filter][crate::model::ListMessagesRequest::filter].
3547        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3548            self.0.request.filter = v.into();
3549            self
3550        }
3551
3552        /// Sets the value of [page_size][crate::model::ListMessagesRequest::page_size].
3553        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3554            self.0.request.page_size = v.into();
3555            self
3556        }
3557
3558        /// Sets the value of [page_token][crate::model::ListMessagesRequest::page_token].
3559        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3560            self.0.request.page_token = v.into();
3561            self
3562        }
3563    }
3564
3565    #[doc(hidden)]
3566    impl crate::RequestBuilder for ListMessages {
3567        fn request_options(&mut self) -> &mut crate::RequestOptions {
3568            &mut self.0.options
3569        }
3570    }
3571
3572    /// The request builder for [Conversations::suggest_conversation_summary][crate::client::Conversations::suggest_conversation_summary] calls.
3573    ///
3574    /// # Example
3575    /// ```
3576    /// # use google_cloud_dialogflow_v2::builder::conversations::SuggestConversationSummary;
3577    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3578    ///
3579    /// let builder = prepare_request_builder();
3580    /// let response = builder.send().await?;
3581    /// # Ok(()) }
3582    ///
3583    /// fn prepare_request_builder() -> SuggestConversationSummary {
3584    ///   # panic!();
3585    ///   // ... details omitted ...
3586    /// }
3587    /// ```
3588    #[derive(Clone, Debug)]
3589    pub struct SuggestConversationSummary(
3590        RequestBuilder<crate::model::SuggestConversationSummaryRequest>,
3591    );
3592
3593    impl SuggestConversationSummary {
3594        pub(crate) fn new(
3595            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3596        ) -> Self {
3597            Self(RequestBuilder::new(stub))
3598        }
3599
3600        /// Sets the full request, replacing any prior values.
3601        pub fn with_request<V: Into<crate::model::SuggestConversationSummaryRequest>>(
3602            mut self,
3603            v: V,
3604        ) -> Self {
3605            self.0.request = v.into();
3606            self
3607        }
3608
3609        /// Sets all the options, replacing any prior values.
3610        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3611            self.0.options = v.into();
3612            self
3613        }
3614
3615        /// Sends the request.
3616        pub async fn send(self) -> Result<crate::model::SuggestConversationSummaryResponse> {
3617            (*self.0.stub)
3618                .suggest_conversation_summary(self.0.request, self.0.options)
3619                .await
3620                .map(crate::Response::into_body)
3621        }
3622
3623        /// Sets the value of [conversation][crate::model::SuggestConversationSummaryRequest::conversation].
3624        ///
3625        /// This is a **required** field for requests.
3626        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3627            self.0.request.conversation = v.into();
3628            self
3629        }
3630
3631        /// Sets the value of [latest_message][crate::model::SuggestConversationSummaryRequest::latest_message].
3632        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3633            self.0.request.latest_message = v.into();
3634            self
3635        }
3636
3637        /// Sets the value of [context_size][crate::model::SuggestConversationSummaryRequest::context_size].
3638        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3639            self.0.request.context_size = v.into();
3640            self
3641        }
3642
3643        /// Sets the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3644        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
3645        where
3646            T: std::convert::Into<crate::model::AssistQueryParameters>,
3647        {
3648            self.0.request.assist_query_params = std::option::Option::Some(v.into());
3649            self
3650        }
3651
3652        /// Sets or clears the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3653        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
3654        where
3655            T: std::convert::Into<crate::model::AssistQueryParameters>,
3656        {
3657            self.0.request.assist_query_params = v.map(|x| x.into());
3658            self
3659        }
3660    }
3661
3662    #[doc(hidden)]
3663    impl crate::RequestBuilder for SuggestConversationSummary {
3664        fn request_options(&mut self) -> &mut crate::RequestOptions {
3665            &mut self.0.options
3666        }
3667    }
3668
3669    /// The request builder for [Conversations::generate_stateless_summary][crate::client::Conversations::generate_stateless_summary] calls.
3670    ///
3671    /// # Example
3672    /// ```
3673    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateStatelessSummary;
3674    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3675    ///
3676    /// let builder = prepare_request_builder();
3677    /// let response = builder.send().await?;
3678    /// # Ok(()) }
3679    ///
3680    /// fn prepare_request_builder() -> GenerateStatelessSummary {
3681    ///   # panic!();
3682    ///   // ... details omitted ...
3683    /// }
3684    /// ```
3685    #[derive(Clone, Debug)]
3686    pub struct GenerateStatelessSummary(
3687        RequestBuilder<crate::model::GenerateStatelessSummaryRequest>,
3688    );
3689
3690    impl GenerateStatelessSummary {
3691        pub(crate) fn new(
3692            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3693        ) -> Self {
3694            Self(RequestBuilder::new(stub))
3695        }
3696
3697        /// Sets the full request, replacing any prior values.
3698        pub fn with_request<V: Into<crate::model::GenerateStatelessSummaryRequest>>(
3699            mut self,
3700            v: V,
3701        ) -> Self {
3702            self.0.request = v.into();
3703            self
3704        }
3705
3706        /// Sets all the options, replacing any prior values.
3707        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3708            self.0.options = v.into();
3709            self
3710        }
3711
3712        /// Sends the request.
3713        pub async fn send(self) -> Result<crate::model::GenerateStatelessSummaryResponse> {
3714            (*self.0.stub)
3715                .generate_stateless_summary(self.0.request, self.0.options)
3716                .await
3717                .map(crate::Response::into_body)
3718        }
3719
3720        /// Sets the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3721        ///
3722        /// This is a **required** field for requests.
3723        pub fn set_stateless_conversation<T>(mut self, v: T) -> Self
3724        where
3725            T: std::convert::Into<
3726                    crate::model::generate_stateless_summary_request::MinimalConversation,
3727                >,
3728        {
3729            self.0.request.stateless_conversation = std::option::Option::Some(v.into());
3730            self
3731        }
3732
3733        /// Sets or clears the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3734        ///
3735        /// This is a **required** field for requests.
3736        pub fn set_or_clear_stateless_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3737        where
3738            T: std::convert::Into<
3739                    crate::model::generate_stateless_summary_request::MinimalConversation,
3740                >,
3741        {
3742            self.0.request.stateless_conversation = v.map(|x| x.into());
3743            self
3744        }
3745
3746        /// Sets the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3747        ///
3748        /// This is a **required** field for requests.
3749        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
3750        where
3751            T: std::convert::Into<crate::model::ConversationProfile>,
3752        {
3753            self.0.request.conversation_profile = std::option::Option::Some(v.into());
3754            self
3755        }
3756
3757        /// Sets or clears the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3758        ///
3759        /// This is a **required** field for requests.
3760        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
3761        where
3762            T: std::convert::Into<crate::model::ConversationProfile>,
3763        {
3764            self.0.request.conversation_profile = v.map(|x| x.into());
3765            self
3766        }
3767
3768        /// Sets the value of [latest_message][crate::model::GenerateStatelessSummaryRequest::latest_message].
3769        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3770            self.0.request.latest_message = v.into();
3771            self
3772        }
3773
3774        /// Sets the value of [max_context_size][crate::model::GenerateStatelessSummaryRequest::max_context_size].
3775        pub fn set_max_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3776            self.0.request.max_context_size = v.into();
3777            self
3778        }
3779    }
3780
3781    #[doc(hidden)]
3782    impl crate::RequestBuilder for GenerateStatelessSummary {
3783        fn request_options(&mut self) -> &mut crate::RequestOptions {
3784            &mut self.0.options
3785        }
3786    }
3787
3788    /// The request builder for [Conversations::generate_stateless_suggestion][crate::client::Conversations::generate_stateless_suggestion] calls.
3789    ///
3790    /// # Example
3791    /// ```
3792    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateStatelessSuggestion;
3793    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3794    ///
3795    /// let builder = prepare_request_builder();
3796    /// let response = builder.send().await?;
3797    /// # Ok(()) }
3798    ///
3799    /// fn prepare_request_builder() -> GenerateStatelessSuggestion {
3800    ///   # panic!();
3801    ///   // ... details omitted ...
3802    /// }
3803    /// ```
3804    #[derive(Clone, Debug)]
3805    pub struct GenerateStatelessSuggestion(
3806        RequestBuilder<crate::model::GenerateStatelessSuggestionRequest>,
3807    );
3808
3809    impl GenerateStatelessSuggestion {
3810        pub(crate) fn new(
3811            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3812        ) -> Self {
3813            Self(RequestBuilder::new(stub))
3814        }
3815
3816        /// Sets the full request, replacing any prior values.
3817        pub fn with_request<V: Into<crate::model::GenerateStatelessSuggestionRequest>>(
3818            mut self,
3819            v: V,
3820        ) -> Self {
3821            self.0.request = v.into();
3822            self
3823        }
3824
3825        /// Sets all the options, replacing any prior values.
3826        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3827            self.0.options = v.into();
3828            self
3829        }
3830
3831        /// Sends the request.
3832        pub async fn send(self) -> Result<crate::model::GenerateStatelessSuggestionResponse> {
3833            (*self.0.stub)
3834                .generate_stateless_suggestion(self.0.request, self.0.options)
3835                .await
3836                .map(crate::Response::into_body)
3837        }
3838
3839        /// Sets the value of [parent][crate::model::GenerateStatelessSuggestionRequest::parent].
3840        ///
3841        /// This is a **required** field for requests.
3842        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3843            self.0.request.parent = v.into();
3844            self
3845        }
3846
3847        /// Sets the value of [context_references][crate::model::GenerateStatelessSuggestionRequest::context_references].
3848        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3849        where
3850            T: std::iter::IntoIterator<Item = (K, V)>,
3851            K: std::convert::Into<std::string::String>,
3852            V: std::convert::Into<crate::model::conversation::ContextReference>,
3853        {
3854            self.0.request.context_references =
3855                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3856            self
3857        }
3858
3859        /// Sets the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3860        pub fn set_conversation_context<T>(mut self, v: T) -> Self
3861        where
3862            T: std::convert::Into<crate::model::ConversationContext>,
3863        {
3864            self.0.request.conversation_context = std::option::Option::Some(v.into());
3865            self
3866        }
3867
3868        /// Sets or clears the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3869        pub fn set_or_clear_conversation_context<T>(mut self, v: std::option::Option<T>) -> Self
3870        where
3871            T: std::convert::Into<crate::model::ConversationContext>,
3872        {
3873            self.0.request.conversation_context = v.map(|x| x.into());
3874            self
3875        }
3876
3877        /// Sets the value of [trigger_events][crate::model::GenerateStatelessSuggestionRequest::trigger_events].
3878        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
3879        where
3880            T: std::iter::IntoIterator<Item = V>,
3881            V: std::convert::Into<crate::model::TriggerEvent>,
3882        {
3883            use std::iter::Iterator;
3884            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
3885            self
3886        }
3887
3888        /// Sets the value of [security_settings][crate::model::GenerateStatelessSuggestionRequest::security_settings].
3889        pub fn set_security_settings<T: Into<std::string::String>>(mut self, v: T) -> Self {
3890            self.0.request.security_settings = v.into();
3891            self
3892        }
3893
3894        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource].
3895        ///
3896        /// Note that all the setters affecting `generator_resource` are
3897        /// mutually exclusive.
3898        pub fn set_generator_resource<
3899            T: Into<Option<crate::model::generate_stateless_suggestion_request::GeneratorResource>>,
3900        >(
3901            mut self,
3902            v: T,
3903        ) -> Self {
3904            self.0.request.generator_resource = v.into();
3905            self
3906        }
3907
3908        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3909        /// to hold a `Generator`.
3910        ///
3911        /// Note that all the setters affecting `generator_resource` are
3912        /// mutually exclusive.
3913        pub fn set_generator<T: std::convert::Into<std::boxed::Box<crate::model::Generator>>>(
3914            mut self,
3915            v: T,
3916        ) -> Self {
3917            self.0.request = self.0.request.set_generator(v);
3918            self
3919        }
3920
3921        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3922        /// to hold a `GeneratorName`.
3923        ///
3924        /// Note that all the setters affecting `generator_resource` are
3925        /// mutually exclusive.
3926        pub fn set_generator_name<T: std::convert::Into<std::string::String>>(
3927            mut self,
3928            v: T,
3929        ) -> Self {
3930            self.0.request = self.0.request.set_generator_name(v);
3931            self
3932        }
3933    }
3934
3935    #[doc(hidden)]
3936    impl crate::RequestBuilder for GenerateStatelessSuggestion {
3937        fn request_options(&mut self) -> &mut crate::RequestOptions {
3938            &mut self.0.options
3939        }
3940    }
3941
3942    /// The request builder for [Conversations::search_knowledge][crate::client::Conversations::search_knowledge] calls.
3943    ///
3944    /// # Example
3945    /// ```
3946    /// # use google_cloud_dialogflow_v2::builder::conversations::SearchKnowledge;
3947    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3948    ///
3949    /// let builder = prepare_request_builder();
3950    /// let response = builder.send().await?;
3951    /// # Ok(()) }
3952    ///
3953    /// fn prepare_request_builder() -> SearchKnowledge {
3954    ///   # panic!();
3955    ///   // ... details omitted ...
3956    /// }
3957    /// ```
3958    #[derive(Clone, Debug)]
3959    pub struct SearchKnowledge(RequestBuilder<crate::model::SearchKnowledgeRequest>);
3960
3961    impl SearchKnowledge {
3962        pub(crate) fn new(
3963            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3964        ) -> Self {
3965            Self(RequestBuilder::new(stub))
3966        }
3967
3968        /// Sets the full request, replacing any prior values.
3969        pub fn with_request<V: Into<crate::model::SearchKnowledgeRequest>>(mut self, v: V) -> Self {
3970            self.0.request = v.into();
3971            self
3972        }
3973
3974        /// Sets all the options, replacing any prior values.
3975        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3976            self.0.options = v.into();
3977            self
3978        }
3979
3980        /// Sends the request.
3981        pub async fn send(self) -> Result<crate::model::SearchKnowledgeResponse> {
3982            (*self.0.stub)
3983                .search_knowledge(self.0.request, self.0.options)
3984                .await
3985                .map(crate::Response::into_body)
3986        }
3987
3988        /// Sets the value of [parent][crate::model::SearchKnowledgeRequest::parent].
3989        ///
3990        /// This is a **required** field for requests.
3991        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3992            self.0.request.parent = v.into();
3993            self
3994        }
3995
3996        /// Sets the value of [query][crate::model::SearchKnowledgeRequest::query].
3997        ///
3998        /// This is a **required** field for requests.
3999        pub fn set_query<T>(mut self, v: T) -> Self
4000        where
4001            T: std::convert::Into<crate::model::TextInput>,
4002        {
4003            self.0.request.query = std::option::Option::Some(v.into());
4004            self
4005        }
4006
4007        /// Sets or clears the value of [query][crate::model::SearchKnowledgeRequest::query].
4008        ///
4009        /// This is a **required** field for requests.
4010        pub fn set_or_clear_query<T>(mut self, v: std::option::Option<T>) -> Self
4011        where
4012            T: std::convert::Into<crate::model::TextInput>,
4013        {
4014            self.0.request.query = v.map(|x| x.into());
4015            self
4016        }
4017
4018        /// Sets the value of [conversation_profile][crate::model::SearchKnowledgeRequest::conversation_profile].
4019        ///
4020        /// This is a **required** field for requests.
4021        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
4022            self.0.request.conversation_profile = v.into();
4023            self
4024        }
4025
4026        /// Sets the value of [session_id][crate::model::SearchKnowledgeRequest::session_id].
4027        ///
4028        /// This is a **required** field for requests.
4029        pub fn set_session_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4030            self.0.request.session_id = v.into();
4031            self
4032        }
4033
4034        /// Sets the value of [conversation][crate::model::SearchKnowledgeRequest::conversation].
4035        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4036            self.0.request.conversation = v.into();
4037            self
4038        }
4039
4040        /// Sets the value of [latest_message][crate::model::SearchKnowledgeRequest::latest_message].
4041        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4042            self.0.request.latest_message = v.into();
4043            self
4044        }
4045
4046        /// Sets the value of [query_source][crate::model::SearchKnowledgeRequest::query_source].
4047        pub fn set_query_source<T: Into<crate::model::search_knowledge_request::QuerySource>>(
4048            mut self,
4049            v: T,
4050        ) -> Self {
4051            self.0.request.query_source = v.into();
4052            self
4053        }
4054
4055        /// Sets the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4056        pub fn set_end_user_metadata<T>(mut self, v: T) -> Self
4057        where
4058            T: std::convert::Into<wkt::Struct>,
4059        {
4060            self.0.request.end_user_metadata = std::option::Option::Some(v.into());
4061            self
4062        }
4063
4064        /// Sets or clears the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4065        pub fn set_or_clear_end_user_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4066        where
4067            T: std::convert::Into<wkt::Struct>,
4068        {
4069            self.0.request.end_user_metadata = v.map(|x| x.into());
4070            self
4071        }
4072
4073        /// Sets the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4074        pub fn set_search_config<T>(mut self, v: T) -> Self
4075        where
4076            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4077        {
4078            self.0.request.search_config = std::option::Option::Some(v.into());
4079            self
4080        }
4081
4082        /// Sets or clears the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4083        pub fn set_or_clear_search_config<T>(mut self, v: std::option::Option<T>) -> Self
4084        where
4085            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4086        {
4087            self.0.request.search_config = v.map(|x| x.into());
4088            self
4089        }
4090
4091        /// Sets the value of [exact_search][crate::model::SearchKnowledgeRequest::exact_search].
4092        pub fn set_exact_search<T: Into<bool>>(mut self, v: T) -> Self {
4093            self.0.request.exact_search = v.into();
4094            self
4095        }
4096    }
4097
4098    #[doc(hidden)]
4099    impl crate::RequestBuilder for SearchKnowledge {
4100        fn request_options(&mut self) -> &mut crate::RequestOptions {
4101            &mut self.0.options
4102        }
4103    }
4104
4105    /// The request builder for [Conversations::generate_suggestions][crate::client::Conversations::generate_suggestions] calls.
4106    ///
4107    /// # Example
4108    /// ```
4109    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateSuggestions;
4110    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4111    ///
4112    /// let builder = prepare_request_builder();
4113    /// let response = builder.send().await?;
4114    /// # Ok(()) }
4115    ///
4116    /// fn prepare_request_builder() -> GenerateSuggestions {
4117    ///   # panic!();
4118    ///   // ... details omitted ...
4119    /// }
4120    /// ```
4121    #[derive(Clone, Debug)]
4122    pub struct GenerateSuggestions(RequestBuilder<crate::model::GenerateSuggestionsRequest>);
4123
4124    impl GenerateSuggestions {
4125        pub(crate) fn new(
4126            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4127        ) -> Self {
4128            Self(RequestBuilder::new(stub))
4129        }
4130
4131        /// Sets the full request, replacing any prior values.
4132        pub fn with_request<V: Into<crate::model::GenerateSuggestionsRequest>>(
4133            mut self,
4134            v: V,
4135        ) -> Self {
4136            self.0.request = v.into();
4137            self
4138        }
4139
4140        /// Sets all the options, replacing any prior values.
4141        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4142            self.0.options = v.into();
4143            self
4144        }
4145
4146        /// Sends the request.
4147        pub async fn send(self) -> Result<crate::model::GenerateSuggestionsResponse> {
4148            (*self.0.stub)
4149                .generate_suggestions(self.0.request, self.0.options)
4150                .await
4151                .map(crate::Response::into_body)
4152        }
4153
4154        /// Sets the value of [conversation][crate::model::GenerateSuggestionsRequest::conversation].
4155        ///
4156        /// This is a **required** field for requests.
4157        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4158            self.0.request.conversation = v.into();
4159            self
4160        }
4161
4162        /// Sets the value of [latest_message][crate::model::GenerateSuggestionsRequest::latest_message].
4163        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4164            self.0.request.latest_message = v.into();
4165            self
4166        }
4167
4168        /// Sets the value of [trigger_events][crate::model::GenerateSuggestionsRequest::trigger_events].
4169        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
4170        where
4171            T: std::iter::IntoIterator<Item = V>,
4172            V: std::convert::Into<crate::model::TriggerEvent>,
4173        {
4174            use std::iter::Iterator;
4175            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
4176            self
4177        }
4178    }
4179
4180    #[doc(hidden)]
4181    impl crate::RequestBuilder for GenerateSuggestions {
4182        fn request_options(&mut self) -> &mut crate::RequestOptions {
4183            &mut self.0.options
4184        }
4185    }
4186
4187    /// The request builder for [Conversations::list_locations][crate::client::Conversations::list_locations] calls.
4188    ///
4189    /// # Example
4190    /// ```
4191    /// # use google_cloud_dialogflow_v2::builder::conversations::ListLocations;
4192    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4193    /// use google_cloud_gax::paginator::ItemPaginator;
4194    ///
4195    /// let builder = prepare_request_builder();
4196    /// let mut items = builder.by_item();
4197    /// while let Some(result) = items.next().await {
4198    ///   let item = result?;
4199    /// }
4200    /// # Ok(()) }
4201    ///
4202    /// fn prepare_request_builder() -> ListLocations {
4203    ///   # panic!();
4204    ///   // ... details omitted ...
4205    /// }
4206    /// ```
4207    #[derive(Clone, Debug)]
4208    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4209
4210    impl ListLocations {
4211        pub(crate) fn new(
4212            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4213        ) -> Self {
4214            Self(RequestBuilder::new(stub))
4215        }
4216
4217        /// Sets the full request, replacing any prior values.
4218        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4219            mut self,
4220            v: V,
4221        ) -> Self {
4222            self.0.request = v.into();
4223            self
4224        }
4225
4226        /// Sets all the options, replacing any prior values.
4227        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4228            self.0.options = v.into();
4229            self
4230        }
4231
4232        /// Sends the request.
4233        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4234            (*self.0.stub)
4235                .list_locations(self.0.request, self.0.options)
4236                .await
4237                .map(crate::Response::into_body)
4238        }
4239
4240        /// Streams each page in the collection.
4241        pub fn by_page(
4242            self,
4243        ) -> impl google_cloud_gax::paginator::Paginator<
4244            google_cloud_location::model::ListLocationsResponse,
4245            crate::Error,
4246        > {
4247            use std::clone::Clone;
4248            let token = self.0.request.page_token.clone();
4249            let execute = move |token: String| {
4250                let mut builder = self.clone();
4251                builder.0.request = builder.0.request.set_page_token(token);
4252                builder.send()
4253            };
4254            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4255        }
4256
4257        /// Streams each item in the collection.
4258        pub fn by_item(
4259            self,
4260        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4261            google_cloud_location::model::ListLocationsResponse,
4262            crate::Error,
4263        > {
4264            use google_cloud_gax::paginator::Paginator;
4265            self.by_page().items()
4266        }
4267
4268        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4269        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4270            self.0.request.name = v.into();
4271            self
4272        }
4273
4274        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4275        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4276            self.0.request.filter = v.into();
4277            self
4278        }
4279
4280        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4281        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4282            self.0.request.page_size = v.into();
4283            self
4284        }
4285
4286        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4287        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4288            self.0.request.page_token = v.into();
4289            self
4290        }
4291    }
4292
4293    #[doc(hidden)]
4294    impl crate::RequestBuilder for ListLocations {
4295        fn request_options(&mut self) -> &mut crate::RequestOptions {
4296            &mut self.0.options
4297        }
4298    }
4299
4300    /// The request builder for [Conversations::get_location][crate::client::Conversations::get_location] calls.
4301    ///
4302    /// # Example
4303    /// ```
4304    /// # use google_cloud_dialogflow_v2::builder::conversations::GetLocation;
4305    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4306    ///
4307    /// let builder = prepare_request_builder();
4308    /// let response = builder.send().await?;
4309    /// # Ok(()) }
4310    ///
4311    /// fn prepare_request_builder() -> GetLocation {
4312    ///   # panic!();
4313    ///   // ... details omitted ...
4314    /// }
4315    /// ```
4316    #[derive(Clone, Debug)]
4317    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4318
4319    impl GetLocation {
4320        pub(crate) fn new(
4321            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4322        ) -> Self {
4323            Self(RequestBuilder::new(stub))
4324        }
4325
4326        /// Sets the full request, replacing any prior values.
4327        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4328            mut self,
4329            v: V,
4330        ) -> Self {
4331            self.0.request = v.into();
4332            self
4333        }
4334
4335        /// Sets all the options, replacing any prior values.
4336        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4337            self.0.options = v.into();
4338            self
4339        }
4340
4341        /// Sends the request.
4342        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4343            (*self.0.stub)
4344                .get_location(self.0.request, self.0.options)
4345                .await
4346                .map(crate::Response::into_body)
4347        }
4348
4349        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4350        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4351            self.0.request.name = v.into();
4352            self
4353        }
4354    }
4355
4356    #[doc(hidden)]
4357    impl crate::RequestBuilder for GetLocation {
4358        fn request_options(&mut self) -> &mut crate::RequestOptions {
4359            &mut self.0.options
4360        }
4361    }
4362
4363    /// The request builder for [Conversations::list_operations][crate::client::Conversations::list_operations] calls.
4364    ///
4365    /// # Example
4366    /// ```
4367    /// # use google_cloud_dialogflow_v2::builder::conversations::ListOperations;
4368    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4369    /// use google_cloud_gax::paginator::ItemPaginator;
4370    ///
4371    /// let builder = prepare_request_builder();
4372    /// let mut items = builder.by_item();
4373    /// while let Some(result) = items.next().await {
4374    ///   let item = result?;
4375    /// }
4376    /// # Ok(()) }
4377    ///
4378    /// fn prepare_request_builder() -> ListOperations {
4379    ///   # panic!();
4380    ///   // ... details omitted ...
4381    /// }
4382    /// ```
4383    #[derive(Clone, Debug)]
4384    pub struct ListOperations(
4385        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4386    );
4387
4388    impl ListOperations {
4389        pub(crate) fn new(
4390            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4391        ) -> Self {
4392            Self(RequestBuilder::new(stub))
4393        }
4394
4395        /// Sets the full request, replacing any prior values.
4396        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4397            mut self,
4398            v: V,
4399        ) -> Self {
4400            self.0.request = v.into();
4401            self
4402        }
4403
4404        /// Sets all the options, replacing any prior values.
4405        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4406            self.0.options = v.into();
4407            self
4408        }
4409
4410        /// Sends the request.
4411        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4412            (*self.0.stub)
4413                .list_operations(self.0.request, self.0.options)
4414                .await
4415                .map(crate::Response::into_body)
4416        }
4417
4418        /// Streams each page in the collection.
4419        pub fn by_page(
4420            self,
4421        ) -> impl google_cloud_gax::paginator::Paginator<
4422            google_cloud_longrunning::model::ListOperationsResponse,
4423            crate::Error,
4424        > {
4425            use std::clone::Clone;
4426            let token = self.0.request.page_token.clone();
4427            let execute = move |token: String| {
4428                let mut builder = self.clone();
4429                builder.0.request = builder.0.request.set_page_token(token);
4430                builder.send()
4431            };
4432            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4433        }
4434
4435        /// Streams each item in the collection.
4436        pub fn by_item(
4437            self,
4438        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4439            google_cloud_longrunning::model::ListOperationsResponse,
4440            crate::Error,
4441        > {
4442            use google_cloud_gax::paginator::Paginator;
4443            self.by_page().items()
4444        }
4445
4446        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4447        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4448            self.0.request.name = v.into();
4449            self
4450        }
4451
4452        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4453        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4454            self.0.request.filter = v.into();
4455            self
4456        }
4457
4458        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4459        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4460            self.0.request.page_size = v.into();
4461            self
4462        }
4463
4464        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4465        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4466            self.0.request.page_token = v.into();
4467            self
4468        }
4469
4470        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4471        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4472            self.0.request.return_partial_success = v.into();
4473            self
4474        }
4475    }
4476
4477    #[doc(hidden)]
4478    impl crate::RequestBuilder for ListOperations {
4479        fn request_options(&mut self) -> &mut crate::RequestOptions {
4480            &mut self.0.options
4481        }
4482    }
4483
4484    /// The request builder for [Conversations::get_operation][crate::client::Conversations::get_operation] calls.
4485    ///
4486    /// # Example
4487    /// ```
4488    /// # use google_cloud_dialogflow_v2::builder::conversations::GetOperation;
4489    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4490    ///
4491    /// let builder = prepare_request_builder();
4492    /// let response = builder.send().await?;
4493    /// # Ok(()) }
4494    ///
4495    /// fn prepare_request_builder() -> GetOperation {
4496    ///   # panic!();
4497    ///   // ... details omitted ...
4498    /// }
4499    /// ```
4500    #[derive(Clone, Debug)]
4501    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4502
4503    impl GetOperation {
4504        pub(crate) fn new(
4505            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4506        ) -> Self {
4507            Self(RequestBuilder::new(stub))
4508        }
4509
4510        /// Sets the full request, replacing any prior values.
4511        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4512            mut self,
4513            v: V,
4514        ) -> Self {
4515            self.0.request = v.into();
4516            self
4517        }
4518
4519        /// Sets all the options, replacing any prior values.
4520        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4521            self.0.options = v.into();
4522            self
4523        }
4524
4525        /// Sends the request.
4526        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4527            (*self.0.stub)
4528                .get_operation(self.0.request, self.0.options)
4529                .await
4530                .map(crate::Response::into_body)
4531        }
4532
4533        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4534        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4535            self.0.request.name = v.into();
4536            self
4537        }
4538    }
4539
4540    #[doc(hidden)]
4541    impl crate::RequestBuilder for GetOperation {
4542        fn request_options(&mut self) -> &mut crate::RequestOptions {
4543            &mut self.0.options
4544        }
4545    }
4546
4547    /// The request builder for [Conversations::cancel_operation][crate::client::Conversations::cancel_operation] calls.
4548    ///
4549    /// # Example
4550    /// ```
4551    /// # use google_cloud_dialogflow_v2::builder::conversations::CancelOperation;
4552    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4553    ///
4554    /// let builder = prepare_request_builder();
4555    /// let response = builder.send().await?;
4556    /// # Ok(()) }
4557    ///
4558    /// fn prepare_request_builder() -> CancelOperation {
4559    ///   # panic!();
4560    ///   // ... details omitted ...
4561    /// }
4562    /// ```
4563    #[derive(Clone, Debug)]
4564    pub struct CancelOperation(
4565        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4566    );
4567
4568    impl CancelOperation {
4569        pub(crate) fn new(
4570            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4571        ) -> Self {
4572            Self(RequestBuilder::new(stub))
4573        }
4574
4575        /// Sets the full request, replacing any prior values.
4576        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4577            mut self,
4578            v: V,
4579        ) -> Self {
4580            self.0.request = v.into();
4581            self
4582        }
4583
4584        /// Sets all the options, replacing any prior values.
4585        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4586            self.0.options = v.into();
4587            self
4588        }
4589
4590        /// Sends the request.
4591        pub async fn send(self) -> Result<()> {
4592            (*self.0.stub)
4593                .cancel_operation(self.0.request, self.0.options)
4594                .await
4595                .map(crate::Response::into_body)
4596        }
4597
4598        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4599        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4600            self.0.request.name = v.into();
4601            self
4602        }
4603    }
4604
4605    #[doc(hidden)]
4606    impl crate::RequestBuilder for CancelOperation {
4607        fn request_options(&mut self) -> &mut crate::RequestOptions {
4608            &mut self.0.options
4609        }
4610    }
4611}
4612
4613/// Request and client builders for [ConversationDatasets][crate::client::ConversationDatasets].
4614#[cfg(feature = "conversation-datasets")]
4615#[cfg_attr(docsrs, doc(cfg(feature = "conversation-datasets")))]
4616pub mod conversation_datasets {
4617    use crate::Result;
4618
4619    /// A builder for [ConversationDatasets][crate::client::ConversationDatasets].
4620    ///
4621    /// ```
4622    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4623    /// # use google_cloud_dialogflow_v2::*;
4624    /// # use builder::conversation_datasets::ClientBuilder;
4625    /// # use client::ConversationDatasets;
4626    /// let builder : ClientBuilder = ConversationDatasets::builder();
4627    /// let client = builder
4628    ///     .with_endpoint("https://dialogflow.googleapis.com")
4629    ///     .build().await?;
4630    /// # Ok(()) }
4631    /// ```
4632    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4633
4634    pub(crate) mod client {
4635        use super::super::super::client::ConversationDatasets;
4636        pub struct Factory;
4637        impl crate::ClientFactory for Factory {
4638            type Client = ConversationDatasets;
4639            type Credentials = gaxi::options::Credentials;
4640            async fn build(
4641                self,
4642                config: gaxi::options::ClientConfig,
4643            ) -> crate::ClientBuilderResult<Self::Client> {
4644                Self::Client::new(config).await
4645            }
4646        }
4647    }
4648
4649    /// Common implementation for [crate::client::ConversationDatasets] request builders.
4650    #[derive(Clone, Debug)]
4651    pub(crate) struct RequestBuilder<R: std::default::Default> {
4652        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4653        request: R,
4654        options: crate::RequestOptions,
4655    }
4656
4657    impl<R> RequestBuilder<R>
4658    where
4659        R: std::default::Default,
4660    {
4661        pub(crate) fn new(
4662            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4663        ) -> Self {
4664            Self {
4665                stub,
4666                request: R::default(),
4667                options: crate::RequestOptions::default(),
4668            }
4669        }
4670    }
4671
4672    /// The request builder for [ConversationDatasets::create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset] calls.
4673    ///
4674    /// # Example
4675    /// ```
4676    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::CreateConversationDataset;
4677    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4678    /// use google_cloud_lro::Poller;
4679    ///
4680    /// let builder = prepare_request_builder();
4681    /// let response = builder.poller().until_done().await?;
4682    /// # Ok(()) }
4683    ///
4684    /// fn prepare_request_builder() -> CreateConversationDataset {
4685    ///   # panic!();
4686    ///   // ... details omitted ...
4687    /// }
4688    /// ```
4689    #[derive(Clone, Debug)]
4690    pub struct CreateConversationDataset(
4691        RequestBuilder<crate::model::CreateConversationDatasetRequest>,
4692    );
4693
4694    impl CreateConversationDataset {
4695        pub(crate) fn new(
4696            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4697        ) -> Self {
4698            Self(RequestBuilder::new(stub))
4699        }
4700
4701        /// Sets the full request, replacing any prior values.
4702        pub fn with_request<V: Into<crate::model::CreateConversationDatasetRequest>>(
4703            mut self,
4704            v: V,
4705        ) -> Self {
4706            self.0.request = v.into();
4707            self
4708        }
4709
4710        /// Sets all the options, replacing any prior values.
4711        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4712            self.0.options = v.into();
4713            self
4714        }
4715
4716        /// Sends the request.
4717        ///
4718        /// # Long running operations
4719        ///
4720        /// This starts, but does not poll, a longrunning operation. More information
4721        /// on [create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset].
4722        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4723            (*self.0.stub)
4724                .create_conversation_dataset(self.0.request, self.0.options)
4725                .await
4726                .map(crate::Response::into_body)
4727        }
4728
4729        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_dataset`.
4730        pub fn poller(
4731            self,
4732        ) -> impl google_cloud_lro::Poller<
4733            crate::model::ConversationDataset,
4734            crate::model::CreateConversationDatasetOperationMetadata,
4735        > {
4736            type Operation = google_cloud_lro::internal::Operation<
4737                crate::model::ConversationDataset,
4738                crate::model::CreateConversationDatasetOperationMetadata,
4739            >;
4740            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4741            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4742
4743            let stub = self.0.stub.clone();
4744            let mut options = self.0.options.clone();
4745            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4746            let query = move |name| {
4747                let stub = stub.clone();
4748                let options = options.clone();
4749                async {
4750                    let op = GetOperation::new(stub)
4751                        .set_name(name)
4752                        .with_options(options)
4753                        .send()
4754                        .await?;
4755                    Ok(Operation::new(op))
4756                }
4757            };
4758
4759            let start = move || async {
4760                let op = self.send().await?;
4761                Ok(Operation::new(op))
4762            };
4763
4764            google_cloud_lro::internal::new_poller(
4765                polling_error_policy,
4766                polling_backoff_policy,
4767                start,
4768                query,
4769            )
4770        }
4771
4772        /// Sets the value of [parent][crate::model::CreateConversationDatasetRequest::parent].
4773        ///
4774        /// This is a **required** field for requests.
4775        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4776            self.0.request.parent = v.into();
4777            self
4778        }
4779
4780        /// Sets the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4781        ///
4782        /// This is a **required** field for requests.
4783        pub fn set_conversation_dataset<T>(mut self, v: T) -> Self
4784        where
4785            T: std::convert::Into<crate::model::ConversationDataset>,
4786        {
4787            self.0.request.conversation_dataset = std::option::Option::Some(v.into());
4788            self
4789        }
4790
4791        /// Sets or clears the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4792        ///
4793        /// This is a **required** field for requests.
4794        pub fn set_or_clear_conversation_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4795        where
4796            T: std::convert::Into<crate::model::ConversationDataset>,
4797        {
4798            self.0.request.conversation_dataset = v.map(|x| x.into());
4799            self
4800        }
4801    }
4802
4803    #[doc(hidden)]
4804    impl crate::RequestBuilder for CreateConversationDataset {
4805        fn request_options(&mut self) -> &mut crate::RequestOptions {
4806            &mut self.0.options
4807        }
4808    }
4809
4810    /// The request builder for [ConversationDatasets::get_conversation_dataset][crate::client::ConversationDatasets::get_conversation_dataset] calls.
4811    ///
4812    /// # Example
4813    /// ```
4814    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetConversationDataset;
4815    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4816    ///
4817    /// let builder = prepare_request_builder();
4818    /// let response = builder.send().await?;
4819    /// # Ok(()) }
4820    ///
4821    /// fn prepare_request_builder() -> GetConversationDataset {
4822    ///   # panic!();
4823    ///   // ... details omitted ...
4824    /// }
4825    /// ```
4826    #[derive(Clone, Debug)]
4827    pub struct GetConversationDataset(RequestBuilder<crate::model::GetConversationDatasetRequest>);
4828
4829    impl GetConversationDataset {
4830        pub(crate) fn new(
4831            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4832        ) -> Self {
4833            Self(RequestBuilder::new(stub))
4834        }
4835
4836        /// Sets the full request, replacing any prior values.
4837        pub fn with_request<V: Into<crate::model::GetConversationDatasetRequest>>(
4838            mut self,
4839            v: V,
4840        ) -> Self {
4841            self.0.request = v.into();
4842            self
4843        }
4844
4845        /// Sets all the options, replacing any prior values.
4846        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4847            self.0.options = v.into();
4848            self
4849        }
4850
4851        /// Sends the request.
4852        pub async fn send(self) -> Result<crate::model::ConversationDataset> {
4853            (*self.0.stub)
4854                .get_conversation_dataset(self.0.request, self.0.options)
4855                .await
4856                .map(crate::Response::into_body)
4857        }
4858
4859        /// Sets the value of [name][crate::model::GetConversationDatasetRequest::name].
4860        ///
4861        /// This is a **required** field for requests.
4862        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4863            self.0.request.name = v.into();
4864            self
4865        }
4866    }
4867
4868    #[doc(hidden)]
4869    impl crate::RequestBuilder for GetConversationDataset {
4870        fn request_options(&mut self) -> &mut crate::RequestOptions {
4871            &mut self.0.options
4872        }
4873    }
4874
4875    /// The request builder for [ConversationDatasets::list_conversation_datasets][crate::client::ConversationDatasets::list_conversation_datasets] calls.
4876    ///
4877    /// # Example
4878    /// ```
4879    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListConversationDatasets;
4880    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4881    /// use google_cloud_gax::paginator::ItemPaginator;
4882    ///
4883    /// let builder = prepare_request_builder();
4884    /// let mut items = builder.by_item();
4885    /// while let Some(result) = items.next().await {
4886    ///   let item = result?;
4887    /// }
4888    /// # Ok(()) }
4889    ///
4890    /// fn prepare_request_builder() -> ListConversationDatasets {
4891    ///   # panic!();
4892    ///   // ... details omitted ...
4893    /// }
4894    /// ```
4895    #[derive(Clone, Debug)]
4896    pub struct ListConversationDatasets(
4897        RequestBuilder<crate::model::ListConversationDatasetsRequest>,
4898    );
4899
4900    impl ListConversationDatasets {
4901        pub(crate) fn new(
4902            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4903        ) -> Self {
4904            Self(RequestBuilder::new(stub))
4905        }
4906
4907        /// Sets the full request, replacing any prior values.
4908        pub fn with_request<V: Into<crate::model::ListConversationDatasetsRequest>>(
4909            mut self,
4910            v: V,
4911        ) -> Self {
4912            self.0.request = v.into();
4913            self
4914        }
4915
4916        /// Sets all the options, replacing any prior values.
4917        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4918            self.0.options = v.into();
4919            self
4920        }
4921
4922        /// Sends the request.
4923        pub async fn send(self) -> Result<crate::model::ListConversationDatasetsResponse> {
4924            (*self.0.stub)
4925                .list_conversation_datasets(self.0.request, self.0.options)
4926                .await
4927                .map(crate::Response::into_body)
4928        }
4929
4930        /// Streams each page in the collection.
4931        pub fn by_page(
4932            self,
4933        ) -> impl google_cloud_gax::paginator::Paginator<
4934            crate::model::ListConversationDatasetsResponse,
4935            crate::Error,
4936        > {
4937            use std::clone::Clone;
4938            let token = self.0.request.page_token.clone();
4939            let execute = move |token: String| {
4940                let mut builder = self.clone();
4941                builder.0.request = builder.0.request.set_page_token(token);
4942                builder.send()
4943            };
4944            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4945        }
4946
4947        /// Streams each item in the collection.
4948        pub fn by_item(
4949            self,
4950        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4951            crate::model::ListConversationDatasetsResponse,
4952            crate::Error,
4953        > {
4954            use google_cloud_gax::paginator::Paginator;
4955            self.by_page().items()
4956        }
4957
4958        /// Sets the value of [parent][crate::model::ListConversationDatasetsRequest::parent].
4959        ///
4960        /// This is a **required** field for requests.
4961        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4962            self.0.request.parent = v.into();
4963            self
4964        }
4965
4966        /// Sets the value of [page_size][crate::model::ListConversationDatasetsRequest::page_size].
4967        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4968            self.0.request.page_size = v.into();
4969            self
4970        }
4971
4972        /// Sets the value of [page_token][crate::model::ListConversationDatasetsRequest::page_token].
4973        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4974            self.0.request.page_token = v.into();
4975            self
4976        }
4977    }
4978
4979    #[doc(hidden)]
4980    impl crate::RequestBuilder for ListConversationDatasets {
4981        fn request_options(&mut self) -> &mut crate::RequestOptions {
4982            &mut self.0.options
4983        }
4984    }
4985
4986    /// The request builder for [ConversationDatasets::delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset] calls.
4987    ///
4988    /// # Example
4989    /// ```
4990    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::DeleteConversationDataset;
4991    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4992    /// use google_cloud_lro::Poller;
4993    ///
4994    /// let builder = prepare_request_builder();
4995    /// let response = builder.poller().until_done().await?;
4996    /// # Ok(()) }
4997    ///
4998    /// fn prepare_request_builder() -> DeleteConversationDataset {
4999    ///   # panic!();
5000    ///   // ... details omitted ...
5001    /// }
5002    /// ```
5003    #[derive(Clone, Debug)]
5004    pub struct DeleteConversationDataset(
5005        RequestBuilder<crate::model::DeleteConversationDatasetRequest>,
5006    );
5007
5008    impl DeleteConversationDataset {
5009        pub(crate) fn new(
5010            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5011        ) -> Self {
5012            Self(RequestBuilder::new(stub))
5013        }
5014
5015        /// Sets the full request, replacing any prior values.
5016        pub fn with_request<V: Into<crate::model::DeleteConversationDatasetRequest>>(
5017            mut self,
5018            v: V,
5019        ) -> Self {
5020            self.0.request = v.into();
5021            self
5022        }
5023
5024        /// Sets all the options, replacing any prior values.
5025        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5026            self.0.options = v.into();
5027            self
5028        }
5029
5030        /// Sends the request.
5031        ///
5032        /// # Long running operations
5033        ///
5034        /// This starts, but does not poll, a longrunning operation. More information
5035        /// on [delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset].
5036        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5037            (*self.0.stub)
5038                .delete_conversation_dataset(self.0.request, self.0.options)
5039                .await
5040                .map(crate::Response::into_body)
5041        }
5042
5043        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_conversation_dataset`.
5044        pub fn poller(
5045            self,
5046        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteConversationDatasetOperationMetadata>
5047        {
5048            type Operation = google_cloud_lro::internal::Operation<
5049                wkt::Empty,
5050                crate::model::DeleteConversationDatasetOperationMetadata,
5051            >;
5052            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5053            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5054
5055            let stub = self.0.stub.clone();
5056            let mut options = self.0.options.clone();
5057            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5058            let query = move |name| {
5059                let stub = stub.clone();
5060                let options = options.clone();
5061                async {
5062                    let op = GetOperation::new(stub)
5063                        .set_name(name)
5064                        .with_options(options)
5065                        .send()
5066                        .await?;
5067                    Ok(Operation::new(op))
5068                }
5069            };
5070
5071            let start = move || async {
5072                let op = self.send().await?;
5073                Ok(Operation::new(op))
5074            };
5075
5076            google_cloud_lro::internal::new_unit_response_poller(
5077                polling_error_policy,
5078                polling_backoff_policy,
5079                start,
5080                query,
5081            )
5082        }
5083
5084        /// Sets the value of [name][crate::model::DeleteConversationDatasetRequest::name].
5085        ///
5086        /// This is a **required** field for requests.
5087        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5088            self.0.request.name = v.into();
5089            self
5090        }
5091    }
5092
5093    #[doc(hidden)]
5094    impl crate::RequestBuilder for DeleteConversationDataset {
5095        fn request_options(&mut self) -> &mut crate::RequestOptions {
5096            &mut self.0.options
5097        }
5098    }
5099
5100    /// The request builder for [ConversationDatasets::import_conversation_data][crate::client::ConversationDatasets::import_conversation_data] calls.
5101    ///
5102    /// # Example
5103    /// ```
5104    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ImportConversationData;
5105    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5106    /// use google_cloud_lro::Poller;
5107    ///
5108    /// let builder = prepare_request_builder();
5109    /// let response = builder.poller().until_done().await?;
5110    /// # Ok(()) }
5111    ///
5112    /// fn prepare_request_builder() -> ImportConversationData {
5113    ///   # panic!();
5114    ///   // ... details omitted ...
5115    /// }
5116    /// ```
5117    #[derive(Clone, Debug)]
5118    pub struct ImportConversationData(RequestBuilder<crate::model::ImportConversationDataRequest>);
5119
5120    impl ImportConversationData {
5121        pub(crate) fn new(
5122            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5123        ) -> Self {
5124            Self(RequestBuilder::new(stub))
5125        }
5126
5127        /// Sets the full request, replacing any prior values.
5128        pub fn with_request<V: Into<crate::model::ImportConversationDataRequest>>(
5129            mut self,
5130            v: V,
5131        ) -> Self {
5132            self.0.request = v.into();
5133            self
5134        }
5135
5136        /// Sets all the options, replacing any prior values.
5137        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5138            self.0.options = v.into();
5139            self
5140        }
5141
5142        /// Sends the request.
5143        ///
5144        /// # Long running operations
5145        ///
5146        /// This starts, but does not poll, a longrunning operation. More information
5147        /// on [import_conversation_data][crate::client::ConversationDatasets::import_conversation_data].
5148        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5149            (*self.0.stub)
5150                .import_conversation_data(self.0.request, self.0.options)
5151                .await
5152                .map(crate::Response::into_body)
5153        }
5154
5155        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_conversation_data`.
5156        pub fn poller(
5157            self,
5158        ) -> impl google_cloud_lro::Poller<
5159            crate::model::ImportConversationDataOperationResponse,
5160            crate::model::ImportConversationDataOperationMetadata,
5161        > {
5162            type Operation = google_cloud_lro::internal::Operation<
5163                crate::model::ImportConversationDataOperationResponse,
5164                crate::model::ImportConversationDataOperationMetadata,
5165            >;
5166            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5167            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5168
5169            let stub = self.0.stub.clone();
5170            let mut options = self.0.options.clone();
5171            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5172            let query = move |name| {
5173                let stub = stub.clone();
5174                let options = options.clone();
5175                async {
5176                    let op = GetOperation::new(stub)
5177                        .set_name(name)
5178                        .with_options(options)
5179                        .send()
5180                        .await?;
5181                    Ok(Operation::new(op))
5182                }
5183            };
5184
5185            let start = move || async {
5186                let op = self.send().await?;
5187                Ok(Operation::new(op))
5188            };
5189
5190            google_cloud_lro::internal::new_poller(
5191                polling_error_policy,
5192                polling_backoff_policy,
5193                start,
5194                query,
5195            )
5196        }
5197
5198        /// Sets the value of [name][crate::model::ImportConversationDataRequest::name].
5199        ///
5200        /// This is a **required** field for requests.
5201        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5202            self.0.request.name = v.into();
5203            self
5204        }
5205
5206        /// Sets the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5207        ///
5208        /// This is a **required** field for requests.
5209        pub fn set_input_config<T>(mut self, v: T) -> Self
5210        where
5211            T: std::convert::Into<crate::model::InputConfig>,
5212        {
5213            self.0.request.input_config = std::option::Option::Some(v.into());
5214            self
5215        }
5216
5217        /// Sets or clears the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5218        ///
5219        /// This is a **required** field for requests.
5220        pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5221        where
5222            T: std::convert::Into<crate::model::InputConfig>,
5223        {
5224            self.0.request.input_config = v.map(|x| x.into());
5225            self
5226        }
5227    }
5228
5229    #[doc(hidden)]
5230    impl crate::RequestBuilder for ImportConversationData {
5231        fn request_options(&mut self) -> &mut crate::RequestOptions {
5232            &mut self.0.options
5233        }
5234    }
5235
5236    /// The request builder for [ConversationDatasets::list_locations][crate::client::ConversationDatasets::list_locations] calls.
5237    ///
5238    /// # Example
5239    /// ```
5240    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListLocations;
5241    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5242    /// use google_cloud_gax::paginator::ItemPaginator;
5243    ///
5244    /// let builder = prepare_request_builder();
5245    /// let mut items = builder.by_item();
5246    /// while let Some(result) = items.next().await {
5247    ///   let item = result?;
5248    /// }
5249    /// # Ok(()) }
5250    ///
5251    /// fn prepare_request_builder() -> ListLocations {
5252    ///   # panic!();
5253    ///   // ... details omitted ...
5254    /// }
5255    /// ```
5256    #[derive(Clone, Debug)]
5257    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5258
5259    impl ListLocations {
5260        pub(crate) fn new(
5261            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5262        ) -> Self {
5263            Self(RequestBuilder::new(stub))
5264        }
5265
5266        /// Sets the full request, replacing any prior values.
5267        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5268            mut self,
5269            v: V,
5270        ) -> Self {
5271            self.0.request = v.into();
5272            self
5273        }
5274
5275        /// Sets all the options, replacing any prior values.
5276        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5277            self.0.options = v.into();
5278            self
5279        }
5280
5281        /// Sends the request.
5282        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5283            (*self.0.stub)
5284                .list_locations(self.0.request, self.0.options)
5285                .await
5286                .map(crate::Response::into_body)
5287        }
5288
5289        /// Streams each page in the collection.
5290        pub fn by_page(
5291            self,
5292        ) -> impl google_cloud_gax::paginator::Paginator<
5293            google_cloud_location::model::ListLocationsResponse,
5294            crate::Error,
5295        > {
5296            use std::clone::Clone;
5297            let token = self.0.request.page_token.clone();
5298            let execute = move |token: String| {
5299                let mut builder = self.clone();
5300                builder.0.request = builder.0.request.set_page_token(token);
5301                builder.send()
5302            };
5303            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5304        }
5305
5306        /// Streams each item in the collection.
5307        pub fn by_item(
5308            self,
5309        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5310            google_cloud_location::model::ListLocationsResponse,
5311            crate::Error,
5312        > {
5313            use google_cloud_gax::paginator::Paginator;
5314            self.by_page().items()
5315        }
5316
5317        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
5318        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5319            self.0.request.name = v.into();
5320            self
5321        }
5322
5323        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
5324        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5325            self.0.request.filter = v.into();
5326            self
5327        }
5328
5329        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
5330        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5331            self.0.request.page_size = v.into();
5332            self
5333        }
5334
5335        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
5336        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5337            self.0.request.page_token = v.into();
5338            self
5339        }
5340    }
5341
5342    #[doc(hidden)]
5343    impl crate::RequestBuilder for ListLocations {
5344        fn request_options(&mut self) -> &mut crate::RequestOptions {
5345            &mut self.0.options
5346        }
5347    }
5348
5349    /// The request builder for [ConversationDatasets::get_location][crate::client::ConversationDatasets::get_location] calls.
5350    ///
5351    /// # Example
5352    /// ```
5353    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetLocation;
5354    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5355    ///
5356    /// let builder = prepare_request_builder();
5357    /// let response = builder.send().await?;
5358    /// # Ok(()) }
5359    ///
5360    /// fn prepare_request_builder() -> GetLocation {
5361    ///   # panic!();
5362    ///   // ... details omitted ...
5363    /// }
5364    /// ```
5365    #[derive(Clone, Debug)]
5366    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5367
5368    impl GetLocation {
5369        pub(crate) fn new(
5370            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5371        ) -> Self {
5372            Self(RequestBuilder::new(stub))
5373        }
5374
5375        /// Sets the full request, replacing any prior values.
5376        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5377            mut self,
5378            v: V,
5379        ) -> Self {
5380            self.0.request = v.into();
5381            self
5382        }
5383
5384        /// Sets all the options, replacing any prior values.
5385        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5386            self.0.options = v.into();
5387            self
5388        }
5389
5390        /// Sends the request.
5391        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5392            (*self.0.stub)
5393                .get_location(self.0.request, self.0.options)
5394                .await
5395                .map(crate::Response::into_body)
5396        }
5397
5398        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
5399        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5400            self.0.request.name = v.into();
5401            self
5402        }
5403    }
5404
5405    #[doc(hidden)]
5406    impl crate::RequestBuilder for GetLocation {
5407        fn request_options(&mut self) -> &mut crate::RequestOptions {
5408            &mut self.0.options
5409        }
5410    }
5411
5412    /// The request builder for [ConversationDatasets::list_operations][crate::client::ConversationDatasets::list_operations] calls.
5413    ///
5414    /// # Example
5415    /// ```
5416    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListOperations;
5417    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5418    /// use google_cloud_gax::paginator::ItemPaginator;
5419    ///
5420    /// let builder = prepare_request_builder();
5421    /// let mut items = builder.by_item();
5422    /// while let Some(result) = items.next().await {
5423    ///   let item = result?;
5424    /// }
5425    /// # Ok(()) }
5426    ///
5427    /// fn prepare_request_builder() -> ListOperations {
5428    ///   # panic!();
5429    ///   // ... details omitted ...
5430    /// }
5431    /// ```
5432    #[derive(Clone, Debug)]
5433    pub struct ListOperations(
5434        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5435    );
5436
5437    impl ListOperations {
5438        pub(crate) fn new(
5439            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5440        ) -> Self {
5441            Self(RequestBuilder::new(stub))
5442        }
5443
5444        /// Sets the full request, replacing any prior values.
5445        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5446            mut self,
5447            v: V,
5448        ) -> Self {
5449            self.0.request = v.into();
5450            self
5451        }
5452
5453        /// Sets all the options, replacing any prior values.
5454        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5455            self.0.options = v.into();
5456            self
5457        }
5458
5459        /// Sends the request.
5460        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5461            (*self.0.stub)
5462                .list_operations(self.0.request, self.0.options)
5463                .await
5464                .map(crate::Response::into_body)
5465        }
5466
5467        /// Streams each page in the collection.
5468        pub fn by_page(
5469            self,
5470        ) -> impl google_cloud_gax::paginator::Paginator<
5471            google_cloud_longrunning::model::ListOperationsResponse,
5472            crate::Error,
5473        > {
5474            use std::clone::Clone;
5475            let token = self.0.request.page_token.clone();
5476            let execute = move |token: String| {
5477                let mut builder = self.clone();
5478                builder.0.request = builder.0.request.set_page_token(token);
5479                builder.send()
5480            };
5481            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5482        }
5483
5484        /// Streams each item in the collection.
5485        pub fn by_item(
5486            self,
5487        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5488            google_cloud_longrunning::model::ListOperationsResponse,
5489            crate::Error,
5490        > {
5491            use google_cloud_gax::paginator::Paginator;
5492            self.by_page().items()
5493        }
5494
5495        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5496        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5497            self.0.request.name = v.into();
5498            self
5499        }
5500
5501        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5502        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5503            self.0.request.filter = v.into();
5504            self
5505        }
5506
5507        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5508        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5509            self.0.request.page_size = v.into();
5510            self
5511        }
5512
5513        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5514        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5515            self.0.request.page_token = v.into();
5516            self
5517        }
5518
5519        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5520        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5521            self.0.request.return_partial_success = v.into();
5522            self
5523        }
5524    }
5525
5526    #[doc(hidden)]
5527    impl crate::RequestBuilder for ListOperations {
5528        fn request_options(&mut self) -> &mut crate::RequestOptions {
5529            &mut self.0.options
5530        }
5531    }
5532
5533    /// The request builder for [ConversationDatasets::get_operation][crate::client::ConversationDatasets::get_operation] calls.
5534    ///
5535    /// # Example
5536    /// ```
5537    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetOperation;
5538    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5539    ///
5540    /// let builder = prepare_request_builder();
5541    /// let response = builder.send().await?;
5542    /// # Ok(()) }
5543    ///
5544    /// fn prepare_request_builder() -> GetOperation {
5545    ///   # panic!();
5546    ///   // ... details omitted ...
5547    /// }
5548    /// ```
5549    #[derive(Clone, Debug)]
5550    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5551
5552    impl GetOperation {
5553        pub(crate) fn new(
5554            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5555        ) -> Self {
5556            Self(RequestBuilder::new(stub))
5557        }
5558
5559        /// Sets the full request, replacing any prior values.
5560        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5561            mut self,
5562            v: V,
5563        ) -> Self {
5564            self.0.request = v.into();
5565            self
5566        }
5567
5568        /// Sets all the options, replacing any prior values.
5569        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5570            self.0.options = v.into();
5571            self
5572        }
5573
5574        /// Sends the request.
5575        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5576            (*self.0.stub)
5577                .get_operation(self.0.request, self.0.options)
5578                .await
5579                .map(crate::Response::into_body)
5580        }
5581
5582        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5583        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5584            self.0.request.name = v.into();
5585            self
5586        }
5587    }
5588
5589    #[doc(hidden)]
5590    impl crate::RequestBuilder for GetOperation {
5591        fn request_options(&mut self) -> &mut crate::RequestOptions {
5592            &mut self.0.options
5593        }
5594    }
5595
5596    /// The request builder for [ConversationDatasets::cancel_operation][crate::client::ConversationDatasets::cancel_operation] calls.
5597    ///
5598    /// # Example
5599    /// ```
5600    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::CancelOperation;
5601    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5602    ///
5603    /// let builder = prepare_request_builder();
5604    /// let response = builder.send().await?;
5605    /// # Ok(()) }
5606    ///
5607    /// fn prepare_request_builder() -> CancelOperation {
5608    ///   # panic!();
5609    ///   // ... details omitted ...
5610    /// }
5611    /// ```
5612    #[derive(Clone, Debug)]
5613    pub struct CancelOperation(
5614        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5615    );
5616
5617    impl CancelOperation {
5618        pub(crate) fn new(
5619            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5620        ) -> Self {
5621            Self(RequestBuilder::new(stub))
5622        }
5623
5624        /// Sets the full request, replacing any prior values.
5625        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5626            mut self,
5627            v: V,
5628        ) -> Self {
5629            self.0.request = v.into();
5630            self
5631        }
5632
5633        /// Sets all the options, replacing any prior values.
5634        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5635            self.0.options = v.into();
5636            self
5637        }
5638
5639        /// Sends the request.
5640        pub async fn send(self) -> Result<()> {
5641            (*self.0.stub)
5642                .cancel_operation(self.0.request, self.0.options)
5643                .await
5644                .map(crate::Response::into_body)
5645        }
5646
5647        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5648        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5649            self.0.request.name = v.into();
5650            self
5651        }
5652    }
5653
5654    #[doc(hidden)]
5655    impl crate::RequestBuilder for CancelOperation {
5656        fn request_options(&mut self) -> &mut crate::RequestOptions {
5657            &mut self.0.options
5658        }
5659    }
5660}
5661
5662/// Request and client builders for [ConversationModels][crate::client::ConversationModels].
5663#[cfg(feature = "conversation-models")]
5664#[cfg_attr(docsrs, doc(cfg(feature = "conversation-models")))]
5665pub mod conversation_models {
5666    use crate::Result;
5667
5668    /// A builder for [ConversationModels][crate::client::ConversationModels].
5669    ///
5670    /// ```
5671    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5672    /// # use google_cloud_dialogflow_v2::*;
5673    /// # use builder::conversation_models::ClientBuilder;
5674    /// # use client::ConversationModels;
5675    /// let builder : ClientBuilder = ConversationModels::builder();
5676    /// let client = builder
5677    ///     .with_endpoint("https://dialogflow.googleapis.com")
5678    ///     .build().await?;
5679    /// # Ok(()) }
5680    /// ```
5681    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5682
5683    pub(crate) mod client {
5684        use super::super::super::client::ConversationModels;
5685        pub struct Factory;
5686        impl crate::ClientFactory for Factory {
5687            type Client = ConversationModels;
5688            type Credentials = gaxi::options::Credentials;
5689            async fn build(
5690                self,
5691                config: gaxi::options::ClientConfig,
5692            ) -> crate::ClientBuilderResult<Self::Client> {
5693                Self::Client::new(config).await
5694            }
5695        }
5696    }
5697
5698    /// Common implementation for [crate::client::ConversationModels] request builders.
5699    #[derive(Clone, Debug)]
5700    pub(crate) struct RequestBuilder<R: std::default::Default> {
5701        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5702        request: R,
5703        options: crate::RequestOptions,
5704    }
5705
5706    impl<R> RequestBuilder<R>
5707    where
5708        R: std::default::Default,
5709    {
5710        pub(crate) fn new(
5711            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5712        ) -> Self {
5713            Self {
5714                stub,
5715                request: R::default(),
5716                options: crate::RequestOptions::default(),
5717            }
5718        }
5719    }
5720
5721    /// The request builder for [ConversationModels::create_conversation_model][crate::client::ConversationModels::create_conversation_model] calls.
5722    ///
5723    /// # Example
5724    /// ```
5725    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CreateConversationModel;
5726    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5727    /// use google_cloud_lro::Poller;
5728    ///
5729    /// let builder = prepare_request_builder();
5730    /// let response = builder.poller().until_done().await?;
5731    /// # Ok(()) }
5732    ///
5733    /// fn prepare_request_builder() -> CreateConversationModel {
5734    ///   # panic!();
5735    ///   // ... details omitted ...
5736    /// }
5737    /// ```
5738    #[derive(Clone, Debug)]
5739    pub struct CreateConversationModel(
5740        RequestBuilder<crate::model::CreateConversationModelRequest>,
5741    );
5742
5743    impl CreateConversationModel {
5744        pub(crate) fn new(
5745            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5746        ) -> Self {
5747            Self(RequestBuilder::new(stub))
5748        }
5749
5750        /// Sets the full request, replacing any prior values.
5751        pub fn with_request<V: Into<crate::model::CreateConversationModelRequest>>(
5752            mut self,
5753            v: V,
5754        ) -> Self {
5755            self.0.request = v.into();
5756            self
5757        }
5758
5759        /// Sets all the options, replacing any prior values.
5760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5761            self.0.options = v.into();
5762            self
5763        }
5764
5765        /// Sends the request.
5766        ///
5767        /// # Long running operations
5768        ///
5769        /// This starts, but does not poll, a longrunning operation. More information
5770        /// on [create_conversation_model][crate::client::ConversationModels::create_conversation_model].
5771        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5772            (*self.0.stub)
5773                .create_conversation_model(self.0.request, self.0.options)
5774                .await
5775                .map(crate::Response::into_body)
5776        }
5777
5778        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_model`.
5779        pub fn poller(
5780            self,
5781        ) -> impl google_cloud_lro::Poller<
5782            crate::model::ConversationModel,
5783            crate::model::CreateConversationModelOperationMetadata,
5784        > {
5785            type Operation = google_cloud_lro::internal::Operation<
5786                crate::model::ConversationModel,
5787                crate::model::CreateConversationModelOperationMetadata,
5788            >;
5789            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5790            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5791
5792            let stub = self.0.stub.clone();
5793            let mut options = self.0.options.clone();
5794            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5795            let query = move |name| {
5796                let stub = stub.clone();
5797                let options = options.clone();
5798                async {
5799                    let op = GetOperation::new(stub)
5800                        .set_name(name)
5801                        .with_options(options)
5802                        .send()
5803                        .await?;
5804                    Ok(Operation::new(op))
5805                }
5806            };
5807
5808            let start = move || async {
5809                let op = self.send().await?;
5810                Ok(Operation::new(op))
5811            };
5812
5813            google_cloud_lro::internal::new_poller(
5814                polling_error_policy,
5815                polling_backoff_policy,
5816                start,
5817                query,
5818            )
5819        }
5820
5821        /// Sets the value of [parent][crate::model::CreateConversationModelRequest::parent].
5822        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5823            self.0.request.parent = v.into();
5824            self
5825        }
5826
5827        /// Sets the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5828        ///
5829        /// This is a **required** field for requests.
5830        pub fn set_conversation_model<T>(mut self, v: T) -> Self
5831        where
5832            T: std::convert::Into<crate::model::ConversationModel>,
5833        {
5834            self.0.request.conversation_model = std::option::Option::Some(v.into());
5835            self
5836        }
5837
5838        /// Sets or clears the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5839        ///
5840        /// This is a **required** field for requests.
5841        pub fn set_or_clear_conversation_model<T>(mut self, v: std::option::Option<T>) -> Self
5842        where
5843            T: std::convert::Into<crate::model::ConversationModel>,
5844        {
5845            self.0.request.conversation_model = v.map(|x| x.into());
5846            self
5847        }
5848    }
5849
5850    #[doc(hidden)]
5851    impl crate::RequestBuilder for CreateConversationModel {
5852        fn request_options(&mut self) -> &mut crate::RequestOptions {
5853            &mut self.0.options
5854        }
5855    }
5856
5857    /// The request builder for [ConversationModels::get_conversation_model][crate::client::ConversationModels::get_conversation_model] calls.
5858    ///
5859    /// # Example
5860    /// ```
5861    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetConversationModel;
5862    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5863    ///
5864    /// let builder = prepare_request_builder();
5865    /// let response = builder.send().await?;
5866    /// # Ok(()) }
5867    ///
5868    /// fn prepare_request_builder() -> GetConversationModel {
5869    ///   # panic!();
5870    ///   // ... details omitted ...
5871    /// }
5872    /// ```
5873    #[derive(Clone, Debug)]
5874    pub struct GetConversationModel(RequestBuilder<crate::model::GetConversationModelRequest>);
5875
5876    impl GetConversationModel {
5877        pub(crate) fn new(
5878            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5879        ) -> Self {
5880            Self(RequestBuilder::new(stub))
5881        }
5882
5883        /// Sets the full request, replacing any prior values.
5884        pub fn with_request<V: Into<crate::model::GetConversationModelRequest>>(
5885            mut self,
5886            v: V,
5887        ) -> Self {
5888            self.0.request = v.into();
5889            self
5890        }
5891
5892        /// Sets all the options, replacing any prior values.
5893        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5894            self.0.options = v.into();
5895            self
5896        }
5897
5898        /// Sends the request.
5899        pub async fn send(self) -> Result<crate::model::ConversationModel> {
5900            (*self.0.stub)
5901                .get_conversation_model(self.0.request, self.0.options)
5902                .await
5903                .map(crate::Response::into_body)
5904        }
5905
5906        /// Sets the value of [name][crate::model::GetConversationModelRequest::name].
5907        ///
5908        /// This is a **required** field for requests.
5909        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5910            self.0.request.name = v.into();
5911            self
5912        }
5913    }
5914
5915    #[doc(hidden)]
5916    impl crate::RequestBuilder for GetConversationModel {
5917        fn request_options(&mut self) -> &mut crate::RequestOptions {
5918            &mut self.0.options
5919        }
5920    }
5921
5922    /// The request builder for [ConversationModels::list_conversation_models][crate::client::ConversationModels::list_conversation_models] calls.
5923    ///
5924    /// # Example
5925    /// ```
5926    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListConversationModels;
5927    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5928    /// use google_cloud_gax::paginator::ItemPaginator;
5929    ///
5930    /// let builder = prepare_request_builder();
5931    /// let mut items = builder.by_item();
5932    /// while let Some(result) = items.next().await {
5933    ///   let item = result?;
5934    /// }
5935    /// # Ok(()) }
5936    ///
5937    /// fn prepare_request_builder() -> ListConversationModels {
5938    ///   # panic!();
5939    ///   // ... details omitted ...
5940    /// }
5941    /// ```
5942    #[derive(Clone, Debug)]
5943    pub struct ListConversationModels(RequestBuilder<crate::model::ListConversationModelsRequest>);
5944
5945    impl ListConversationModels {
5946        pub(crate) fn new(
5947            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5948        ) -> Self {
5949            Self(RequestBuilder::new(stub))
5950        }
5951
5952        /// Sets the full request, replacing any prior values.
5953        pub fn with_request<V: Into<crate::model::ListConversationModelsRequest>>(
5954            mut self,
5955            v: V,
5956        ) -> Self {
5957            self.0.request = v.into();
5958            self
5959        }
5960
5961        /// Sets all the options, replacing any prior values.
5962        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5963            self.0.options = v.into();
5964            self
5965        }
5966
5967        /// Sends the request.
5968        pub async fn send(self) -> Result<crate::model::ListConversationModelsResponse> {
5969            (*self.0.stub)
5970                .list_conversation_models(self.0.request, self.0.options)
5971                .await
5972                .map(crate::Response::into_body)
5973        }
5974
5975        /// Streams each page in the collection.
5976        pub fn by_page(
5977            self,
5978        ) -> impl google_cloud_gax::paginator::Paginator<
5979            crate::model::ListConversationModelsResponse,
5980            crate::Error,
5981        > {
5982            use std::clone::Clone;
5983            let token = self.0.request.page_token.clone();
5984            let execute = move |token: String| {
5985                let mut builder = self.clone();
5986                builder.0.request = builder.0.request.set_page_token(token);
5987                builder.send()
5988            };
5989            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5990        }
5991
5992        /// Streams each item in the collection.
5993        pub fn by_item(
5994            self,
5995        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5996            crate::model::ListConversationModelsResponse,
5997            crate::Error,
5998        > {
5999            use google_cloud_gax::paginator::Paginator;
6000            self.by_page().items()
6001        }
6002
6003        /// Sets the value of [parent][crate::model::ListConversationModelsRequest::parent].
6004        ///
6005        /// This is a **required** field for requests.
6006        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6007            self.0.request.parent = v.into();
6008            self
6009        }
6010
6011        /// Sets the value of [page_size][crate::model::ListConversationModelsRequest::page_size].
6012        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6013            self.0.request.page_size = v.into();
6014            self
6015        }
6016
6017        /// Sets the value of [page_token][crate::model::ListConversationModelsRequest::page_token].
6018        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6019            self.0.request.page_token = v.into();
6020            self
6021        }
6022    }
6023
6024    #[doc(hidden)]
6025    impl crate::RequestBuilder for ListConversationModels {
6026        fn request_options(&mut self) -> &mut crate::RequestOptions {
6027            &mut self.0.options
6028        }
6029    }
6030
6031    /// The request builder for [ConversationModels::delete_conversation_model][crate::client::ConversationModels::delete_conversation_model] calls.
6032    ///
6033    /// # Example
6034    /// ```
6035    /// # use google_cloud_dialogflow_v2::builder::conversation_models::DeleteConversationModel;
6036    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6037    /// use google_cloud_lro::Poller;
6038    ///
6039    /// let builder = prepare_request_builder();
6040    /// let response = builder.poller().until_done().await?;
6041    /// # Ok(()) }
6042    ///
6043    /// fn prepare_request_builder() -> DeleteConversationModel {
6044    ///   # panic!();
6045    ///   // ... details omitted ...
6046    /// }
6047    /// ```
6048    #[derive(Clone, Debug)]
6049    pub struct DeleteConversationModel(
6050        RequestBuilder<crate::model::DeleteConversationModelRequest>,
6051    );
6052
6053    impl DeleteConversationModel {
6054        pub(crate) fn new(
6055            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6056        ) -> Self {
6057            Self(RequestBuilder::new(stub))
6058        }
6059
6060        /// Sets the full request, replacing any prior values.
6061        pub fn with_request<V: Into<crate::model::DeleteConversationModelRequest>>(
6062            mut self,
6063            v: V,
6064        ) -> Self {
6065            self.0.request = v.into();
6066            self
6067        }
6068
6069        /// Sets all the options, replacing any prior values.
6070        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6071            self.0.options = v.into();
6072            self
6073        }
6074
6075        /// Sends the request.
6076        ///
6077        /// # Long running operations
6078        ///
6079        /// This starts, but does not poll, a longrunning operation. More information
6080        /// on [delete_conversation_model][crate::client::ConversationModels::delete_conversation_model].
6081        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6082            (*self.0.stub)
6083                .delete_conversation_model(self.0.request, self.0.options)
6084                .await
6085                .map(crate::Response::into_body)
6086        }
6087
6088        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_conversation_model`.
6089        pub fn poller(
6090            self,
6091        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteConversationModelOperationMetadata>
6092        {
6093            type Operation = google_cloud_lro::internal::Operation<
6094                wkt::Empty,
6095                crate::model::DeleteConversationModelOperationMetadata,
6096            >;
6097            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6098            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6099
6100            let stub = self.0.stub.clone();
6101            let mut options = self.0.options.clone();
6102            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6103            let query = move |name| {
6104                let stub = stub.clone();
6105                let options = options.clone();
6106                async {
6107                    let op = GetOperation::new(stub)
6108                        .set_name(name)
6109                        .with_options(options)
6110                        .send()
6111                        .await?;
6112                    Ok(Operation::new(op))
6113                }
6114            };
6115
6116            let start = move || async {
6117                let op = self.send().await?;
6118                Ok(Operation::new(op))
6119            };
6120
6121            google_cloud_lro::internal::new_unit_response_poller(
6122                polling_error_policy,
6123                polling_backoff_policy,
6124                start,
6125                query,
6126            )
6127        }
6128
6129        /// Sets the value of [name][crate::model::DeleteConversationModelRequest::name].
6130        ///
6131        /// This is a **required** field for requests.
6132        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6133            self.0.request.name = v.into();
6134            self
6135        }
6136    }
6137
6138    #[doc(hidden)]
6139    impl crate::RequestBuilder for DeleteConversationModel {
6140        fn request_options(&mut self) -> &mut crate::RequestOptions {
6141            &mut self.0.options
6142        }
6143    }
6144
6145    /// The request builder for [ConversationModels::deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model] calls.
6146    ///
6147    /// # Example
6148    /// ```
6149    /// # use google_cloud_dialogflow_v2::builder::conversation_models::DeployConversationModel;
6150    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6151    /// use google_cloud_lro::Poller;
6152    ///
6153    /// let builder = prepare_request_builder();
6154    /// let response = builder.poller().until_done().await?;
6155    /// # Ok(()) }
6156    ///
6157    /// fn prepare_request_builder() -> DeployConversationModel {
6158    ///   # panic!();
6159    ///   // ... details omitted ...
6160    /// }
6161    /// ```
6162    #[derive(Clone, Debug)]
6163    pub struct DeployConversationModel(
6164        RequestBuilder<crate::model::DeployConversationModelRequest>,
6165    );
6166
6167    impl DeployConversationModel {
6168        pub(crate) fn new(
6169            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6170        ) -> Self {
6171            Self(RequestBuilder::new(stub))
6172        }
6173
6174        /// Sets the full request, replacing any prior values.
6175        pub fn with_request<V: Into<crate::model::DeployConversationModelRequest>>(
6176            mut self,
6177            v: V,
6178        ) -> Self {
6179            self.0.request = v.into();
6180            self
6181        }
6182
6183        /// Sets all the options, replacing any prior values.
6184        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6185            self.0.options = v.into();
6186            self
6187        }
6188
6189        /// Sends the request.
6190        ///
6191        /// # Long running operations
6192        ///
6193        /// This starts, but does not poll, a longrunning operation. More information
6194        /// on [deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model].
6195        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6196            (*self.0.stub)
6197                .deploy_conversation_model(self.0.request, self.0.options)
6198                .await
6199                .map(crate::Response::into_body)
6200        }
6201
6202        /// Creates a [Poller][google_cloud_lro::Poller] to work with `deploy_conversation_model`.
6203        pub fn poller(
6204            self,
6205        ) -> impl google_cloud_lro::Poller<(), crate::model::DeployConversationModelOperationMetadata>
6206        {
6207            type Operation = google_cloud_lro::internal::Operation<
6208                wkt::Empty,
6209                crate::model::DeployConversationModelOperationMetadata,
6210            >;
6211            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6212            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6213
6214            let stub = self.0.stub.clone();
6215            let mut options = self.0.options.clone();
6216            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6217            let query = move |name| {
6218                let stub = stub.clone();
6219                let options = options.clone();
6220                async {
6221                    let op = GetOperation::new(stub)
6222                        .set_name(name)
6223                        .with_options(options)
6224                        .send()
6225                        .await?;
6226                    Ok(Operation::new(op))
6227                }
6228            };
6229
6230            let start = move || async {
6231                let op = self.send().await?;
6232                Ok(Operation::new(op))
6233            };
6234
6235            google_cloud_lro::internal::new_unit_response_poller(
6236                polling_error_policy,
6237                polling_backoff_policy,
6238                start,
6239                query,
6240            )
6241        }
6242
6243        /// Sets the value of [name][crate::model::DeployConversationModelRequest::name].
6244        ///
6245        /// This is a **required** field for requests.
6246        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6247            self.0.request.name = v.into();
6248            self
6249        }
6250    }
6251
6252    #[doc(hidden)]
6253    impl crate::RequestBuilder for DeployConversationModel {
6254        fn request_options(&mut self) -> &mut crate::RequestOptions {
6255            &mut self.0.options
6256        }
6257    }
6258
6259    /// The request builder for [ConversationModels::undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model] calls.
6260    ///
6261    /// # Example
6262    /// ```
6263    /// # use google_cloud_dialogflow_v2::builder::conversation_models::UndeployConversationModel;
6264    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6265    /// use google_cloud_lro::Poller;
6266    ///
6267    /// let builder = prepare_request_builder();
6268    /// let response = builder.poller().until_done().await?;
6269    /// # Ok(()) }
6270    ///
6271    /// fn prepare_request_builder() -> UndeployConversationModel {
6272    ///   # panic!();
6273    ///   // ... details omitted ...
6274    /// }
6275    /// ```
6276    #[derive(Clone, Debug)]
6277    pub struct UndeployConversationModel(
6278        RequestBuilder<crate::model::UndeployConversationModelRequest>,
6279    );
6280
6281    impl UndeployConversationModel {
6282        pub(crate) fn new(
6283            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6284        ) -> Self {
6285            Self(RequestBuilder::new(stub))
6286        }
6287
6288        /// Sets the full request, replacing any prior values.
6289        pub fn with_request<V: Into<crate::model::UndeployConversationModelRequest>>(
6290            mut self,
6291            v: V,
6292        ) -> Self {
6293            self.0.request = v.into();
6294            self
6295        }
6296
6297        /// Sets all the options, replacing any prior values.
6298        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6299            self.0.options = v.into();
6300            self
6301        }
6302
6303        /// Sends the request.
6304        ///
6305        /// # Long running operations
6306        ///
6307        /// This starts, but does not poll, a longrunning operation. More information
6308        /// on [undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model].
6309        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6310            (*self.0.stub)
6311                .undeploy_conversation_model(self.0.request, self.0.options)
6312                .await
6313                .map(crate::Response::into_body)
6314        }
6315
6316        /// Creates a [Poller][google_cloud_lro::Poller] to work with `undeploy_conversation_model`.
6317        pub fn poller(
6318            self,
6319        ) -> impl google_cloud_lro::Poller<(), crate::model::UndeployConversationModelOperationMetadata>
6320        {
6321            type Operation = google_cloud_lro::internal::Operation<
6322                wkt::Empty,
6323                crate::model::UndeployConversationModelOperationMetadata,
6324            >;
6325            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6326            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6327
6328            let stub = self.0.stub.clone();
6329            let mut options = self.0.options.clone();
6330            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6331            let query = move |name| {
6332                let stub = stub.clone();
6333                let options = options.clone();
6334                async {
6335                    let op = GetOperation::new(stub)
6336                        .set_name(name)
6337                        .with_options(options)
6338                        .send()
6339                        .await?;
6340                    Ok(Operation::new(op))
6341                }
6342            };
6343
6344            let start = move || async {
6345                let op = self.send().await?;
6346                Ok(Operation::new(op))
6347            };
6348
6349            google_cloud_lro::internal::new_unit_response_poller(
6350                polling_error_policy,
6351                polling_backoff_policy,
6352                start,
6353                query,
6354            )
6355        }
6356
6357        /// Sets the value of [name][crate::model::UndeployConversationModelRequest::name].
6358        ///
6359        /// This is a **required** field for requests.
6360        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6361            self.0.request.name = v.into();
6362            self
6363        }
6364    }
6365
6366    #[doc(hidden)]
6367    impl crate::RequestBuilder for UndeployConversationModel {
6368        fn request_options(&mut self) -> &mut crate::RequestOptions {
6369            &mut self.0.options
6370        }
6371    }
6372
6373    /// The request builder for [ConversationModels::get_conversation_model_evaluation][crate::client::ConversationModels::get_conversation_model_evaluation] calls.
6374    ///
6375    /// # Example
6376    /// ```
6377    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetConversationModelEvaluation;
6378    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6379    ///
6380    /// let builder = prepare_request_builder();
6381    /// let response = builder.send().await?;
6382    /// # Ok(()) }
6383    ///
6384    /// fn prepare_request_builder() -> GetConversationModelEvaluation {
6385    ///   # panic!();
6386    ///   // ... details omitted ...
6387    /// }
6388    /// ```
6389    #[derive(Clone, Debug)]
6390    pub struct GetConversationModelEvaluation(
6391        RequestBuilder<crate::model::GetConversationModelEvaluationRequest>,
6392    );
6393
6394    impl GetConversationModelEvaluation {
6395        pub(crate) fn new(
6396            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6397        ) -> Self {
6398            Self(RequestBuilder::new(stub))
6399        }
6400
6401        /// Sets the full request, replacing any prior values.
6402        pub fn with_request<V: Into<crate::model::GetConversationModelEvaluationRequest>>(
6403            mut self,
6404            v: V,
6405        ) -> Self {
6406            self.0.request = v.into();
6407            self
6408        }
6409
6410        /// Sets all the options, replacing any prior values.
6411        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6412            self.0.options = v.into();
6413            self
6414        }
6415
6416        /// Sends the request.
6417        pub async fn send(self) -> Result<crate::model::ConversationModelEvaluation> {
6418            (*self.0.stub)
6419                .get_conversation_model_evaluation(self.0.request, self.0.options)
6420                .await
6421                .map(crate::Response::into_body)
6422        }
6423
6424        /// Sets the value of [name][crate::model::GetConversationModelEvaluationRequest::name].
6425        ///
6426        /// This is a **required** field for requests.
6427        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6428            self.0.request.name = v.into();
6429            self
6430        }
6431    }
6432
6433    #[doc(hidden)]
6434    impl crate::RequestBuilder for GetConversationModelEvaluation {
6435        fn request_options(&mut self) -> &mut crate::RequestOptions {
6436            &mut self.0.options
6437        }
6438    }
6439
6440    /// The request builder for [ConversationModels::list_conversation_model_evaluations][crate::client::ConversationModels::list_conversation_model_evaluations] calls.
6441    ///
6442    /// # Example
6443    /// ```
6444    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListConversationModelEvaluations;
6445    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6446    /// use google_cloud_gax::paginator::ItemPaginator;
6447    ///
6448    /// let builder = prepare_request_builder();
6449    /// let mut items = builder.by_item();
6450    /// while let Some(result) = items.next().await {
6451    ///   let item = result?;
6452    /// }
6453    /// # Ok(()) }
6454    ///
6455    /// fn prepare_request_builder() -> ListConversationModelEvaluations {
6456    ///   # panic!();
6457    ///   // ... details omitted ...
6458    /// }
6459    /// ```
6460    #[derive(Clone, Debug)]
6461    pub struct ListConversationModelEvaluations(
6462        RequestBuilder<crate::model::ListConversationModelEvaluationsRequest>,
6463    );
6464
6465    impl ListConversationModelEvaluations {
6466        pub(crate) fn new(
6467            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6468        ) -> Self {
6469            Self(RequestBuilder::new(stub))
6470        }
6471
6472        /// Sets the full request, replacing any prior values.
6473        pub fn with_request<V: Into<crate::model::ListConversationModelEvaluationsRequest>>(
6474            mut self,
6475            v: V,
6476        ) -> Self {
6477            self.0.request = v.into();
6478            self
6479        }
6480
6481        /// Sets all the options, replacing any prior values.
6482        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6483            self.0.options = v.into();
6484            self
6485        }
6486
6487        /// Sends the request.
6488        pub async fn send(self) -> Result<crate::model::ListConversationModelEvaluationsResponse> {
6489            (*self.0.stub)
6490                .list_conversation_model_evaluations(self.0.request, self.0.options)
6491                .await
6492                .map(crate::Response::into_body)
6493        }
6494
6495        /// Streams each page in the collection.
6496        pub fn by_page(
6497            self,
6498        ) -> impl google_cloud_gax::paginator::Paginator<
6499            crate::model::ListConversationModelEvaluationsResponse,
6500            crate::Error,
6501        > {
6502            use std::clone::Clone;
6503            let token = self.0.request.page_token.clone();
6504            let execute = move |token: String| {
6505                let mut builder = self.clone();
6506                builder.0.request = builder.0.request.set_page_token(token);
6507                builder.send()
6508            };
6509            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6510        }
6511
6512        /// Streams each item in the collection.
6513        pub fn by_item(
6514            self,
6515        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6516            crate::model::ListConversationModelEvaluationsResponse,
6517            crate::Error,
6518        > {
6519            use google_cloud_gax::paginator::Paginator;
6520            self.by_page().items()
6521        }
6522
6523        /// Sets the value of [parent][crate::model::ListConversationModelEvaluationsRequest::parent].
6524        ///
6525        /// This is a **required** field for requests.
6526        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6527            self.0.request.parent = v.into();
6528            self
6529        }
6530
6531        /// Sets the value of [page_size][crate::model::ListConversationModelEvaluationsRequest::page_size].
6532        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6533            self.0.request.page_size = v.into();
6534            self
6535        }
6536
6537        /// Sets the value of [page_token][crate::model::ListConversationModelEvaluationsRequest::page_token].
6538        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6539            self.0.request.page_token = v.into();
6540            self
6541        }
6542    }
6543
6544    #[doc(hidden)]
6545    impl crate::RequestBuilder for ListConversationModelEvaluations {
6546        fn request_options(&mut self) -> &mut crate::RequestOptions {
6547            &mut self.0.options
6548        }
6549    }
6550
6551    /// The request builder for [ConversationModels::create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation] calls.
6552    ///
6553    /// # Example
6554    /// ```
6555    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CreateConversationModelEvaluation;
6556    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6557    /// use google_cloud_lro::Poller;
6558    ///
6559    /// let builder = prepare_request_builder();
6560    /// let response = builder.poller().until_done().await?;
6561    /// # Ok(()) }
6562    ///
6563    /// fn prepare_request_builder() -> CreateConversationModelEvaluation {
6564    ///   # panic!();
6565    ///   // ... details omitted ...
6566    /// }
6567    /// ```
6568    #[derive(Clone, Debug)]
6569    pub struct CreateConversationModelEvaluation(
6570        RequestBuilder<crate::model::CreateConversationModelEvaluationRequest>,
6571    );
6572
6573    impl CreateConversationModelEvaluation {
6574        pub(crate) fn new(
6575            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6576        ) -> Self {
6577            Self(RequestBuilder::new(stub))
6578        }
6579
6580        /// Sets the full request, replacing any prior values.
6581        pub fn with_request<V: Into<crate::model::CreateConversationModelEvaluationRequest>>(
6582            mut self,
6583            v: V,
6584        ) -> Self {
6585            self.0.request = v.into();
6586            self
6587        }
6588
6589        /// Sets all the options, replacing any prior values.
6590        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6591            self.0.options = v.into();
6592            self
6593        }
6594
6595        /// Sends the request.
6596        ///
6597        /// # Long running operations
6598        ///
6599        /// This starts, but does not poll, a longrunning operation. More information
6600        /// on [create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation].
6601        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6602            (*self.0.stub)
6603                .create_conversation_model_evaluation(self.0.request, self.0.options)
6604                .await
6605                .map(crate::Response::into_body)
6606        }
6607
6608        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_model_evaluation`.
6609        pub fn poller(
6610            self,
6611        ) -> impl google_cloud_lro::Poller<
6612            crate::model::ConversationModelEvaluation,
6613            crate::model::CreateConversationModelEvaluationOperationMetadata,
6614        > {
6615            type Operation = google_cloud_lro::internal::Operation<
6616                crate::model::ConversationModelEvaluation,
6617                crate::model::CreateConversationModelEvaluationOperationMetadata,
6618            >;
6619            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6620            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6621
6622            let stub = self.0.stub.clone();
6623            let mut options = self.0.options.clone();
6624            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6625            let query = move |name| {
6626                let stub = stub.clone();
6627                let options = options.clone();
6628                async {
6629                    let op = GetOperation::new(stub)
6630                        .set_name(name)
6631                        .with_options(options)
6632                        .send()
6633                        .await?;
6634                    Ok(Operation::new(op))
6635                }
6636            };
6637
6638            let start = move || async {
6639                let op = self.send().await?;
6640                Ok(Operation::new(op))
6641            };
6642
6643            google_cloud_lro::internal::new_poller(
6644                polling_error_policy,
6645                polling_backoff_policy,
6646                start,
6647                query,
6648            )
6649        }
6650
6651        /// Sets the value of [parent][crate::model::CreateConversationModelEvaluationRequest::parent].
6652        ///
6653        /// This is a **required** field for requests.
6654        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6655            self.0.request.parent = v.into();
6656            self
6657        }
6658
6659        /// Sets the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6660        ///
6661        /// This is a **required** field for requests.
6662        pub fn set_conversation_model_evaluation<T>(mut self, v: T) -> Self
6663        where
6664            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6665        {
6666            self.0.request.conversation_model_evaluation = std::option::Option::Some(v.into());
6667            self
6668        }
6669
6670        /// Sets or clears the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6671        ///
6672        /// This is a **required** field for requests.
6673        pub fn set_or_clear_conversation_model_evaluation<T>(
6674            mut self,
6675            v: std::option::Option<T>,
6676        ) -> Self
6677        where
6678            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6679        {
6680            self.0.request.conversation_model_evaluation = v.map(|x| x.into());
6681            self
6682        }
6683    }
6684
6685    #[doc(hidden)]
6686    impl crate::RequestBuilder for CreateConversationModelEvaluation {
6687        fn request_options(&mut self) -> &mut crate::RequestOptions {
6688            &mut self.0.options
6689        }
6690    }
6691
6692    /// The request builder for [ConversationModels::list_locations][crate::client::ConversationModels::list_locations] calls.
6693    ///
6694    /// # Example
6695    /// ```
6696    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListLocations;
6697    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6698    /// use google_cloud_gax::paginator::ItemPaginator;
6699    ///
6700    /// let builder = prepare_request_builder();
6701    /// let mut items = builder.by_item();
6702    /// while let Some(result) = items.next().await {
6703    ///   let item = result?;
6704    /// }
6705    /// # Ok(()) }
6706    ///
6707    /// fn prepare_request_builder() -> ListLocations {
6708    ///   # panic!();
6709    ///   // ... details omitted ...
6710    /// }
6711    /// ```
6712    #[derive(Clone, Debug)]
6713    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6714
6715    impl ListLocations {
6716        pub(crate) fn new(
6717            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6718        ) -> Self {
6719            Self(RequestBuilder::new(stub))
6720        }
6721
6722        /// Sets the full request, replacing any prior values.
6723        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6724            mut self,
6725            v: V,
6726        ) -> Self {
6727            self.0.request = v.into();
6728            self
6729        }
6730
6731        /// Sets all the options, replacing any prior values.
6732        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6733            self.0.options = v.into();
6734            self
6735        }
6736
6737        /// Sends the request.
6738        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6739            (*self.0.stub)
6740                .list_locations(self.0.request, self.0.options)
6741                .await
6742                .map(crate::Response::into_body)
6743        }
6744
6745        /// Streams each page in the collection.
6746        pub fn by_page(
6747            self,
6748        ) -> impl google_cloud_gax::paginator::Paginator<
6749            google_cloud_location::model::ListLocationsResponse,
6750            crate::Error,
6751        > {
6752            use std::clone::Clone;
6753            let token = self.0.request.page_token.clone();
6754            let execute = move |token: String| {
6755                let mut builder = self.clone();
6756                builder.0.request = builder.0.request.set_page_token(token);
6757                builder.send()
6758            };
6759            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6760        }
6761
6762        /// Streams each item in the collection.
6763        pub fn by_item(
6764            self,
6765        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6766            google_cloud_location::model::ListLocationsResponse,
6767            crate::Error,
6768        > {
6769            use google_cloud_gax::paginator::Paginator;
6770            self.by_page().items()
6771        }
6772
6773        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6774        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6775            self.0.request.name = v.into();
6776            self
6777        }
6778
6779        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6780        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6781            self.0.request.filter = v.into();
6782            self
6783        }
6784
6785        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6786        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6787            self.0.request.page_size = v.into();
6788            self
6789        }
6790
6791        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6792        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6793            self.0.request.page_token = v.into();
6794            self
6795        }
6796    }
6797
6798    #[doc(hidden)]
6799    impl crate::RequestBuilder for ListLocations {
6800        fn request_options(&mut self) -> &mut crate::RequestOptions {
6801            &mut self.0.options
6802        }
6803    }
6804
6805    /// The request builder for [ConversationModels::get_location][crate::client::ConversationModels::get_location] calls.
6806    ///
6807    /// # Example
6808    /// ```
6809    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetLocation;
6810    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6811    ///
6812    /// let builder = prepare_request_builder();
6813    /// let response = builder.send().await?;
6814    /// # Ok(()) }
6815    ///
6816    /// fn prepare_request_builder() -> GetLocation {
6817    ///   # panic!();
6818    ///   // ... details omitted ...
6819    /// }
6820    /// ```
6821    #[derive(Clone, Debug)]
6822    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6823
6824    impl GetLocation {
6825        pub(crate) fn new(
6826            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6827        ) -> Self {
6828            Self(RequestBuilder::new(stub))
6829        }
6830
6831        /// Sets the full request, replacing any prior values.
6832        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6833            mut self,
6834            v: V,
6835        ) -> Self {
6836            self.0.request = v.into();
6837            self
6838        }
6839
6840        /// Sets all the options, replacing any prior values.
6841        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6842            self.0.options = v.into();
6843            self
6844        }
6845
6846        /// Sends the request.
6847        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6848            (*self.0.stub)
6849                .get_location(self.0.request, self.0.options)
6850                .await
6851                .map(crate::Response::into_body)
6852        }
6853
6854        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6855        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6856            self.0.request.name = v.into();
6857            self
6858        }
6859    }
6860
6861    #[doc(hidden)]
6862    impl crate::RequestBuilder for GetLocation {
6863        fn request_options(&mut self) -> &mut crate::RequestOptions {
6864            &mut self.0.options
6865        }
6866    }
6867
6868    /// The request builder for [ConversationModels::list_operations][crate::client::ConversationModels::list_operations] calls.
6869    ///
6870    /// # Example
6871    /// ```
6872    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListOperations;
6873    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6874    /// use google_cloud_gax::paginator::ItemPaginator;
6875    ///
6876    /// let builder = prepare_request_builder();
6877    /// let mut items = builder.by_item();
6878    /// while let Some(result) = items.next().await {
6879    ///   let item = result?;
6880    /// }
6881    /// # Ok(()) }
6882    ///
6883    /// fn prepare_request_builder() -> ListOperations {
6884    ///   # panic!();
6885    ///   // ... details omitted ...
6886    /// }
6887    /// ```
6888    #[derive(Clone, Debug)]
6889    pub struct ListOperations(
6890        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6891    );
6892
6893    impl ListOperations {
6894        pub(crate) fn new(
6895            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6896        ) -> Self {
6897            Self(RequestBuilder::new(stub))
6898        }
6899
6900        /// Sets the full request, replacing any prior values.
6901        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6902            mut self,
6903            v: V,
6904        ) -> Self {
6905            self.0.request = v.into();
6906            self
6907        }
6908
6909        /// Sets all the options, replacing any prior values.
6910        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6911            self.0.options = v.into();
6912            self
6913        }
6914
6915        /// Sends the request.
6916        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6917            (*self.0.stub)
6918                .list_operations(self.0.request, self.0.options)
6919                .await
6920                .map(crate::Response::into_body)
6921        }
6922
6923        /// Streams each page in the collection.
6924        pub fn by_page(
6925            self,
6926        ) -> impl google_cloud_gax::paginator::Paginator<
6927            google_cloud_longrunning::model::ListOperationsResponse,
6928            crate::Error,
6929        > {
6930            use std::clone::Clone;
6931            let token = self.0.request.page_token.clone();
6932            let execute = move |token: String| {
6933                let mut builder = self.clone();
6934                builder.0.request = builder.0.request.set_page_token(token);
6935                builder.send()
6936            };
6937            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6938        }
6939
6940        /// Streams each item in the collection.
6941        pub fn by_item(
6942            self,
6943        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6944            google_cloud_longrunning::model::ListOperationsResponse,
6945            crate::Error,
6946        > {
6947            use google_cloud_gax::paginator::Paginator;
6948            self.by_page().items()
6949        }
6950
6951        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6952        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6953            self.0.request.name = v.into();
6954            self
6955        }
6956
6957        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6958        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6959            self.0.request.filter = v.into();
6960            self
6961        }
6962
6963        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6964        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6965            self.0.request.page_size = v.into();
6966            self
6967        }
6968
6969        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6970        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6971            self.0.request.page_token = v.into();
6972            self
6973        }
6974
6975        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6976        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6977            self.0.request.return_partial_success = v.into();
6978            self
6979        }
6980    }
6981
6982    #[doc(hidden)]
6983    impl crate::RequestBuilder for ListOperations {
6984        fn request_options(&mut self) -> &mut crate::RequestOptions {
6985            &mut self.0.options
6986        }
6987    }
6988
6989    /// The request builder for [ConversationModels::get_operation][crate::client::ConversationModels::get_operation] calls.
6990    ///
6991    /// # Example
6992    /// ```
6993    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetOperation;
6994    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6995    ///
6996    /// let builder = prepare_request_builder();
6997    /// let response = builder.send().await?;
6998    /// # Ok(()) }
6999    ///
7000    /// fn prepare_request_builder() -> GetOperation {
7001    ///   # panic!();
7002    ///   // ... details omitted ...
7003    /// }
7004    /// ```
7005    #[derive(Clone, Debug)]
7006    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7007
7008    impl GetOperation {
7009        pub(crate) fn new(
7010            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7011        ) -> Self {
7012            Self(RequestBuilder::new(stub))
7013        }
7014
7015        /// Sets the full request, replacing any prior values.
7016        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7017            mut self,
7018            v: V,
7019        ) -> Self {
7020            self.0.request = v.into();
7021            self
7022        }
7023
7024        /// Sets all the options, replacing any prior values.
7025        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7026            self.0.options = v.into();
7027            self
7028        }
7029
7030        /// Sends the request.
7031        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7032            (*self.0.stub)
7033                .get_operation(self.0.request, self.0.options)
7034                .await
7035                .map(crate::Response::into_body)
7036        }
7037
7038        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7039        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7040            self.0.request.name = v.into();
7041            self
7042        }
7043    }
7044
7045    #[doc(hidden)]
7046    impl crate::RequestBuilder for GetOperation {
7047        fn request_options(&mut self) -> &mut crate::RequestOptions {
7048            &mut self.0.options
7049        }
7050    }
7051
7052    /// The request builder for [ConversationModels::cancel_operation][crate::client::ConversationModels::cancel_operation] calls.
7053    ///
7054    /// # Example
7055    /// ```
7056    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CancelOperation;
7057    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7058    ///
7059    /// let builder = prepare_request_builder();
7060    /// let response = builder.send().await?;
7061    /// # Ok(()) }
7062    ///
7063    /// fn prepare_request_builder() -> CancelOperation {
7064    ///   # panic!();
7065    ///   // ... details omitted ...
7066    /// }
7067    /// ```
7068    #[derive(Clone, Debug)]
7069    pub struct CancelOperation(
7070        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7071    );
7072
7073    impl CancelOperation {
7074        pub(crate) fn new(
7075            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7076        ) -> Self {
7077            Self(RequestBuilder::new(stub))
7078        }
7079
7080        /// Sets the full request, replacing any prior values.
7081        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7082            mut self,
7083            v: V,
7084        ) -> Self {
7085            self.0.request = v.into();
7086            self
7087        }
7088
7089        /// Sets all the options, replacing any prior values.
7090        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7091            self.0.options = v.into();
7092            self
7093        }
7094
7095        /// Sends the request.
7096        pub async fn send(self) -> Result<()> {
7097            (*self.0.stub)
7098                .cancel_operation(self.0.request, self.0.options)
7099                .await
7100                .map(crate::Response::into_body)
7101        }
7102
7103        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7104        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7105            self.0.request.name = v.into();
7106            self
7107        }
7108    }
7109
7110    #[doc(hidden)]
7111    impl crate::RequestBuilder for CancelOperation {
7112        fn request_options(&mut self) -> &mut crate::RequestOptions {
7113            &mut self.0.options
7114        }
7115    }
7116}
7117
7118/// Request and client builders for [ConversationProfiles][crate::client::ConversationProfiles].
7119#[cfg(feature = "conversation-profiles")]
7120#[cfg_attr(docsrs, doc(cfg(feature = "conversation-profiles")))]
7121pub mod conversation_profiles {
7122    use crate::Result;
7123
7124    /// A builder for [ConversationProfiles][crate::client::ConversationProfiles].
7125    ///
7126    /// ```
7127    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7128    /// # use google_cloud_dialogflow_v2::*;
7129    /// # use builder::conversation_profiles::ClientBuilder;
7130    /// # use client::ConversationProfiles;
7131    /// let builder : ClientBuilder = ConversationProfiles::builder();
7132    /// let client = builder
7133    ///     .with_endpoint("https://dialogflow.googleapis.com")
7134    ///     .build().await?;
7135    /// # Ok(()) }
7136    /// ```
7137    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7138
7139    pub(crate) mod client {
7140        use super::super::super::client::ConversationProfiles;
7141        pub struct Factory;
7142        impl crate::ClientFactory for Factory {
7143            type Client = ConversationProfiles;
7144            type Credentials = gaxi::options::Credentials;
7145            async fn build(
7146                self,
7147                config: gaxi::options::ClientConfig,
7148            ) -> crate::ClientBuilderResult<Self::Client> {
7149                Self::Client::new(config).await
7150            }
7151        }
7152    }
7153
7154    /// Common implementation for [crate::client::ConversationProfiles] request builders.
7155    #[derive(Clone, Debug)]
7156    pub(crate) struct RequestBuilder<R: std::default::Default> {
7157        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7158        request: R,
7159        options: crate::RequestOptions,
7160    }
7161
7162    impl<R> RequestBuilder<R>
7163    where
7164        R: std::default::Default,
7165    {
7166        pub(crate) fn new(
7167            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7168        ) -> Self {
7169            Self {
7170                stub,
7171                request: R::default(),
7172                options: crate::RequestOptions::default(),
7173            }
7174        }
7175    }
7176
7177    /// The request builder for [ConversationProfiles::list_conversation_profiles][crate::client::ConversationProfiles::list_conversation_profiles] calls.
7178    ///
7179    /// # Example
7180    /// ```
7181    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListConversationProfiles;
7182    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7183    /// use google_cloud_gax::paginator::ItemPaginator;
7184    ///
7185    /// let builder = prepare_request_builder();
7186    /// let mut items = builder.by_item();
7187    /// while let Some(result) = items.next().await {
7188    ///   let item = result?;
7189    /// }
7190    /// # Ok(()) }
7191    ///
7192    /// fn prepare_request_builder() -> ListConversationProfiles {
7193    ///   # panic!();
7194    ///   // ... details omitted ...
7195    /// }
7196    /// ```
7197    #[derive(Clone, Debug)]
7198    pub struct ListConversationProfiles(
7199        RequestBuilder<crate::model::ListConversationProfilesRequest>,
7200    );
7201
7202    impl ListConversationProfiles {
7203        pub(crate) fn new(
7204            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7205        ) -> Self {
7206            Self(RequestBuilder::new(stub))
7207        }
7208
7209        /// Sets the full request, replacing any prior values.
7210        pub fn with_request<V: Into<crate::model::ListConversationProfilesRequest>>(
7211            mut self,
7212            v: V,
7213        ) -> Self {
7214            self.0.request = v.into();
7215            self
7216        }
7217
7218        /// Sets all the options, replacing any prior values.
7219        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7220            self.0.options = v.into();
7221            self
7222        }
7223
7224        /// Sends the request.
7225        pub async fn send(self) -> Result<crate::model::ListConversationProfilesResponse> {
7226            (*self.0.stub)
7227                .list_conversation_profiles(self.0.request, self.0.options)
7228                .await
7229                .map(crate::Response::into_body)
7230        }
7231
7232        /// Streams each page in the collection.
7233        pub fn by_page(
7234            self,
7235        ) -> impl google_cloud_gax::paginator::Paginator<
7236            crate::model::ListConversationProfilesResponse,
7237            crate::Error,
7238        > {
7239            use std::clone::Clone;
7240            let token = self.0.request.page_token.clone();
7241            let execute = move |token: String| {
7242                let mut builder = self.clone();
7243                builder.0.request = builder.0.request.set_page_token(token);
7244                builder.send()
7245            };
7246            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7247        }
7248
7249        /// Streams each item in the collection.
7250        pub fn by_item(
7251            self,
7252        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7253            crate::model::ListConversationProfilesResponse,
7254            crate::Error,
7255        > {
7256            use google_cloud_gax::paginator::Paginator;
7257            self.by_page().items()
7258        }
7259
7260        /// Sets the value of [parent][crate::model::ListConversationProfilesRequest::parent].
7261        ///
7262        /// This is a **required** field for requests.
7263        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7264            self.0.request.parent = v.into();
7265            self
7266        }
7267
7268        /// Sets the value of [page_size][crate::model::ListConversationProfilesRequest::page_size].
7269        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7270            self.0.request.page_size = v.into();
7271            self
7272        }
7273
7274        /// Sets the value of [page_token][crate::model::ListConversationProfilesRequest::page_token].
7275        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7276            self.0.request.page_token = v.into();
7277            self
7278        }
7279    }
7280
7281    #[doc(hidden)]
7282    impl crate::RequestBuilder for ListConversationProfiles {
7283        fn request_options(&mut self) -> &mut crate::RequestOptions {
7284            &mut self.0.options
7285        }
7286    }
7287
7288    /// The request builder for [ConversationProfiles::get_conversation_profile][crate::client::ConversationProfiles::get_conversation_profile] calls.
7289    ///
7290    /// # Example
7291    /// ```
7292    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetConversationProfile;
7293    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7294    ///
7295    /// let builder = prepare_request_builder();
7296    /// let response = builder.send().await?;
7297    /// # Ok(()) }
7298    ///
7299    /// fn prepare_request_builder() -> GetConversationProfile {
7300    ///   # panic!();
7301    ///   // ... details omitted ...
7302    /// }
7303    /// ```
7304    #[derive(Clone, Debug)]
7305    pub struct GetConversationProfile(RequestBuilder<crate::model::GetConversationProfileRequest>);
7306
7307    impl GetConversationProfile {
7308        pub(crate) fn new(
7309            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7310        ) -> Self {
7311            Self(RequestBuilder::new(stub))
7312        }
7313
7314        /// Sets the full request, replacing any prior values.
7315        pub fn with_request<V: Into<crate::model::GetConversationProfileRequest>>(
7316            mut self,
7317            v: V,
7318        ) -> Self {
7319            self.0.request = v.into();
7320            self
7321        }
7322
7323        /// Sets all the options, replacing any prior values.
7324        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7325            self.0.options = v.into();
7326            self
7327        }
7328
7329        /// Sends the request.
7330        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7331            (*self.0.stub)
7332                .get_conversation_profile(self.0.request, self.0.options)
7333                .await
7334                .map(crate::Response::into_body)
7335        }
7336
7337        /// Sets the value of [name][crate::model::GetConversationProfileRequest::name].
7338        ///
7339        /// This is a **required** field for requests.
7340        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7341            self.0.request.name = v.into();
7342            self
7343        }
7344    }
7345
7346    #[doc(hidden)]
7347    impl crate::RequestBuilder for GetConversationProfile {
7348        fn request_options(&mut self) -> &mut crate::RequestOptions {
7349            &mut self.0.options
7350        }
7351    }
7352
7353    /// The request builder for [ConversationProfiles::create_conversation_profile][crate::client::ConversationProfiles::create_conversation_profile] calls.
7354    ///
7355    /// # Example
7356    /// ```
7357    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::CreateConversationProfile;
7358    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7359    ///
7360    /// let builder = prepare_request_builder();
7361    /// let response = builder.send().await?;
7362    /// # Ok(()) }
7363    ///
7364    /// fn prepare_request_builder() -> CreateConversationProfile {
7365    ///   # panic!();
7366    ///   // ... details omitted ...
7367    /// }
7368    /// ```
7369    #[derive(Clone, Debug)]
7370    pub struct CreateConversationProfile(
7371        RequestBuilder<crate::model::CreateConversationProfileRequest>,
7372    );
7373
7374    impl CreateConversationProfile {
7375        pub(crate) fn new(
7376            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7377        ) -> Self {
7378            Self(RequestBuilder::new(stub))
7379        }
7380
7381        /// Sets the full request, replacing any prior values.
7382        pub fn with_request<V: Into<crate::model::CreateConversationProfileRequest>>(
7383            mut self,
7384            v: V,
7385        ) -> Self {
7386            self.0.request = v.into();
7387            self
7388        }
7389
7390        /// Sets all the options, replacing any prior values.
7391        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7392            self.0.options = v.into();
7393            self
7394        }
7395
7396        /// Sends the request.
7397        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7398            (*self.0.stub)
7399                .create_conversation_profile(self.0.request, self.0.options)
7400                .await
7401                .map(crate::Response::into_body)
7402        }
7403
7404        /// Sets the value of [parent][crate::model::CreateConversationProfileRequest::parent].
7405        ///
7406        /// This is a **required** field for requests.
7407        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7408            self.0.request.parent = v.into();
7409            self
7410        }
7411
7412        /// Sets the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7413        ///
7414        /// This is a **required** field for requests.
7415        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7416        where
7417            T: std::convert::Into<crate::model::ConversationProfile>,
7418        {
7419            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7420            self
7421        }
7422
7423        /// Sets or clears the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7424        ///
7425        /// This is a **required** field for requests.
7426        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7427        where
7428            T: std::convert::Into<crate::model::ConversationProfile>,
7429        {
7430            self.0.request.conversation_profile = v.map(|x| x.into());
7431            self
7432        }
7433    }
7434
7435    #[doc(hidden)]
7436    impl crate::RequestBuilder for CreateConversationProfile {
7437        fn request_options(&mut self) -> &mut crate::RequestOptions {
7438            &mut self.0.options
7439        }
7440    }
7441
7442    /// The request builder for [ConversationProfiles::update_conversation_profile][crate::client::ConversationProfiles::update_conversation_profile] calls.
7443    ///
7444    /// # Example
7445    /// ```
7446    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::UpdateConversationProfile;
7447    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7448    ///
7449    /// let builder = prepare_request_builder();
7450    /// let response = builder.send().await?;
7451    /// # Ok(()) }
7452    ///
7453    /// fn prepare_request_builder() -> UpdateConversationProfile {
7454    ///   # panic!();
7455    ///   // ... details omitted ...
7456    /// }
7457    /// ```
7458    #[derive(Clone, Debug)]
7459    pub struct UpdateConversationProfile(
7460        RequestBuilder<crate::model::UpdateConversationProfileRequest>,
7461    );
7462
7463    impl UpdateConversationProfile {
7464        pub(crate) fn new(
7465            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7466        ) -> Self {
7467            Self(RequestBuilder::new(stub))
7468        }
7469
7470        /// Sets the full request, replacing any prior values.
7471        pub fn with_request<V: Into<crate::model::UpdateConversationProfileRequest>>(
7472            mut self,
7473            v: V,
7474        ) -> Self {
7475            self.0.request = v.into();
7476            self
7477        }
7478
7479        /// Sets all the options, replacing any prior values.
7480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7481            self.0.options = v.into();
7482            self
7483        }
7484
7485        /// Sends the request.
7486        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7487            (*self.0.stub)
7488                .update_conversation_profile(self.0.request, self.0.options)
7489                .await
7490                .map(crate::Response::into_body)
7491        }
7492
7493        /// Sets the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7494        ///
7495        /// This is a **required** field for requests.
7496        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7497        where
7498            T: std::convert::Into<crate::model::ConversationProfile>,
7499        {
7500            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7501            self
7502        }
7503
7504        /// Sets or clears the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7505        ///
7506        /// This is a **required** field for requests.
7507        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7508        where
7509            T: std::convert::Into<crate::model::ConversationProfile>,
7510        {
7511            self.0.request.conversation_profile = v.map(|x| x.into());
7512            self
7513        }
7514
7515        /// Sets the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7516        ///
7517        /// This is a **required** field for requests.
7518        pub fn set_update_mask<T>(mut self, v: T) -> Self
7519        where
7520            T: std::convert::Into<wkt::FieldMask>,
7521        {
7522            self.0.request.update_mask = std::option::Option::Some(v.into());
7523            self
7524        }
7525
7526        /// Sets or clears the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7527        ///
7528        /// This is a **required** field for requests.
7529        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7530        where
7531            T: std::convert::Into<wkt::FieldMask>,
7532        {
7533            self.0.request.update_mask = v.map(|x| x.into());
7534            self
7535        }
7536    }
7537
7538    #[doc(hidden)]
7539    impl crate::RequestBuilder for UpdateConversationProfile {
7540        fn request_options(&mut self) -> &mut crate::RequestOptions {
7541            &mut self.0.options
7542        }
7543    }
7544
7545    /// The request builder for [ConversationProfiles::delete_conversation_profile][crate::client::ConversationProfiles::delete_conversation_profile] calls.
7546    ///
7547    /// # Example
7548    /// ```
7549    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::DeleteConversationProfile;
7550    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7551    ///
7552    /// let builder = prepare_request_builder();
7553    /// let response = builder.send().await?;
7554    /// # Ok(()) }
7555    ///
7556    /// fn prepare_request_builder() -> DeleteConversationProfile {
7557    ///   # panic!();
7558    ///   // ... details omitted ...
7559    /// }
7560    /// ```
7561    #[derive(Clone, Debug)]
7562    pub struct DeleteConversationProfile(
7563        RequestBuilder<crate::model::DeleteConversationProfileRequest>,
7564    );
7565
7566    impl DeleteConversationProfile {
7567        pub(crate) fn new(
7568            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7569        ) -> Self {
7570            Self(RequestBuilder::new(stub))
7571        }
7572
7573        /// Sets the full request, replacing any prior values.
7574        pub fn with_request<V: Into<crate::model::DeleteConversationProfileRequest>>(
7575            mut self,
7576            v: V,
7577        ) -> Self {
7578            self.0.request = v.into();
7579            self
7580        }
7581
7582        /// Sets all the options, replacing any prior values.
7583        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7584            self.0.options = v.into();
7585            self
7586        }
7587
7588        /// Sends the request.
7589        pub async fn send(self) -> Result<()> {
7590            (*self.0.stub)
7591                .delete_conversation_profile(self.0.request, self.0.options)
7592                .await
7593                .map(crate::Response::into_body)
7594        }
7595
7596        /// Sets the value of [name][crate::model::DeleteConversationProfileRequest::name].
7597        ///
7598        /// This is a **required** field for requests.
7599        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7600            self.0.request.name = v.into();
7601            self
7602        }
7603    }
7604
7605    #[doc(hidden)]
7606    impl crate::RequestBuilder for DeleteConversationProfile {
7607        fn request_options(&mut self) -> &mut crate::RequestOptions {
7608            &mut self.0.options
7609        }
7610    }
7611
7612    /// The request builder for [ConversationProfiles::set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config] calls.
7613    ///
7614    /// # Example
7615    /// ```
7616    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::SetSuggestionFeatureConfig;
7617    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7618    /// use google_cloud_lro::Poller;
7619    ///
7620    /// let builder = prepare_request_builder();
7621    /// let response = builder.poller().until_done().await?;
7622    /// # Ok(()) }
7623    ///
7624    /// fn prepare_request_builder() -> SetSuggestionFeatureConfig {
7625    ///   # panic!();
7626    ///   // ... details omitted ...
7627    /// }
7628    /// ```
7629    #[derive(Clone, Debug)]
7630    pub struct SetSuggestionFeatureConfig(
7631        RequestBuilder<crate::model::SetSuggestionFeatureConfigRequest>,
7632    );
7633
7634    impl SetSuggestionFeatureConfig {
7635        pub(crate) fn new(
7636            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7637        ) -> Self {
7638            Self(RequestBuilder::new(stub))
7639        }
7640
7641        /// Sets the full request, replacing any prior values.
7642        pub fn with_request<V: Into<crate::model::SetSuggestionFeatureConfigRequest>>(
7643            mut self,
7644            v: V,
7645        ) -> Self {
7646            self.0.request = v.into();
7647            self
7648        }
7649
7650        /// Sets all the options, replacing any prior values.
7651        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7652            self.0.options = v.into();
7653            self
7654        }
7655
7656        /// Sends the request.
7657        ///
7658        /// # Long running operations
7659        ///
7660        /// This starts, but does not poll, a longrunning operation. More information
7661        /// on [set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config].
7662        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7663            (*self.0.stub)
7664                .set_suggestion_feature_config(self.0.request, self.0.options)
7665                .await
7666                .map(crate::Response::into_body)
7667        }
7668
7669        /// Creates a [Poller][google_cloud_lro::Poller] to work with `set_suggestion_feature_config`.
7670        pub fn poller(
7671            self,
7672        ) -> impl google_cloud_lro::Poller<
7673            crate::model::ConversationProfile,
7674            crate::model::SetSuggestionFeatureConfigOperationMetadata,
7675        > {
7676            type Operation = google_cloud_lro::internal::Operation<
7677                crate::model::ConversationProfile,
7678                crate::model::SetSuggestionFeatureConfigOperationMetadata,
7679            >;
7680            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7681            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7682
7683            let stub = self.0.stub.clone();
7684            let mut options = self.0.options.clone();
7685            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7686            let query = move |name| {
7687                let stub = stub.clone();
7688                let options = options.clone();
7689                async {
7690                    let op = GetOperation::new(stub)
7691                        .set_name(name)
7692                        .with_options(options)
7693                        .send()
7694                        .await?;
7695                    Ok(Operation::new(op))
7696                }
7697            };
7698
7699            let start = move || async {
7700                let op = self.send().await?;
7701                Ok(Operation::new(op))
7702            };
7703
7704            google_cloud_lro::internal::new_poller(
7705                polling_error_policy,
7706                polling_backoff_policy,
7707                start,
7708                query,
7709            )
7710        }
7711
7712        /// Sets the value of [conversation_profile][crate::model::SetSuggestionFeatureConfigRequest::conversation_profile].
7713        ///
7714        /// This is a **required** field for requests.
7715        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7716            self.0.request.conversation_profile = v.into();
7717            self
7718        }
7719
7720        /// Sets the value of [participant_role][crate::model::SetSuggestionFeatureConfigRequest::participant_role].
7721        ///
7722        /// This is a **required** field for requests.
7723        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7724            mut self,
7725            v: T,
7726        ) -> Self {
7727            self.0.request.participant_role = v.into();
7728            self
7729        }
7730
7731        /// Sets the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7732        ///
7733        /// This is a **required** field for requests.
7734        pub fn set_suggestion_feature_config<T>(mut self, v: T) -> Self
7735        where
7736            T: std::convert::Into<
7737                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7738                >,
7739        {
7740            self.0.request.suggestion_feature_config = std::option::Option::Some(v.into());
7741            self
7742        }
7743
7744        /// Sets or clears the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7745        ///
7746        /// This is a **required** field for requests.
7747        pub fn set_or_clear_suggestion_feature_config<T>(
7748            mut self,
7749            v: std::option::Option<T>,
7750        ) -> Self
7751        where
7752            T: std::convert::Into<
7753                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7754                >,
7755        {
7756            self.0.request.suggestion_feature_config = v.map(|x| x.into());
7757            self
7758        }
7759    }
7760
7761    #[doc(hidden)]
7762    impl crate::RequestBuilder for SetSuggestionFeatureConfig {
7763        fn request_options(&mut self) -> &mut crate::RequestOptions {
7764            &mut self.0.options
7765        }
7766    }
7767
7768    /// The request builder for [ConversationProfiles::clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config] calls.
7769    ///
7770    /// # Example
7771    /// ```
7772    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ClearSuggestionFeatureConfig;
7773    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7774    /// use google_cloud_lro::Poller;
7775    ///
7776    /// let builder = prepare_request_builder();
7777    /// let response = builder.poller().until_done().await?;
7778    /// # Ok(()) }
7779    ///
7780    /// fn prepare_request_builder() -> ClearSuggestionFeatureConfig {
7781    ///   # panic!();
7782    ///   // ... details omitted ...
7783    /// }
7784    /// ```
7785    #[derive(Clone, Debug)]
7786    pub struct ClearSuggestionFeatureConfig(
7787        RequestBuilder<crate::model::ClearSuggestionFeatureConfigRequest>,
7788    );
7789
7790    impl ClearSuggestionFeatureConfig {
7791        pub(crate) fn new(
7792            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7793        ) -> Self {
7794            Self(RequestBuilder::new(stub))
7795        }
7796
7797        /// Sets the full request, replacing any prior values.
7798        pub fn with_request<V: Into<crate::model::ClearSuggestionFeatureConfigRequest>>(
7799            mut self,
7800            v: V,
7801        ) -> Self {
7802            self.0.request = v.into();
7803            self
7804        }
7805
7806        /// Sets all the options, replacing any prior values.
7807        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7808            self.0.options = v.into();
7809            self
7810        }
7811
7812        /// Sends the request.
7813        ///
7814        /// # Long running operations
7815        ///
7816        /// This starts, but does not poll, a longrunning operation. More information
7817        /// on [clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config].
7818        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7819            (*self.0.stub)
7820                .clear_suggestion_feature_config(self.0.request, self.0.options)
7821                .await
7822                .map(crate::Response::into_body)
7823        }
7824
7825        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clear_suggestion_feature_config`.
7826        pub fn poller(
7827            self,
7828        ) -> impl google_cloud_lro::Poller<
7829            crate::model::ConversationProfile,
7830            crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7831        > {
7832            type Operation = google_cloud_lro::internal::Operation<
7833                crate::model::ConversationProfile,
7834                crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7835            >;
7836            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7837            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7838
7839            let stub = self.0.stub.clone();
7840            let mut options = self.0.options.clone();
7841            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7842            let query = move |name| {
7843                let stub = stub.clone();
7844                let options = options.clone();
7845                async {
7846                    let op = GetOperation::new(stub)
7847                        .set_name(name)
7848                        .with_options(options)
7849                        .send()
7850                        .await?;
7851                    Ok(Operation::new(op))
7852                }
7853            };
7854
7855            let start = move || async {
7856                let op = self.send().await?;
7857                Ok(Operation::new(op))
7858            };
7859
7860            google_cloud_lro::internal::new_poller(
7861                polling_error_policy,
7862                polling_backoff_policy,
7863                start,
7864                query,
7865            )
7866        }
7867
7868        /// Sets the value of [conversation_profile][crate::model::ClearSuggestionFeatureConfigRequest::conversation_profile].
7869        ///
7870        /// This is a **required** field for requests.
7871        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7872            self.0.request.conversation_profile = v.into();
7873            self
7874        }
7875
7876        /// Sets the value of [participant_role][crate::model::ClearSuggestionFeatureConfigRequest::participant_role].
7877        ///
7878        /// This is a **required** field for requests.
7879        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7880            mut self,
7881            v: T,
7882        ) -> Self {
7883            self.0.request.participant_role = v.into();
7884            self
7885        }
7886
7887        /// Sets the value of [suggestion_feature_type][crate::model::ClearSuggestionFeatureConfigRequest::suggestion_feature_type].
7888        ///
7889        /// This is a **required** field for requests.
7890        pub fn set_suggestion_feature_type<T: Into<crate::model::suggestion_feature::Type>>(
7891            mut self,
7892            v: T,
7893        ) -> Self {
7894            self.0.request.suggestion_feature_type = v.into();
7895            self
7896        }
7897    }
7898
7899    #[doc(hidden)]
7900    impl crate::RequestBuilder for ClearSuggestionFeatureConfig {
7901        fn request_options(&mut self) -> &mut crate::RequestOptions {
7902            &mut self.0.options
7903        }
7904    }
7905
7906    /// The request builder for [ConversationProfiles::list_locations][crate::client::ConversationProfiles::list_locations] calls.
7907    ///
7908    /// # Example
7909    /// ```
7910    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListLocations;
7911    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7912    /// use google_cloud_gax::paginator::ItemPaginator;
7913    ///
7914    /// let builder = prepare_request_builder();
7915    /// let mut items = builder.by_item();
7916    /// while let Some(result) = items.next().await {
7917    ///   let item = result?;
7918    /// }
7919    /// # Ok(()) }
7920    ///
7921    /// fn prepare_request_builder() -> ListLocations {
7922    ///   # panic!();
7923    ///   // ... details omitted ...
7924    /// }
7925    /// ```
7926    #[derive(Clone, Debug)]
7927    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7928
7929    impl ListLocations {
7930        pub(crate) fn new(
7931            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7932        ) -> Self {
7933            Self(RequestBuilder::new(stub))
7934        }
7935
7936        /// Sets the full request, replacing any prior values.
7937        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7938            mut self,
7939            v: V,
7940        ) -> Self {
7941            self.0.request = v.into();
7942            self
7943        }
7944
7945        /// Sets all the options, replacing any prior values.
7946        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7947            self.0.options = v.into();
7948            self
7949        }
7950
7951        /// Sends the request.
7952        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7953            (*self.0.stub)
7954                .list_locations(self.0.request, self.0.options)
7955                .await
7956                .map(crate::Response::into_body)
7957        }
7958
7959        /// Streams each page in the collection.
7960        pub fn by_page(
7961            self,
7962        ) -> impl google_cloud_gax::paginator::Paginator<
7963            google_cloud_location::model::ListLocationsResponse,
7964            crate::Error,
7965        > {
7966            use std::clone::Clone;
7967            let token = self.0.request.page_token.clone();
7968            let execute = move |token: String| {
7969                let mut builder = self.clone();
7970                builder.0.request = builder.0.request.set_page_token(token);
7971                builder.send()
7972            };
7973            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7974        }
7975
7976        /// Streams each item in the collection.
7977        pub fn by_item(
7978            self,
7979        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7980            google_cloud_location::model::ListLocationsResponse,
7981            crate::Error,
7982        > {
7983            use google_cloud_gax::paginator::Paginator;
7984            self.by_page().items()
7985        }
7986
7987        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
7988        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7989            self.0.request.name = v.into();
7990            self
7991        }
7992
7993        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
7994        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7995            self.0.request.filter = v.into();
7996            self
7997        }
7998
7999        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
8000        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8001            self.0.request.page_size = v.into();
8002            self
8003        }
8004
8005        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
8006        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8007            self.0.request.page_token = v.into();
8008            self
8009        }
8010    }
8011
8012    #[doc(hidden)]
8013    impl crate::RequestBuilder for ListLocations {
8014        fn request_options(&mut self) -> &mut crate::RequestOptions {
8015            &mut self.0.options
8016        }
8017    }
8018
8019    /// The request builder for [ConversationProfiles::get_location][crate::client::ConversationProfiles::get_location] calls.
8020    ///
8021    /// # Example
8022    /// ```
8023    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetLocation;
8024    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8025    ///
8026    /// let builder = prepare_request_builder();
8027    /// let response = builder.send().await?;
8028    /// # Ok(()) }
8029    ///
8030    /// fn prepare_request_builder() -> GetLocation {
8031    ///   # panic!();
8032    ///   // ... details omitted ...
8033    /// }
8034    /// ```
8035    #[derive(Clone, Debug)]
8036    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8037
8038    impl GetLocation {
8039        pub(crate) fn new(
8040            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8041        ) -> Self {
8042            Self(RequestBuilder::new(stub))
8043        }
8044
8045        /// Sets the full request, replacing any prior values.
8046        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8047            mut self,
8048            v: V,
8049        ) -> Self {
8050            self.0.request = v.into();
8051            self
8052        }
8053
8054        /// Sets all the options, replacing any prior values.
8055        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8056            self.0.options = v.into();
8057            self
8058        }
8059
8060        /// Sends the request.
8061        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8062            (*self.0.stub)
8063                .get_location(self.0.request, self.0.options)
8064                .await
8065                .map(crate::Response::into_body)
8066        }
8067
8068        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
8069        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8070            self.0.request.name = v.into();
8071            self
8072        }
8073    }
8074
8075    #[doc(hidden)]
8076    impl crate::RequestBuilder for GetLocation {
8077        fn request_options(&mut self) -> &mut crate::RequestOptions {
8078            &mut self.0.options
8079        }
8080    }
8081
8082    /// The request builder for [ConversationProfiles::list_operations][crate::client::ConversationProfiles::list_operations] calls.
8083    ///
8084    /// # Example
8085    /// ```
8086    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListOperations;
8087    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8088    /// use google_cloud_gax::paginator::ItemPaginator;
8089    ///
8090    /// let builder = prepare_request_builder();
8091    /// let mut items = builder.by_item();
8092    /// while let Some(result) = items.next().await {
8093    ///   let item = result?;
8094    /// }
8095    /// # Ok(()) }
8096    ///
8097    /// fn prepare_request_builder() -> ListOperations {
8098    ///   # panic!();
8099    ///   // ... details omitted ...
8100    /// }
8101    /// ```
8102    #[derive(Clone, Debug)]
8103    pub struct ListOperations(
8104        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8105    );
8106
8107    impl ListOperations {
8108        pub(crate) fn new(
8109            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8110        ) -> Self {
8111            Self(RequestBuilder::new(stub))
8112        }
8113
8114        /// Sets the full request, replacing any prior values.
8115        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8116            mut self,
8117            v: V,
8118        ) -> Self {
8119            self.0.request = v.into();
8120            self
8121        }
8122
8123        /// Sets all the options, replacing any prior values.
8124        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8125            self.0.options = v.into();
8126            self
8127        }
8128
8129        /// Sends the request.
8130        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8131            (*self.0.stub)
8132                .list_operations(self.0.request, self.0.options)
8133                .await
8134                .map(crate::Response::into_body)
8135        }
8136
8137        /// Streams each page in the collection.
8138        pub fn by_page(
8139            self,
8140        ) -> impl google_cloud_gax::paginator::Paginator<
8141            google_cloud_longrunning::model::ListOperationsResponse,
8142            crate::Error,
8143        > {
8144            use std::clone::Clone;
8145            let token = self.0.request.page_token.clone();
8146            let execute = move |token: String| {
8147                let mut builder = self.clone();
8148                builder.0.request = builder.0.request.set_page_token(token);
8149                builder.send()
8150            };
8151            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8152        }
8153
8154        /// Streams each item in the collection.
8155        pub fn by_item(
8156            self,
8157        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8158            google_cloud_longrunning::model::ListOperationsResponse,
8159            crate::Error,
8160        > {
8161            use google_cloud_gax::paginator::Paginator;
8162            self.by_page().items()
8163        }
8164
8165        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
8166        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8167            self.0.request.name = v.into();
8168            self
8169        }
8170
8171        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
8172        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8173            self.0.request.filter = v.into();
8174            self
8175        }
8176
8177        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
8178        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8179            self.0.request.page_size = v.into();
8180            self
8181        }
8182
8183        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
8184        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8185            self.0.request.page_token = v.into();
8186            self
8187        }
8188
8189        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
8190        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8191            self.0.request.return_partial_success = v.into();
8192            self
8193        }
8194    }
8195
8196    #[doc(hidden)]
8197    impl crate::RequestBuilder for ListOperations {
8198        fn request_options(&mut self) -> &mut crate::RequestOptions {
8199            &mut self.0.options
8200        }
8201    }
8202
8203    /// The request builder for [ConversationProfiles::get_operation][crate::client::ConversationProfiles::get_operation] calls.
8204    ///
8205    /// # Example
8206    /// ```
8207    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetOperation;
8208    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8209    ///
8210    /// let builder = prepare_request_builder();
8211    /// let response = builder.send().await?;
8212    /// # Ok(()) }
8213    ///
8214    /// fn prepare_request_builder() -> GetOperation {
8215    ///   # panic!();
8216    ///   // ... details omitted ...
8217    /// }
8218    /// ```
8219    #[derive(Clone, Debug)]
8220    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8221
8222    impl GetOperation {
8223        pub(crate) fn new(
8224            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8225        ) -> Self {
8226            Self(RequestBuilder::new(stub))
8227        }
8228
8229        /// Sets the full request, replacing any prior values.
8230        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8231            mut self,
8232            v: V,
8233        ) -> Self {
8234            self.0.request = v.into();
8235            self
8236        }
8237
8238        /// Sets all the options, replacing any prior values.
8239        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8240            self.0.options = v.into();
8241            self
8242        }
8243
8244        /// Sends the request.
8245        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8246            (*self.0.stub)
8247                .get_operation(self.0.request, self.0.options)
8248                .await
8249                .map(crate::Response::into_body)
8250        }
8251
8252        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
8253        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8254            self.0.request.name = v.into();
8255            self
8256        }
8257    }
8258
8259    #[doc(hidden)]
8260    impl crate::RequestBuilder for GetOperation {
8261        fn request_options(&mut self) -> &mut crate::RequestOptions {
8262            &mut self.0.options
8263        }
8264    }
8265
8266    /// The request builder for [ConversationProfiles::cancel_operation][crate::client::ConversationProfiles::cancel_operation] calls.
8267    ///
8268    /// # Example
8269    /// ```
8270    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::CancelOperation;
8271    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8272    ///
8273    /// let builder = prepare_request_builder();
8274    /// let response = builder.send().await?;
8275    /// # Ok(()) }
8276    ///
8277    /// fn prepare_request_builder() -> CancelOperation {
8278    ///   # panic!();
8279    ///   // ... details omitted ...
8280    /// }
8281    /// ```
8282    #[derive(Clone, Debug)]
8283    pub struct CancelOperation(
8284        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8285    );
8286
8287    impl CancelOperation {
8288        pub(crate) fn new(
8289            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8290        ) -> Self {
8291            Self(RequestBuilder::new(stub))
8292        }
8293
8294        /// Sets the full request, replacing any prior values.
8295        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8296            mut self,
8297            v: V,
8298        ) -> Self {
8299            self.0.request = v.into();
8300            self
8301        }
8302
8303        /// Sets all the options, replacing any prior values.
8304        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8305            self.0.options = v.into();
8306            self
8307        }
8308
8309        /// Sends the request.
8310        pub async fn send(self) -> Result<()> {
8311            (*self.0.stub)
8312                .cancel_operation(self.0.request, self.0.options)
8313                .await
8314                .map(crate::Response::into_body)
8315        }
8316
8317        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
8318        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8319            self.0.request.name = v.into();
8320            self
8321        }
8322    }
8323
8324    #[doc(hidden)]
8325    impl crate::RequestBuilder for CancelOperation {
8326        fn request_options(&mut self) -> &mut crate::RequestOptions {
8327            &mut self.0.options
8328        }
8329    }
8330}
8331
8332/// Request and client builders for [Documents][crate::client::Documents].
8333#[cfg(feature = "documents")]
8334#[cfg_attr(docsrs, doc(cfg(feature = "documents")))]
8335pub mod documents {
8336    use crate::Result;
8337
8338    /// A builder for [Documents][crate::client::Documents].
8339    ///
8340    /// ```
8341    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8342    /// # use google_cloud_dialogflow_v2::*;
8343    /// # use builder::documents::ClientBuilder;
8344    /// # use client::Documents;
8345    /// let builder : ClientBuilder = Documents::builder();
8346    /// let client = builder
8347    ///     .with_endpoint("https://dialogflow.googleapis.com")
8348    ///     .build().await?;
8349    /// # Ok(()) }
8350    /// ```
8351    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8352
8353    pub(crate) mod client {
8354        use super::super::super::client::Documents;
8355        pub struct Factory;
8356        impl crate::ClientFactory for Factory {
8357            type Client = Documents;
8358            type Credentials = gaxi::options::Credentials;
8359            async fn build(
8360                self,
8361                config: gaxi::options::ClientConfig,
8362            ) -> crate::ClientBuilderResult<Self::Client> {
8363                Self::Client::new(config).await
8364            }
8365        }
8366    }
8367
8368    /// Common implementation for [crate::client::Documents] request builders.
8369    #[derive(Clone, Debug)]
8370    pub(crate) struct RequestBuilder<R: std::default::Default> {
8371        stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8372        request: R,
8373        options: crate::RequestOptions,
8374    }
8375
8376    impl<R> RequestBuilder<R>
8377    where
8378        R: std::default::Default,
8379    {
8380        pub(crate) fn new(
8381            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8382        ) -> Self {
8383            Self {
8384                stub,
8385                request: R::default(),
8386                options: crate::RequestOptions::default(),
8387            }
8388        }
8389    }
8390
8391    /// The request builder for [Documents::list_documents][crate::client::Documents::list_documents] calls.
8392    ///
8393    /// # Example
8394    /// ```
8395    /// # use google_cloud_dialogflow_v2::builder::documents::ListDocuments;
8396    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8397    /// use google_cloud_gax::paginator::ItemPaginator;
8398    ///
8399    /// let builder = prepare_request_builder();
8400    /// let mut items = builder.by_item();
8401    /// while let Some(result) = items.next().await {
8402    ///   let item = result?;
8403    /// }
8404    /// # Ok(()) }
8405    ///
8406    /// fn prepare_request_builder() -> ListDocuments {
8407    ///   # panic!();
8408    ///   // ... details omitted ...
8409    /// }
8410    /// ```
8411    #[derive(Clone, Debug)]
8412    pub struct ListDocuments(RequestBuilder<crate::model::ListDocumentsRequest>);
8413
8414    impl ListDocuments {
8415        pub(crate) fn new(
8416            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8417        ) -> Self {
8418            Self(RequestBuilder::new(stub))
8419        }
8420
8421        /// Sets the full request, replacing any prior values.
8422        pub fn with_request<V: Into<crate::model::ListDocumentsRequest>>(mut self, v: V) -> Self {
8423            self.0.request = v.into();
8424            self
8425        }
8426
8427        /// Sets all the options, replacing any prior values.
8428        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8429            self.0.options = v.into();
8430            self
8431        }
8432
8433        /// Sends the request.
8434        pub async fn send(self) -> Result<crate::model::ListDocumentsResponse> {
8435            (*self.0.stub)
8436                .list_documents(self.0.request, self.0.options)
8437                .await
8438                .map(crate::Response::into_body)
8439        }
8440
8441        /// Streams each page in the collection.
8442        pub fn by_page(
8443            self,
8444        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDocumentsResponse, crate::Error>
8445        {
8446            use std::clone::Clone;
8447            let token = self.0.request.page_token.clone();
8448            let execute = move |token: String| {
8449                let mut builder = self.clone();
8450                builder.0.request = builder.0.request.set_page_token(token);
8451                builder.send()
8452            };
8453            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8454        }
8455
8456        /// Streams each item in the collection.
8457        pub fn by_item(
8458            self,
8459        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8460            crate::model::ListDocumentsResponse,
8461            crate::Error,
8462        > {
8463            use google_cloud_gax::paginator::Paginator;
8464            self.by_page().items()
8465        }
8466
8467        /// Sets the value of [parent][crate::model::ListDocumentsRequest::parent].
8468        ///
8469        /// This is a **required** field for requests.
8470        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8471            self.0.request.parent = v.into();
8472            self
8473        }
8474
8475        /// Sets the value of [page_size][crate::model::ListDocumentsRequest::page_size].
8476        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8477            self.0.request.page_size = v.into();
8478            self
8479        }
8480
8481        /// Sets the value of [page_token][crate::model::ListDocumentsRequest::page_token].
8482        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8483            self.0.request.page_token = v.into();
8484            self
8485        }
8486
8487        /// Sets the value of [filter][crate::model::ListDocumentsRequest::filter].
8488        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8489            self.0.request.filter = v.into();
8490            self
8491        }
8492    }
8493
8494    #[doc(hidden)]
8495    impl crate::RequestBuilder for ListDocuments {
8496        fn request_options(&mut self) -> &mut crate::RequestOptions {
8497            &mut self.0.options
8498        }
8499    }
8500
8501    /// The request builder for [Documents::get_document][crate::client::Documents::get_document] calls.
8502    ///
8503    /// # Example
8504    /// ```
8505    /// # use google_cloud_dialogflow_v2::builder::documents::GetDocument;
8506    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8507    ///
8508    /// let builder = prepare_request_builder();
8509    /// let response = builder.send().await?;
8510    /// # Ok(()) }
8511    ///
8512    /// fn prepare_request_builder() -> GetDocument {
8513    ///   # panic!();
8514    ///   // ... details omitted ...
8515    /// }
8516    /// ```
8517    #[derive(Clone, Debug)]
8518    pub struct GetDocument(RequestBuilder<crate::model::GetDocumentRequest>);
8519
8520    impl GetDocument {
8521        pub(crate) fn new(
8522            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8523        ) -> Self {
8524            Self(RequestBuilder::new(stub))
8525        }
8526
8527        /// Sets the full request, replacing any prior values.
8528        pub fn with_request<V: Into<crate::model::GetDocumentRequest>>(mut self, v: V) -> Self {
8529            self.0.request = v.into();
8530            self
8531        }
8532
8533        /// Sets all the options, replacing any prior values.
8534        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8535            self.0.options = v.into();
8536            self
8537        }
8538
8539        /// Sends the request.
8540        pub async fn send(self) -> Result<crate::model::Document> {
8541            (*self.0.stub)
8542                .get_document(self.0.request, self.0.options)
8543                .await
8544                .map(crate::Response::into_body)
8545        }
8546
8547        /// Sets the value of [name][crate::model::GetDocumentRequest::name].
8548        ///
8549        /// This is a **required** field for requests.
8550        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8551            self.0.request.name = v.into();
8552            self
8553        }
8554    }
8555
8556    #[doc(hidden)]
8557    impl crate::RequestBuilder for GetDocument {
8558        fn request_options(&mut self) -> &mut crate::RequestOptions {
8559            &mut self.0.options
8560        }
8561    }
8562
8563    /// The request builder for [Documents::create_document][crate::client::Documents::create_document] calls.
8564    ///
8565    /// # Example
8566    /// ```
8567    /// # use google_cloud_dialogflow_v2::builder::documents::CreateDocument;
8568    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8569    /// use google_cloud_lro::Poller;
8570    ///
8571    /// let builder = prepare_request_builder();
8572    /// let response = builder.poller().until_done().await?;
8573    /// # Ok(()) }
8574    ///
8575    /// fn prepare_request_builder() -> CreateDocument {
8576    ///   # panic!();
8577    ///   // ... details omitted ...
8578    /// }
8579    /// ```
8580    #[derive(Clone, Debug)]
8581    pub struct CreateDocument(RequestBuilder<crate::model::CreateDocumentRequest>);
8582
8583    impl CreateDocument {
8584        pub(crate) fn new(
8585            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8586        ) -> Self {
8587            Self(RequestBuilder::new(stub))
8588        }
8589
8590        /// Sets the full request, replacing any prior values.
8591        pub fn with_request<V: Into<crate::model::CreateDocumentRequest>>(mut self, v: V) -> Self {
8592            self.0.request = v.into();
8593            self
8594        }
8595
8596        /// Sets all the options, replacing any prior values.
8597        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8598            self.0.options = v.into();
8599            self
8600        }
8601
8602        /// Sends the request.
8603        ///
8604        /// # Long running operations
8605        ///
8606        /// This starts, but does not poll, a longrunning operation. More information
8607        /// on [create_document][crate::client::Documents::create_document].
8608        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8609            (*self.0.stub)
8610                .create_document(self.0.request, self.0.options)
8611                .await
8612                .map(crate::Response::into_body)
8613        }
8614
8615        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_document`.
8616        pub fn poller(
8617            self,
8618        ) -> impl google_cloud_lro::Poller<
8619            crate::model::Document,
8620            crate::model::KnowledgeOperationMetadata,
8621        > {
8622            type Operation = google_cloud_lro::internal::Operation<
8623                crate::model::Document,
8624                crate::model::KnowledgeOperationMetadata,
8625            >;
8626            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8627            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8628
8629            let stub = self.0.stub.clone();
8630            let mut options = self.0.options.clone();
8631            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8632            let query = move |name| {
8633                let stub = stub.clone();
8634                let options = options.clone();
8635                async {
8636                    let op = GetOperation::new(stub)
8637                        .set_name(name)
8638                        .with_options(options)
8639                        .send()
8640                        .await?;
8641                    Ok(Operation::new(op))
8642                }
8643            };
8644
8645            let start = move || async {
8646                let op = self.send().await?;
8647                Ok(Operation::new(op))
8648            };
8649
8650            google_cloud_lro::internal::new_poller(
8651                polling_error_policy,
8652                polling_backoff_policy,
8653                start,
8654                query,
8655            )
8656        }
8657
8658        /// Sets the value of [parent][crate::model::CreateDocumentRequest::parent].
8659        ///
8660        /// This is a **required** field for requests.
8661        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8662            self.0.request.parent = v.into();
8663            self
8664        }
8665
8666        /// Sets the value of [document][crate::model::CreateDocumentRequest::document].
8667        ///
8668        /// This is a **required** field for requests.
8669        pub fn set_document<T>(mut self, v: T) -> Self
8670        where
8671            T: std::convert::Into<crate::model::Document>,
8672        {
8673            self.0.request.document = std::option::Option::Some(v.into());
8674            self
8675        }
8676
8677        /// Sets or clears the value of [document][crate::model::CreateDocumentRequest::document].
8678        ///
8679        /// This is a **required** field for requests.
8680        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
8681        where
8682            T: std::convert::Into<crate::model::Document>,
8683        {
8684            self.0.request.document = v.map(|x| x.into());
8685            self
8686        }
8687    }
8688
8689    #[doc(hidden)]
8690    impl crate::RequestBuilder for CreateDocument {
8691        fn request_options(&mut self) -> &mut crate::RequestOptions {
8692            &mut self.0.options
8693        }
8694    }
8695
8696    /// The request builder for [Documents::import_documents][crate::client::Documents::import_documents] calls.
8697    ///
8698    /// # Example
8699    /// ```
8700    /// # use google_cloud_dialogflow_v2::builder::documents::ImportDocuments;
8701    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8702    /// use google_cloud_lro::Poller;
8703    ///
8704    /// let builder = prepare_request_builder();
8705    /// let response = builder.poller().until_done().await?;
8706    /// # Ok(()) }
8707    ///
8708    /// fn prepare_request_builder() -> ImportDocuments {
8709    ///   # panic!();
8710    ///   // ... details omitted ...
8711    /// }
8712    /// ```
8713    #[derive(Clone, Debug)]
8714    pub struct ImportDocuments(RequestBuilder<crate::model::ImportDocumentsRequest>);
8715
8716    impl ImportDocuments {
8717        pub(crate) fn new(
8718            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8719        ) -> Self {
8720            Self(RequestBuilder::new(stub))
8721        }
8722
8723        /// Sets the full request, replacing any prior values.
8724        pub fn with_request<V: Into<crate::model::ImportDocumentsRequest>>(mut self, v: V) -> Self {
8725            self.0.request = v.into();
8726            self
8727        }
8728
8729        /// Sets all the options, replacing any prior values.
8730        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8731            self.0.options = v.into();
8732            self
8733        }
8734
8735        /// Sends the request.
8736        ///
8737        /// # Long running operations
8738        ///
8739        /// This starts, but does not poll, a longrunning operation. More information
8740        /// on [import_documents][crate::client::Documents::import_documents].
8741        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8742            (*self.0.stub)
8743                .import_documents(self.0.request, self.0.options)
8744                .await
8745                .map(crate::Response::into_body)
8746        }
8747
8748        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_documents`.
8749        pub fn poller(
8750            self,
8751        ) -> impl google_cloud_lro::Poller<
8752            crate::model::ImportDocumentsResponse,
8753            crate::model::KnowledgeOperationMetadata,
8754        > {
8755            type Operation = google_cloud_lro::internal::Operation<
8756                crate::model::ImportDocumentsResponse,
8757                crate::model::KnowledgeOperationMetadata,
8758            >;
8759            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8760            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8761
8762            let stub = self.0.stub.clone();
8763            let mut options = self.0.options.clone();
8764            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8765            let query = move |name| {
8766                let stub = stub.clone();
8767                let options = options.clone();
8768                async {
8769                    let op = GetOperation::new(stub)
8770                        .set_name(name)
8771                        .with_options(options)
8772                        .send()
8773                        .await?;
8774                    Ok(Operation::new(op))
8775                }
8776            };
8777
8778            let start = move || async {
8779                let op = self.send().await?;
8780                Ok(Operation::new(op))
8781            };
8782
8783            google_cloud_lro::internal::new_poller(
8784                polling_error_policy,
8785                polling_backoff_policy,
8786                start,
8787                query,
8788            )
8789        }
8790
8791        /// Sets the value of [parent][crate::model::ImportDocumentsRequest::parent].
8792        ///
8793        /// This is a **required** field for requests.
8794        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8795            self.0.request.parent = v.into();
8796            self
8797        }
8798
8799        /// Sets the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8800        ///
8801        /// This is a **required** field for requests.
8802        pub fn set_document_template<T>(mut self, v: T) -> Self
8803        where
8804            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8805        {
8806            self.0.request.document_template = std::option::Option::Some(v.into());
8807            self
8808        }
8809
8810        /// Sets or clears the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8811        ///
8812        /// This is a **required** field for requests.
8813        pub fn set_or_clear_document_template<T>(mut self, v: std::option::Option<T>) -> Self
8814        where
8815            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8816        {
8817            self.0.request.document_template = v.map(|x| x.into());
8818            self
8819        }
8820
8821        /// Sets the value of [import_gcs_custom_metadata][crate::model::ImportDocumentsRequest::import_gcs_custom_metadata].
8822        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
8823            self.0.request.import_gcs_custom_metadata = v.into();
8824            self
8825        }
8826
8827        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source].
8828        ///
8829        /// Note that all the setters affecting `source` are
8830        /// mutually exclusive.
8831        pub fn set_source<T: Into<Option<crate::model::import_documents_request::Source>>>(
8832            mut self,
8833            v: T,
8834        ) -> Self {
8835            self.0.request.source = v.into();
8836            self
8837        }
8838
8839        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source]
8840        /// to hold a `GcsSource`.
8841        ///
8842        /// Note that all the setters affecting `source` are
8843        /// mutually exclusive.
8844        pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSources>>>(
8845            mut self,
8846            v: T,
8847        ) -> Self {
8848            self.0.request = self.0.request.set_gcs_source(v);
8849            self
8850        }
8851    }
8852
8853    #[doc(hidden)]
8854    impl crate::RequestBuilder for ImportDocuments {
8855        fn request_options(&mut self) -> &mut crate::RequestOptions {
8856            &mut self.0.options
8857        }
8858    }
8859
8860    /// The request builder for [Documents::delete_document][crate::client::Documents::delete_document] calls.
8861    ///
8862    /// # Example
8863    /// ```
8864    /// # use google_cloud_dialogflow_v2::builder::documents::DeleteDocument;
8865    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8866    /// use google_cloud_lro::Poller;
8867    ///
8868    /// let builder = prepare_request_builder();
8869    /// let response = builder.poller().until_done().await?;
8870    /// # Ok(()) }
8871    ///
8872    /// fn prepare_request_builder() -> DeleteDocument {
8873    ///   # panic!();
8874    ///   // ... details omitted ...
8875    /// }
8876    /// ```
8877    #[derive(Clone, Debug)]
8878    pub struct DeleteDocument(RequestBuilder<crate::model::DeleteDocumentRequest>);
8879
8880    impl DeleteDocument {
8881        pub(crate) fn new(
8882            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8883        ) -> Self {
8884            Self(RequestBuilder::new(stub))
8885        }
8886
8887        /// Sets the full request, replacing any prior values.
8888        pub fn with_request<V: Into<crate::model::DeleteDocumentRequest>>(mut self, v: V) -> Self {
8889            self.0.request = v.into();
8890            self
8891        }
8892
8893        /// Sets all the options, replacing any prior values.
8894        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8895            self.0.options = v.into();
8896            self
8897        }
8898
8899        /// Sends the request.
8900        ///
8901        /// # Long running operations
8902        ///
8903        /// This starts, but does not poll, a longrunning operation. More information
8904        /// on [delete_document][crate::client::Documents::delete_document].
8905        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8906            (*self.0.stub)
8907                .delete_document(self.0.request, self.0.options)
8908                .await
8909                .map(crate::Response::into_body)
8910        }
8911
8912        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_document`.
8913        pub fn poller(
8914            self,
8915        ) -> impl google_cloud_lro::Poller<(), crate::model::KnowledgeOperationMetadata> {
8916            type Operation = google_cloud_lro::internal::Operation<
8917                wkt::Empty,
8918                crate::model::KnowledgeOperationMetadata,
8919            >;
8920            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8921            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8922
8923            let stub = self.0.stub.clone();
8924            let mut options = self.0.options.clone();
8925            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8926            let query = move |name| {
8927                let stub = stub.clone();
8928                let options = options.clone();
8929                async {
8930                    let op = GetOperation::new(stub)
8931                        .set_name(name)
8932                        .with_options(options)
8933                        .send()
8934                        .await?;
8935                    Ok(Operation::new(op))
8936                }
8937            };
8938
8939            let start = move || async {
8940                let op = self.send().await?;
8941                Ok(Operation::new(op))
8942            };
8943
8944            google_cloud_lro::internal::new_unit_response_poller(
8945                polling_error_policy,
8946                polling_backoff_policy,
8947                start,
8948                query,
8949            )
8950        }
8951
8952        /// Sets the value of [name][crate::model::DeleteDocumentRequest::name].
8953        ///
8954        /// This is a **required** field for requests.
8955        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8956            self.0.request.name = v.into();
8957            self
8958        }
8959    }
8960
8961    #[doc(hidden)]
8962    impl crate::RequestBuilder for DeleteDocument {
8963        fn request_options(&mut self) -> &mut crate::RequestOptions {
8964            &mut self.0.options
8965        }
8966    }
8967
8968    /// The request builder for [Documents::update_document][crate::client::Documents::update_document] calls.
8969    ///
8970    /// # Example
8971    /// ```
8972    /// # use google_cloud_dialogflow_v2::builder::documents::UpdateDocument;
8973    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8974    /// use google_cloud_lro::Poller;
8975    ///
8976    /// let builder = prepare_request_builder();
8977    /// let response = builder.poller().until_done().await?;
8978    /// # Ok(()) }
8979    ///
8980    /// fn prepare_request_builder() -> UpdateDocument {
8981    ///   # panic!();
8982    ///   // ... details omitted ...
8983    /// }
8984    /// ```
8985    #[derive(Clone, Debug)]
8986    pub struct UpdateDocument(RequestBuilder<crate::model::UpdateDocumentRequest>);
8987
8988    impl UpdateDocument {
8989        pub(crate) fn new(
8990            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8991        ) -> Self {
8992            Self(RequestBuilder::new(stub))
8993        }
8994
8995        /// Sets the full request, replacing any prior values.
8996        pub fn with_request<V: Into<crate::model::UpdateDocumentRequest>>(mut self, v: V) -> Self {
8997            self.0.request = v.into();
8998            self
8999        }
9000
9001        /// Sets all the options, replacing any prior values.
9002        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9003            self.0.options = v.into();
9004            self
9005        }
9006
9007        /// Sends the request.
9008        ///
9009        /// # Long running operations
9010        ///
9011        /// This starts, but does not poll, a longrunning operation. More information
9012        /// on [update_document][crate::client::Documents::update_document].
9013        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9014            (*self.0.stub)
9015                .update_document(self.0.request, self.0.options)
9016                .await
9017                .map(crate::Response::into_body)
9018        }
9019
9020        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_document`.
9021        pub fn poller(
9022            self,
9023        ) -> impl google_cloud_lro::Poller<
9024            crate::model::Document,
9025            crate::model::KnowledgeOperationMetadata,
9026        > {
9027            type Operation = google_cloud_lro::internal::Operation<
9028                crate::model::Document,
9029                crate::model::KnowledgeOperationMetadata,
9030            >;
9031            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9032            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9033
9034            let stub = self.0.stub.clone();
9035            let mut options = self.0.options.clone();
9036            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9037            let query = move |name| {
9038                let stub = stub.clone();
9039                let options = options.clone();
9040                async {
9041                    let op = GetOperation::new(stub)
9042                        .set_name(name)
9043                        .with_options(options)
9044                        .send()
9045                        .await?;
9046                    Ok(Operation::new(op))
9047                }
9048            };
9049
9050            let start = move || async {
9051                let op = self.send().await?;
9052                Ok(Operation::new(op))
9053            };
9054
9055            google_cloud_lro::internal::new_poller(
9056                polling_error_policy,
9057                polling_backoff_policy,
9058                start,
9059                query,
9060            )
9061        }
9062
9063        /// Sets the value of [document][crate::model::UpdateDocumentRequest::document].
9064        ///
9065        /// This is a **required** field for requests.
9066        pub fn set_document<T>(mut self, v: T) -> Self
9067        where
9068            T: std::convert::Into<crate::model::Document>,
9069        {
9070            self.0.request.document = std::option::Option::Some(v.into());
9071            self
9072        }
9073
9074        /// Sets or clears the value of [document][crate::model::UpdateDocumentRequest::document].
9075        ///
9076        /// This is a **required** field for requests.
9077        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
9078        where
9079            T: std::convert::Into<crate::model::Document>,
9080        {
9081            self.0.request.document = v.map(|x| x.into());
9082            self
9083        }
9084
9085        /// Sets the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
9086        pub fn set_update_mask<T>(mut self, v: T) -> Self
9087        where
9088            T: std::convert::Into<wkt::FieldMask>,
9089        {
9090            self.0.request.update_mask = std::option::Option::Some(v.into());
9091            self
9092        }
9093
9094        /// Sets or clears the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
9095        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9096        where
9097            T: std::convert::Into<wkt::FieldMask>,
9098        {
9099            self.0.request.update_mask = v.map(|x| x.into());
9100            self
9101        }
9102    }
9103
9104    #[doc(hidden)]
9105    impl crate::RequestBuilder for UpdateDocument {
9106        fn request_options(&mut self) -> &mut crate::RequestOptions {
9107            &mut self.0.options
9108        }
9109    }
9110
9111    /// The request builder for [Documents::reload_document][crate::client::Documents::reload_document] calls.
9112    ///
9113    /// # Example
9114    /// ```
9115    /// # use google_cloud_dialogflow_v2::builder::documents::ReloadDocument;
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() -> ReloadDocument {
9124    ///   # panic!();
9125    ///   // ... details omitted ...
9126    /// }
9127    /// ```
9128    #[derive(Clone, Debug)]
9129    pub struct ReloadDocument(RequestBuilder<crate::model::ReloadDocumentRequest>);
9130
9131    impl ReloadDocument {
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::ReloadDocumentRequest>>(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 [reload_document][crate::client::Documents::reload_document].
9156        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9157            (*self.0.stub)
9158                .reload_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 `reload_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
9177            let stub = self.0.stub.clone();
9178            let mut options = self.0.options.clone();
9179            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9180            let query = move |name| {
9181                let stub = stub.clone();
9182                let options = options.clone();
9183                async {
9184                    let op = GetOperation::new(stub)
9185                        .set_name(name)
9186                        .with_options(options)
9187                        .send()
9188                        .await?;
9189                    Ok(Operation::new(op))
9190                }
9191            };
9192
9193            let start = move || async {
9194                let op = self.send().await?;
9195                Ok(Operation::new(op))
9196            };
9197
9198            google_cloud_lro::internal::new_poller(
9199                polling_error_policy,
9200                polling_backoff_policy,
9201                start,
9202                query,
9203            )
9204        }
9205
9206        /// Sets the value of [name][crate::model::ReloadDocumentRequest::name].
9207        ///
9208        /// This is a **required** field for requests.
9209        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9210            self.0.request.name = v.into();
9211            self
9212        }
9213
9214        /// Sets the value of [import_gcs_custom_metadata][crate::model::ReloadDocumentRequest::import_gcs_custom_metadata].
9215        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
9216            self.0.request.import_gcs_custom_metadata = v.into();
9217            self
9218        }
9219
9220        /// Sets the value of [smart_messaging_partial_update][crate::model::ReloadDocumentRequest::smart_messaging_partial_update].
9221        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9222            self.0.request.smart_messaging_partial_update = v.into();
9223            self
9224        }
9225
9226        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source].
9227        ///
9228        /// Note that all the setters affecting `source` are
9229        /// mutually exclusive.
9230        pub fn set_source<T: Into<Option<crate::model::reload_document_request::Source>>>(
9231            mut self,
9232            v: T,
9233        ) -> Self {
9234            self.0.request.source = v.into();
9235            self
9236        }
9237
9238        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source]
9239        /// to hold a `ContentUri`.
9240        ///
9241        /// Note that all the setters affecting `source` are
9242        /// mutually exclusive.
9243        pub fn set_content_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9244            self.0.request = self.0.request.set_content_uri(v);
9245            self
9246        }
9247    }
9248
9249    #[doc(hidden)]
9250    impl crate::RequestBuilder for ReloadDocument {
9251        fn request_options(&mut self) -> &mut crate::RequestOptions {
9252            &mut self.0.options
9253        }
9254    }
9255
9256    /// The request builder for [Documents::export_document][crate::client::Documents::export_document] calls.
9257    ///
9258    /// # Example
9259    /// ```
9260    /// # use google_cloud_dialogflow_v2::builder::documents::ExportDocument;
9261    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9262    /// use google_cloud_lro::Poller;
9263    ///
9264    /// let builder = prepare_request_builder();
9265    /// let response = builder.poller().until_done().await?;
9266    /// # Ok(()) }
9267    ///
9268    /// fn prepare_request_builder() -> ExportDocument {
9269    ///   # panic!();
9270    ///   // ... details omitted ...
9271    /// }
9272    /// ```
9273    #[derive(Clone, Debug)]
9274    pub struct ExportDocument(RequestBuilder<crate::model::ExportDocumentRequest>);
9275
9276    impl ExportDocument {
9277        pub(crate) fn new(
9278            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9279        ) -> Self {
9280            Self(RequestBuilder::new(stub))
9281        }
9282
9283        /// Sets the full request, replacing any prior values.
9284        pub fn with_request<V: Into<crate::model::ExportDocumentRequest>>(mut self, v: V) -> Self {
9285            self.0.request = v.into();
9286            self
9287        }
9288
9289        /// Sets all the options, replacing any prior values.
9290        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9291            self.0.options = v.into();
9292            self
9293        }
9294
9295        /// Sends the request.
9296        ///
9297        /// # Long running operations
9298        ///
9299        /// This starts, but does not poll, a longrunning operation. More information
9300        /// on [export_document][crate::client::Documents::export_document].
9301        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9302            (*self.0.stub)
9303                .export_document(self.0.request, self.0.options)
9304                .await
9305                .map(crate::Response::into_body)
9306        }
9307
9308        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_document`.
9309        pub fn poller(
9310            self,
9311        ) -> impl google_cloud_lro::Poller<
9312            crate::model::Document,
9313            crate::model::KnowledgeOperationMetadata,
9314        > {
9315            type Operation = google_cloud_lro::internal::Operation<
9316                crate::model::Document,
9317                crate::model::KnowledgeOperationMetadata,
9318            >;
9319            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9320            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9321
9322            let stub = self.0.stub.clone();
9323            let mut options = self.0.options.clone();
9324            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9325            let query = move |name| {
9326                let stub = stub.clone();
9327                let options = options.clone();
9328                async {
9329                    let op = GetOperation::new(stub)
9330                        .set_name(name)
9331                        .with_options(options)
9332                        .send()
9333                        .await?;
9334                    Ok(Operation::new(op))
9335                }
9336            };
9337
9338            let start = move || async {
9339                let op = self.send().await?;
9340                Ok(Operation::new(op))
9341            };
9342
9343            google_cloud_lro::internal::new_poller(
9344                polling_error_policy,
9345                polling_backoff_policy,
9346                start,
9347                query,
9348            )
9349        }
9350
9351        /// Sets the value of [name][crate::model::ExportDocumentRequest::name].
9352        ///
9353        /// This is a **required** field for requests.
9354        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9355            self.0.request.name = v.into();
9356            self
9357        }
9358
9359        /// Sets the value of [export_full_content][crate::model::ExportDocumentRequest::export_full_content].
9360        pub fn set_export_full_content<T: Into<bool>>(mut self, v: T) -> Self {
9361            self.0.request.export_full_content = v.into();
9362            self
9363        }
9364
9365        /// Sets the value of [smart_messaging_partial_update][crate::model::ExportDocumentRequest::smart_messaging_partial_update].
9366        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9367            self.0.request.smart_messaging_partial_update = v.into();
9368            self
9369        }
9370
9371        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination].
9372        ///
9373        /// Note that all the setters affecting `destination` are
9374        /// mutually exclusive.
9375        pub fn set_destination<
9376            T: Into<Option<crate::model::export_document_request::Destination>>,
9377        >(
9378            mut self,
9379            v: T,
9380        ) -> Self {
9381            self.0.request.destination = v.into();
9382            self
9383        }
9384
9385        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination]
9386        /// to hold a `GcsDestination`.
9387        ///
9388        /// Note that all the setters affecting `destination` are
9389        /// mutually exclusive.
9390        pub fn set_gcs_destination<
9391            T: std::convert::Into<std::boxed::Box<crate::model::GcsDestination>>,
9392        >(
9393            mut self,
9394            v: T,
9395        ) -> Self {
9396            self.0.request = self.0.request.set_gcs_destination(v);
9397            self
9398        }
9399    }
9400
9401    #[doc(hidden)]
9402    impl crate::RequestBuilder for ExportDocument {
9403        fn request_options(&mut self) -> &mut crate::RequestOptions {
9404            &mut self.0.options
9405        }
9406    }
9407
9408    /// The request builder for [Documents::list_locations][crate::client::Documents::list_locations] calls.
9409    ///
9410    /// # Example
9411    /// ```
9412    /// # use google_cloud_dialogflow_v2::builder::documents::ListLocations;
9413    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9414    /// use google_cloud_gax::paginator::ItemPaginator;
9415    ///
9416    /// let builder = prepare_request_builder();
9417    /// let mut items = builder.by_item();
9418    /// while let Some(result) = items.next().await {
9419    ///   let item = result?;
9420    /// }
9421    /// # Ok(()) }
9422    ///
9423    /// fn prepare_request_builder() -> ListLocations {
9424    ///   # panic!();
9425    ///   // ... details omitted ...
9426    /// }
9427    /// ```
9428    #[derive(Clone, Debug)]
9429    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9430
9431    impl ListLocations {
9432        pub(crate) fn new(
9433            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9434        ) -> Self {
9435            Self(RequestBuilder::new(stub))
9436        }
9437
9438        /// Sets the full request, replacing any prior values.
9439        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9440            mut self,
9441            v: V,
9442        ) -> Self {
9443            self.0.request = v.into();
9444            self
9445        }
9446
9447        /// Sets all the options, replacing any prior values.
9448        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9449            self.0.options = v.into();
9450            self
9451        }
9452
9453        /// Sends the request.
9454        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9455            (*self.0.stub)
9456                .list_locations(self.0.request, self.0.options)
9457                .await
9458                .map(crate::Response::into_body)
9459        }
9460
9461        /// Streams each page in the collection.
9462        pub fn by_page(
9463            self,
9464        ) -> impl google_cloud_gax::paginator::Paginator<
9465            google_cloud_location::model::ListLocationsResponse,
9466            crate::Error,
9467        > {
9468            use std::clone::Clone;
9469            let token = self.0.request.page_token.clone();
9470            let execute = move |token: String| {
9471                let mut builder = self.clone();
9472                builder.0.request = builder.0.request.set_page_token(token);
9473                builder.send()
9474            };
9475            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9476        }
9477
9478        /// Streams each item in the collection.
9479        pub fn by_item(
9480            self,
9481        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9482            google_cloud_location::model::ListLocationsResponse,
9483            crate::Error,
9484        > {
9485            use google_cloud_gax::paginator::Paginator;
9486            self.by_page().items()
9487        }
9488
9489        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9490        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9491            self.0.request.name = v.into();
9492            self
9493        }
9494
9495        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9496        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9497            self.0.request.filter = v.into();
9498            self
9499        }
9500
9501        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9502        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9503            self.0.request.page_size = v.into();
9504            self
9505        }
9506
9507        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9508        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9509            self.0.request.page_token = v.into();
9510            self
9511        }
9512    }
9513
9514    #[doc(hidden)]
9515    impl crate::RequestBuilder for ListLocations {
9516        fn request_options(&mut self) -> &mut crate::RequestOptions {
9517            &mut self.0.options
9518        }
9519    }
9520
9521    /// The request builder for [Documents::get_location][crate::client::Documents::get_location] calls.
9522    ///
9523    /// # Example
9524    /// ```
9525    /// # use google_cloud_dialogflow_v2::builder::documents::GetLocation;
9526    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9527    ///
9528    /// let builder = prepare_request_builder();
9529    /// let response = builder.send().await?;
9530    /// # Ok(()) }
9531    ///
9532    /// fn prepare_request_builder() -> GetLocation {
9533    ///   # panic!();
9534    ///   // ... details omitted ...
9535    /// }
9536    /// ```
9537    #[derive(Clone, Debug)]
9538    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9539
9540    impl GetLocation {
9541        pub(crate) fn new(
9542            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9543        ) -> Self {
9544            Self(RequestBuilder::new(stub))
9545        }
9546
9547        /// Sets the full request, replacing any prior values.
9548        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9549            mut self,
9550            v: V,
9551        ) -> Self {
9552            self.0.request = v.into();
9553            self
9554        }
9555
9556        /// Sets all the options, replacing any prior values.
9557        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9558            self.0.options = v.into();
9559            self
9560        }
9561
9562        /// Sends the request.
9563        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9564            (*self.0.stub)
9565                .get_location(self.0.request, self.0.options)
9566                .await
9567                .map(crate::Response::into_body)
9568        }
9569
9570        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9571        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9572            self.0.request.name = v.into();
9573            self
9574        }
9575    }
9576
9577    #[doc(hidden)]
9578    impl crate::RequestBuilder for GetLocation {
9579        fn request_options(&mut self) -> &mut crate::RequestOptions {
9580            &mut self.0.options
9581        }
9582    }
9583
9584    /// The request builder for [Documents::list_operations][crate::client::Documents::list_operations] calls.
9585    ///
9586    /// # Example
9587    /// ```
9588    /// # use google_cloud_dialogflow_v2::builder::documents::ListOperations;
9589    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9590    /// use google_cloud_gax::paginator::ItemPaginator;
9591    ///
9592    /// let builder = prepare_request_builder();
9593    /// let mut items = builder.by_item();
9594    /// while let Some(result) = items.next().await {
9595    ///   let item = result?;
9596    /// }
9597    /// # Ok(()) }
9598    ///
9599    /// fn prepare_request_builder() -> ListOperations {
9600    ///   # panic!();
9601    ///   // ... details omitted ...
9602    /// }
9603    /// ```
9604    #[derive(Clone, Debug)]
9605    pub struct ListOperations(
9606        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9607    );
9608
9609    impl ListOperations {
9610        pub(crate) fn new(
9611            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9612        ) -> Self {
9613            Self(RequestBuilder::new(stub))
9614        }
9615
9616        /// Sets the full request, replacing any prior values.
9617        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9618            mut self,
9619            v: V,
9620        ) -> Self {
9621            self.0.request = v.into();
9622            self
9623        }
9624
9625        /// Sets all the options, replacing any prior values.
9626        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9627            self.0.options = v.into();
9628            self
9629        }
9630
9631        /// Sends the request.
9632        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9633            (*self.0.stub)
9634                .list_operations(self.0.request, self.0.options)
9635                .await
9636                .map(crate::Response::into_body)
9637        }
9638
9639        /// Streams each page in the collection.
9640        pub fn by_page(
9641            self,
9642        ) -> impl google_cloud_gax::paginator::Paginator<
9643            google_cloud_longrunning::model::ListOperationsResponse,
9644            crate::Error,
9645        > {
9646            use std::clone::Clone;
9647            let token = self.0.request.page_token.clone();
9648            let execute = move |token: String| {
9649                let mut builder = self.clone();
9650                builder.0.request = builder.0.request.set_page_token(token);
9651                builder.send()
9652            };
9653            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9654        }
9655
9656        /// Streams each item in the collection.
9657        pub fn by_item(
9658            self,
9659        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9660            google_cloud_longrunning::model::ListOperationsResponse,
9661            crate::Error,
9662        > {
9663            use google_cloud_gax::paginator::Paginator;
9664            self.by_page().items()
9665        }
9666
9667        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
9668        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9669            self.0.request.name = v.into();
9670            self
9671        }
9672
9673        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
9674        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9675            self.0.request.filter = v.into();
9676            self
9677        }
9678
9679        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
9680        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9681            self.0.request.page_size = v.into();
9682            self
9683        }
9684
9685        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
9686        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9687            self.0.request.page_token = v.into();
9688            self
9689        }
9690
9691        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
9692        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9693            self.0.request.return_partial_success = v.into();
9694            self
9695        }
9696    }
9697
9698    #[doc(hidden)]
9699    impl crate::RequestBuilder for ListOperations {
9700        fn request_options(&mut self) -> &mut crate::RequestOptions {
9701            &mut self.0.options
9702        }
9703    }
9704
9705    /// The request builder for [Documents::get_operation][crate::client::Documents::get_operation] calls.
9706    ///
9707    /// # Example
9708    /// ```
9709    /// # use google_cloud_dialogflow_v2::builder::documents::GetOperation;
9710    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9711    ///
9712    /// let builder = prepare_request_builder();
9713    /// let response = builder.send().await?;
9714    /// # Ok(()) }
9715    ///
9716    /// fn prepare_request_builder() -> GetOperation {
9717    ///   # panic!();
9718    ///   // ... details omitted ...
9719    /// }
9720    /// ```
9721    #[derive(Clone, Debug)]
9722    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9723
9724    impl GetOperation {
9725        pub(crate) fn new(
9726            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9727        ) -> Self {
9728            Self(RequestBuilder::new(stub))
9729        }
9730
9731        /// Sets the full request, replacing any prior values.
9732        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9733            mut self,
9734            v: V,
9735        ) -> Self {
9736            self.0.request = v.into();
9737            self
9738        }
9739
9740        /// Sets all the options, replacing any prior values.
9741        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9742            self.0.options = v.into();
9743            self
9744        }
9745
9746        /// Sends the request.
9747        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9748            (*self.0.stub)
9749                .get_operation(self.0.request, self.0.options)
9750                .await
9751                .map(crate::Response::into_body)
9752        }
9753
9754        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
9755        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9756            self.0.request.name = v.into();
9757            self
9758        }
9759    }
9760
9761    #[doc(hidden)]
9762    impl crate::RequestBuilder for GetOperation {
9763        fn request_options(&mut self) -> &mut crate::RequestOptions {
9764            &mut self.0.options
9765        }
9766    }
9767
9768    /// The request builder for [Documents::cancel_operation][crate::client::Documents::cancel_operation] calls.
9769    ///
9770    /// # Example
9771    /// ```
9772    /// # use google_cloud_dialogflow_v2::builder::documents::CancelOperation;
9773    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9774    ///
9775    /// let builder = prepare_request_builder();
9776    /// let response = builder.send().await?;
9777    /// # Ok(()) }
9778    ///
9779    /// fn prepare_request_builder() -> CancelOperation {
9780    ///   # panic!();
9781    ///   // ... details omitted ...
9782    /// }
9783    /// ```
9784    #[derive(Clone, Debug)]
9785    pub struct CancelOperation(
9786        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9787    );
9788
9789    impl CancelOperation {
9790        pub(crate) fn new(
9791            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9792        ) -> Self {
9793            Self(RequestBuilder::new(stub))
9794        }
9795
9796        /// Sets the full request, replacing any prior values.
9797        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9798            mut self,
9799            v: V,
9800        ) -> Self {
9801            self.0.request = v.into();
9802            self
9803        }
9804
9805        /// Sets all the options, replacing any prior values.
9806        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9807            self.0.options = v.into();
9808            self
9809        }
9810
9811        /// Sends the request.
9812        pub async fn send(self) -> Result<()> {
9813            (*self.0.stub)
9814                .cancel_operation(self.0.request, self.0.options)
9815                .await
9816                .map(crate::Response::into_body)
9817        }
9818
9819        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
9820        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9821            self.0.request.name = v.into();
9822            self
9823        }
9824    }
9825
9826    #[doc(hidden)]
9827    impl crate::RequestBuilder for CancelOperation {
9828        fn request_options(&mut self) -> &mut crate::RequestOptions {
9829            &mut self.0.options
9830        }
9831    }
9832}
9833
9834/// Request and client builders for [EncryptionSpecService][crate::client::EncryptionSpecService].
9835#[cfg(feature = "encryption-spec-service")]
9836#[cfg_attr(docsrs, doc(cfg(feature = "encryption-spec-service")))]
9837pub mod encryption_spec_service {
9838    use crate::Result;
9839
9840    /// A builder for [EncryptionSpecService][crate::client::EncryptionSpecService].
9841    ///
9842    /// ```
9843    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9844    /// # use google_cloud_dialogflow_v2::*;
9845    /// # use builder::encryption_spec_service::ClientBuilder;
9846    /// # use client::EncryptionSpecService;
9847    /// let builder : ClientBuilder = EncryptionSpecService::builder();
9848    /// let client = builder
9849    ///     .with_endpoint("https://dialogflow.googleapis.com")
9850    ///     .build().await?;
9851    /// # Ok(()) }
9852    /// ```
9853    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9854
9855    pub(crate) mod client {
9856        use super::super::super::client::EncryptionSpecService;
9857        pub struct Factory;
9858        impl crate::ClientFactory for Factory {
9859            type Client = EncryptionSpecService;
9860            type Credentials = gaxi::options::Credentials;
9861            async fn build(
9862                self,
9863                config: gaxi::options::ClientConfig,
9864            ) -> crate::ClientBuilderResult<Self::Client> {
9865                Self::Client::new(config).await
9866            }
9867        }
9868    }
9869
9870    /// Common implementation for [crate::client::EncryptionSpecService] request builders.
9871    #[derive(Clone, Debug)]
9872    pub(crate) struct RequestBuilder<R: std::default::Default> {
9873        stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9874        request: R,
9875        options: crate::RequestOptions,
9876    }
9877
9878    impl<R> RequestBuilder<R>
9879    where
9880        R: std::default::Default,
9881    {
9882        pub(crate) fn new(
9883            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9884        ) -> Self {
9885            Self {
9886                stub,
9887                request: R::default(),
9888                options: crate::RequestOptions::default(),
9889            }
9890        }
9891    }
9892
9893    /// The request builder for [EncryptionSpecService::get_encryption_spec][crate::client::EncryptionSpecService::get_encryption_spec] calls.
9894    ///
9895    /// # Example
9896    /// ```
9897    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetEncryptionSpec;
9898    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9899    ///
9900    /// let builder = prepare_request_builder();
9901    /// let response = builder.send().await?;
9902    /// # Ok(()) }
9903    ///
9904    /// fn prepare_request_builder() -> GetEncryptionSpec {
9905    ///   # panic!();
9906    ///   // ... details omitted ...
9907    /// }
9908    /// ```
9909    #[derive(Clone, Debug)]
9910    pub struct GetEncryptionSpec(RequestBuilder<crate::model::GetEncryptionSpecRequest>);
9911
9912    impl GetEncryptionSpec {
9913        pub(crate) fn new(
9914            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9915        ) -> Self {
9916            Self(RequestBuilder::new(stub))
9917        }
9918
9919        /// Sets the full request, replacing any prior values.
9920        pub fn with_request<V: Into<crate::model::GetEncryptionSpecRequest>>(
9921            mut self,
9922            v: V,
9923        ) -> Self {
9924            self.0.request = v.into();
9925            self
9926        }
9927
9928        /// Sets all the options, replacing any prior values.
9929        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9930            self.0.options = v.into();
9931            self
9932        }
9933
9934        /// Sends the request.
9935        pub async fn send(self) -> Result<crate::model::EncryptionSpec> {
9936            (*self.0.stub)
9937                .get_encryption_spec(self.0.request, self.0.options)
9938                .await
9939                .map(crate::Response::into_body)
9940        }
9941
9942        /// Sets the value of [name][crate::model::GetEncryptionSpecRequest::name].
9943        ///
9944        /// This is a **required** field for requests.
9945        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9946            self.0.request.name = v.into();
9947            self
9948        }
9949    }
9950
9951    #[doc(hidden)]
9952    impl crate::RequestBuilder for GetEncryptionSpec {
9953        fn request_options(&mut self) -> &mut crate::RequestOptions {
9954            &mut self.0.options
9955        }
9956    }
9957
9958    /// The request builder for [EncryptionSpecService::initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec] calls.
9959    ///
9960    /// # Example
9961    /// ```
9962    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::InitializeEncryptionSpec;
9963    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9964    /// use google_cloud_lro::Poller;
9965    ///
9966    /// let builder = prepare_request_builder();
9967    /// let response = builder.poller().until_done().await?;
9968    /// # Ok(()) }
9969    ///
9970    /// fn prepare_request_builder() -> InitializeEncryptionSpec {
9971    ///   # panic!();
9972    ///   // ... details omitted ...
9973    /// }
9974    /// ```
9975    #[derive(Clone, Debug)]
9976    pub struct InitializeEncryptionSpec(
9977        RequestBuilder<crate::model::InitializeEncryptionSpecRequest>,
9978    );
9979
9980    impl InitializeEncryptionSpec {
9981        pub(crate) fn new(
9982            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9983        ) -> Self {
9984            Self(RequestBuilder::new(stub))
9985        }
9986
9987        /// Sets the full request, replacing any prior values.
9988        pub fn with_request<V: Into<crate::model::InitializeEncryptionSpecRequest>>(
9989            mut self,
9990            v: V,
9991        ) -> Self {
9992            self.0.request = v.into();
9993            self
9994        }
9995
9996        /// Sets all the options, replacing any prior values.
9997        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9998            self.0.options = v.into();
9999            self
10000        }
10001
10002        /// Sends the request.
10003        ///
10004        /// # Long running operations
10005        ///
10006        /// This starts, but does not poll, a longrunning operation. More information
10007        /// on [initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec].
10008        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10009            (*self.0.stub)
10010                .initialize_encryption_spec(self.0.request, self.0.options)
10011                .await
10012                .map(crate::Response::into_body)
10013        }
10014
10015        /// Creates a [Poller][google_cloud_lro::Poller] to work with `initialize_encryption_spec`.
10016        pub fn poller(
10017            self,
10018        ) -> impl google_cloud_lro::Poller<
10019            crate::model::InitializeEncryptionSpecResponse,
10020            crate::model::InitializeEncryptionSpecMetadata,
10021        > {
10022            type Operation = google_cloud_lro::internal::Operation<
10023                crate::model::InitializeEncryptionSpecResponse,
10024                crate::model::InitializeEncryptionSpecMetadata,
10025            >;
10026            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10027            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10028
10029            let stub = self.0.stub.clone();
10030            let mut options = self.0.options.clone();
10031            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10032            let query = move |name| {
10033                let stub = stub.clone();
10034                let options = options.clone();
10035                async {
10036                    let op = GetOperation::new(stub)
10037                        .set_name(name)
10038                        .with_options(options)
10039                        .send()
10040                        .await?;
10041                    Ok(Operation::new(op))
10042                }
10043            };
10044
10045            let start = move || async {
10046                let op = self.send().await?;
10047                Ok(Operation::new(op))
10048            };
10049
10050            google_cloud_lro::internal::new_poller(
10051                polling_error_policy,
10052                polling_backoff_policy,
10053                start,
10054                query,
10055            )
10056        }
10057
10058        /// Sets the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
10059        ///
10060        /// This is a **required** field for requests.
10061        pub fn set_encryption_spec<T>(mut self, v: T) -> Self
10062        where
10063            T: std::convert::Into<crate::model::EncryptionSpec>,
10064        {
10065            self.0.request.encryption_spec = std::option::Option::Some(v.into());
10066            self
10067        }
10068
10069        /// Sets or clears the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
10070        ///
10071        /// This is a **required** field for requests.
10072        pub fn set_or_clear_encryption_spec<T>(mut self, v: std::option::Option<T>) -> Self
10073        where
10074            T: std::convert::Into<crate::model::EncryptionSpec>,
10075        {
10076            self.0.request.encryption_spec = v.map(|x| x.into());
10077            self
10078        }
10079    }
10080
10081    #[doc(hidden)]
10082    impl crate::RequestBuilder for InitializeEncryptionSpec {
10083        fn request_options(&mut self) -> &mut crate::RequestOptions {
10084            &mut self.0.options
10085        }
10086    }
10087
10088    /// The request builder for [EncryptionSpecService::list_locations][crate::client::EncryptionSpecService::list_locations] calls.
10089    ///
10090    /// # Example
10091    /// ```
10092    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::ListLocations;
10093    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10094    /// use google_cloud_gax::paginator::ItemPaginator;
10095    ///
10096    /// let builder = prepare_request_builder();
10097    /// let mut items = builder.by_item();
10098    /// while let Some(result) = items.next().await {
10099    ///   let item = result?;
10100    /// }
10101    /// # Ok(()) }
10102    ///
10103    /// fn prepare_request_builder() -> ListLocations {
10104    ///   # panic!();
10105    ///   // ... details omitted ...
10106    /// }
10107    /// ```
10108    #[derive(Clone, Debug)]
10109    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10110
10111    impl ListLocations {
10112        pub(crate) fn new(
10113            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10114        ) -> Self {
10115            Self(RequestBuilder::new(stub))
10116        }
10117
10118        /// Sets the full request, replacing any prior values.
10119        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10120            mut self,
10121            v: V,
10122        ) -> Self {
10123            self.0.request = v.into();
10124            self
10125        }
10126
10127        /// Sets all the options, replacing any prior values.
10128        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10129            self.0.options = v.into();
10130            self
10131        }
10132
10133        /// Sends the request.
10134        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10135            (*self.0.stub)
10136                .list_locations(self.0.request, self.0.options)
10137                .await
10138                .map(crate::Response::into_body)
10139        }
10140
10141        /// Streams each page in the collection.
10142        pub fn by_page(
10143            self,
10144        ) -> impl google_cloud_gax::paginator::Paginator<
10145            google_cloud_location::model::ListLocationsResponse,
10146            crate::Error,
10147        > {
10148            use std::clone::Clone;
10149            let token = self.0.request.page_token.clone();
10150            let execute = move |token: String| {
10151                let mut builder = self.clone();
10152                builder.0.request = builder.0.request.set_page_token(token);
10153                builder.send()
10154            };
10155            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10156        }
10157
10158        /// Streams each item in the collection.
10159        pub fn by_item(
10160            self,
10161        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10162            google_cloud_location::model::ListLocationsResponse,
10163            crate::Error,
10164        > {
10165            use google_cloud_gax::paginator::Paginator;
10166            self.by_page().items()
10167        }
10168
10169        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10170        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10171            self.0.request.name = v.into();
10172            self
10173        }
10174
10175        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10176        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10177            self.0.request.filter = v.into();
10178            self
10179        }
10180
10181        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10182        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10183            self.0.request.page_size = v.into();
10184            self
10185        }
10186
10187        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10188        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10189            self.0.request.page_token = v.into();
10190            self
10191        }
10192    }
10193
10194    #[doc(hidden)]
10195    impl crate::RequestBuilder for ListLocations {
10196        fn request_options(&mut self) -> &mut crate::RequestOptions {
10197            &mut self.0.options
10198        }
10199    }
10200
10201    /// The request builder for [EncryptionSpecService::get_location][crate::client::EncryptionSpecService::get_location] calls.
10202    ///
10203    /// # Example
10204    /// ```
10205    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetLocation;
10206    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10207    ///
10208    /// let builder = prepare_request_builder();
10209    /// let response = builder.send().await?;
10210    /// # Ok(()) }
10211    ///
10212    /// fn prepare_request_builder() -> GetLocation {
10213    ///   # panic!();
10214    ///   // ... details omitted ...
10215    /// }
10216    /// ```
10217    #[derive(Clone, Debug)]
10218    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10219
10220    impl GetLocation {
10221        pub(crate) fn new(
10222            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10223        ) -> Self {
10224            Self(RequestBuilder::new(stub))
10225        }
10226
10227        /// Sets the full request, replacing any prior values.
10228        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10229            mut self,
10230            v: V,
10231        ) -> Self {
10232            self.0.request = v.into();
10233            self
10234        }
10235
10236        /// Sets all the options, replacing any prior values.
10237        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10238            self.0.options = v.into();
10239            self
10240        }
10241
10242        /// Sends the request.
10243        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10244            (*self.0.stub)
10245                .get_location(self.0.request, self.0.options)
10246                .await
10247                .map(crate::Response::into_body)
10248        }
10249
10250        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
10251        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10252            self.0.request.name = v.into();
10253            self
10254        }
10255    }
10256
10257    #[doc(hidden)]
10258    impl crate::RequestBuilder for GetLocation {
10259        fn request_options(&mut self) -> &mut crate::RequestOptions {
10260            &mut self.0.options
10261        }
10262    }
10263
10264    /// The request builder for [EncryptionSpecService::list_operations][crate::client::EncryptionSpecService::list_operations] calls.
10265    ///
10266    /// # Example
10267    /// ```
10268    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::ListOperations;
10269    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10270    /// use google_cloud_gax::paginator::ItemPaginator;
10271    ///
10272    /// let builder = prepare_request_builder();
10273    /// let mut items = builder.by_item();
10274    /// while let Some(result) = items.next().await {
10275    ///   let item = result?;
10276    /// }
10277    /// # Ok(()) }
10278    ///
10279    /// fn prepare_request_builder() -> ListOperations {
10280    ///   # panic!();
10281    ///   // ... details omitted ...
10282    /// }
10283    /// ```
10284    #[derive(Clone, Debug)]
10285    pub struct ListOperations(
10286        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10287    );
10288
10289    impl ListOperations {
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_longrunning::model::ListOperationsRequest>>(
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_longrunning::model::ListOperationsResponse> {
10313            (*self.0.stub)
10314                .list_operations(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_longrunning::model::ListOperationsResponse,
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_longrunning::model::ListOperationsResponse,
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_longrunning::model::ListOperationsRequest::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_longrunning::model::ListOperationsRequest::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_longrunning::model::ListOperationsRequest::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_longrunning::model::ListOperationsRequest::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        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
10372        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10373            self.0.request.return_partial_success = v.into();
10374            self
10375        }
10376    }
10377
10378    #[doc(hidden)]
10379    impl crate::RequestBuilder for ListOperations {
10380        fn request_options(&mut self) -> &mut crate::RequestOptions {
10381            &mut self.0.options
10382        }
10383    }
10384
10385    /// The request builder for [EncryptionSpecService::get_operation][crate::client::EncryptionSpecService::get_operation] calls.
10386    ///
10387    /// # Example
10388    /// ```
10389    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetOperation;
10390    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10391    ///
10392    /// let builder = prepare_request_builder();
10393    /// let response = builder.send().await?;
10394    /// # Ok(()) }
10395    ///
10396    /// fn prepare_request_builder() -> GetOperation {
10397    ///   # panic!();
10398    ///   // ... details omitted ...
10399    /// }
10400    /// ```
10401    #[derive(Clone, Debug)]
10402    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10403
10404    impl GetOperation {
10405        pub(crate) fn new(
10406            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10407        ) -> Self {
10408            Self(RequestBuilder::new(stub))
10409        }
10410
10411        /// Sets the full request, replacing any prior values.
10412        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10413            mut self,
10414            v: V,
10415        ) -> Self {
10416            self.0.request = v.into();
10417            self
10418        }
10419
10420        /// Sets all the options, replacing any prior values.
10421        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10422            self.0.options = v.into();
10423            self
10424        }
10425
10426        /// Sends the request.
10427        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10428            (*self.0.stub)
10429                .get_operation(self.0.request, self.0.options)
10430                .await
10431                .map(crate::Response::into_body)
10432        }
10433
10434        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
10435        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10436            self.0.request.name = v.into();
10437            self
10438        }
10439    }
10440
10441    #[doc(hidden)]
10442    impl crate::RequestBuilder for GetOperation {
10443        fn request_options(&mut self) -> &mut crate::RequestOptions {
10444            &mut self.0.options
10445        }
10446    }
10447
10448    /// The request builder for [EncryptionSpecService::cancel_operation][crate::client::EncryptionSpecService::cancel_operation] calls.
10449    ///
10450    /// # Example
10451    /// ```
10452    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::CancelOperation;
10453    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10454    ///
10455    /// let builder = prepare_request_builder();
10456    /// let response = builder.send().await?;
10457    /// # Ok(()) }
10458    ///
10459    /// fn prepare_request_builder() -> CancelOperation {
10460    ///   # panic!();
10461    ///   // ... details omitted ...
10462    /// }
10463    /// ```
10464    #[derive(Clone, Debug)]
10465    pub struct CancelOperation(
10466        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10467    );
10468
10469    impl CancelOperation {
10470        pub(crate) fn new(
10471            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10472        ) -> Self {
10473            Self(RequestBuilder::new(stub))
10474        }
10475
10476        /// Sets the full request, replacing any prior values.
10477        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10478            mut self,
10479            v: V,
10480        ) -> Self {
10481            self.0.request = v.into();
10482            self
10483        }
10484
10485        /// Sets all the options, replacing any prior values.
10486        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10487            self.0.options = v.into();
10488            self
10489        }
10490
10491        /// Sends the request.
10492        pub async fn send(self) -> Result<()> {
10493            (*self.0.stub)
10494                .cancel_operation(self.0.request, self.0.options)
10495                .await
10496                .map(crate::Response::into_body)
10497        }
10498
10499        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
10500        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10501            self.0.request.name = v.into();
10502            self
10503        }
10504    }
10505
10506    #[doc(hidden)]
10507    impl crate::RequestBuilder for CancelOperation {
10508        fn request_options(&mut self) -> &mut crate::RequestOptions {
10509            &mut self.0.options
10510        }
10511    }
10512}
10513
10514/// Request and client builders for [EntityTypes][crate::client::EntityTypes].
10515#[cfg(feature = "entity-types")]
10516#[cfg_attr(docsrs, doc(cfg(feature = "entity-types")))]
10517pub mod entity_types {
10518    use crate::Result;
10519
10520    /// A builder for [EntityTypes][crate::client::EntityTypes].
10521    ///
10522    /// ```
10523    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10524    /// # use google_cloud_dialogflow_v2::*;
10525    /// # use builder::entity_types::ClientBuilder;
10526    /// # use client::EntityTypes;
10527    /// let builder : ClientBuilder = EntityTypes::builder();
10528    /// let client = builder
10529    ///     .with_endpoint("https://dialogflow.googleapis.com")
10530    ///     .build().await?;
10531    /// # Ok(()) }
10532    /// ```
10533    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10534
10535    pub(crate) mod client {
10536        use super::super::super::client::EntityTypes;
10537        pub struct Factory;
10538        impl crate::ClientFactory for Factory {
10539            type Client = EntityTypes;
10540            type Credentials = gaxi::options::Credentials;
10541            async fn build(
10542                self,
10543                config: gaxi::options::ClientConfig,
10544            ) -> crate::ClientBuilderResult<Self::Client> {
10545                Self::Client::new(config).await
10546            }
10547        }
10548    }
10549
10550    /// Common implementation for [crate::client::EntityTypes] request builders.
10551    #[derive(Clone, Debug)]
10552    pub(crate) struct RequestBuilder<R: std::default::Default> {
10553        stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10554        request: R,
10555        options: crate::RequestOptions,
10556    }
10557
10558    impl<R> RequestBuilder<R>
10559    where
10560        R: std::default::Default,
10561    {
10562        pub(crate) fn new(
10563            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10564        ) -> Self {
10565            Self {
10566                stub,
10567                request: R::default(),
10568                options: crate::RequestOptions::default(),
10569            }
10570        }
10571    }
10572
10573    /// The request builder for [EntityTypes::list_entity_types][crate::client::EntityTypes::list_entity_types] calls.
10574    ///
10575    /// # Example
10576    /// ```
10577    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListEntityTypes;
10578    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10579    /// use google_cloud_gax::paginator::ItemPaginator;
10580    ///
10581    /// let builder = prepare_request_builder();
10582    /// let mut items = builder.by_item();
10583    /// while let Some(result) = items.next().await {
10584    ///   let item = result?;
10585    /// }
10586    /// # Ok(()) }
10587    ///
10588    /// fn prepare_request_builder() -> ListEntityTypes {
10589    ///   # panic!();
10590    ///   // ... details omitted ...
10591    /// }
10592    /// ```
10593    #[derive(Clone, Debug)]
10594    pub struct ListEntityTypes(RequestBuilder<crate::model::ListEntityTypesRequest>);
10595
10596    impl ListEntityTypes {
10597        pub(crate) fn new(
10598            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10599        ) -> Self {
10600            Self(RequestBuilder::new(stub))
10601        }
10602
10603        /// Sets the full request, replacing any prior values.
10604        pub fn with_request<V: Into<crate::model::ListEntityTypesRequest>>(mut self, v: V) -> Self {
10605            self.0.request = v.into();
10606            self
10607        }
10608
10609        /// Sets all the options, replacing any prior values.
10610        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10611            self.0.options = v.into();
10612            self
10613        }
10614
10615        /// Sends the request.
10616        pub async fn send(self) -> Result<crate::model::ListEntityTypesResponse> {
10617            (*self.0.stub)
10618                .list_entity_types(self.0.request, self.0.options)
10619                .await
10620                .map(crate::Response::into_body)
10621        }
10622
10623        /// Streams each page in the collection.
10624        pub fn by_page(
10625            self,
10626        ) -> impl google_cloud_gax::paginator::Paginator<
10627            crate::model::ListEntityTypesResponse,
10628            crate::Error,
10629        > {
10630            use std::clone::Clone;
10631            let token = self.0.request.page_token.clone();
10632            let execute = move |token: String| {
10633                let mut builder = self.clone();
10634                builder.0.request = builder.0.request.set_page_token(token);
10635                builder.send()
10636            };
10637            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10638        }
10639
10640        /// Streams each item in the collection.
10641        pub fn by_item(
10642            self,
10643        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10644            crate::model::ListEntityTypesResponse,
10645            crate::Error,
10646        > {
10647            use google_cloud_gax::paginator::Paginator;
10648            self.by_page().items()
10649        }
10650
10651        /// Sets the value of [parent][crate::model::ListEntityTypesRequest::parent].
10652        ///
10653        /// This is a **required** field for requests.
10654        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10655            self.0.request.parent = v.into();
10656            self
10657        }
10658
10659        /// Sets the value of [language_code][crate::model::ListEntityTypesRequest::language_code].
10660        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10661            self.0.request.language_code = v.into();
10662            self
10663        }
10664
10665        /// Sets the value of [page_size][crate::model::ListEntityTypesRequest::page_size].
10666        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10667            self.0.request.page_size = v.into();
10668            self
10669        }
10670
10671        /// Sets the value of [page_token][crate::model::ListEntityTypesRequest::page_token].
10672        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10673            self.0.request.page_token = v.into();
10674            self
10675        }
10676    }
10677
10678    #[doc(hidden)]
10679    impl crate::RequestBuilder for ListEntityTypes {
10680        fn request_options(&mut self) -> &mut crate::RequestOptions {
10681            &mut self.0.options
10682        }
10683    }
10684
10685    /// The request builder for [EntityTypes::get_entity_type][crate::client::EntityTypes::get_entity_type] calls.
10686    ///
10687    /// # Example
10688    /// ```
10689    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetEntityType;
10690    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10691    ///
10692    /// let builder = prepare_request_builder();
10693    /// let response = builder.send().await?;
10694    /// # Ok(()) }
10695    ///
10696    /// fn prepare_request_builder() -> GetEntityType {
10697    ///   # panic!();
10698    ///   // ... details omitted ...
10699    /// }
10700    /// ```
10701    #[derive(Clone, Debug)]
10702    pub struct GetEntityType(RequestBuilder<crate::model::GetEntityTypeRequest>);
10703
10704    impl GetEntityType {
10705        pub(crate) fn new(
10706            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10707        ) -> Self {
10708            Self(RequestBuilder::new(stub))
10709        }
10710
10711        /// Sets the full request, replacing any prior values.
10712        pub fn with_request<V: Into<crate::model::GetEntityTypeRequest>>(mut self, v: V) -> Self {
10713            self.0.request = v.into();
10714            self
10715        }
10716
10717        /// Sets all the options, replacing any prior values.
10718        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10719            self.0.options = v.into();
10720            self
10721        }
10722
10723        /// Sends the request.
10724        pub async fn send(self) -> Result<crate::model::EntityType> {
10725            (*self.0.stub)
10726                .get_entity_type(self.0.request, self.0.options)
10727                .await
10728                .map(crate::Response::into_body)
10729        }
10730
10731        /// Sets the value of [name][crate::model::GetEntityTypeRequest::name].
10732        ///
10733        /// This is a **required** field for requests.
10734        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10735            self.0.request.name = v.into();
10736            self
10737        }
10738
10739        /// Sets the value of [language_code][crate::model::GetEntityTypeRequest::language_code].
10740        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10741            self.0.request.language_code = v.into();
10742            self
10743        }
10744    }
10745
10746    #[doc(hidden)]
10747    impl crate::RequestBuilder for GetEntityType {
10748        fn request_options(&mut self) -> &mut crate::RequestOptions {
10749            &mut self.0.options
10750        }
10751    }
10752
10753    /// The request builder for [EntityTypes::create_entity_type][crate::client::EntityTypes::create_entity_type] calls.
10754    ///
10755    /// # Example
10756    /// ```
10757    /// # use google_cloud_dialogflow_v2::builder::entity_types::CreateEntityType;
10758    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10759    ///
10760    /// let builder = prepare_request_builder();
10761    /// let response = builder.send().await?;
10762    /// # Ok(()) }
10763    ///
10764    /// fn prepare_request_builder() -> CreateEntityType {
10765    ///   # panic!();
10766    ///   // ... details omitted ...
10767    /// }
10768    /// ```
10769    #[derive(Clone, Debug)]
10770    pub struct CreateEntityType(RequestBuilder<crate::model::CreateEntityTypeRequest>);
10771
10772    impl CreateEntityType {
10773        pub(crate) fn new(
10774            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10775        ) -> Self {
10776            Self(RequestBuilder::new(stub))
10777        }
10778
10779        /// Sets the full request, replacing any prior values.
10780        pub fn with_request<V: Into<crate::model::CreateEntityTypeRequest>>(
10781            mut self,
10782            v: V,
10783        ) -> Self {
10784            self.0.request = v.into();
10785            self
10786        }
10787
10788        /// Sets all the options, replacing any prior values.
10789        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10790            self.0.options = v.into();
10791            self
10792        }
10793
10794        /// Sends the request.
10795        pub async fn send(self) -> Result<crate::model::EntityType> {
10796            (*self.0.stub)
10797                .create_entity_type(self.0.request, self.0.options)
10798                .await
10799                .map(crate::Response::into_body)
10800        }
10801
10802        /// Sets the value of [parent][crate::model::CreateEntityTypeRequest::parent].
10803        ///
10804        /// This is a **required** field for requests.
10805        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10806            self.0.request.parent = v.into();
10807            self
10808        }
10809
10810        /// Sets the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10811        ///
10812        /// This is a **required** field for requests.
10813        pub fn set_entity_type<T>(mut self, v: T) -> Self
10814        where
10815            T: std::convert::Into<crate::model::EntityType>,
10816        {
10817            self.0.request.entity_type = std::option::Option::Some(v.into());
10818            self
10819        }
10820
10821        /// Sets or clears the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10822        ///
10823        /// This is a **required** field for requests.
10824        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
10825        where
10826            T: std::convert::Into<crate::model::EntityType>,
10827        {
10828            self.0.request.entity_type = v.map(|x| x.into());
10829            self
10830        }
10831
10832        /// Sets the value of [language_code][crate::model::CreateEntityTypeRequest::language_code].
10833        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10834            self.0.request.language_code = v.into();
10835            self
10836        }
10837    }
10838
10839    #[doc(hidden)]
10840    impl crate::RequestBuilder for CreateEntityType {
10841        fn request_options(&mut self) -> &mut crate::RequestOptions {
10842            &mut self.0.options
10843        }
10844    }
10845
10846    /// The request builder for [EntityTypes::update_entity_type][crate::client::EntityTypes::update_entity_type] calls.
10847    ///
10848    /// # Example
10849    /// ```
10850    /// # use google_cloud_dialogflow_v2::builder::entity_types::UpdateEntityType;
10851    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10852    ///
10853    /// let builder = prepare_request_builder();
10854    /// let response = builder.send().await?;
10855    /// # Ok(()) }
10856    ///
10857    /// fn prepare_request_builder() -> UpdateEntityType {
10858    ///   # panic!();
10859    ///   // ... details omitted ...
10860    /// }
10861    /// ```
10862    #[derive(Clone, Debug)]
10863    pub struct UpdateEntityType(RequestBuilder<crate::model::UpdateEntityTypeRequest>);
10864
10865    impl UpdateEntityType {
10866        pub(crate) fn new(
10867            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10868        ) -> Self {
10869            Self(RequestBuilder::new(stub))
10870        }
10871
10872        /// Sets the full request, replacing any prior values.
10873        pub fn with_request<V: Into<crate::model::UpdateEntityTypeRequest>>(
10874            mut self,
10875            v: V,
10876        ) -> Self {
10877            self.0.request = v.into();
10878            self
10879        }
10880
10881        /// Sets all the options, replacing any prior values.
10882        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10883            self.0.options = v.into();
10884            self
10885        }
10886
10887        /// Sends the request.
10888        pub async fn send(self) -> Result<crate::model::EntityType> {
10889            (*self.0.stub)
10890                .update_entity_type(self.0.request, self.0.options)
10891                .await
10892                .map(crate::Response::into_body)
10893        }
10894
10895        /// Sets the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
10896        ///
10897        /// This is a **required** field for requests.
10898        pub fn set_entity_type<T>(mut self, v: T) -> Self
10899        where
10900            T: std::convert::Into<crate::model::EntityType>,
10901        {
10902            self.0.request.entity_type = std::option::Option::Some(v.into());
10903            self
10904        }
10905
10906        /// Sets or clears the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
10907        ///
10908        /// This is a **required** field for requests.
10909        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
10910        where
10911            T: std::convert::Into<crate::model::EntityType>,
10912        {
10913            self.0.request.entity_type = v.map(|x| x.into());
10914            self
10915        }
10916
10917        /// Sets the value of [language_code][crate::model::UpdateEntityTypeRequest::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        /// Sets the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
10924        pub fn set_update_mask<T>(mut self, v: T) -> Self
10925        where
10926            T: std::convert::Into<wkt::FieldMask>,
10927        {
10928            self.0.request.update_mask = std::option::Option::Some(v.into());
10929            self
10930        }
10931
10932        /// Sets or clears the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
10933        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10934        where
10935            T: std::convert::Into<wkt::FieldMask>,
10936        {
10937            self.0.request.update_mask = v.map(|x| x.into());
10938            self
10939        }
10940    }
10941
10942    #[doc(hidden)]
10943    impl crate::RequestBuilder for UpdateEntityType {
10944        fn request_options(&mut self) -> &mut crate::RequestOptions {
10945            &mut self.0.options
10946        }
10947    }
10948
10949    /// The request builder for [EntityTypes::delete_entity_type][crate::client::EntityTypes::delete_entity_type] calls.
10950    ///
10951    /// # Example
10952    /// ```
10953    /// # use google_cloud_dialogflow_v2::builder::entity_types::DeleteEntityType;
10954    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10955    ///
10956    /// let builder = prepare_request_builder();
10957    /// let response = builder.send().await?;
10958    /// # Ok(()) }
10959    ///
10960    /// fn prepare_request_builder() -> DeleteEntityType {
10961    ///   # panic!();
10962    ///   // ... details omitted ...
10963    /// }
10964    /// ```
10965    #[derive(Clone, Debug)]
10966    pub struct DeleteEntityType(RequestBuilder<crate::model::DeleteEntityTypeRequest>);
10967
10968    impl DeleteEntityType {
10969        pub(crate) fn new(
10970            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10971        ) -> Self {
10972            Self(RequestBuilder::new(stub))
10973        }
10974
10975        /// Sets the full request, replacing any prior values.
10976        pub fn with_request<V: Into<crate::model::DeleteEntityTypeRequest>>(
10977            mut self,
10978            v: V,
10979        ) -> Self {
10980            self.0.request = v.into();
10981            self
10982        }
10983
10984        /// Sets all the options, replacing any prior values.
10985        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10986            self.0.options = v.into();
10987            self
10988        }
10989
10990        /// Sends the request.
10991        pub async fn send(self) -> Result<()> {
10992            (*self.0.stub)
10993                .delete_entity_type(self.0.request, self.0.options)
10994                .await
10995                .map(crate::Response::into_body)
10996        }
10997
10998        /// Sets the value of [name][crate::model::DeleteEntityTypeRequest::name].
10999        ///
11000        /// This is a **required** field for requests.
11001        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11002            self.0.request.name = v.into();
11003            self
11004        }
11005    }
11006
11007    #[doc(hidden)]
11008    impl crate::RequestBuilder for DeleteEntityType {
11009        fn request_options(&mut self) -> &mut crate::RequestOptions {
11010            &mut self.0.options
11011        }
11012    }
11013
11014    /// The request builder for [EntityTypes::batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types] calls.
11015    ///
11016    /// # Example
11017    /// ```
11018    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchUpdateEntityTypes;
11019    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11020    /// use google_cloud_lro::Poller;
11021    ///
11022    /// let builder = prepare_request_builder();
11023    /// let response = builder.poller().until_done().await?;
11024    /// # Ok(()) }
11025    ///
11026    /// fn prepare_request_builder() -> BatchUpdateEntityTypes {
11027    ///   # panic!();
11028    ///   // ... details omitted ...
11029    /// }
11030    /// ```
11031    #[derive(Clone, Debug)]
11032    pub struct BatchUpdateEntityTypes(RequestBuilder<crate::model::BatchUpdateEntityTypesRequest>);
11033
11034    impl BatchUpdateEntityTypes {
11035        pub(crate) fn new(
11036            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11037        ) -> Self {
11038            Self(RequestBuilder::new(stub))
11039        }
11040
11041        /// Sets the full request, replacing any prior values.
11042        pub fn with_request<V: Into<crate::model::BatchUpdateEntityTypesRequest>>(
11043            mut self,
11044            v: V,
11045        ) -> Self {
11046            self.0.request = v.into();
11047            self
11048        }
11049
11050        /// Sets all the options, replacing any prior values.
11051        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11052            self.0.options = v.into();
11053            self
11054        }
11055
11056        /// Sends the request.
11057        ///
11058        /// # Long running operations
11059        ///
11060        /// This starts, but does not poll, a longrunning operation. More information
11061        /// on [batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types].
11062        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11063            (*self.0.stub)
11064                .batch_update_entity_types(self.0.request, self.0.options)
11065                .await
11066                .map(crate::Response::into_body)
11067        }
11068
11069        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_entity_types`.
11070        pub fn poller(
11071            self,
11072        ) -> impl google_cloud_lro::Poller<crate::model::BatchUpdateEntityTypesResponse, wkt::Struct>
11073        {
11074            type Operation = google_cloud_lro::internal::Operation<
11075                crate::model::BatchUpdateEntityTypesResponse,
11076                wkt::Struct,
11077            >;
11078            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11079            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11080
11081            let stub = self.0.stub.clone();
11082            let mut options = self.0.options.clone();
11083            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11084            let query = move |name| {
11085                let stub = stub.clone();
11086                let options = options.clone();
11087                async {
11088                    let op = GetOperation::new(stub)
11089                        .set_name(name)
11090                        .with_options(options)
11091                        .send()
11092                        .await?;
11093                    Ok(Operation::new(op))
11094                }
11095            };
11096
11097            let start = move || async {
11098                let op = self.send().await?;
11099                Ok(Operation::new(op))
11100            };
11101
11102            google_cloud_lro::internal::new_poller(
11103                polling_error_policy,
11104                polling_backoff_policy,
11105                start,
11106                query,
11107            )
11108        }
11109
11110        /// Sets the value of [parent][crate::model::BatchUpdateEntityTypesRequest::parent].
11111        ///
11112        /// This is a **required** field for requests.
11113        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11114            self.0.request.parent = v.into();
11115            self
11116        }
11117
11118        /// Sets the value of [language_code][crate::model::BatchUpdateEntityTypesRequest::language_code].
11119        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11120            self.0.request.language_code = v.into();
11121            self
11122        }
11123
11124        /// Sets the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
11125        pub fn set_update_mask<T>(mut self, v: T) -> Self
11126        where
11127            T: std::convert::Into<wkt::FieldMask>,
11128        {
11129            self.0.request.update_mask = std::option::Option::Some(v.into());
11130            self
11131        }
11132
11133        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
11134        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11135        where
11136            T: std::convert::Into<wkt::FieldMask>,
11137        {
11138            self.0.request.update_mask = v.map(|x| x.into());
11139            self
11140        }
11141
11142        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch].
11143        ///
11144        /// Note that all the setters affecting `entity_type_batch` are
11145        /// mutually exclusive.
11146        pub fn set_entity_type_batch<
11147            T: Into<Option<crate::model::batch_update_entity_types_request::EntityTypeBatch>>,
11148        >(
11149            mut self,
11150            v: T,
11151        ) -> Self {
11152            self.0.request.entity_type_batch = v.into();
11153            self
11154        }
11155
11156        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
11157        /// to hold a `EntityTypeBatchUri`.
11158        ///
11159        /// Note that all the setters affecting `entity_type_batch` are
11160        /// mutually exclusive.
11161        pub fn set_entity_type_batch_uri<T: std::convert::Into<std::string::String>>(
11162            mut self,
11163            v: T,
11164        ) -> Self {
11165            self.0.request = self.0.request.set_entity_type_batch_uri(v);
11166            self
11167        }
11168
11169        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
11170        /// to hold a `EntityTypeBatchInline`.
11171        ///
11172        /// Note that all the setters affecting `entity_type_batch` are
11173        /// mutually exclusive.
11174        pub fn set_entity_type_batch_inline<
11175            T: std::convert::Into<std::boxed::Box<crate::model::EntityTypeBatch>>,
11176        >(
11177            mut self,
11178            v: T,
11179        ) -> Self {
11180            self.0.request = self.0.request.set_entity_type_batch_inline(v);
11181            self
11182        }
11183    }
11184
11185    #[doc(hidden)]
11186    impl crate::RequestBuilder for BatchUpdateEntityTypes {
11187        fn request_options(&mut self) -> &mut crate::RequestOptions {
11188            &mut self.0.options
11189        }
11190    }
11191
11192    /// The request builder for [EntityTypes::batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types] calls.
11193    ///
11194    /// # Example
11195    /// ```
11196    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchDeleteEntityTypes;
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() -> BatchDeleteEntityTypes {
11205    ///   # panic!();
11206    ///   // ... details omitted ...
11207    /// }
11208    /// ```
11209    #[derive(Clone, Debug)]
11210    pub struct BatchDeleteEntityTypes(RequestBuilder<crate::model::BatchDeleteEntityTypesRequest>);
11211
11212    impl BatchDeleteEntityTypes {
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::BatchDeleteEntityTypesRequest>>(
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_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types].
11240        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11241            (*self.0.stub)
11242                .batch_delete_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_delete_entity_types`.
11248        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11249            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11250            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11251            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11252
11253            let stub = self.0.stub.clone();
11254            let mut options = self.0.options.clone();
11255            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11256            let query = move |name| {
11257                let stub = stub.clone();
11258                let options = options.clone();
11259                async {
11260                    let op = GetOperation::new(stub)
11261                        .set_name(name)
11262                        .with_options(options)
11263                        .send()
11264                        .await?;
11265                    Ok(Operation::new(op))
11266                }
11267            };
11268
11269            let start = move || async {
11270                let op = self.send().await?;
11271                Ok(Operation::new(op))
11272            };
11273
11274            google_cloud_lro::internal::new_unit_response_poller(
11275                polling_error_policy,
11276                polling_backoff_policy,
11277                start,
11278                query,
11279            )
11280        }
11281
11282        /// Sets the value of [parent][crate::model::BatchDeleteEntityTypesRequest::parent].
11283        ///
11284        /// This is a **required** field for requests.
11285        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11286            self.0.request.parent = v.into();
11287            self
11288        }
11289
11290        /// Sets the value of [entity_type_names][crate::model::BatchDeleteEntityTypesRequest::entity_type_names].
11291        ///
11292        /// This is a **required** field for requests.
11293        pub fn set_entity_type_names<T, V>(mut self, v: T) -> Self
11294        where
11295            T: std::iter::IntoIterator<Item = V>,
11296            V: std::convert::Into<std::string::String>,
11297        {
11298            use std::iter::Iterator;
11299            self.0.request.entity_type_names = v.into_iter().map(|i| i.into()).collect();
11300            self
11301        }
11302    }
11303
11304    #[doc(hidden)]
11305    impl crate::RequestBuilder for BatchDeleteEntityTypes {
11306        fn request_options(&mut self) -> &mut crate::RequestOptions {
11307            &mut self.0.options
11308        }
11309    }
11310
11311    /// The request builder for [EntityTypes::batch_create_entities][crate::client::EntityTypes::batch_create_entities] calls.
11312    ///
11313    /// # Example
11314    /// ```
11315    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchCreateEntities;
11316    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11317    /// use google_cloud_lro::Poller;
11318    ///
11319    /// let builder = prepare_request_builder();
11320    /// let response = builder.poller().until_done().await?;
11321    /// # Ok(()) }
11322    ///
11323    /// fn prepare_request_builder() -> BatchCreateEntities {
11324    ///   # panic!();
11325    ///   // ... details omitted ...
11326    /// }
11327    /// ```
11328    #[derive(Clone, Debug)]
11329    pub struct BatchCreateEntities(RequestBuilder<crate::model::BatchCreateEntitiesRequest>);
11330
11331    impl BatchCreateEntities {
11332        pub(crate) fn new(
11333            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11334        ) -> Self {
11335            Self(RequestBuilder::new(stub))
11336        }
11337
11338        /// Sets the full request, replacing any prior values.
11339        pub fn with_request<V: Into<crate::model::BatchCreateEntitiesRequest>>(
11340            mut self,
11341            v: V,
11342        ) -> Self {
11343            self.0.request = v.into();
11344            self
11345        }
11346
11347        /// Sets all the options, replacing any prior values.
11348        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11349            self.0.options = v.into();
11350            self
11351        }
11352
11353        /// Sends the request.
11354        ///
11355        /// # Long running operations
11356        ///
11357        /// This starts, but does not poll, a longrunning operation. More information
11358        /// on [batch_create_entities][crate::client::EntityTypes::batch_create_entities].
11359        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11360            (*self.0.stub)
11361                .batch_create_entities(self.0.request, self.0.options)
11362                .await
11363                .map(crate::Response::into_body)
11364        }
11365
11366        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_create_entities`.
11367        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11368            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11369            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11370            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11371
11372            let stub = self.0.stub.clone();
11373            let mut options = self.0.options.clone();
11374            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11375            let query = move |name| {
11376                let stub = stub.clone();
11377                let options = options.clone();
11378                async {
11379                    let op = GetOperation::new(stub)
11380                        .set_name(name)
11381                        .with_options(options)
11382                        .send()
11383                        .await?;
11384                    Ok(Operation::new(op))
11385                }
11386            };
11387
11388            let start = move || async {
11389                let op = self.send().await?;
11390                Ok(Operation::new(op))
11391            };
11392
11393            google_cloud_lro::internal::new_unit_response_poller(
11394                polling_error_policy,
11395                polling_backoff_policy,
11396                start,
11397                query,
11398            )
11399        }
11400
11401        /// Sets the value of [parent][crate::model::BatchCreateEntitiesRequest::parent].
11402        ///
11403        /// This is a **required** field for requests.
11404        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11405            self.0.request.parent = v.into();
11406            self
11407        }
11408
11409        /// Sets the value of [entities][crate::model::BatchCreateEntitiesRequest::entities].
11410        ///
11411        /// This is a **required** field for requests.
11412        pub fn set_entities<T, V>(mut self, v: T) -> Self
11413        where
11414            T: std::iter::IntoIterator<Item = V>,
11415            V: std::convert::Into<crate::model::entity_type::Entity>,
11416        {
11417            use std::iter::Iterator;
11418            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11419            self
11420        }
11421
11422        /// Sets the value of [language_code][crate::model::BatchCreateEntitiesRequest::language_code].
11423        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11424            self.0.request.language_code = v.into();
11425            self
11426        }
11427    }
11428
11429    #[doc(hidden)]
11430    impl crate::RequestBuilder for BatchCreateEntities {
11431        fn request_options(&mut self) -> &mut crate::RequestOptions {
11432            &mut self.0.options
11433        }
11434    }
11435
11436    /// The request builder for [EntityTypes::batch_update_entities][crate::client::EntityTypes::batch_update_entities] calls.
11437    ///
11438    /// # Example
11439    /// ```
11440    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchUpdateEntities;
11441    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11442    /// use google_cloud_lro::Poller;
11443    ///
11444    /// let builder = prepare_request_builder();
11445    /// let response = builder.poller().until_done().await?;
11446    /// # Ok(()) }
11447    ///
11448    /// fn prepare_request_builder() -> BatchUpdateEntities {
11449    ///   # panic!();
11450    ///   // ... details omitted ...
11451    /// }
11452    /// ```
11453    #[derive(Clone, Debug)]
11454    pub struct BatchUpdateEntities(RequestBuilder<crate::model::BatchUpdateEntitiesRequest>);
11455
11456    impl BatchUpdateEntities {
11457        pub(crate) fn new(
11458            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11459        ) -> Self {
11460            Self(RequestBuilder::new(stub))
11461        }
11462
11463        /// Sets the full request, replacing any prior values.
11464        pub fn with_request<V: Into<crate::model::BatchUpdateEntitiesRequest>>(
11465            mut self,
11466            v: V,
11467        ) -> Self {
11468            self.0.request = v.into();
11469            self
11470        }
11471
11472        /// Sets all the options, replacing any prior values.
11473        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11474            self.0.options = v.into();
11475            self
11476        }
11477
11478        /// Sends the request.
11479        ///
11480        /// # Long running operations
11481        ///
11482        /// This starts, but does not poll, a longrunning operation. More information
11483        /// on [batch_update_entities][crate::client::EntityTypes::batch_update_entities].
11484        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11485            (*self.0.stub)
11486                .batch_update_entities(self.0.request, self.0.options)
11487                .await
11488                .map(crate::Response::into_body)
11489        }
11490
11491        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_entities`.
11492        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11493            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11494            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11495            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11496
11497            let stub = self.0.stub.clone();
11498            let mut options = self.0.options.clone();
11499            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11500            let query = move |name| {
11501                let stub = stub.clone();
11502                let options = options.clone();
11503                async {
11504                    let op = GetOperation::new(stub)
11505                        .set_name(name)
11506                        .with_options(options)
11507                        .send()
11508                        .await?;
11509                    Ok(Operation::new(op))
11510                }
11511            };
11512
11513            let start = move || async {
11514                let op = self.send().await?;
11515                Ok(Operation::new(op))
11516            };
11517
11518            google_cloud_lro::internal::new_unit_response_poller(
11519                polling_error_policy,
11520                polling_backoff_policy,
11521                start,
11522                query,
11523            )
11524        }
11525
11526        /// Sets the value of [parent][crate::model::BatchUpdateEntitiesRequest::parent].
11527        ///
11528        /// This is a **required** field for requests.
11529        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11530            self.0.request.parent = v.into();
11531            self
11532        }
11533
11534        /// Sets the value of [entities][crate::model::BatchUpdateEntitiesRequest::entities].
11535        ///
11536        /// This is a **required** field for requests.
11537        pub fn set_entities<T, V>(mut self, v: T) -> Self
11538        where
11539            T: std::iter::IntoIterator<Item = V>,
11540            V: std::convert::Into<crate::model::entity_type::Entity>,
11541        {
11542            use std::iter::Iterator;
11543            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11544            self
11545        }
11546
11547        /// Sets the value of [language_code][crate::model::BatchUpdateEntitiesRequest::language_code].
11548        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11549            self.0.request.language_code = v.into();
11550            self
11551        }
11552
11553        /// Sets the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11554        pub fn set_update_mask<T>(mut self, v: T) -> Self
11555        where
11556            T: std::convert::Into<wkt::FieldMask>,
11557        {
11558            self.0.request.update_mask = std::option::Option::Some(v.into());
11559            self
11560        }
11561
11562        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11563        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11564        where
11565            T: std::convert::Into<wkt::FieldMask>,
11566        {
11567            self.0.request.update_mask = v.map(|x| x.into());
11568            self
11569        }
11570    }
11571
11572    #[doc(hidden)]
11573    impl crate::RequestBuilder for BatchUpdateEntities {
11574        fn request_options(&mut self) -> &mut crate::RequestOptions {
11575            &mut self.0.options
11576        }
11577    }
11578
11579    /// The request builder for [EntityTypes::batch_delete_entities][crate::client::EntityTypes::batch_delete_entities] calls.
11580    ///
11581    /// # Example
11582    /// ```
11583    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchDeleteEntities;
11584    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11585    /// use google_cloud_lro::Poller;
11586    ///
11587    /// let builder = prepare_request_builder();
11588    /// let response = builder.poller().until_done().await?;
11589    /// # Ok(()) }
11590    ///
11591    /// fn prepare_request_builder() -> BatchDeleteEntities {
11592    ///   # panic!();
11593    ///   // ... details omitted ...
11594    /// }
11595    /// ```
11596    #[derive(Clone, Debug)]
11597    pub struct BatchDeleteEntities(RequestBuilder<crate::model::BatchDeleteEntitiesRequest>);
11598
11599    impl BatchDeleteEntities {
11600        pub(crate) fn new(
11601            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11602        ) -> Self {
11603            Self(RequestBuilder::new(stub))
11604        }
11605
11606        /// Sets the full request, replacing any prior values.
11607        pub fn with_request<V: Into<crate::model::BatchDeleteEntitiesRequest>>(
11608            mut self,
11609            v: V,
11610        ) -> Self {
11611            self.0.request = v.into();
11612            self
11613        }
11614
11615        /// Sets all the options, replacing any prior values.
11616        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11617            self.0.options = v.into();
11618            self
11619        }
11620
11621        /// Sends the request.
11622        ///
11623        /// # Long running operations
11624        ///
11625        /// This starts, but does not poll, a longrunning operation. More information
11626        /// on [batch_delete_entities][crate::client::EntityTypes::batch_delete_entities].
11627        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11628            (*self.0.stub)
11629                .batch_delete_entities(self.0.request, self.0.options)
11630                .await
11631                .map(crate::Response::into_body)
11632        }
11633
11634        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_entities`.
11635        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11636            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11637            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11638            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11639
11640            let stub = self.0.stub.clone();
11641            let mut options = self.0.options.clone();
11642            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11643            let query = move |name| {
11644                let stub = stub.clone();
11645                let options = options.clone();
11646                async {
11647                    let op = GetOperation::new(stub)
11648                        .set_name(name)
11649                        .with_options(options)
11650                        .send()
11651                        .await?;
11652                    Ok(Operation::new(op))
11653                }
11654            };
11655
11656            let start = move || async {
11657                let op = self.send().await?;
11658                Ok(Operation::new(op))
11659            };
11660
11661            google_cloud_lro::internal::new_unit_response_poller(
11662                polling_error_policy,
11663                polling_backoff_policy,
11664                start,
11665                query,
11666            )
11667        }
11668
11669        /// Sets the value of [parent][crate::model::BatchDeleteEntitiesRequest::parent].
11670        ///
11671        /// This is a **required** field for requests.
11672        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11673            self.0.request.parent = v.into();
11674            self
11675        }
11676
11677        /// Sets the value of [entity_values][crate::model::BatchDeleteEntitiesRequest::entity_values].
11678        ///
11679        /// This is a **required** field for requests.
11680        pub fn set_entity_values<T, V>(mut self, v: T) -> Self
11681        where
11682            T: std::iter::IntoIterator<Item = V>,
11683            V: std::convert::Into<std::string::String>,
11684        {
11685            use std::iter::Iterator;
11686            self.0.request.entity_values = v.into_iter().map(|i| i.into()).collect();
11687            self
11688        }
11689
11690        /// Sets the value of [language_code][crate::model::BatchDeleteEntitiesRequest::language_code].
11691        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11692            self.0.request.language_code = v.into();
11693            self
11694        }
11695    }
11696
11697    #[doc(hidden)]
11698    impl crate::RequestBuilder for BatchDeleteEntities {
11699        fn request_options(&mut self) -> &mut crate::RequestOptions {
11700            &mut self.0.options
11701        }
11702    }
11703
11704    /// The request builder for [EntityTypes::list_locations][crate::client::EntityTypes::list_locations] calls.
11705    ///
11706    /// # Example
11707    /// ```
11708    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListLocations;
11709    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11710    /// use google_cloud_gax::paginator::ItemPaginator;
11711    ///
11712    /// let builder = prepare_request_builder();
11713    /// let mut items = builder.by_item();
11714    /// while let Some(result) = items.next().await {
11715    ///   let item = result?;
11716    /// }
11717    /// # Ok(()) }
11718    ///
11719    /// fn prepare_request_builder() -> ListLocations {
11720    ///   # panic!();
11721    ///   // ... details omitted ...
11722    /// }
11723    /// ```
11724    #[derive(Clone, Debug)]
11725    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
11726
11727    impl ListLocations {
11728        pub(crate) fn new(
11729            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11730        ) -> Self {
11731            Self(RequestBuilder::new(stub))
11732        }
11733
11734        /// Sets the full request, replacing any prior values.
11735        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
11736            mut self,
11737            v: V,
11738        ) -> Self {
11739            self.0.request = v.into();
11740            self
11741        }
11742
11743        /// Sets all the options, replacing any prior values.
11744        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11745            self.0.options = v.into();
11746            self
11747        }
11748
11749        /// Sends the request.
11750        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
11751            (*self.0.stub)
11752                .list_locations(self.0.request, self.0.options)
11753                .await
11754                .map(crate::Response::into_body)
11755        }
11756
11757        /// Streams each page in the collection.
11758        pub fn by_page(
11759            self,
11760        ) -> impl google_cloud_gax::paginator::Paginator<
11761            google_cloud_location::model::ListLocationsResponse,
11762            crate::Error,
11763        > {
11764            use std::clone::Clone;
11765            let token = self.0.request.page_token.clone();
11766            let execute = move |token: String| {
11767                let mut builder = self.clone();
11768                builder.0.request = builder.0.request.set_page_token(token);
11769                builder.send()
11770            };
11771            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11772        }
11773
11774        /// Streams each item in the collection.
11775        pub fn by_item(
11776            self,
11777        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11778            google_cloud_location::model::ListLocationsResponse,
11779            crate::Error,
11780        > {
11781            use google_cloud_gax::paginator::Paginator;
11782            self.by_page().items()
11783        }
11784
11785        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
11786        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11787            self.0.request.name = v.into();
11788            self
11789        }
11790
11791        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
11792        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11793            self.0.request.filter = v.into();
11794            self
11795        }
11796
11797        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
11798        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11799            self.0.request.page_size = v.into();
11800            self
11801        }
11802
11803        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
11804        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11805            self.0.request.page_token = v.into();
11806            self
11807        }
11808    }
11809
11810    #[doc(hidden)]
11811    impl crate::RequestBuilder for ListLocations {
11812        fn request_options(&mut self) -> &mut crate::RequestOptions {
11813            &mut self.0.options
11814        }
11815    }
11816
11817    /// The request builder for [EntityTypes::get_location][crate::client::EntityTypes::get_location] calls.
11818    ///
11819    /// # Example
11820    /// ```
11821    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetLocation;
11822    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11823    ///
11824    /// let builder = prepare_request_builder();
11825    /// let response = builder.send().await?;
11826    /// # Ok(()) }
11827    ///
11828    /// fn prepare_request_builder() -> GetLocation {
11829    ///   # panic!();
11830    ///   // ... details omitted ...
11831    /// }
11832    /// ```
11833    #[derive(Clone, Debug)]
11834    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
11835
11836    impl GetLocation {
11837        pub(crate) fn new(
11838            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11839        ) -> Self {
11840            Self(RequestBuilder::new(stub))
11841        }
11842
11843        /// Sets the full request, replacing any prior values.
11844        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
11845            mut self,
11846            v: V,
11847        ) -> Self {
11848            self.0.request = v.into();
11849            self
11850        }
11851
11852        /// Sets all the options, replacing any prior values.
11853        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11854            self.0.options = v.into();
11855            self
11856        }
11857
11858        /// Sends the request.
11859        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
11860            (*self.0.stub)
11861                .get_location(self.0.request, self.0.options)
11862                .await
11863                .map(crate::Response::into_body)
11864        }
11865
11866        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
11867        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11868            self.0.request.name = v.into();
11869            self
11870        }
11871    }
11872
11873    #[doc(hidden)]
11874    impl crate::RequestBuilder for GetLocation {
11875        fn request_options(&mut self) -> &mut crate::RequestOptions {
11876            &mut self.0.options
11877        }
11878    }
11879
11880    /// The request builder for [EntityTypes::list_operations][crate::client::EntityTypes::list_operations] calls.
11881    ///
11882    /// # Example
11883    /// ```
11884    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListOperations;
11885    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11886    /// use google_cloud_gax::paginator::ItemPaginator;
11887    ///
11888    /// let builder = prepare_request_builder();
11889    /// let mut items = builder.by_item();
11890    /// while let Some(result) = items.next().await {
11891    ///   let item = result?;
11892    /// }
11893    /// # Ok(()) }
11894    ///
11895    /// fn prepare_request_builder() -> ListOperations {
11896    ///   # panic!();
11897    ///   // ... details omitted ...
11898    /// }
11899    /// ```
11900    #[derive(Clone, Debug)]
11901    pub struct ListOperations(
11902        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11903    );
11904
11905    impl ListOperations {
11906        pub(crate) fn new(
11907            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11908        ) -> Self {
11909            Self(RequestBuilder::new(stub))
11910        }
11911
11912        /// Sets the full request, replacing any prior values.
11913        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11914            mut self,
11915            v: V,
11916        ) -> Self {
11917            self.0.request = v.into();
11918            self
11919        }
11920
11921        /// Sets all the options, replacing any prior values.
11922        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11923            self.0.options = v.into();
11924            self
11925        }
11926
11927        /// Sends the request.
11928        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11929            (*self.0.stub)
11930                .list_operations(self.0.request, self.0.options)
11931                .await
11932                .map(crate::Response::into_body)
11933        }
11934
11935        /// Streams each page in the collection.
11936        pub fn by_page(
11937            self,
11938        ) -> impl google_cloud_gax::paginator::Paginator<
11939            google_cloud_longrunning::model::ListOperationsResponse,
11940            crate::Error,
11941        > {
11942            use std::clone::Clone;
11943            let token = self.0.request.page_token.clone();
11944            let execute = move |token: String| {
11945                let mut builder = self.clone();
11946                builder.0.request = builder.0.request.set_page_token(token);
11947                builder.send()
11948            };
11949            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11950        }
11951
11952        /// Streams each item in the collection.
11953        pub fn by_item(
11954            self,
11955        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11956            google_cloud_longrunning::model::ListOperationsResponse,
11957            crate::Error,
11958        > {
11959            use google_cloud_gax::paginator::Paginator;
11960            self.by_page().items()
11961        }
11962
11963        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
11964        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11965            self.0.request.name = v.into();
11966            self
11967        }
11968
11969        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
11970        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11971            self.0.request.filter = v.into();
11972            self
11973        }
11974
11975        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
11976        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11977            self.0.request.page_size = v.into();
11978            self
11979        }
11980
11981        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
11982        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11983            self.0.request.page_token = v.into();
11984            self
11985        }
11986
11987        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
11988        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11989            self.0.request.return_partial_success = v.into();
11990            self
11991        }
11992    }
11993
11994    #[doc(hidden)]
11995    impl crate::RequestBuilder for ListOperations {
11996        fn request_options(&mut self) -> &mut crate::RequestOptions {
11997            &mut self.0.options
11998        }
11999    }
12000
12001    /// The request builder for [EntityTypes::get_operation][crate::client::EntityTypes::get_operation] calls.
12002    ///
12003    /// # Example
12004    /// ```
12005    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetOperation;
12006    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12007    ///
12008    /// let builder = prepare_request_builder();
12009    /// let response = builder.send().await?;
12010    /// # Ok(()) }
12011    ///
12012    /// fn prepare_request_builder() -> GetOperation {
12013    ///   # panic!();
12014    ///   // ... details omitted ...
12015    /// }
12016    /// ```
12017    #[derive(Clone, Debug)]
12018    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
12019
12020    impl GetOperation {
12021        pub(crate) fn new(
12022            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12023        ) -> Self {
12024            Self(RequestBuilder::new(stub))
12025        }
12026
12027        /// Sets the full request, replacing any prior values.
12028        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
12029            mut self,
12030            v: V,
12031        ) -> Self {
12032            self.0.request = v.into();
12033            self
12034        }
12035
12036        /// Sets all the options, replacing any prior values.
12037        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12038            self.0.options = v.into();
12039            self
12040        }
12041
12042        /// Sends the request.
12043        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12044            (*self.0.stub)
12045                .get_operation(self.0.request, self.0.options)
12046                .await
12047                .map(crate::Response::into_body)
12048        }
12049
12050        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
12051        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12052            self.0.request.name = v.into();
12053            self
12054        }
12055    }
12056
12057    #[doc(hidden)]
12058    impl crate::RequestBuilder for GetOperation {
12059        fn request_options(&mut self) -> &mut crate::RequestOptions {
12060            &mut self.0.options
12061        }
12062    }
12063
12064    /// The request builder for [EntityTypes::cancel_operation][crate::client::EntityTypes::cancel_operation] calls.
12065    ///
12066    /// # Example
12067    /// ```
12068    /// # use google_cloud_dialogflow_v2::builder::entity_types::CancelOperation;
12069    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12070    ///
12071    /// let builder = prepare_request_builder();
12072    /// let response = builder.send().await?;
12073    /// # Ok(()) }
12074    ///
12075    /// fn prepare_request_builder() -> CancelOperation {
12076    ///   # panic!();
12077    ///   // ... details omitted ...
12078    /// }
12079    /// ```
12080    #[derive(Clone, Debug)]
12081    pub struct CancelOperation(
12082        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
12083    );
12084
12085    impl CancelOperation {
12086        pub(crate) fn new(
12087            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12088        ) -> Self {
12089            Self(RequestBuilder::new(stub))
12090        }
12091
12092        /// Sets the full request, replacing any prior values.
12093        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
12094            mut self,
12095            v: V,
12096        ) -> Self {
12097            self.0.request = v.into();
12098            self
12099        }
12100
12101        /// Sets all the options, replacing any prior values.
12102        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12103            self.0.options = v.into();
12104            self
12105        }
12106
12107        /// Sends the request.
12108        pub async fn send(self) -> Result<()> {
12109            (*self.0.stub)
12110                .cancel_operation(self.0.request, self.0.options)
12111                .await
12112                .map(crate::Response::into_body)
12113        }
12114
12115        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
12116        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12117            self.0.request.name = v.into();
12118            self
12119        }
12120    }
12121
12122    #[doc(hidden)]
12123    impl crate::RequestBuilder for CancelOperation {
12124        fn request_options(&mut self) -> &mut crate::RequestOptions {
12125            &mut self.0.options
12126        }
12127    }
12128}
12129
12130/// Request and client builders for [Environments][crate::client::Environments].
12131#[cfg(feature = "environments")]
12132#[cfg_attr(docsrs, doc(cfg(feature = "environments")))]
12133pub mod environments {
12134    use crate::Result;
12135
12136    /// A builder for [Environments][crate::client::Environments].
12137    ///
12138    /// ```
12139    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12140    /// # use google_cloud_dialogflow_v2::*;
12141    /// # use builder::environments::ClientBuilder;
12142    /// # use client::Environments;
12143    /// let builder : ClientBuilder = Environments::builder();
12144    /// let client = builder
12145    ///     .with_endpoint("https://dialogflow.googleapis.com")
12146    ///     .build().await?;
12147    /// # Ok(()) }
12148    /// ```
12149    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12150
12151    pub(crate) mod client {
12152        use super::super::super::client::Environments;
12153        pub struct Factory;
12154        impl crate::ClientFactory for Factory {
12155            type Client = Environments;
12156            type Credentials = gaxi::options::Credentials;
12157            async fn build(
12158                self,
12159                config: gaxi::options::ClientConfig,
12160            ) -> crate::ClientBuilderResult<Self::Client> {
12161                Self::Client::new(config).await
12162            }
12163        }
12164    }
12165
12166    /// Common implementation for [crate::client::Environments] request builders.
12167    #[derive(Clone, Debug)]
12168    pub(crate) struct RequestBuilder<R: std::default::Default> {
12169        stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12170        request: R,
12171        options: crate::RequestOptions,
12172    }
12173
12174    impl<R> RequestBuilder<R>
12175    where
12176        R: std::default::Default,
12177    {
12178        pub(crate) fn new(
12179            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12180        ) -> Self {
12181            Self {
12182                stub,
12183                request: R::default(),
12184                options: crate::RequestOptions::default(),
12185            }
12186        }
12187    }
12188
12189    /// The request builder for [Environments::list_environments][crate::client::Environments::list_environments] calls.
12190    ///
12191    /// # Example
12192    /// ```
12193    /// # use google_cloud_dialogflow_v2::builder::environments::ListEnvironments;
12194    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12195    /// use google_cloud_gax::paginator::ItemPaginator;
12196    ///
12197    /// let builder = prepare_request_builder();
12198    /// let mut items = builder.by_item();
12199    /// while let Some(result) = items.next().await {
12200    ///   let item = result?;
12201    /// }
12202    /// # Ok(()) }
12203    ///
12204    /// fn prepare_request_builder() -> ListEnvironments {
12205    ///   # panic!();
12206    ///   // ... details omitted ...
12207    /// }
12208    /// ```
12209    #[derive(Clone, Debug)]
12210    pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
12211
12212    impl ListEnvironments {
12213        pub(crate) fn new(
12214            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12215        ) -> Self {
12216            Self(RequestBuilder::new(stub))
12217        }
12218
12219        /// Sets the full request, replacing any prior values.
12220        pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
12221            mut self,
12222            v: V,
12223        ) -> Self {
12224            self.0.request = v.into();
12225            self
12226        }
12227
12228        /// Sets all the options, replacing any prior values.
12229        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12230            self.0.options = v.into();
12231            self
12232        }
12233
12234        /// Sends the request.
12235        pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
12236            (*self.0.stub)
12237                .list_environments(self.0.request, self.0.options)
12238                .await
12239                .map(crate::Response::into_body)
12240        }
12241
12242        /// Streams each page in the collection.
12243        pub fn by_page(
12244            self,
12245        ) -> impl google_cloud_gax::paginator::Paginator<
12246            crate::model::ListEnvironmentsResponse,
12247            crate::Error,
12248        > {
12249            use std::clone::Clone;
12250            let token = self.0.request.page_token.clone();
12251            let execute = move |token: String| {
12252                let mut builder = self.clone();
12253                builder.0.request = builder.0.request.set_page_token(token);
12254                builder.send()
12255            };
12256            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12257        }
12258
12259        /// Streams each item in the collection.
12260        pub fn by_item(
12261            self,
12262        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12263            crate::model::ListEnvironmentsResponse,
12264            crate::Error,
12265        > {
12266            use google_cloud_gax::paginator::Paginator;
12267            self.by_page().items()
12268        }
12269
12270        /// Sets the value of [parent][crate::model::ListEnvironmentsRequest::parent].
12271        ///
12272        /// This is a **required** field for requests.
12273        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12274            self.0.request.parent = v.into();
12275            self
12276        }
12277
12278        /// Sets the value of [page_size][crate::model::ListEnvironmentsRequest::page_size].
12279        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12280            self.0.request.page_size = v.into();
12281            self
12282        }
12283
12284        /// Sets the value of [page_token][crate::model::ListEnvironmentsRequest::page_token].
12285        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12286            self.0.request.page_token = v.into();
12287            self
12288        }
12289    }
12290
12291    #[doc(hidden)]
12292    impl crate::RequestBuilder for ListEnvironments {
12293        fn request_options(&mut self) -> &mut crate::RequestOptions {
12294            &mut self.0.options
12295        }
12296    }
12297
12298    /// The request builder for [Environments::get_environment][crate::client::Environments::get_environment] calls.
12299    ///
12300    /// # Example
12301    /// ```
12302    /// # use google_cloud_dialogflow_v2::builder::environments::GetEnvironment;
12303    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12304    ///
12305    /// let builder = prepare_request_builder();
12306    /// let response = builder.send().await?;
12307    /// # Ok(()) }
12308    ///
12309    /// fn prepare_request_builder() -> GetEnvironment {
12310    ///   # panic!();
12311    ///   // ... details omitted ...
12312    /// }
12313    /// ```
12314    #[derive(Clone, Debug)]
12315    pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
12316
12317    impl GetEnvironment {
12318        pub(crate) fn new(
12319            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12320        ) -> Self {
12321            Self(RequestBuilder::new(stub))
12322        }
12323
12324        /// Sets the full request, replacing any prior values.
12325        pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
12326            self.0.request = v.into();
12327            self
12328        }
12329
12330        /// Sets all the options, replacing any prior values.
12331        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12332            self.0.options = v.into();
12333            self
12334        }
12335
12336        /// Sends the request.
12337        pub async fn send(self) -> Result<crate::model::Environment> {
12338            (*self.0.stub)
12339                .get_environment(self.0.request, self.0.options)
12340                .await
12341                .map(crate::Response::into_body)
12342        }
12343
12344        /// Sets the value of [name][crate::model::GetEnvironmentRequest::name].
12345        ///
12346        /// This is a **required** field for requests.
12347        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12348            self.0.request.name = v.into();
12349            self
12350        }
12351    }
12352
12353    #[doc(hidden)]
12354    impl crate::RequestBuilder for GetEnvironment {
12355        fn request_options(&mut self) -> &mut crate::RequestOptions {
12356            &mut self.0.options
12357        }
12358    }
12359
12360    /// The request builder for [Environments::create_environment][crate::client::Environments::create_environment] calls.
12361    ///
12362    /// # Example
12363    /// ```
12364    /// # use google_cloud_dialogflow_v2::builder::environments::CreateEnvironment;
12365    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12366    ///
12367    /// let builder = prepare_request_builder();
12368    /// let response = builder.send().await?;
12369    /// # Ok(()) }
12370    ///
12371    /// fn prepare_request_builder() -> CreateEnvironment {
12372    ///   # panic!();
12373    ///   // ... details omitted ...
12374    /// }
12375    /// ```
12376    #[derive(Clone, Debug)]
12377    pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
12378
12379    impl CreateEnvironment {
12380        pub(crate) fn new(
12381            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12382        ) -> Self {
12383            Self(RequestBuilder::new(stub))
12384        }
12385
12386        /// Sets the full request, replacing any prior values.
12387        pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
12388            mut self,
12389            v: V,
12390        ) -> Self {
12391            self.0.request = v.into();
12392            self
12393        }
12394
12395        /// Sets all the options, replacing any prior values.
12396        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12397            self.0.options = v.into();
12398            self
12399        }
12400
12401        /// Sends the request.
12402        pub async fn send(self) -> Result<crate::model::Environment> {
12403            (*self.0.stub)
12404                .create_environment(self.0.request, self.0.options)
12405                .await
12406                .map(crate::Response::into_body)
12407        }
12408
12409        /// Sets the value of [parent][crate::model::CreateEnvironmentRequest::parent].
12410        ///
12411        /// This is a **required** field for requests.
12412        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12413            self.0.request.parent = v.into();
12414            self
12415        }
12416
12417        /// Sets the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12418        ///
12419        /// This is a **required** field for requests.
12420        pub fn set_environment<T>(mut self, v: T) -> Self
12421        where
12422            T: std::convert::Into<crate::model::Environment>,
12423        {
12424            self.0.request.environment = std::option::Option::Some(v.into());
12425            self
12426        }
12427
12428        /// Sets or clears the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12429        ///
12430        /// This is a **required** field for requests.
12431        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12432        where
12433            T: std::convert::Into<crate::model::Environment>,
12434        {
12435            self.0.request.environment = v.map(|x| x.into());
12436            self
12437        }
12438
12439        /// Sets the value of [environment_id][crate::model::CreateEnvironmentRequest::environment_id].
12440        ///
12441        /// This is a **required** field for requests.
12442        pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12443            self.0.request.environment_id = v.into();
12444            self
12445        }
12446    }
12447
12448    #[doc(hidden)]
12449    impl crate::RequestBuilder for CreateEnvironment {
12450        fn request_options(&mut self) -> &mut crate::RequestOptions {
12451            &mut self.0.options
12452        }
12453    }
12454
12455    /// The request builder for [Environments::update_environment][crate::client::Environments::update_environment] calls.
12456    ///
12457    /// # Example
12458    /// ```
12459    /// # use google_cloud_dialogflow_v2::builder::environments::UpdateEnvironment;
12460    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12461    ///
12462    /// let builder = prepare_request_builder();
12463    /// let response = builder.send().await?;
12464    /// # Ok(()) }
12465    ///
12466    /// fn prepare_request_builder() -> UpdateEnvironment {
12467    ///   # panic!();
12468    ///   // ... details omitted ...
12469    /// }
12470    /// ```
12471    #[derive(Clone, Debug)]
12472    pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
12473
12474    impl UpdateEnvironment {
12475        pub(crate) fn new(
12476            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12477        ) -> Self {
12478            Self(RequestBuilder::new(stub))
12479        }
12480
12481        /// Sets the full request, replacing any prior values.
12482        pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
12483            mut self,
12484            v: V,
12485        ) -> Self {
12486            self.0.request = v.into();
12487            self
12488        }
12489
12490        /// Sets all the options, replacing any prior values.
12491        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12492            self.0.options = v.into();
12493            self
12494        }
12495
12496        /// Sends the request.
12497        pub async fn send(self) -> Result<crate::model::Environment> {
12498            (*self.0.stub)
12499                .update_environment(self.0.request, self.0.options)
12500                .await
12501                .map(crate::Response::into_body)
12502        }
12503
12504        /// Sets the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12505        ///
12506        /// This is a **required** field for requests.
12507        pub fn set_environment<T>(mut self, v: T) -> Self
12508        where
12509            T: std::convert::Into<crate::model::Environment>,
12510        {
12511            self.0.request.environment = std::option::Option::Some(v.into());
12512            self
12513        }
12514
12515        /// Sets or clears the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12516        ///
12517        /// This is a **required** field for requests.
12518        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12519        where
12520            T: std::convert::Into<crate::model::Environment>,
12521        {
12522            self.0.request.environment = v.map(|x| x.into());
12523            self
12524        }
12525
12526        /// Sets the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12527        ///
12528        /// This is a **required** field for requests.
12529        pub fn set_update_mask<T>(mut self, v: T) -> Self
12530        where
12531            T: std::convert::Into<wkt::FieldMask>,
12532        {
12533            self.0.request.update_mask = std::option::Option::Some(v.into());
12534            self
12535        }
12536
12537        /// Sets or clears the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12538        ///
12539        /// This is a **required** field for requests.
12540        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12541        where
12542            T: std::convert::Into<wkt::FieldMask>,
12543        {
12544            self.0.request.update_mask = v.map(|x| x.into());
12545            self
12546        }
12547
12548        /// Sets the value of [allow_load_to_draft_and_discard_changes][crate::model::UpdateEnvironmentRequest::allow_load_to_draft_and_discard_changes].
12549        pub fn set_allow_load_to_draft_and_discard_changes<T: Into<bool>>(mut self, v: T) -> Self {
12550            self.0.request.allow_load_to_draft_and_discard_changes = v.into();
12551            self
12552        }
12553    }
12554
12555    #[doc(hidden)]
12556    impl crate::RequestBuilder for UpdateEnvironment {
12557        fn request_options(&mut self) -> &mut crate::RequestOptions {
12558            &mut self.0.options
12559        }
12560    }
12561
12562    /// The request builder for [Environments::delete_environment][crate::client::Environments::delete_environment] calls.
12563    ///
12564    /// # Example
12565    /// ```
12566    /// # use google_cloud_dialogflow_v2::builder::environments::DeleteEnvironment;
12567    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12568    ///
12569    /// let builder = prepare_request_builder();
12570    /// let response = builder.send().await?;
12571    /// # Ok(()) }
12572    ///
12573    /// fn prepare_request_builder() -> DeleteEnvironment {
12574    ///   # panic!();
12575    ///   // ... details omitted ...
12576    /// }
12577    /// ```
12578    #[derive(Clone, Debug)]
12579    pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
12580
12581    impl DeleteEnvironment {
12582        pub(crate) fn new(
12583            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12584        ) -> Self {
12585            Self(RequestBuilder::new(stub))
12586        }
12587
12588        /// Sets the full request, replacing any prior values.
12589        pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
12590            mut self,
12591            v: V,
12592        ) -> Self {
12593            self.0.request = v.into();
12594            self
12595        }
12596
12597        /// Sets all the options, replacing any prior values.
12598        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12599            self.0.options = v.into();
12600            self
12601        }
12602
12603        /// Sends the request.
12604        pub async fn send(self) -> Result<()> {
12605            (*self.0.stub)
12606                .delete_environment(self.0.request, self.0.options)
12607                .await
12608                .map(crate::Response::into_body)
12609        }
12610
12611        /// Sets the value of [name][crate::model::DeleteEnvironmentRequest::name].
12612        ///
12613        /// This is a **required** field for requests.
12614        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12615            self.0.request.name = v.into();
12616            self
12617        }
12618    }
12619
12620    #[doc(hidden)]
12621    impl crate::RequestBuilder for DeleteEnvironment {
12622        fn request_options(&mut self) -> &mut crate::RequestOptions {
12623            &mut self.0.options
12624        }
12625    }
12626
12627    /// The request builder for [Environments::get_environment_history][crate::client::Environments::get_environment_history] calls.
12628    ///
12629    /// # Example
12630    /// ```
12631    /// # use google_cloud_dialogflow_v2::builder::environments::GetEnvironmentHistory;
12632    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12633    /// use google_cloud_gax::paginator::ItemPaginator;
12634    ///
12635    /// let builder = prepare_request_builder();
12636    /// let mut items = builder.by_item();
12637    /// while let Some(result) = items.next().await {
12638    ///   let item = result?;
12639    /// }
12640    /// # Ok(()) }
12641    ///
12642    /// fn prepare_request_builder() -> GetEnvironmentHistory {
12643    ///   # panic!();
12644    ///   // ... details omitted ...
12645    /// }
12646    /// ```
12647    #[derive(Clone, Debug)]
12648    pub struct GetEnvironmentHistory(RequestBuilder<crate::model::GetEnvironmentHistoryRequest>);
12649
12650    impl GetEnvironmentHistory {
12651        pub(crate) fn new(
12652            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12653        ) -> Self {
12654            Self(RequestBuilder::new(stub))
12655        }
12656
12657        /// Sets the full request, replacing any prior values.
12658        pub fn with_request<V: Into<crate::model::GetEnvironmentHistoryRequest>>(
12659            mut self,
12660            v: V,
12661        ) -> Self {
12662            self.0.request = v.into();
12663            self
12664        }
12665
12666        /// Sets all the options, replacing any prior values.
12667        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12668            self.0.options = v.into();
12669            self
12670        }
12671
12672        /// Sends the request.
12673        pub async fn send(self) -> Result<crate::model::EnvironmentHistory> {
12674            (*self.0.stub)
12675                .get_environment_history(self.0.request, self.0.options)
12676                .await
12677                .map(crate::Response::into_body)
12678        }
12679
12680        /// Streams each page in the collection.
12681        pub fn by_page(
12682            self,
12683        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::EnvironmentHistory, crate::Error>
12684        {
12685            use std::clone::Clone;
12686            let token = self.0.request.page_token.clone();
12687            let execute = move |token: String| {
12688                let mut builder = self.clone();
12689                builder.0.request = builder.0.request.set_page_token(token);
12690                builder.send()
12691            };
12692            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12693        }
12694
12695        /// Streams each item in the collection.
12696        pub fn by_item(
12697            self,
12698        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12699            crate::model::EnvironmentHistory,
12700            crate::Error,
12701        > {
12702            use google_cloud_gax::paginator::Paginator;
12703            self.by_page().items()
12704        }
12705
12706        /// Sets the value of [parent][crate::model::GetEnvironmentHistoryRequest::parent].
12707        ///
12708        /// This is a **required** field for requests.
12709        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12710            self.0.request.parent = v.into();
12711            self
12712        }
12713
12714        /// Sets the value of [page_size][crate::model::GetEnvironmentHistoryRequest::page_size].
12715        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12716            self.0.request.page_size = v.into();
12717            self
12718        }
12719
12720        /// Sets the value of [page_token][crate::model::GetEnvironmentHistoryRequest::page_token].
12721        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12722            self.0.request.page_token = v.into();
12723            self
12724        }
12725    }
12726
12727    #[doc(hidden)]
12728    impl crate::RequestBuilder for GetEnvironmentHistory {
12729        fn request_options(&mut self) -> &mut crate::RequestOptions {
12730            &mut self.0.options
12731        }
12732    }
12733
12734    /// The request builder for [Environments::list_locations][crate::client::Environments::list_locations] calls.
12735    ///
12736    /// # Example
12737    /// ```
12738    /// # use google_cloud_dialogflow_v2::builder::environments::ListLocations;
12739    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12740    /// use google_cloud_gax::paginator::ItemPaginator;
12741    ///
12742    /// let builder = prepare_request_builder();
12743    /// let mut items = builder.by_item();
12744    /// while let Some(result) = items.next().await {
12745    ///   let item = result?;
12746    /// }
12747    /// # Ok(()) }
12748    ///
12749    /// fn prepare_request_builder() -> ListLocations {
12750    ///   # panic!();
12751    ///   // ... details omitted ...
12752    /// }
12753    /// ```
12754    #[derive(Clone, Debug)]
12755    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12756
12757    impl ListLocations {
12758        pub(crate) fn new(
12759            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12760        ) -> Self {
12761            Self(RequestBuilder::new(stub))
12762        }
12763
12764        /// Sets the full request, replacing any prior values.
12765        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12766            mut self,
12767            v: V,
12768        ) -> Self {
12769            self.0.request = v.into();
12770            self
12771        }
12772
12773        /// Sets all the options, replacing any prior values.
12774        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12775            self.0.options = v.into();
12776            self
12777        }
12778
12779        /// Sends the request.
12780        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12781            (*self.0.stub)
12782                .list_locations(self.0.request, self.0.options)
12783                .await
12784                .map(crate::Response::into_body)
12785        }
12786
12787        /// Streams each page in the collection.
12788        pub fn by_page(
12789            self,
12790        ) -> impl google_cloud_gax::paginator::Paginator<
12791            google_cloud_location::model::ListLocationsResponse,
12792            crate::Error,
12793        > {
12794            use std::clone::Clone;
12795            let token = self.0.request.page_token.clone();
12796            let execute = move |token: String| {
12797                let mut builder = self.clone();
12798                builder.0.request = builder.0.request.set_page_token(token);
12799                builder.send()
12800            };
12801            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12802        }
12803
12804        /// Streams each item in the collection.
12805        pub fn by_item(
12806            self,
12807        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12808            google_cloud_location::model::ListLocationsResponse,
12809            crate::Error,
12810        > {
12811            use google_cloud_gax::paginator::Paginator;
12812            self.by_page().items()
12813        }
12814
12815        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
12816        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12817            self.0.request.name = v.into();
12818            self
12819        }
12820
12821        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
12822        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12823            self.0.request.filter = v.into();
12824            self
12825        }
12826
12827        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
12828        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12829            self.0.request.page_size = v.into();
12830            self
12831        }
12832
12833        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
12834        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12835            self.0.request.page_token = v.into();
12836            self
12837        }
12838    }
12839
12840    #[doc(hidden)]
12841    impl crate::RequestBuilder for ListLocations {
12842        fn request_options(&mut self) -> &mut crate::RequestOptions {
12843            &mut self.0.options
12844        }
12845    }
12846
12847    /// The request builder for [Environments::get_location][crate::client::Environments::get_location] calls.
12848    ///
12849    /// # Example
12850    /// ```
12851    /// # use google_cloud_dialogflow_v2::builder::environments::GetLocation;
12852    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12853    ///
12854    /// let builder = prepare_request_builder();
12855    /// let response = builder.send().await?;
12856    /// # Ok(()) }
12857    ///
12858    /// fn prepare_request_builder() -> GetLocation {
12859    ///   # panic!();
12860    ///   // ... details omitted ...
12861    /// }
12862    /// ```
12863    #[derive(Clone, Debug)]
12864    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
12865
12866    impl GetLocation {
12867        pub(crate) fn new(
12868            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12869        ) -> Self {
12870            Self(RequestBuilder::new(stub))
12871        }
12872
12873        /// Sets the full request, replacing any prior values.
12874        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
12875            mut self,
12876            v: V,
12877        ) -> Self {
12878            self.0.request = v.into();
12879            self
12880        }
12881
12882        /// Sets all the options, replacing any prior values.
12883        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12884            self.0.options = v.into();
12885            self
12886        }
12887
12888        /// Sends the request.
12889        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
12890            (*self.0.stub)
12891                .get_location(self.0.request, self.0.options)
12892                .await
12893                .map(crate::Response::into_body)
12894        }
12895
12896        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
12897        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12898            self.0.request.name = v.into();
12899            self
12900        }
12901    }
12902
12903    #[doc(hidden)]
12904    impl crate::RequestBuilder for GetLocation {
12905        fn request_options(&mut self) -> &mut crate::RequestOptions {
12906            &mut self.0.options
12907        }
12908    }
12909
12910    /// The request builder for [Environments::list_operations][crate::client::Environments::list_operations] calls.
12911    ///
12912    /// # Example
12913    /// ```
12914    /// # use google_cloud_dialogflow_v2::builder::environments::ListOperations;
12915    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12916    /// use google_cloud_gax::paginator::ItemPaginator;
12917    ///
12918    /// let builder = prepare_request_builder();
12919    /// let mut items = builder.by_item();
12920    /// while let Some(result) = items.next().await {
12921    ///   let item = result?;
12922    /// }
12923    /// # Ok(()) }
12924    ///
12925    /// fn prepare_request_builder() -> ListOperations {
12926    ///   # panic!();
12927    ///   // ... details omitted ...
12928    /// }
12929    /// ```
12930    #[derive(Clone, Debug)]
12931    pub struct ListOperations(
12932        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
12933    );
12934
12935    impl ListOperations {
12936        pub(crate) fn new(
12937            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12938        ) -> Self {
12939            Self(RequestBuilder::new(stub))
12940        }
12941
12942        /// Sets the full request, replacing any prior values.
12943        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
12944            mut self,
12945            v: V,
12946        ) -> Self {
12947            self.0.request = v.into();
12948            self
12949        }
12950
12951        /// Sets all the options, replacing any prior values.
12952        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12953            self.0.options = v.into();
12954            self
12955        }
12956
12957        /// Sends the request.
12958        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
12959            (*self.0.stub)
12960                .list_operations(self.0.request, self.0.options)
12961                .await
12962                .map(crate::Response::into_body)
12963        }
12964
12965        /// Streams each page in the collection.
12966        pub fn by_page(
12967            self,
12968        ) -> impl google_cloud_gax::paginator::Paginator<
12969            google_cloud_longrunning::model::ListOperationsResponse,
12970            crate::Error,
12971        > {
12972            use std::clone::Clone;
12973            let token = self.0.request.page_token.clone();
12974            let execute = move |token: String| {
12975                let mut builder = self.clone();
12976                builder.0.request = builder.0.request.set_page_token(token);
12977                builder.send()
12978            };
12979            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12980        }
12981
12982        /// Streams each item in the collection.
12983        pub fn by_item(
12984            self,
12985        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12986            google_cloud_longrunning::model::ListOperationsResponse,
12987            crate::Error,
12988        > {
12989            use google_cloud_gax::paginator::Paginator;
12990            self.by_page().items()
12991        }
12992
12993        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
12994        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12995            self.0.request.name = v.into();
12996            self
12997        }
12998
12999        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
13000        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13001            self.0.request.filter = v.into();
13002            self
13003        }
13004
13005        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
13006        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13007            self.0.request.page_size = v.into();
13008            self
13009        }
13010
13011        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13012        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13013            self.0.request.page_token = v.into();
13014            self
13015        }
13016
13017        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13018        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13019            self.0.request.return_partial_success = v.into();
13020            self
13021        }
13022    }
13023
13024    #[doc(hidden)]
13025    impl crate::RequestBuilder for ListOperations {
13026        fn request_options(&mut self) -> &mut crate::RequestOptions {
13027            &mut self.0.options
13028        }
13029    }
13030
13031    /// The request builder for [Environments::get_operation][crate::client::Environments::get_operation] calls.
13032    ///
13033    /// # Example
13034    /// ```
13035    /// # use google_cloud_dialogflow_v2::builder::environments::GetOperation;
13036    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13037    ///
13038    /// let builder = prepare_request_builder();
13039    /// let response = builder.send().await?;
13040    /// # Ok(()) }
13041    ///
13042    /// fn prepare_request_builder() -> GetOperation {
13043    ///   # panic!();
13044    ///   // ... details omitted ...
13045    /// }
13046    /// ```
13047    #[derive(Clone, Debug)]
13048    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13049
13050    impl GetOperation {
13051        pub(crate) fn new(
13052            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13053        ) -> Self {
13054            Self(RequestBuilder::new(stub))
13055        }
13056
13057        /// Sets the full request, replacing any prior values.
13058        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13059            mut self,
13060            v: V,
13061        ) -> Self {
13062            self.0.request = v.into();
13063            self
13064        }
13065
13066        /// Sets all the options, replacing any prior values.
13067        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13068            self.0.options = v.into();
13069            self
13070        }
13071
13072        /// Sends the request.
13073        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13074            (*self.0.stub)
13075                .get_operation(self.0.request, self.0.options)
13076                .await
13077                .map(crate::Response::into_body)
13078        }
13079
13080        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13081        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13082            self.0.request.name = v.into();
13083            self
13084        }
13085    }
13086
13087    #[doc(hidden)]
13088    impl crate::RequestBuilder for GetOperation {
13089        fn request_options(&mut self) -> &mut crate::RequestOptions {
13090            &mut self.0.options
13091        }
13092    }
13093
13094    /// The request builder for [Environments::cancel_operation][crate::client::Environments::cancel_operation] calls.
13095    ///
13096    /// # Example
13097    /// ```
13098    /// # use google_cloud_dialogflow_v2::builder::environments::CancelOperation;
13099    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13100    ///
13101    /// let builder = prepare_request_builder();
13102    /// let response = builder.send().await?;
13103    /// # Ok(()) }
13104    ///
13105    /// fn prepare_request_builder() -> CancelOperation {
13106    ///   # panic!();
13107    ///   // ... details omitted ...
13108    /// }
13109    /// ```
13110    #[derive(Clone, Debug)]
13111    pub struct CancelOperation(
13112        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13113    );
13114
13115    impl CancelOperation {
13116        pub(crate) fn new(
13117            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13118        ) -> Self {
13119            Self(RequestBuilder::new(stub))
13120        }
13121
13122        /// Sets the full request, replacing any prior values.
13123        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13124            mut self,
13125            v: V,
13126        ) -> Self {
13127            self.0.request = v.into();
13128            self
13129        }
13130
13131        /// Sets all the options, replacing any prior values.
13132        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13133            self.0.options = v.into();
13134            self
13135        }
13136
13137        /// Sends the request.
13138        pub async fn send(self) -> Result<()> {
13139            (*self.0.stub)
13140                .cancel_operation(self.0.request, self.0.options)
13141                .await
13142                .map(crate::Response::into_body)
13143        }
13144
13145        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
13146        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13147            self.0.request.name = v.into();
13148            self
13149        }
13150    }
13151
13152    #[doc(hidden)]
13153    impl crate::RequestBuilder for CancelOperation {
13154        fn request_options(&mut self) -> &mut crate::RequestOptions {
13155            &mut self.0.options
13156        }
13157    }
13158}
13159
13160/// Request and client builders for [Fulfillments][crate::client::Fulfillments].
13161#[cfg(feature = "fulfillments")]
13162#[cfg_attr(docsrs, doc(cfg(feature = "fulfillments")))]
13163pub mod fulfillments {
13164    use crate::Result;
13165
13166    /// A builder for [Fulfillments][crate::client::Fulfillments].
13167    ///
13168    /// ```
13169    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13170    /// # use google_cloud_dialogflow_v2::*;
13171    /// # use builder::fulfillments::ClientBuilder;
13172    /// # use client::Fulfillments;
13173    /// let builder : ClientBuilder = Fulfillments::builder();
13174    /// let client = builder
13175    ///     .with_endpoint("https://dialogflow.googleapis.com")
13176    ///     .build().await?;
13177    /// # Ok(()) }
13178    /// ```
13179    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13180
13181    pub(crate) mod client {
13182        use super::super::super::client::Fulfillments;
13183        pub struct Factory;
13184        impl crate::ClientFactory for Factory {
13185            type Client = Fulfillments;
13186            type Credentials = gaxi::options::Credentials;
13187            async fn build(
13188                self,
13189                config: gaxi::options::ClientConfig,
13190            ) -> crate::ClientBuilderResult<Self::Client> {
13191                Self::Client::new(config).await
13192            }
13193        }
13194    }
13195
13196    /// Common implementation for [crate::client::Fulfillments] request builders.
13197    #[derive(Clone, Debug)]
13198    pub(crate) struct RequestBuilder<R: std::default::Default> {
13199        stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13200        request: R,
13201        options: crate::RequestOptions,
13202    }
13203
13204    impl<R> RequestBuilder<R>
13205    where
13206        R: std::default::Default,
13207    {
13208        pub(crate) fn new(
13209            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13210        ) -> Self {
13211            Self {
13212                stub,
13213                request: R::default(),
13214                options: crate::RequestOptions::default(),
13215            }
13216        }
13217    }
13218
13219    /// The request builder for [Fulfillments::get_fulfillment][crate::client::Fulfillments::get_fulfillment] calls.
13220    ///
13221    /// # Example
13222    /// ```
13223    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetFulfillment;
13224    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13225    ///
13226    /// let builder = prepare_request_builder();
13227    /// let response = builder.send().await?;
13228    /// # Ok(()) }
13229    ///
13230    /// fn prepare_request_builder() -> GetFulfillment {
13231    ///   # panic!();
13232    ///   // ... details omitted ...
13233    /// }
13234    /// ```
13235    #[derive(Clone, Debug)]
13236    pub struct GetFulfillment(RequestBuilder<crate::model::GetFulfillmentRequest>);
13237
13238    impl GetFulfillment {
13239        pub(crate) fn new(
13240            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13241        ) -> Self {
13242            Self(RequestBuilder::new(stub))
13243        }
13244
13245        /// Sets the full request, replacing any prior values.
13246        pub fn with_request<V: Into<crate::model::GetFulfillmentRequest>>(mut self, v: V) -> Self {
13247            self.0.request = v.into();
13248            self
13249        }
13250
13251        /// Sets all the options, replacing any prior values.
13252        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13253            self.0.options = v.into();
13254            self
13255        }
13256
13257        /// Sends the request.
13258        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13259            (*self.0.stub)
13260                .get_fulfillment(self.0.request, self.0.options)
13261                .await
13262                .map(crate::Response::into_body)
13263        }
13264
13265        /// Sets the value of [name][crate::model::GetFulfillmentRequest::name].
13266        ///
13267        /// This is a **required** field for requests.
13268        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13269            self.0.request.name = v.into();
13270            self
13271        }
13272    }
13273
13274    #[doc(hidden)]
13275    impl crate::RequestBuilder for GetFulfillment {
13276        fn request_options(&mut self) -> &mut crate::RequestOptions {
13277            &mut self.0.options
13278        }
13279    }
13280
13281    /// The request builder for [Fulfillments::update_fulfillment][crate::client::Fulfillments::update_fulfillment] calls.
13282    ///
13283    /// # Example
13284    /// ```
13285    /// # use google_cloud_dialogflow_v2::builder::fulfillments::UpdateFulfillment;
13286    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13287    ///
13288    /// let builder = prepare_request_builder();
13289    /// let response = builder.send().await?;
13290    /// # Ok(()) }
13291    ///
13292    /// fn prepare_request_builder() -> UpdateFulfillment {
13293    ///   # panic!();
13294    ///   // ... details omitted ...
13295    /// }
13296    /// ```
13297    #[derive(Clone, Debug)]
13298    pub struct UpdateFulfillment(RequestBuilder<crate::model::UpdateFulfillmentRequest>);
13299
13300    impl UpdateFulfillment {
13301        pub(crate) fn new(
13302            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13303        ) -> Self {
13304            Self(RequestBuilder::new(stub))
13305        }
13306
13307        /// Sets the full request, replacing any prior values.
13308        pub fn with_request<V: Into<crate::model::UpdateFulfillmentRequest>>(
13309            mut self,
13310            v: V,
13311        ) -> Self {
13312            self.0.request = v.into();
13313            self
13314        }
13315
13316        /// Sets all the options, replacing any prior values.
13317        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13318            self.0.options = v.into();
13319            self
13320        }
13321
13322        /// Sends the request.
13323        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13324            (*self.0.stub)
13325                .update_fulfillment(self.0.request, self.0.options)
13326                .await
13327                .map(crate::Response::into_body)
13328        }
13329
13330        /// Sets the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13331        ///
13332        /// This is a **required** field for requests.
13333        pub fn set_fulfillment<T>(mut self, v: T) -> Self
13334        where
13335            T: std::convert::Into<crate::model::Fulfillment>,
13336        {
13337            self.0.request.fulfillment = std::option::Option::Some(v.into());
13338            self
13339        }
13340
13341        /// Sets or clears the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13342        ///
13343        /// This is a **required** field for requests.
13344        pub fn set_or_clear_fulfillment<T>(mut self, v: std::option::Option<T>) -> Self
13345        where
13346            T: std::convert::Into<crate::model::Fulfillment>,
13347        {
13348            self.0.request.fulfillment = v.map(|x| x.into());
13349            self
13350        }
13351
13352        /// Sets the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13353        ///
13354        /// This is a **required** field for requests.
13355        pub fn set_update_mask<T>(mut self, v: T) -> Self
13356        where
13357            T: std::convert::Into<wkt::FieldMask>,
13358        {
13359            self.0.request.update_mask = std::option::Option::Some(v.into());
13360            self
13361        }
13362
13363        /// Sets or clears the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13364        ///
13365        /// This is a **required** field for requests.
13366        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13367        where
13368            T: std::convert::Into<wkt::FieldMask>,
13369        {
13370            self.0.request.update_mask = v.map(|x| x.into());
13371            self
13372        }
13373    }
13374
13375    #[doc(hidden)]
13376    impl crate::RequestBuilder for UpdateFulfillment {
13377        fn request_options(&mut self) -> &mut crate::RequestOptions {
13378            &mut self.0.options
13379        }
13380    }
13381
13382    /// The request builder for [Fulfillments::list_locations][crate::client::Fulfillments::list_locations] calls.
13383    ///
13384    /// # Example
13385    /// ```
13386    /// # use google_cloud_dialogflow_v2::builder::fulfillments::ListLocations;
13387    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13388    /// use google_cloud_gax::paginator::ItemPaginator;
13389    ///
13390    /// let builder = prepare_request_builder();
13391    /// let mut items = builder.by_item();
13392    /// while let Some(result) = items.next().await {
13393    ///   let item = result?;
13394    /// }
13395    /// # Ok(()) }
13396    ///
13397    /// fn prepare_request_builder() -> ListLocations {
13398    ///   # panic!();
13399    ///   // ... details omitted ...
13400    /// }
13401    /// ```
13402    #[derive(Clone, Debug)]
13403    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13404
13405    impl ListLocations {
13406        pub(crate) fn new(
13407            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13408        ) -> Self {
13409            Self(RequestBuilder::new(stub))
13410        }
13411
13412        /// Sets the full request, replacing any prior values.
13413        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13414            mut self,
13415            v: V,
13416        ) -> Self {
13417            self.0.request = v.into();
13418            self
13419        }
13420
13421        /// Sets all the options, replacing any prior values.
13422        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13423            self.0.options = v.into();
13424            self
13425        }
13426
13427        /// Sends the request.
13428        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13429            (*self.0.stub)
13430                .list_locations(self.0.request, self.0.options)
13431                .await
13432                .map(crate::Response::into_body)
13433        }
13434
13435        /// Streams each page in the collection.
13436        pub fn by_page(
13437            self,
13438        ) -> impl google_cloud_gax::paginator::Paginator<
13439            google_cloud_location::model::ListLocationsResponse,
13440            crate::Error,
13441        > {
13442            use std::clone::Clone;
13443            let token = self.0.request.page_token.clone();
13444            let execute = move |token: String| {
13445                let mut builder = self.clone();
13446                builder.0.request = builder.0.request.set_page_token(token);
13447                builder.send()
13448            };
13449            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13450        }
13451
13452        /// Streams each item in the collection.
13453        pub fn by_item(
13454            self,
13455        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13456            google_cloud_location::model::ListLocationsResponse,
13457            crate::Error,
13458        > {
13459            use google_cloud_gax::paginator::Paginator;
13460            self.by_page().items()
13461        }
13462
13463        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13464        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13465            self.0.request.name = v.into();
13466            self
13467        }
13468
13469        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13470        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13471            self.0.request.filter = v.into();
13472            self
13473        }
13474
13475        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13476        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13477            self.0.request.page_size = v.into();
13478            self
13479        }
13480
13481        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
13482        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13483            self.0.request.page_token = v.into();
13484            self
13485        }
13486    }
13487
13488    #[doc(hidden)]
13489    impl crate::RequestBuilder for ListLocations {
13490        fn request_options(&mut self) -> &mut crate::RequestOptions {
13491            &mut self.0.options
13492        }
13493    }
13494
13495    /// The request builder for [Fulfillments::get_location][crate::client::Fulfillments::get_location] calls.
13496    ///
13497    /// # Example
13498    /// ```
13499    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetLocation;
13500    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13501    ///
13502    /// let builder = prepare_request_builder();
13503    /// let response = builder.send().await?;
13504    /// # Ok(()) }
13505    ///
13506    /// fn prepare_request_builder() -> GetLocation {
13507    ///   # panic!();
13508    ///   // ... details omitted ...
13509    /// }
13510    /// ```
13511    #[derive(Clone, Debug)]
13512    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13513
13514    impl GetLocation {
13515        pub(crate) fn new(
13516            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13517        ) -> Self {
13518            Self(RequestBuilder::new(stub))
13519        }
13520
13521        /// Sets the full request, replacing any prior values.
13522        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13523            mut self,
13524            v: V,
13525        ) -> Self {
13526            self.0.request = v.into();
13527            self
13528        }
13529
13530        /// Sets all the options, replacing any prior values.
13531        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13532            self.0.options = v.into();
13533            self
13534        }
13535
13536        /// Sends the request.
13537        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13538            (*self.0.stub)
13539                .get_location(self.0.request, self.0.options)
13540                .await
13541                .map(crate::Response::into_body)
13542        }
13543
13544        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
13545        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13546            self.0.request.name = v.into();
13547            self
13548        }
13549    }
13550
13551    #[doc(hidden)]
13552    impl crate::RequestBuilder for GetLocation {
13553        fn request_options(&mut self) -> &mut crate::RequestOptions {
13554            &mut self.0.options
13555        }
13556    }
13557
13558    /// The request builder for [Fulfillments::list_operations][crate::client::Fulfillments::list_operations] calls.
13559    ///
13560    /// # Example
13561    /// ```
13562    /// # use google_cloud_dialogflow_v2::builder::fulfillments::ListOperations;
13563    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13564    /// use google_cloud_gax::paginator::ItemPaginator;
13565    ///
13566    /// let builder = prepare_request_builder();
13567    /// let mut items = builder.by_item();
13568    /// while let Some(result) = items.next().await {
13569    ///   let item = result?;
13570    /// }
13571    /// # Ok(()) }
13572    ///
13573    /// fn prepare_request_builder() -> ListOperations {
13574    ///   # panic!();
13575    ///   // ... details omitted ...
13576    /// }
13577    /// ```
13578    #[derive(Clone, Debug)]
13579    pub struct ListOperations(
13580        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13581    );
13582
13583    impl ListOperations {
13584        pub(crate) fn new(
13585            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13586        ) -> Self {
13587            Self(RequestBuilder::new(stub))
13588        }
13589
13590        /// Sets the full request, replacing any prior values.
13591        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13592            mut self,
13593            v: V,
13594        ) -> Self {
13595            self.0.request = v.into();
13596            self
13597        }
13598
13599        /// Sets all the options, replacing any prior values.
13600        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13601            self.0.options = v.into();
13602            self
13603        }
13604
13605        /// Sends the request.
13606        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13607            (*self.0.stub)
13608                .list_operations(self.0.request, self.0.options)
13609                .await
13610                .map(crate::Response::into_body)
13611        }
13612
13613        /// Streams each page in the collection.
13614        pub fn by_page(
13615            self,
13616        ) -> impl google_cloud_gax::paginator::Paginator<
13617            google_cloud_longrunning::model::ListOperationsResponse,
13618            crate::Error,
13619        > {
13620            use std::clone::Clone;
13621            let token = self.0.request.page_token.clone();
13622            let execute = move |token: String| {
13623                let mut builder = self.clone();
13624                builder.0.request = builder.0.request.set_page_token(token);
13625                builder.send()
13626            };
13627            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13628        }
13629
13630        /// Streams each item in the collection.
13631        pub fn by_item(
13632            self,
13633        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13634            google_cloud_longrunning::model::ListOperationsResponse,
13635            crate::Error,
13636        > {
13637            use google_cloud_gax::paginator::Paginator;
13638            self.by_page().items()
13639        }
13640
13641        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
13642        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13643            self.0.request.name = v.into();
13644            self
13645        }
13646
13647        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
13648        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13649            self.0.request.filter = v.into();
13650            self
13651        }
13652
13653        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
13654        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13655            self.0.request.page_size = v.into();
13656            self
13657        }
13658
13659        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13660        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13661            self.0.request.page_token = v.into();
13662            self
13663        }
13664
13665        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13666        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13667            self.0.request.return_partial_success = v.into();
13668            self
13669        }
13670    }
13671
13672    #[doc(hidden)]
13673    impl crate::RequestBuilder for ListOperations {
13674        fn request_options(&mut self) -> &mut crate::RequestOptions {
13675            &mut self.0.options
13676        }
13677    }
13678
13679    /// The request builder for [Fulfillments::get_operation][crate::client::Fulfillments::get_operation] calls.
13680    ///
13681    /// # Example
13682    /// ```
13683    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetOperation;
13684    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13685    ///
13686    /// let builder = prepare_request_builder();
13687    /// let response = builder.send().await?;
13688    /// # Ok(()) }
13689    ///
13690    /// fn prepare_request_builder() -> GetOperation {
13691    ///   # panic!();
13692    ///   // ... details omitted ...
13693    /// }
13694    /// ```
13695    #[derive(Clone, Debug)]
13696    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13697
13698    impl GetOperation {
13699        pub(crate) fn new(
13700            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13701        ) -> Self {
13702            Self(RequestBuilder::new(stub))
13703        }
13704
13705        /// Sets the full request, replacing any prior values.
13706        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13707            mut self,
13708            v: V,
13709        ) -> Self {
13710            self.0.request = v.into();
13711            self
13712        }
13713
13714        /// Sets all the options, replacing any prior values.
13715        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13716            self.0.options = v.into();
13717            self
13718        }
13719
13720        /// Sends the request.
13721        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13722            (*self.0.stub)
13723                .get_operation(self.0.request, self.0.options)
13724                .await
13725                .map(crate::Response::into_body)
13726        }
13727
13728        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13729        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13730            self.0.request.name = v.into();
13731            self
13732        }
13733    }
13734
13735    #[doc(hidden)]
13736    impl crate::RequestBuilder for GetOperation {
13737        fn request_options(&mut self) -> &mut crate::RequestOptions {
13738            &mut self.0.options
13739        }
13740    }
13741
13742    /// The request builder for [Fulfillments::cancel_operation][crate::client::Fulfillments::cancel_operation] calls.
13743    ///
13744    /// # Example
13745    /// ```
13746    /// # use google_cloud_dialogflow_v2::builder::fulfillments::CancelOperation;
13747    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13748    ///
13749    /// let builder = prepare_request_builder();
13750    /// let response = builder.send().await?;
13751    /// # Ok(()) }
13752    ///
13753    /// fn prepare_request_builder() -> CancelOperation {
13754    ///   # panic!();
13755    ///   // ... details omitted ...
13756    /// }
13757    /// ```
13758    #[derive(Clone, Debug)]
13759    pub struct CancelOperation(
13760        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13761    );
13762
13763    impl CancelOperation {
13764        pub(crate) fn new(
13765            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13766        ) -> Self {
13767            Self(RequestBuilder::new(stub))
13768        }
13769
13770        /// Sets the full request, replacing any prior values.
13771        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13772            mut self,
13773            v: V,
13774        ) -> Self {
13775            self.0.request = v.into();
13776            self
13777        }
13778
13779        /// Sets all the options, replacing any prior values.
13780        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13781            self.0.options = v.into();
13782            self
13783        }
13784
13785        /// Sends the request.
13786        pub async fn send(self) -> Result<()> {
13787            (*self.0.stub)
13788                .cancel_operation(self.0.request, self.0.options)
13789                .await
13790                .map(crate::Response::into_body)
13791        }
13792
13793        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
13794        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13795            self.0.request.name = v.into();
13796            self
13797        }
13798    }
13799
13800    #[doc(hidden)]
13801    impl crate::RequestBuilder for CancelOperation {
13802        fn request_options(&mut self) -> &mut crate::RequestOptions {
13803            &mut self.0.options
13804        }
13805    }
13806}
13807
13808/// Request and client builders for [Generators][crate::client::Generators].
13809#[cfg(feature = "generators")]
13810#[cfg_attr(docsrs, doc(cfg(feature = "generators")))]
13811pub mod generators {
13812    use crate::Result;
13813
13814    /// A builder for [Generators][crate::client::Generators].
13815    ///
13816    /// ```
13817    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13818    /// # use google_cloud_dialogflow_v2::*;
13819    /// # use builder::generators::ClientBuilder;
13820    /// # use client::Generators;
13821    /// let builder : ClientBuilder = Generators::builder();
13822    /// let client = builder
13823    ///     .with_endpoint("https://dialogflow.googleapis.com")
13824    ///     .build().await?;
13825    /// # Ok(()) }
13826    /// ```
13827    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13828
13829    pub(crate) mod client {
13830        use super::super::super::client::Generators;
13831        pub struct Factory;
13832        impl crate::ClientFactory for Factory {
13833            type Client = Generators;
13834            type Credentials = gaxi::options::Credentials;
13835            async fn build(
13836                self,
13837                config: gaxi::options::ClientConfig,
13838            ) -> crate::ClientBuilderResult<Self::Client> {
13839                Self::Client::new(config).await
13840            }
13841        }
13842    }
13843
13844    /// Common implementation for [crate::client::Generators] request builders.
13845    #[derive(Clone, Debug)]
13846    pub(crate) struct RequestBuilder<R: std::default::Default> {
13847        stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13848        request: R,
13849        options: crate::RequestOptions,
13850    }
13851
13852    impl<R> RequestBuilder<R>
13853    where
13854        R: std::default::Default,
13855    {
13856        pub(crate) fn new(
13857            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13858        ) -> Self {
13859            Self {
13860                stub,
13861                request: R::default(),
13862                options: crate::RequestOptions::default(),
13863            }
13864        }
13865    }
13866
13867    /// The request builder for [Generators::create_generator][crate::client::Generators::create_generator] calls.
13868    ///
13869    /// # Example
13870    /// ```
13871    /// # use google_cloud_dialogflow_v2::builder::generators::CreateGenerator;
13872    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13873    ///
13874    /// let builder = prepare_request_builder();
13875    /// let response = builder.send().await?;
13876    /// # Ok(()) }
13877    ///
13878    /// fn prepare_request_builder() -> CreateGenerator {
13879    ///   # panic!();
13880    ///   // ... details omitted ...
13881    /// }
13882    /// ```
13883    #[derive(Clone, Debug)]
13884    pub struct CreateGenerator(RequestBuilder<crate::model::CreateGeneratorRequest>);
13885
13886    impl CreateGenerator {
13887        pub(crate) fn new(
13888            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13889        ) -> Self {
13890            Self(RequestBuilder::new(stub))
13891        }
13892
13893        /// Sets the full request, replacing any prior values.
13894        pub fn with_request<V: Into<crate::model::CreateGeneratorRequest>>(mut self, v: V) -> Self {
13895            self.0.request = v.into();
13896            self
13897        }
13898
13899        /// Sets all the options, replacing any prior values.
13900        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13901            self.0.options = v.into();
13902            self
13903        }
13904
13905        /// Sends the request.
13906        pub async fn send(self) -> Result<crate::model::Generator> {
13907            (*self.0.stub)
13908                .create_generator(self.0.request, self.0.options)
13909                .await
13910                .map(crate::Response::into_body)
13911        }
13912
13913        /// Sets the value of [parent][crate::model::CreateGeneratorRequest::parent].
13914        ///
13915        /// This is a **required** field for requests.
13916        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13917            self.0.request.parent = v.into();
13918            self
13919        }
13920
13921        /// Sets the value of [generator][crate::model::CreateGeneratorRequest::generator].
13922        ///
13923        /// This is a **required** field for requests.
13924        pub fn set_generator<T>(mut self, v: T) -> Self
13925        where
13926            T: std::convert::Into<crate::model::Generator>,
13927        {
13928            self.0.request.generator = std::option::Option::Some(v.into());
13929            self
13930        }
13931
13932        /// Sets or clears the value of [generator][crate::model::CreateGeneratorRequest::generator].
13933        ///
13934        /// This is a **required** field for requests.
13935        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
13936        where
13937            T: std::convert::Into<crate::model::Generator>,
13938        {
13939            self.0.request.generator = v.map(|x| x.into());
13940            self
13941        }
13942
13943        /// Sets the value of [generator_id][crate::model::CreateGeneratorRequest::generator_id].
13944        pub fn set_generator_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13945            self.0.request.generator_id = v.into();
13946            self
13947        }
13948    }
13949
13950    #[doc(hidden)]
13951    impl crate::RequestBuilder for CreateGenerator {
13952        fn request_options(&mut self) -> &mut crate::RequestOptions {
13953            &mut self.0.options
13954        }
13955    }
13956
13957    /// The request builder for [Generators::get_generator][crate::client::Generators::get_generator] calls.
13958    ///
13959    /// # Example
13960    /// ```
13961    /// # use google_cloud_dialogflow_v2::builder::generators::GetGenerator;
13962    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13963    ///
13964    /// let builder = prepare_request_builder();
13965    /// let response = builder.send().await?;
13966    /// # Ok(()) }
13967    ///
13968    /// fn prepare_request_builder() -> GetGenerator {
13969    ///   # panic!();
13970    ///   // ... details omitted ...
13971    /// }
13972    /// ```
13973    #[derive(Clone, Debug)]
13974    pub struct GetGenerator(RequestBuilder<crate::model::GetGeneratorRequest>);
13975
13976    impl GetGenerator {
13977        pub(crate) fn new(
13978            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13979        ) -> Self {
13980            Self(RequestBuilder::new(stub))
13981        }
13982
13983        /// Sets the full request, replacing any prior values.
13984        pub fn with_request<V: Into<crate::model::GetGeneratorRequest>>(mut self, v: V) -> Self {
13985            self.0.request = v.into();
13986            self
13987        }
13988
13989        /// Sets all the options, replacing any prior values.
13990        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13991            self.0.options = v.into();
13992            self
13993        }
13994
13995        /// Sends the request.
13996        pub async fn send(self) -> Result<crate::model::Generator> {
13997            (*self.0.stub)
13998                .get_generator(self.0.request, self.0.options)
13999                .await
14000                .map(crate::Response::into_body)
14001        }
14002
14003        /// Sets the value of [name][crate::model::GetGeneratorRequest::name].
14004        ///
14005        /// This is a **required** field for requests.
14006        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14007            self.0.request.name = v.into();
14008            self
14009        }
14010    }
14011
14012    #[doc(hidden)]
14013    impl crate::RequestBuilder for GetGenerator {
14014        fn request_options(&mut self) -> &mut crate::RequestOptions {
14015            &mut self.0.options
14016        }
14017    }
14018
14019    /// The request builder for [Generators::list_generators][crate::client::Generators::list_generators] calls.
14020    ///
14021    /// # Example
14022    /// ```
14023    /// # use google_cloud_dialogflow_v2::builder::generators::ListGenerators;
14024    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14025    /// use google_cloud_gax::paginator::ItemPaginator;
14026    ///
14027    /// let builder = prepare_request_builder();
14028    /// let mut items = builder.by_item();
14029    /// while let Some(result) = items.next().await {
14030    ///   let item = result?;
14031    /// }
14032    /// # Ok(()) }
14033    ///
14034    /// fn prepare_request_builder() -> ListGenerators {
14035    ///   # panic!();
14036    ///   // ... details omitted ...
14037    /// }
14038    /// ```
14039    #[derive(Clone, Debug)]
14040    pub struct ListGenerators(RequestBuilder<crate::model::ListGeneratorsRequest>);
14041
14042    impl ListGenerators {
14043        pub(crate) fn new(
14044            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14045        ) -> Self {
14046            Self(RequestBuilder::new(stub))
14047        }
14048
14049        /// Sets the full request, replacing any prior values.
14050        pub fn with_request<V: Into<crate::model::ListGeneratorsRequest>>(mut self, v: V) -> Self {
14051            self.0.request = v.into();
14052            self
14053        }
14054
14055        /// Sets all the options, replacing any prior values.
14056        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14057            self.0.options = v.into();
14058            self
14059        }
14060
14061        /// Sends the request.
14062        pub async fn send(self) -> Result<crate::model::ListGeneratorsResponse> {
14063            (*self.0.stub)
14064                .list_generators(self.0.request, self.0.options)
14065                .await
14066                .map(crate::Response::into_body)
14067        }
14068
14069        /// Streams each page in the collection.
14070        pub fn by_page(
14071            self,
14072        ) -> impl google_cloud_gax::paginator::Paginator<
14073            crate::model::ListGeneratorsResponse,
14074            crate::Error,
14075        > {
14076            use std::clone::Clone;
14077            let token = self.0.request.page_token.clone();
14078            let execute = move |token: String| {
14079                let mut builder = self.clone();
14080                builder.0.request = builder.0.request.set_page_token(token);
14081                builder.send()
14082            };
14083            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14084        }
14085
14086        /// Streams each item in the collection.
14087        pub fn by_item(
14088            self,
14089        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14090            crate::model::ListGeneratorsResponse,
14091            crate::Error,
14092        > {
14093            use google_cloud_gax::paginator::Paginator;
14094            self.by_page().items()
14095        }
14096
14097        /// Sets the value of [parent][crate::model::ListGeneratorsRequest::parent].
14098        ///
14099        /// This is a **required** field for requests.
14100        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14101            self.0.request.parent = v.into();
14102            self
14103        }
14104
14105        /// Sets the value of [page_size][crate::model::ListGeneratorsRequest::page_size].
14106        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14107            self.0.request.page_size = v.into();
14108            self
14109        }
14110
14111        /// Sets the value of [page_token][crate::model::ListGeneratorsRequest::page_token].
14112        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14113            self.0.request.page_token = v.into();
14114            self
14115        }
14116    }
14117
14118    #[doc(hidden)]
14119    impl crate::RequestBuilder for ListGenerators {
14120        fn request_options(&mut self) -> &mut crate::RequestOptions {
14121            &mut self.0.options
14122        }
14123    }
14124
14125    /// The request builder for [Generators::delete_generator][crate::client::Generators::delete_generator] calls.
14126    ///
14127    /// # Example
14128    /// ```
14129    /// # use google_cloud_dialogflow_v2::builder::generators::DeleteGenerator;
14130    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14131    ///
14132    /// let builder = prepare_request_builder();
14133    /// let response = builder.send().await?;
14134    /// # Ok(()) }
14135    ///
14136    /// fn prepare_request_builder() -> DeleteGenerator {
14137    ///   # panic!();
14138    ///   // ... details omitted ...
14139    /// }
14140    /// ```
14141    #[derive(Clone, Debug)]
14142    pub struct DeleteGenerator(RequestBuilder<crate::model::DeleteGeneratorRequest>);
14143
14144    impl DeleteGenerator {
14145        pub(crate) fn new(
14146            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14147        ) -> Self {
14148            Self(RequestBuilder::new(stub))
14149        }
14150
14151        /// Sets the full request, replacing any prior values.
14152        pub fn with_request<V: Into<crate::model::DeleteGeneratorRequest>>(mut self, v: V) -> Self {
14153            self.0.request = v.into();
14154            self
14155        }
14156
14157        /// Sets all the options, replacing any prior values.
14158        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14159            self.0.options = v.into();
14160            self
14161        }
14162
14163        /// Sends the request.
14164        pub async fn send(self) -> Result<()> {
14165            (*self.0.stub)
14166                .delete_generator(self.0.request, self.0.options)
14167                .await
14168                .map(crate::Response::into_body)
14169        }
14170
14171        /// Sets the value of [name][crate::model::DeleteGeneratorRequest::name].
14172        ///
14173        /// This is a **required** field for requests.
14174        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14175            self.0.request.name = v.into();
14176            self
14177        }
14178    }
14179
14180    #[doc(hidden)]
14181    impl crate::RequestBuilder for DeleteGenerator {
14182        fn request_options(&mut self) -> &mut crate::RequestOptions {
14183            &mut self.0.options
14184        }
14185    }
14186
14187    /// The request builder for [Generators::update_generator][crate::client::Generators::update_generator] calls.
14188    ///
14189    /// # Example
14190    /// ```
14191    /// # use google_cloud_dialogflow_v2::builder::generators::UpdateGenerator;
14192    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14193    ///
14194    /// let builder = prepare_request_builder();
14195    /// let response = builder.send().await?;
14196    /// # Ok(()) }
14197    ///
14198    /// fn prepare_request_builder() -> UpdateGenerator {
14199    ///   # panic!();
14200    ///   // ... details omitted ...
14201    /// }
14202    /// ```
14203    #[derive(Clone, Debug)]
14204    pub struct UpdateGenerator(RequestBuilder<crate::model::UpdateGeneratorRequest>);
14205
14206    impl UpdateGenerator {
14207        pub(crate) fn new(
14208            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14209        ) -> Self {
14210            Self(RequestBuilder::new(stub))
14211        }
14212
14213        /// Sets the full request, replacing any prior values.
14214        pub fn with_request<V: Into<crate::model::UpdateGeneratorRequest>>(mut self, v: V) -> Self {
14215            self.0.request = v.into();
14216            self
14217        }
14218
14219        /// Sets all the options, replacing any prior values.
14220        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14221            self.0.options = v.into();
14222            self
14223        }
14224
14225        /// Sends the request.
14226        pub async fn send(self) -> Result<crate::model::Generator> {
14227            (*self.0.stub)
14228                .update_generator(self.0.request, self.0.options)
14229                .await
14230                .map(crate::Response::into_body)
14231        }
14232
14233        /// Sets the value of [generator][crate::model::UpdateGeneratorRequest::generator].
14234        ///
14235        /// This is a **required** field for requests.
14236        pub fn set_generator<T>(mut self, v: T) -> Self
14237        where
14238            T: std::convert::Into<crate::model::Generator>,
14239        {
14240            self.0.request.generator = std::option::Option::Some(v.into());
14241            self
14242        }
14243
14244        /// Sets or clears the value of [generator][crate::model::UpdateGeneratorRequest::generator].
14245        ///
14246        /// This is a **required** field for requests.
14247        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
14248        where
14249            T: std::convert::Into<crate::model::Generator>,
14250        {
14251            self.0.request.generator = v.map(|x| x.into());
14252            self
14253        }
14254
14255        /// Sets the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
14256        pub fn set_update_mask<T>(mut self, v: T) -> Self
14257        where
14258            T: std::convert::Into<wkt::FieldMask>,
14259        {
14260            self.0.request.update_mask = std::option::Option::Some(v.into());
14261            self
14262        }
14263
14264        /// Sets or clears the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
14265        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14266        where
14267            T: std::convert::Into<wkt::FieldMask>,
14268        {
14269            self.0.request.update_mask = v.map(|x| x.into());
14270            self
14271        }
14272    }
14273
14274    #[doc(hidden)]
14275    impl crate::RequestBuilder for UpdateGenerator {
14276        fn request_options(&mut self) -> &mut crate::RequestOptions {
14277            &mut self.0.options
14278        }
14279    }
14280
14281    /// The request builder for [Generators::list_locations][crate::client::Generators::list_locations] calls.
14282    ///
14283    /// # Example
14284    /// ```
14285    /// # use google_cloud_dialogflow_v2::builder::generators::ListLocations;
14286    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14287    /// use google_cloud_gax::paginator::ItemPaginator;
14288    ///
14289    /// let builder = prepare_request_builder();
14290    /// let mut items = builder.by_item();
14291    /// while let Some(result) = items.next().await {
14292    ///   let item = result?;
14293    /// }
14294    /// # Ok(()) }
14295    ///
14296    /// fn prepare_request_builder() -> ListLocations {
14297    ///   # panic!();
14298    ///   // ... details omitted ...
14299    /// }
14300    /// ```
14301    #[derive(Clone, Debug)]
14302    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14303
14304    impl ListLocations {
14305        pub(crate) fn new(
14306            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14307        ) -> Self {
14308            Self(RequestBuilder::new(stub))
14309        }
14310
14311        /// Sets the full request, replacing any prior values.
14312        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14313            mut self,
14314            v: V,
14315        ) -> Self {
14316            self.0.request = v.into();
14317            self
14318        }
14319
14320        /// Sets all the options, replacing any prior values.
14321        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14322            self.0.options = v.into();
14323            self
14324        }
14325
14326        /// Sends the request.
14327        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14328            (*self.0.stub)
14329                .list_locations(self.0.request, self.0.options)
14330                .await
14331                .map(crate::Response::into_body)
14332        }
14333
14334        /// Streams each page in the collection.
14335        pub fn by_page(
14336            self,
14337        ) -> impl google_cloud_gax::paginator::Paginator<
14338            google_cloud_location::model::ListLocationsResponse,
14339            crate::Error,
14340        > {
14341            use std::clone::Clone;
14342            let token = self.0.request.page_token.clone();
14343            let execute = move |token: String| {
14344                let mut builder = self.clone();
14345                builder.0.request = builder.0.request.set_page_token(token);
14346                builder.send()
14347            };
14348            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14349        }
14350
14351        /// Streams each item in the collection.
14352        pub fn by_item(
14353            self,
14354        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14355            google_cloud_location::model::ListLocationsResponse,
14356            crate::Error,
14357        > {
14358            use google_cloud_gax::paginator::Paginator;
14359            self.by_page().items()
14360        }
14361
14362        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
14363        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14364            self.0.request.name = v.into();
14365            self
14366        }
14367
14368        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
14369        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14370            self.0.request.filter = v.into();
14371            self
14372        }
14373
14374        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
14375        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14376            self.0.request.page_size = v.into();
14377            self
14378        }
14379
14380        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
14381        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14382            self.0.request.page_token = v.into();
14383            self
14384        }
14385    }
14386
14387    #[doc(hidden)]
14388    impl crate::RequestBuilder for ListLocations {
14389        fn request_options(&mut self) -> &mut crate::RequestOptions {
14390            &mut self.0.options
14391        }
14392    }
14393
14394    /// The request builder for [Generators::get_location][crate::client::Generators::get_location] calls.
14395    ///
14396    /// # Example
14397    /// ```
14398    /// # use google_cloud_dialogflow_v2::builder::generators::GetLocation;
14399    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14400    ///
14401    /// let builder = prepare_request_builder();
14402    /// let response = builder.send().await?;
14403    /// # Ok(()) }
14404    ///
14405    /// fn prepare_request_builder() -> GetLocation {
14406    ///   # panic!();
14407    ///   // ... details omitted ...
14408    /// }
14409    /// ```
14410    #[derive(Clone, Debug)]
14411    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14412
14413    impl GetLocation {
14414        pub(crate) fn new(
14415            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14416        ) -> Self {
14417            Self(RequestBuilder::new(stub))
14418        }
14419
14420        /// Sets the full request, replacing any prior values.
14421        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14422            mut self,
14423            v: V,
14424        ) -> Self {
14425            self.0.request = v.into();
14426            self
14427        }
14428
14429        /// Sets all the options, replacing any prior values.
14430        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14431            self.0.options = v.into();
14432            self
14433        }
14434
14435        /// Sends the request.
14436        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14437            (*self.0.stub)
14438                .get_location(self.0.request, self.0.options)
14439                .await
14440                .map(crate::Response::into_body)
14441        }
14442
14443        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
14444        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14445            self.0.request.name = v.into();
14446            self
14447        }
14448    }
14449
14450    #[doc(hidden)]
14451    impl crate::RequestBuilder for GetLocation {
14452        fn request_options(&mut self) -> &mut crate::RequestOptions {
14453            &mut self.0.options
14454        }
14455    }
14456
14457    /// The request builder for [Generators::list_operations][crate::client::Generators::list_operations] calls.
14458    ///
14459    /// # Example
14460    /// ```
14461    /// # use google_cloud_dialogflow_v2::builder::generators::ListOperations;
14462    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14463    /// use google_cloud_gax::paginator::ItemPaginator;
14464    ///
14465    /// let builder = prepare_request_builder();
14466    /// let mut items = builder.by_item();
14467    /// while let Some(result) = items.next().await {
14468    ///   let item = result?;
14469    /// }
14470    /// # Ok(()) }
14471    ///
14472    /// fn prepare_request_builder() -> ListOperations {
14473    ///   # panic!();
14474    ///   // ... details omitted ...
14475    /// }
14476    /// ```
14477    #[derive(Clone, Debug)]
14478    pub struct ListOperations(
14479        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14480    );
14481
14482    impl ListOperations {
14483        pub(crate) fn new(
14484            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14485        ) -> Self {
14486            Self(RequestBuilder::new(stub))
14487        }
14488
14489        /// Sets the full request, replacing any prior values.
14490        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14491            mut self,
14492            v: V,
14493        ) -> Self {
14494            self.0.request = v.into();
14495            self
14496        }
14497
14498        /// Sets all the options, replacing any prior values.
14499        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14500            self.0.options = v.into();
14501            self
14502        }
14503
14504        /// Sends the request.
14505        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14506            (*self.0.stub)
14507                .list_operations(self.0.request, self.0.options)
14508                .await
14509                .map(crate::Response::into_body)
14510        }
14511
14512        /// Streams each page in the collection.
14513        pub fn by_page(
14514            self,
14515        ) -> impl google_cloud_gax::paginator::Paginator<
14516            google_cloud_longrunning::model::ListOperationsResponse,
14517            crate::Error,
14518        > {
14519            use std::clone::Clone;
14520            let token = self.0.request.page_token.clone();
14521            let execute = move |token: String| {
14522                let mut builder = self.clone();
14523                builder.0.request = builder.0.request.set_page_token(token);
14524                builder.send()
14525            };
14526            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14527        }
14528
14529        /// Streams each item in the collection.
14530        pub fn by_item(
14531            self,
14532        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14533            google_cloud_longrunning::model::ListOperationsResponse,
14534            crate::Error,
14535        > {
14536            use google_cloud_gax::paginator::Paginator;
14537            self.by_page().items()
14538        }
14539
14540        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
14541        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14542            self.0.request.name = v.into();
14543            self
14544        }
14545
14546        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
14547        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14548            self.0.request.filter = v.into();
14549            self
14550        }
14551
14552        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
14553        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14554            self.0.request.page_size = v.into();
14555            self
14556        }
14557
14558        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
14559        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14560            self.0.request.page_token = v.into();
14561            self
14562        }
14563
14564        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
14565        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14566            self.0.request.return_partial_success = v.into();
14567            self
14568        }
14569    }
14570
14571    #[doc(hidden)]
14572    impl crate::RequestBuilder for ListOperations {
14573        fn request_options(&mut self) -> &mut crate::RequestOptions {
14574            &mut self.0.options
14575        }
14576    }
14577
14578    /// The request builder for [Generators::get_operation][crate::client::Generators::get_operation] calls.
14579    ///
14580    /// # Example
14581    /// ```
14582    /// # use google_cloud_dialogflow_v2::builder::generators::GetOperation;
14583    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14584    ///
14585    /// let builder = prepare_request_builder();
14586    /// let response = builder.send().await?;
14587    /// # Ok(()) }
14588    ///
14589    /// fn prepare_request_builder() -> GetOperation {
14590    ///   # panic!();
14591    ///   // ... details omitted ...
14592    /// }
14593    /// ```
14594    #[derive(Clone, Debug)]
14595    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14596
14597    impl GetOperation {
14598        pub(crate) fn new(
14599            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14600        ) -> Self {
14601            Self(RequestBuilder::new(stub))
14602        }
14603
14604        /// Sets the full request, replacing any prior values.
14605        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14606            mut self,
14607            v: V,
14608        ) -> Self {
14609            self.0.request = v.into();
14610            self
14611        }
14612
14613        /// Sets all the options, replacing any prior values.
14614        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14615            self.0.options = v.into();
14616            self
14617        }
14618
14619        /// Sends the request.
14620        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14621            (*self.0.stub)
14622                .get_operation(self.0.request, self.0.options)
14623                .await
14624                .map(crate::Response::into_body)
14625        }
14626
14627        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
14628        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14629            self.0.request.name = v.into();
14630            self
14631        }
14632    }
14633
14634    #[doc(hidden)]
14635    impl crate::RequestBuilder for GetOperation {
14636        fn request_options(&mut self) -> &mut crate::RequestOptions {
14637            &mut self.0.options
14638        }
14639    }
14640
14641    /// The request builder for [Generators::cancel_operation][crate::client::Generators::cancel_operation] calls.
14642    ///
14643    /// # Example
14644    /// ```
14645    /// # use google_cloud_dialogflow_v2::builder::generators::CancelOperation;
14646    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14647    ///
14648    /// let builder = prepare_request_builder();
14649    /// let response = builder.send().await?;
14650    /// # Ok(()) }
14651    ///
14652    /// fn prepare_request_builder() -> CancelOperation {
14653    ///   # panic!();
14654    ///   // ... details omitted ...
14655    /// }
14656    /// ```
14657    #[derive(Clone, Debug)]
14658    pub struct CancelOperation(
14659        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14660    );
14661
14662    impl CancelOperation {
14663        pub(crate) fn new(
14664            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14665        ) -> Self {
14666            Self(RequestBuilder::new(stub))
14667        }
14668
14669        /// Sets the full request, replacing any prior values.
14670        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14671            mut self,
14672            v: V,
14673        ) -> Self {
14674            self.0.request = v.into();
14675            self
14676        }
14677
14678        /// Sets all the options, replacing any prior values.
14679        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14680            self.0.options = v.into();
14681            self
14682        }
14683
14684        /// Sends the request.
14685        pub async fn send(self) -> Result<()> {
14686            (*self.0.stub)
14687                .cancel_operation(self.0.request, self.0.options)
14688                .await
14689                .map(crate::Response::into_body)
14690        }
14691
14692        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
14693        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14694            self.0.request.name = v.into();
14695            self
14696        }
14697    }
14698
14699    #[doc(hidden)]
14700    impl crate::RequestBuilder for CancelOperation {
14701        fn request_options(&mut self) -> &mut crate::RequestOptions {
14702            &mut self.0.options
14703        }
14704    }
14705}
14706
14707/// Request and client builders for [GeneratorEvaluations][crate::client::GeneratorEvaluations].
14708#[cfg(feature = "generator-evaluations")]
14709#[cfg_attr(docsrs, doc(cfg(feature = "generator-evaluations")))]
14710pub mod generator_evaluations {
14711    use crate::Result;
14712
14713    /// A builder for [GeneratorEvaluations][crate::client::GeneratorEvaluations].
14714    ///
14715    /// ```
14716    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14717    /// # use google_cloud_dialogflow_v2::*;
14718    /// # use builder::generator_evaluations::ClientBuilder;
14719    /// # use client::GeneratorEvaluations;
14720    /// let builder : ClientBuilder = GeneratorEvaluations::builder();
14721    /// let client = builder
14722    ///     .with_endpoint("https://dialogflow.googleapis.com")
14723    ///     .build().await?;
14724    /// # Ok(()) }
14725    /// ```
14726    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14727
14728    pub(crate) mod client {
14729        use super::super::super::client::GeneratorEvaluations;
14730        pub struct Factory;
14731        impl crate::ClientFactory for Factory {
14732            type Client = GeneratorEvaluations;
14733            type Credentials = gaxi::options::Credentials;
14734            async fn build(
14735                self,
14736                config: gaxi::options::ClientConfig,
14737            ) -> crate::ClientBuilderResult<Self::Client> {
14738                Self::Client::new(config).await
14739            }
14740        }
14741    }
14742
14743    /// Common implementation for [crate::client::GeneratorEvaluations] request builders.
14744    #[derive(Clone, Debug)]
14745    pub(crate) struct RequestBuilder<R: std::default::Default> {
14746        stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14747        request: R,
14748        options: crate::RequestOptions,
14749    }
14750
14751    impl<R> RequestBuilder<R>
14752    where
14753        R: std::default::Default,
14754    {
14755        pub(crate) fn new(
14756            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14757        ) -> Self {
14758            Self {
14759                stub,
14760                request: R::default(),
14761                options: crate::RequestOptions::default(),
14762            }
14763        }
14764    }
14765
14766    /// The request builder for [GeneratorEvaluations::create_generator_evaluation][crate::client::GeneratorEvaluations::create_generator_evaluation] calls.
14767    ///
14768    /// # Example
14769    /// ```
14770    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::CreateGeneratorEvaluation;
14771    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14772    /// use google_cloud_lro::Poller;
14773    ///
14774    /// let builder = prepare_request_builder();
14775    /// let response = builder.poller().until_done().await?;
14776    /// # Ok(()) }
14777    ///
14778    /// fn prepare_request_builder() -> CreateGeneratorEvaluation {
14779    ///   # panic!();
14780    ///   // ... details omitted ...
14781    /// }
14782    /// ```
14783    #[derive(Clone, Debug)]
14784    pub struct CreateGeneratorEvaluation(
14785        RequestBuilder<crate::model::CreateGeneratorEvaluationRequest>,
14786    );
14787
14788    impl CreateGeneratorEvaluation {
14789        pub(crate) fn new(
14790            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14791        ) -> Self {
14792            Self(RequestBuilder::new(stub))
14793        }
14794
14795        /// Sets the full request, replacing any prior values.
14796        pub fn with_request<V: Into<crate::model::CreateGeneratorEvaluationRequest>>(
14797            mut self,
14798            v: V,
14799        ) -> Self {
14800            self.0.request = v.into();
14801            self
14802        }
14803
14804        /// Sets all the options, replacing any prior values.
14805        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14806            self.0.options = v.into();
14807            self
14808        }
14809
14810        /// Sends the request.
14811        ///
14812        /// # Long running operations
14813        ///
14814        /// This starts, but does not poll, a longrunning operation. More information
14815        /// on [create_generator_evaluation][crate::client::GeneratorEvaluations::create_generator_evaluation].
14816        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14817            (*self.0.stub)
14818                .create_generator_evaluation(self.0.request, self.0.options)
14819                .await
14820                .map(crate::Response::into_body)
14821        }
14822
14823        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_generator_evaluation`.
14824        pub fn poller(
14825            self,
14826        ) -> impl google_cloud_lro::Poller<
14827            crate::model::GeneratorEvaluation,
14828            crate::model::GeneratorEvaluationOperationMetadata,
14829        > {
14830            type Operation = google_cloud_lro::internal::Operation<
14831                crate::model::GeneratorEvaluation,
14832                crate::model::GeneratorEvaluationOperationMetadata,
14833            >;
14834            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14835            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14836
14837            let stub = self.0.stub.clone();
14838            let mut options = self.0.options.clone();
14839            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14840            let query = move |name| {
14841                let stub = stub.clone();
14842                let options = options.clone();
14843                async {
14844                    let op = GetOperation::new(stub)
14845                        .set_name(name)
14846                        .with_options(options)
14847                        .send()
14848                        .await?;
14849                    Ok(Operation::new(op))
14850                }
14851            };
14852
14853            let start = move || async {
14854                let op = self.send().await?;
14855                Ok(Operation::new(op))
14856            };
14857
14858            google_cloud_lro::internal::new_poller(
14859                polling_error_policy,
14860                polling_backoff_policy,
14861                start,
14862                query,
14863            )
14864        }
14865
14866        /// Sets the value of [parent][crate::model::CreateGeneratorEvaluationRequest::parent].
14867        ///
14868        /// This is a **required** field for requests.
14869        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14870            self.0.request.parent = v.into();
14871            self
14872        }
14873
14874        /// Sets the value of [generator_evaluation][crate::model::CreateGeneratorEvaluationRequest::generator_evaluation].
14875        ///
14876        /// This is a **required** field for requests.
14877        pub fn set_generator_evaluation<T>(mut self, v: T) -> Self
14878        where
14879            T: std::convert::Into<crate::model::GeneratorEvaluation>,
14880        {
14881            self.0.request.generator_evaluation = std::option::Option::Some(v.into());
14882            self
14883        }
14884
14885        /// Sets or clears the value of [generator_evaluation][crate::model::CreateGeneratorEvaluationRequest::generator_evaluation].
14886        ///
14887        /// This is a **required** field for requests.
14888        pub fn set_or_clear_generator_evaluation<T>(mut self, v: std::option::Option<T>) -> Self
14889        where
14890            T: std::convert::Into<crate::model::GeneratorEvaluation>,
14891        {
14892            self.0.request.generator_evaluation = v.map(|x| x.into());
14893            self
14894        }
14895    }
14896
14897    #[doc(hidden)]
14898    impl crate::RequestBuilder for CreateGeneratorEvaluation {
14899        fn request_options(&mut self) -> &mut crate::RequestOptions {
14900            &mut self.0.options
14901        }
14902    }
14903
14904    /// The request builder for [GeneratorEvaluations::get_generator_evaluation][crate::client::GeneratorEvaluations::get_generator_evaluation] calls.
14905    ///
14906    /// # Example
14907    /// ```
14908    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetGeneratorEvaluation;
14909    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14910    ///
14911    /// let builder = prepare_request_builder();
14912    /// let response = builder.send().await?;
14913    /// # Ok(()) }
14914    ///
14915    /// fn prepare_request_builder() -> GetGeneratorEvaluation {
14916    ///   # panic!();
14917    ///   // ... details omitted ...
14918    /// }
14919    /// ```
14920    #[derive(Clone, Debug)]
14921    pub struct GetGeneratorEvaluation(RequestBuilder<crate::model::GetGeneratorEvaluationRequest>);
14922
14923    impl GetGeneratorEvaluation {
14924        pub(crate) fn new(
14925            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14926        ) -> Self {
14927            Self(RequestBuilder::new(stub))
14928        }
14929
14930        /// Sets the full request, replacing any prior values.
14931        pub fn with_request<V: Into<crate::model::GetGeneratorEvaluationRequest>>(
14932            mut self,
14933            v: V,
14934        ) -> Self {
14935            self.0.request = v.into();
14936            self
14937        }
14938
14939        /// Sets all the options, replacing any prior values.
14940        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14941            self.0.options = v.into();
14942            self
14943        }
14944
14945        /// Sends the request.
14946        pub async fn send(self) -> Result<crate::model::GeneratorEvaluation> {
14947            (*self.0.stub)
14948                .get_generator_evaluation(self.0.request, self.0.options)
14949                .await
14950                .map(crate::Response::into_body)
14951        }
14952
14953        /// Sets the value of [name][crate::model::GetGeneratorEvaluationRequest::name].
14954        ///
14955        /// This is a **required** field for requests.
14956        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14957            self.0.request.name = v.into();
14958            self
14959        }
14960    }
14961
14962    #[doc(hidden)]
14963    impl crate::RequestBuilder for GetGeneratorEvaluation {
14964        fn request_options(&mut self) -> &mut crate::RequestOptions {
14965            &mut self.0.options
14966        }
14967    }
14968
14969    /// The request builder for [GeneratorEvaluations::list_generator_evaluations][crate::client::GeneratorEvaluations::list_generator_evaluations] calls.
14970    ///
14971    /// # Example
14972    /// ```
14973    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListGeneratorEvaluations;
14974    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14975    /// use google_cloud_gax::paginator::ItemPaginator;
14976    ///
14977    /// let builder = prepare_request_builder();
14978    /// let mut items = builder.by_item();
14979    /// while let Some(result) = items.next().await {
14980    ///   let item = result?;
14981    /// }
14982    /// # Ok(()) }
14983    ///
14984    /// fn prepare_request_builder() -> ListGeneratorEvaluations {
14985    ///   # panic!();
14986    ///   // ... details omitted ...
14987    /// }
14988    /// ```
14989    #[derive(Clone, Debug)]
14990    pub struct ListGeneratorEvaluations(
14991        RequestBuilder<crate::model::ListGeneratorEvaluationsRequest>,
14992    );
14993
14994    impl ListGeneratorEvaluations {
14995        pub(crate) fn new(
14996            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14997        ) -> Self {
14998            Self(RequestBuilder::new(stub))
14999        }
15000
15001        /// Sets the full request, replacing any prior values.
15002        pub fn with_request<V: Into<crate::model::ListGeneratorEvaluationsRequest>>(
15003            mut self,
15004            v: V,
15005        ) -> Self {
15006            self.0.request = v.into();
15007            self
15008        }
15009
15010        /// Sets all the options, replacing any prior values.
15011        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15012            self.0.options = v.into();
15013            self
15014        }
15015
15016        /// Sends the request.
15017        pub async fn send(self) -> Result<crate::model::ListGeneratorEvaluationsResponse> {
15018            (*self.0.stub)
15019                .list_generator_evaluations(self.0.request, self.0.options)
15020                .await
15021                .map(crate::Response::into_body)
15022        }
15023
15024        /// Streams each page in the collection.
15025        pub fn by_page(
15026            self,
15027        ) -> impl google_cloud_gax::paginator::Paginator<
15028            crate::model::ListGeneratorEvaluationsResponse,
15029            crate::Error,
15030        > {
15031            use std::clone::Clone;
15032            let token = self.0.request.page_token.clone();
15033            let execute = move |token: String| {
15034                let mut builder = self.clone();
15035                builder.0.request = builder.0.request.set_page_token(token);
15036                builder.send()
15037            };
15038            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15039        }
15040
15041        /// Streams each item in the collection.
15042        pub fn by_item(
15043            self,
15044        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15045            crate::model::ListGeneratorEvaluationsResponse,
15046            crate::Error,
15047        > {
15048            use google_cloud_gax::paginator::Paginator;
15049            self.by_page().items()
15050        }
15051
15052        /// Sets the value of [parent][crate::model::ListGeneratorEvaluationsRequest::parent].
15053        ///
15054        /// This is a **required** field for requests.
15055        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15056            self.0.request.parent = v.into();
15057            self
15058        }
15059
15060        /// Sets the value of [page_size][crate::model::ListGeneratorEvaluationsRequest::page_size].
15061        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15062            self.0.request.page_size = v.into();
15063            self
15064        }
15065
15066        /// Sets the value of [page_token][crate::model::ListGeneratorEvaluationsRequest::page_token].
15067        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15068            self.0.request.page_token = v.into();
15069            self
15070        }
15071    }
15072
15073    #[doc(hidden)]
15074    impl crate::RequestBuilder for ListGeneratorEvaluations {
15075        fn request_options(&mut self) -> &mut crate::RequestOptions {
15076            &mut self.0.options
15077        }
15078    }
15079
15080    /// The request builder for [GeneratorEvaluations::delete_generator_evaluation][crate::client::GeneratorEvaluations::delete_generator_evaluation] calls.
15081    ///
15082    /// # Example
15083    /// ```
15084    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::DeleteGeneratorEvaluation;
15085    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15086    ///
15087    /// let builder = prepare_request_builder();
15088    /// let response = builder.send().await?;
15089    /// # Ok(()) }
15090    ///
15091    /// fn prepare_request_builder() -> DeleteGeneratorEvaluation {
15092    ///   # panic!();
15093    ///   // ... details omitted ...
15094    /// }
15095    /// ```
15096    #[derive(Clone, Debug)]
15097    pub struct DeleteGeneratorEvaluation(
15098        RequestBuilder<crate::model::DeleteGeneratorEvaluationRequest>,
15099    );
15100
15101    impl DeleteGeneratorEvaluation {
15102        pub(crate) fn new(
15103            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15104        ) -> Self {
15105            Self(RequestBuilder::new(stub))
15106        }
15107
15108        /// Sets the full request, replacing any prior values.
15109        pub fn with_request<V: Into<crate::model::DeleteGeneratorEvaluationRequest>>(
15110            mut self,
15111            v: V,
15112        ) -> Self {
15113            self.0.request = v.into();
15114            self
15115        }
15116
15117        /// Sets all the options, replacing any prior values.
15118        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15119            self.0.options = v.into();
15120            self
15121        }
15122
15123        /// Sends the request.
15124        pub async fn send(self) -> Result<()> {
15125            (*self.0.stub)
15126                .delete_generator_evaluation(self.0.request, self.0.options)
15127                .await
15128                .map(crate::Response::into_body)
15129        }
15130
15131        /// Sets the value of [name][crate::model::DeleteGeneratorEvaluationRequest::name].
15132        ///
15133        /// This is a **required** field for requests.
15134        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15135            self.0.request.name = v.into();
15136            self
15137        }
15138    }
15139
15140    #[doc(hidden)]
15141    impl crate::RequestBuilder for DeleteGeneratorEvaluation {
15142        fn request_options(&mut self) -> &mut crate::RequestOptions {
15143            &mut self.0.options
15144        }
15145    }
15146
15147    /// The request builder for [GeneratorEvaluations::list_locations][crate::client::GeneratorEvaluations::list_locations] calls.
15148    ///
15149    /// # Example
15150    /// ```
15151    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListLocations;
15152    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15153    /// use google_cloud_gax::paginator::ItemPaginator;
15154    ///
15155    /// let builder = prepare_request_builder();
15156    /// let mut items = builder.by_item();
15157    /// while let Some(result) = items.next().await {
15158    ///   let item = result?;
15159    /// }
15160    /// # Ok(()) }
15161    ///
15162    /// fn prepare_request_builder() -> ListLocations {
15163    ///   # panic!();
15164    ///   // ... details omitted ...
15165    /// }
15166    /// ```
15167    #[derive(Clone, Debug)]
15168    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
15169
15170    impl ListLocations {
15171        pub(crate) fn new(
15172            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15173        ) -> Self {
15174            Self(RequestBuilder::new(stub))
15175        }
15176
15177        /// Sets the full request, replacing any prior values.
15178        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
15179            mut self,
15180            v: V,
15181        ) -> Self {
15182            self.0.request = v.into();
15183            self
15184        }
15185
15186        /// Sets all the options, replacing any prior values.
15187        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15188            self.0.options = v.into();
15189            self
15190        }
15191
15192        /// Sends the request.
15193        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
15194            (*self.0.stub)
15195                .list_locations(self.0.request, self.0.options)
15196                .await
15197                .map(crate::Response::into_body)
15198        }
15199
15200        /// Streams each page in the collection.
15201        pub fn by_page(
15202            self,
15203        ) -> impl google_cloud_gax::paginator::Paginator<
15204            google_cloud_location::model::ListLocationsResponse,
15205            crate::Error,
15206        > {
15207            use std::clone::Clone;
15208            let token = self.0.request.page_token.clone();
15209            let execute = move |token: String| {
15210                let mut builder = self.clone();
15211                builder.0.request = builder.0.request.set_page_token(token);
15212                builder.send()
15213            };
15214            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15215        }
15216
15217        /// Streams each item in the collection.
15218        pub fn by_item(
15219            self,
15220        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15221            google_cloud_location::model::ListLocationsResponse,
15222            crate::Error,
15223        > {
15224            use google_cloud_gax::paginator::Paginator;
15225            self.by_page().items()
15226        }
15227
15228        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
15229        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15230            self.0.request.name = v.into();
15231            self
15232        }
15233
15234        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
15235        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15236            self.0.request.filter = v.into();
15237            self
15238        }
15239
15240        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
15241        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15242            self.0.request.page_size = v.into();
15243            self
15244        }
15245
15246        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
15247        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15248            self.0.request.page_token = v.into();
15249            self
15250        }
15251    }
15252
15253    #[doc(hidden)]
15254    impl crate::RequestBuilder for ListLocations {
15255        fn request_options(&mut self) -> &mut crate::RequestOptions {
15256            &mut self.0.options
15257        }
15258    }
15259
15260    /// The request builder for [GeneratorEvaluations::get_location][crate::client::GeneratorEvaluations::get_location] calls.
15261    ///
15262    /// # Example
15263    /// ```
15264    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetLocation;
15265    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15266    ///
15267    /// let builder = prepare_request_builder();
15268    /// let response = builder.send().await?;
15269    /// # Ok(()) }
15270    ///
15271    /// fn prepare_request_builder() -> GetLocation {
15272    ///   # panic!();
15273    ///   // ... details omitted ...
15274    /// }
15275    /// ```
15276    #[derive(Clone, Debug)]
15277    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15278
15279    impl GetLocation {
15280        pub(crate) fn new(
15281            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15282        ) -> Self {
15283            Self(RequestBuilder::new(stub))
15284        }
15285
15286        /// Sets the full request, replacing any prior values.
15287        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15288            mut self,
15289            v: V,
15290        ) -> Self {
15291            self.0.request = v.into();
15292            self
15293        }
15294
15295        /// Sets all the options, replacing any prior values.
15296        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15297            self.0.options = v.into();
15298            self
15299        }
15300
15301        /// Sends the request.
15302        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15303            (*self.0.stub)
15304                .get_location(self.0.request, self.0.options)
15305                .await
15306                .map(crate::Response::into_body)
15307        }
15308
15309        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
15310        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15311            self.0.request.name = v.into();
15312            self
15313        }
15314    }
15315
15316    #[doc(hidden)]
15317    impl crate::RequestBuilder for GetLocation {
15318        fn request_options(&mut self) -> &mut crate::RequestOptions {
15319            &mut self.0.options
15320        }
15321    }
15322
15323    /// The request builder for [GeneratorEvaluations::list_operations][crate::client::GeneratorEvaluations::list_operations] calls.
15324    ///
15325    /// # Example
15326    /// ```
15327    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListOperations;
15328    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15329    /// use google_cloud_gax::paginator::ItemPaginator;
15330    ///
15331    /// let builder = prepare_request_builder();
15332    /// let mut items = builder.by_item();
15333    /// while let Some(result) = items.next().await {
15334    ///   let item = result?;
15335    /// }
15336    /// # Ok(()) }
15337    ///
15338    /// fn prepare_request_builder() -> ListOperations {
15339    ///   # panic!();
15340    ///   // ... details omitted ...
15341    /// }
15342    /// ```
15343    #[derive(Clone, Debug)]
15344    pub struct ListOperations(
15345        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15346    );
15347
15348    impl ListOperations {
15349        pub(crate) fn new(
15350            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15351        ) -> Self {
15352            Self(RequestBuilder::new(stub))
15353        }
15354
15355        /// Sets the full request, replacing any prior values.
15356        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15357            mut self,
15358            v: V,
15359        ) -> Self {
15360            self.0.request = v.into();
15361            self
15362        }
15363
15364        /// Sets all the options, replacing any prior values.
15365        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15366            self.0.options = v.into();
15367            self
15368        }
15369
15370        /// Sends the request.
15371        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15372            (*self.0.stub)
15373                .list_operations(self.0.request, self.0.options)
15374                .await
15375                .map(crate::Response::into_body)
15376        }
15377
15378        /// Streams each page in the collection.
15379        pub fn by_page(
15380            self,
15381        ) -> impl google_cloud_gax::paginator::Paginator<
15382            google_cloud_longrunning::model::ListOperationsResponse,
15383            crate::Error,
15384        > {
15385            use std::clone::Clone;
15386            let token = self.0.request.page_token.clone();
15387            let execute = move |token: String| {
15388                let mut builder = self.clone();
15389                builder.0.request = builder.0.request.set_page_token(token);
15390                builder.send()
15391            };
15392            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15393        }
15394
15395        /// Streams each item in the collection.
15396        pub fn by_item(
15397            self,
15398        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15399            google_cloud_longrunning::model::ListOperationsResponse,
15400            crate::Error,
15401        > {
15402            use google_cloud_gax::paginator::Paginator;
15403            self.by_page().items()
15404        }
15405
15406        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
15407        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15408            self.0.request.name = v.into();
15409            self
15410        }
15411
15412        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
15413        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15414            self.0.request.filter = v.into();
15415            self
15416        }
15417
15418        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
15419        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15420            self.0.request.page_size = v.into();
15421            self
15422        }
15423
15424        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
15425        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15426            self.0.request.page_token = v.into();
15427            self
15428        }
15429
15430        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
15431        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15432            self.0.request.return_partial_success = v.into();
15433            self
15434        }
15435    }
15436
15437    #[doc(hidden)]
15438    impl crate::RequestBuilder for ListOperations {
15439        fn request_options(&mut self) -> &mut crate::RequestOptions {
15440            &mut self.0.options
15441        }
15442    }
15443
15444    /// The request builder for [GeneratorEvaluations::get_operation][crate::client::GeneratorEvaluations::get_operation] calls.
15445    ///
15446    /// # Example
15447    /// ```
15448    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetOperation;
15449    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15450    ///
15451    /// let builder = prepare_request_builder();
15452    /// let response = builder.send().await?;
15453    /// # Ok(()) }
15454    ///
15455    /// fn prepare_request_builder() -> GetOperation {
15456    ///   # panic!();
15457    ///   // ... details omitted ...
15458    /// }
15459    /// ```
15460    #[derive(Clone, Debug)]
15461    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15462
15463    impl GetOperation {
15464        pub(crate) fn new(
15465            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15466        ) -> Self {
15467            Self(RequestBuilder::new(stub))
15468        }
15469
15470        /// Sets the full request, replacing any prior values.
15471        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15472            mut self,
15473            v: V,
15474        ) -> Self {
15475            self.0.request = v.into();
15476            self
15477        }
15478
15479        /// Sets all the options, replacing any prior values.
15480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15481            self.0.options = v.into();
15482            self
15483        }
15484
15485        /// Sends the request.
15486        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15487            (*self.0.stub)
15488                .get_operation(self.0.request, self.0.options)
15489                .await
15490                .map(crate::Response::into_body)
15491        }
15492
15493        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
15494        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15495            self.0.request.name = v.into();
15496            self
15497        }
15498    }
15499
15500    #[doc(hidden)]
15501    impl crate::RequestBuilder for GetOperation {
15502        fn request_options(&mut self) -> &mut crate::RequestOptions {
15503            &mut self.0.options
15504        }
15505    }
15506
15507    /// The request builder for [GeneratorEvaluations::cancel_operation][crate::client::GeneratorEvaluations::cancel_operation] calls.
15508    ///
15509    /// # Example
15510    /// ```
15511    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::CancelOperation;
15512    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15513    ///
15514    /// let builder = prepare_request_builder();
15515    /// let response = builder.send().await?;
15516    /// # Ok(()) }
15517    ///
15518    /// fn prepare_request_builder() -> CancelOperation {
15519    ///   # panic!();
15520    ///   // ... details omitted ...
15521    /// }
15522    /// ```
15523    #[derive(Clone, Debug)]
15524    pub struct CancelOperation(
15525        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15526    );
15527
15528    impl CancelOperation {
15529        pub(crate) fn new(
15530            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15531        ) -> Self {
15532            Self(RequestBuilder::new(stub))
15533        }
15534
15535        /// Sets the full request, replacing any prior values.
15536        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15537            mut self,
15538            v: V,
15539        ) -> Self {
15540            self.0.request = v.into();
15541            self
15542        }
15543
15544        /// Sets all the options, replacing any prior values.
15545        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15546            self.0.options = v.into();
15547            self
15548        }
15549
15550        /// Sends the request.
15551        pub async fn send(self) -> Result<()> {
15552            (*self.0.stub)
15553                .cancel_operation(self.0.request, self.0.options)
15554                .await
15555                .map(crate::Response::into_body)
15556        }
15557
15558        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
15559        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15560            self.0.request.name = v.into();
15561            self
15562        }
15563    }
15564
15565    #[doc(hidden)]
15566    impl crate::RequestBuilder for CancelOperation {
15567        fn request_options(&mut self) -> &mut crate::RequestOptions {
15568            &mut self.0.options
15569        }
15570    }
15571}
15572
15573/// Request and client builders for [Intents][crate::client::Intents].
15574#[cfg(feature = "intents")]
15575#[cfg_attr(docsrs, doc(cfg(feature = "intents")))]
15576pub mod intents {
15577    use crate::Result;
15578
15579    /// A builder for [Intents][crate::client::Intents].
15580    ///
15581    /// ```
15582    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15583    /// # use google_cloud_dialogflow_v2::*;
15584    /// # use builder::intents::ClientBuilder;
15585    /// # use client::Intents;
15586    /// let builder : ClientBuilder = Intents::builder();
15587    /// let client = builder
15588    ///     .with_endpoint("https://dialogflow.googleapis.com")
15589    ///     .build().await?;
15590    /// # Ok(()) }
15591    /// ```
15592    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15593
15594    pub(crate) mod client {
15595        use super::super::super::client::Intents;
15596        pub struct Factory;
15597        impl crate::ClientFactory for Factory {
15598            type Client = Intents;
15599            type Credentials = gaxi::options::Credentials;
15600            async fn build(
15601                self,
15602                config: gaxi::options::ClientConfig,
15603            ) -> crate::ClientBuilderResult<Self::Client> {
15604                Self::Client::new(config).await
15605            }
15606        }
15607    }
15608
15609    /// Common implementation for [crate::client::Intents] request builders.
15610    #[derive(Clone, Debug)]
15611    pub(crate) struct RequestBuilder<R: std::default::Default> {
15612        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>,
15613        request: R,
15614        options: crate::RequestOptions,
15615    }
15616
15617    impl<R> RequestBuilder<R>
15618    where
15619        R: std::default::Default,
15620    {
15621        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15622            Self {
15623                stub,
15624                request: R::default(),
15625                options: crate::RequestOptions::default(),
15626            }
15627        }
15628    }
15629
15630    /// The request builder for [Intents::list_intents][crate::client::Intents::list_intents] calls.
15631    ///
15632    /// # Example
15633    /// ```
15634    /// # use google_cloud_dialogflow_v2::builder::intents::ListIntents;
15635    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15636    /// use google_cloud_gax::paginator::ItemPaginator;
15637    ///
15638    /// let builder = prepare_request_builder();
15639    /// let mut items = builder.by_item();
15640    /// while let Some(result) = items.next().await {
15641    ///   let item = result?;
15642    /// }
15643    /// # Ok(()) }
15644    ///
15645    /// fn prepare_request_builder() -> ListIntents {
15646    ///   # panic!();
15647    ///   // ... details omitted ...
15648    /// }
15649    /// ```
15650    #[derive(Clone, Debug)]
15651    pub struct ListIntents(RequestBuilder<crate::model::ListIntentsRequest>);
15652
15653    impl ListIntents {
15654        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15655            Self(RequestBuilder::new(stub))
15656        }
15657
15658        /// Sets the full request, replacing any prior values.
15659        pub fn with_request<V: Into<crate::model::ListIntentsRequest>>(mut self, v: V) -> Self {
15660            self.0.request = v.into();
15661            self
15662        }
15663
15664        /// Sets all the options, replacing any prior values.
15665        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15666            self.0.options = v.into();
15667            self
15668        }
15669
15670        /// Sends the request.
15671        pub async fn send(self) -> Result<crate::model::ListIntentsResponse> {
15672            (*self.0.stub)
15673                .list_intents(self.0.request, self.0.options)
15674                .await
15675                .map(crate::Response::into_body)
15676        }
15677
15678        /// Streams each page in the collection.
15679        pub fn by_page(
15680            self,
15681        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIntentsResponse, crate::Error>
15682        {
15683            use std::clone::Clone;
15684            let token = self.0.request.page_token.clone();
15685            let execute = move |token: String| {
15686                let mut builder = self.clone();
15687                builder.0.request = builder.0.request.set_page_token(token);
15688                builder.send()
15689            };
15690            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15691        }
15692
15693        /// Streams each item in the collection.
15694        pub fn by_item(
15695            self,
15696        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15697            crate::model::ListIntentsResponse,
15698            crate::Error,
15699        > {
15700            use google_cloud_gax::paginator::Paginator;
15701            self.by_page().items()
15702        }
15703
15704        /// Sets the value of [parent][crate::model::ListIntentsRequest::parent].
15705        ///
15706        /// This is a **required** field for requests.
15707        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15708            self.0.request.parent = v.into();
15709            self
15710        }
15711
15712        /// Sets the value of [language_code][crate::model::ListIntentsRequest::language_code].
15713        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15714            self.0.request.language_code = v.into();
15715            self
15716        }
15717
15718        /// Sets the value of [intent_view][crate::model::ListIntentsRequest::intent_view].
15719        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15720            self.0.request.intent_view = v.into();
15721            self
15722        }
15723
15724        /// Sets the value of [page_size][crate::model::ListIntentsRequest::page_size].
15725        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15726            self.0.request.page_size = v.into();
15727            self
15728        }
15729
15730        /// Sets the value of [page_token][crate::model::ListIntentsRequest::page_token].
15731        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15732            self.0.request.page_token = v.into();
15733            self
15734        }
15735    }
15736
15737    #[doc(hidden)]
15738    impl crate::RequestBuilder for ListIntents {
15739        fn request_options(&mut self) -> &mut crate::RequestOptions {
15740            &mut self.0.options
15741        }
15742    }
15743
15744    /// The request builder for [Intents::get_intent][crate::client::Intents::get_intent] calls.
15745    ///
15746    /// # Example
15747    /// ```
15748    /// # use google_cloud_dialogflow_v2::builder::intents::GetIntent;
15749    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15750    ///
15751    /// let builder = prepare_request_builder();
15752    /// let response = builder.send().await?;
15753    /// # Ok(()) }
15754    ///
15755    /// fn prepare_request_builder() -> GetIntent {
15756    ///   # panic!();
15757    ///   // ... details omitted ...
15758    /// }
15759    /// ```
15760    #[derive(Clone, Debug)]
15761    pub struct GetIntent(RequestBuilder<crate::model::GetIntentRequest>);
15762
15763    impl GetIntent {
15764        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15765            Self(RequestBuilder::new(stub))
15766        }
15767
15768        /// Sets the full request, replacing any prior values.
15769        pub fn with_request<V: Into<crate::model::GetIntentRequest>>(mut self, v: V) -> Self {
15770            self.0.request = v.into();
15771            self
15772        }
15773
15774        /// Sets all the options, replacing any prior values.
15775        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15776            self.0.options = v.into();
15777            self
15778        }
15779
15780        /// Sends the request.
15781        pub async fn send(self) -> Result<crate::model::Intent> {
15782            (*self.0.stub)
15783                .get_intent(self.0.request, self.0.options)
15784                .await
15785                .map(crate::Response::into_body)
15786        }
15787
15788        /// Sets the value of [name][crate::model::GetIntentRequest::name].
15789        ///
15790        /// This is a **required** field for requests.
15791        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15792            self.0.request.name = v.into();
15793            self
15794        }
15795
15796        /// Sets the value of [language_code][crate::model::GetIntentRequest::language_code].
15797        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15798            self.0.request.language_code = v.into();
15799            self
15800        }
15801
15802        /// Sets the value of [intent_view][crate::model::GetIntentRequest::intent_view].
15803        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15804            self.0.request.intent_view = v.into();
15805            self
15806        }
15807    }
15808
15809    #[doc(hidden)]
15810    impl crate::RequestBuilder for GetIntent {
15811        fn request_options(&mut self) -> &mut crate::RequestOptions {
15812            &mut self.0.options
15813        }
15814    }
15815
15816    /// The request builder for [Intents::create_intent][crate::client::Intents::create_intent] calls.
15817    ///
15818    /// # Example
15819    /// ```
15820    /// # use google_cloud_dialogflow_v2::builder::intents::CreateIntent;
15821    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15822    ///
15823    /// let builder = prepare_request_builder();
15824    /// let response = builder.send().await?;
15825    /// # Ok(()) }
15826    ///
15827    /// fn prepare_request_builder() -> CreateIntent {
15828    ///   # panic!();
15829    ///   // ... details omitted ...
15830    /// }
15831    /// ```
15832    #[derive(Clone, Debug)]
15833    pub struct CreateIntent(RequestBuilder<crate::model::CreateIntentRequest>);
15834
15835    impl CreateIntent {
15836        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15837            Self(RequestBuilder::new(stub))
15838        }
15839
15840        /// Sets the full request, replacing any prior values.
15841        pub fn with_request<V: Into<crate::model::CreateIntentRequest>>(mut self, v: V) -> Self {
15842            self.0.request = v.into();
15843            self
15844        }
15845
15846        /// Sets all the options, replacing any prior values.
15847        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15848            self.0.options = v.into();
15849            self
15850        }
15851
15852        /// Sends the request.
15853        pub async fn send(self) -> Result<crate::model::Intent> {
15854            (*self.0.stub)
15855                .create_intent(self.0.request, self.0.options)
15856                .await
15857                .map(crate::Response::into_body)
15858        }
15859
15860        /// Sets the value of [parent][crate::model::CreateIntentRequest::parent].
15861        ///
15862        /// This is a **required** field for requests.
15863        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15864            self.0.request.parent = v.into();
15865            self
15866        }
15867
15868        /// Sets the value of [intent][crate::model::CreateIntentRequest::intent].
15869        ///
15870        /// This is a **required** field for requests.
15871        pub fn set_intent<T>(mut self, v: T) -> Self
15872        where
15873            T: std::convert::Into<crate::model::Intent>,
15874        {
15875            self.0.request.intent = std::option::Option::Some(v.into());
15876            self
15877        }
15878
15879        /// Sets or clears the value of [intent][crate::model::CreateIntentRequest::intent].
15880        ///
15881        /// This is a **required** field for requests.
15882        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
15883        where
15884            T: std::convert::Into<crate::model::Intent>,
15885        {
15886            self.0.request.intent = v.map(|x| x.into());
15887            self
15888        }
15889
15890        /// Sets the value of [language_code][crate::model::CreateIntentRequest::language_code].
15891        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15892            self.0.request.language_code = v.into();
15893            self
15894        }
15895
15896        /// Sets the value of [intent_view][crate::model::CreateIntentRequest::intent_view].
15897        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15898            self.0.request.intent_view = v.into();
15899            self
15900        }
15901    }
15902
15903    #[doc(hidden)]
15904    impl crate::RequestBuilder for CreateIntent {
15905        fn request_options(&mut self) -> &mut crate::RequestOptions {
15906            &mut self.0.options
15907        }
15908    }
15909
15910    /// The request builder for [Intents::update_intent][crate::client::Intents::update_intent] calls.
15911    ///
15912    /// # Example
15913    /// ```
15914    /// # use google_cloud_dialogflow_v2::builder::intents::UpdateIntent;
15915    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15916    ///
15917    /// let builder = prepare_request_builder();
15918    /// let response = builder.send().await?;
15919    /// # Ok(()) }
15920    ///
15921    /// fn prepare_request_builder() -> UpdateIntent {
15922    ///   # panic!();
15923    ///   // ... details omitted ...
15924    /// }
15925    /// ```
15926    #[derive(Clone, Debug)]
15927    pub struct UpdateIntent(RequestBuilder<crate::model::UpdateIntentRequest>);
15928
15929    impl UpdateIntent {
15930        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15931            Self(RequestBuilder::new(stub))
15932        }
15933
15934        /// Sets the full request, replacing any prior values.
15935        pub fn with_request<V: Into<crate::model::UpdateIntentRequest>>(mut self, v: V) -> Self {
15936            self.0.request = v.into();
15937            self
15938        }
15939
15940        /// Sets all the options, replacing any prior values.
15941        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15942            self.0.options = v.into();
15943            self
15944        }
15945
15946        /// Sends the request.
15947        pub async fn send(self) -> Result<crate::model::Intent> {
15948            (*self.0.stub)
15949                .update_intent(self.0.request, self.0.options)
15950                .await
15951                .map(crate::Response::into_body)
15952        }
15953
15954        /// Sets the value of [intent][crate::model::UpdateIntentRequest::intent].
15955        ///
15956        /// This is a **required** field for requests.
15957        pub fn set_intent<T>(mut self, v: T) -> Self
15958        where
15959            T: std::convert::Into<crate::model::Intent>,
15960        {
15961            self.0.request.intent = std::option::Option::Some(v.into());
15962            self
15963        }
15964
15965        /// Sets or clears the value of [intent][crate::model::UpdateIntentRequest::intent].
15966        ///
15967        /// This is a **required** field for requests.
15968        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
15969        where
15970            T: std::convert::Into<crate::model::Intent>,
15971        {
15972            self.0.request.intent = v.map(|x| x.into());
15973            self
15974        }
15975
15976        /// Sets the value of [language_code][crate::model::UpdateIntentRequest::language_code].
15977        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15978            self.0.request.language_code = v.into();
15979            self
15980        }
15981
15982        /// Sets the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
15983        pub fn set_update_mask<T>(mut self, v: T) -> Self
15984        where
15985            T: std::convert::Into<wkt::FieldMask>,
15986        {
15987            self.0.request.update_mask = std::option::Option::Some(v.into());
15988            self
15989        }
15990
15991        /// Sets or clears the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
15992        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15993        where
15994            T: std::convert::Into<wkt::FieldMask>,
15995        {
15996            self.0.request.update_mask = v.map(|x| x.into());
15997            self
15998        }
15999
16000        /// Sets the value of [intent_view][crate::model::UpdateIntentRequest::intent_view].
16001        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16002            self.0.request.intent_view = v.into();
16003            self
16004        }
16005    }
16006
16007    #[doc(hidden)]
16008    impl crate::RequestBuilder for UpdateIntent {
16009        fn request_options(&mut self) -> &mut crate::RequestOptions {
16010            &mut self.0.options
16011        }
16012    }
16013
16014    /// The request builder for [Intents::delete_intent][crate::client::Intents::delete_intent] calls.
16015    ///
16016    /// # Example
16017    /// ```
16018    /// # use google_cloud_dialogflow_v2::builder::intents::DeleteIntent;
16019    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16020    ///
16021    /// let builder = prepare_request_builder();
16022    /// let response = builder.send().await?;
16023    /// # Ok(()) }
16024    ///
16025    /// fn prepare_request_builder() -> DeleteIntent {
16026    ///   # panic!();
16027    ///   // ... details omitted ...
16028    /// }
16029    /// ```
16030    #[derive(Clone, Debug)]
16031    pub struct DeleteIntent(RequestBuilder<crate::model::DeleteIntentRequest>);
16032
16033    impl DeleteIntent {
16034        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16035            Self(RequestBuilder::new(stub))
16036        }
16037
16038        /// Sets the full request, replacing any prior values.
16039        pub fn with_request<V: Into<crate::model::DeleteIntentRequest>>(mut self, v: V) -> Self {
16040            self.0.request = v.into();
16041            self
16042        }
16043
16044        /// Sets all the options, replacing any prior values.
16045        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16046            self.0.options = v.into();
16047            self
16048        }
16049
16050        /// Sends the request.
16051        pub async fn send(self) -> Result<()> {
16052            (*self.0.stub)
16053                .delete_intent(self.0.request, self.0.options)
16054                .await
16055                .map(crate::Response::into_body)
16056        }
16057
16058        /// Sets the value of [name][crate::model::DeleteIntentRequest::name].
16059        ///
16060        /// This is a **required** field for requests.
16061        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16062            self.0.request.name = v.into();
16063            self
16064        }
16065    }
16066
16067    #[doc(hidden)]
16068    impl crate::RequestBuilder for DeleteIntent {
16069        fn request_options(&mut self) -> &mut crate::RequestOptions {
16070            &mut self.0.options
16071        }
16072    }
16073
16074    /// The request builder for [Intents::batch_update_intents][crate::client::Intents::batch_update_intents] calls.
16075    ///
16076    /// # Example
16077    /// ```
16078    /// # use google_cloud_dialogflow_v2::builder::intents::BatchUpdateIntents;
16079    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16080    /// use google_cloud_lro::Poller;
16081    ///
16082    /// let builder = prepare_request_builder();
16083    /// let response = builder.poller().until_done().await?;
16084    /// # Ok(()) }
16085    ///
16086    /// fn prepare_request_builder() -> BatchUpdateIntents {
16087    ///   # panic!();
16088    ///   // ... details omitted ...
16089    /// }
16090    /// ```
16091    #[derive(Clone, Debug)]
16092    pub struct BatchUpdateIntents(RequestBuilder<crate::model::BatchUpdateIntentsRequest>);
16093
16094    impl BatchUpdateIntents {
16095        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16096            Self(RequestBuilder::new(stub))
16097        }
16098
16099        /// Sets the full request, replacing any prior values.
16100        pub fn with_request<V: Into<crate::model::BatchUpdateIntentsRequest>>(
16101            mut self,
16102            v: V,
16103        ) -> Self {
16104            self.0.request = v.into();
16105            self
16106        }
16107
16108        /// Sets all the options, replacing any prior values.
16109        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16110            self.0.options = v.into();
16111            self
16112        }
16113
16114        /// Sends the request.
16115        ///
16116        /// # Long running operations
16117        ///
16118        /// This starts, but does not poll, a longrunning operation. More information
16119        /// on [batch_update_intents][crate::client::Intents::batch_update_intents].
16120        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16121            (*self.0.stub)
16122                .batch_update_intents(self.0.request, self.0.options)
16123                .await
16124                .map(crate::Response::into_body)
16125        }
16126
16127        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_intents`.
16128        pub fn poller(
16129            self,
16130        ) -> impl google_cloud_lro::Poller<crate::model::BatchUpdateIntentsResponse, wkt::Struct>
16131        {
16132            type Operation = google_cloud_lro::internal::Operation<
16133                crate::model::BatchUpdateIntentsResponse,
16134                wkt::Struct,
16135            >;
16136            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16137            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16138
16139            let stub = self.0.stub.clone();
16140            let mut options = self.0.options.clone();
16141            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16142            let query = move |name| {
16143                let stub = stub.clone();
16144                let options = options.clone();
16145                async {
16146                    let op = GetOperation::new(stub)
16147                        .set_name(name)
16148                        .with_options(options)
16149                        .send()
16150                        .await?;
16151                    Ok(Operation::new(op))
16152                }
16153            };
16154
16155            let start = move || async {
16156                let op = self.send().await?;
16157                Ok(Operation::new(op))
16158            };
16159
16160            google_cloud_lro::internal::new_poller(
16161                polling_error_policy,
16162                polling_backoff_policy,
16163                start,
16164                query,
16165            )
16166        }
16167
16168        /// Sets the value of [parent][crate::model::BatchUpdateIntentsRequest::parent].
16169        ///
16170        /// This is a **required** field for requests.
16171        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16172            self.0.request.parent = v.into();
16173            self
16174        }
16175
16176        /// Sets the value of [language_code][crate::model::BatchUpdateIntentsRequest::language_code].
16177        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16178            self.0.request.language_code = v.into();
16179            self
16180        }
16181
16182        /// Sets the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
16183        pub fn set_update_mask<T>(mut self, v: T) -> Self
16184        where
16185            T: std::convert::Into<wkt::FieldMask>,
16186        {
16187            self.0.request.update_mask = std::option::Option::Some(v.into());
16188            self
16189        }
16190
16191        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
16192        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16193        where
16194            T: std::convert::Into<wkt::FieldMask>,
16195        {
16196            self.0.request.update_mask = v.map(|x| x.into());
16197            self
16198        }
16199
16200        /// Sets the value of [intent_view][crate::model::BatchUpdateIntentsRequest::intent_view].
16201        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16202            self.0.request.intent_view = v.into();
16203            self
16204        }
16205
16206        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch].
16207        ///
16208        /// Note that all the setters affecting `intent_batch` are
16209        /// mutually exclusive.
16210        pub fn set_intent_batch<
16211            T: Into<Option<crate::model::batch_update_intents_request::IntentBatch>>,
16212        >(
16213            mut self,
16214            v: T,
16215        ) -> Self {
16216            self.0.request.intent_batch = v.into();
16217            self
16218        }
16219
16220        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
16221        /// to hold a `IntentBatchUri`.
16222        ///
16223        /// Note that all the setters affecting `intent_batch` are
16224        /// mutually exclusive.
16225        pub fn set_intent_batch_uri<T: std::convert::Into<std::string::String>>(
16226            mut self,
16227            v: T,
16228        ) -> Self {
16229            self.0.request = self.0.request.set_intent_batch_uri(v);
16230            self
16231        }
16232
16233        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
16234        /// to hold a `IntentBatchInline`.
16235        ///
16236        /// Note that all the setters affecting `intent_batch` are
16237        /// mutually exclusive.
16238        pub fn set_intent_batch_inline<
16239            T: std::convert::Into<std::boxed::Box<crate::model::IntentBatch>>,
16240        >(
16241            mut self,
16242            v: T,
16243        ) -> Self {
16244            self.0.request = self.0.request.set_intent_batch_inline(v);
16245            self
16246        }
16247    }
16248
16249    #[doc(hidden)]
16250    impl crate::RequestBuilder for BatchUpdateIntents {
16251        fn request_options(&mut self) -> &mut crate::RequestOptions {
16252            &mut self.0.options
16253        }
16254    }
16255
16256    /// The request builder for [Intents::batch_delete_intents][crate::client::Intents::batch_delete_intents] calls.
16257    ///
16258    /// # Example
16259    /// ```
16260    /// # use google_cloud_dialogflow_v2::builder::intents::BatchDeleteIntents;
16261    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16262    /// use google_cloud_lro::Poller;
16263    ///
16264    /// let builder = prepare_request_builder();
16265    /// let response = builder.poller().until_done().await?;
16266    /// # Ok(()) }
16267    ///
16268    /// fn prepare_request_builder() -> BatchDeleteIntents {
16269    ///   # panic!();
16270    ///   // ... details omitted ...
16271    /// }
16272    /// ```
16273    #[derive(Clone, Debug)]
16274    pub struct BatchDeleteIntents(RequestBuilder<crate::model::BatchDeleteIntentsRequest>);
16275
16276    impl BatchDeleteIntents {
16277        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16278            Self(RequestBuilder::new(stub))
16279        }
16280
16281        /// Sets the full request, replacing any prior values.
16282        pub fn with_request<V: Into<crate::model::BatchDeleteIntentsRequest>>(
16283            mut self,
16284            v: V,
16285        ) -> Self {
16286            self.0.request = v.into();
16287            self
16288        }
16289
16290        /// Sets all the options, replacing any prior values.
16291        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16292            self.0.options = v.into();
16293            self
16294        }
16295
16296        /// Sends the request.
16297        ///
16298        /// # Long running operations
16299        ///
16300        /// This starts, but does not poll, a longrunning operation. More information
16301        /// on [batch_delete_intents][crate::client::Intents::batch_delete_intents].
16302        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16303            (*self.0.stub)
16304                .batch_delete_intents(self.0.request, self.0.options)
16305                .await
16306                .map(crate::Response::into_body)
16307        }
16308
16309        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_intents`.
16310        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
16311            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
16312            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16313            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16314
16315            let stub = self.0.stub.clone();
16316            let mut options = self.0.options.clone();
16317            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16318            let query = move |name| {
16319                let stub = stub.clone();
16320                let options = options.clone();
16321                async {
16322                    let op = GetOperation::new(stub)
16323                        .set_name(name)
16324                        .with_options(options)
16325                        .send()
16326                        .await?;
16327                    Ok(Operation::new(op))
16328                }
16329            };
16330
16331            let start = move || async {
16332                let op = self.send().await?;
16333                Ok(Operation::new(op))
16334            };
16335
16336            google_cloud_lro::internal::new_unit_response_poller(
16337                polling_error_policy,
16338                polling_backoff_policy,
16339                start,
16340                query,
16341            )
16342        }
16343
16344        /// Sets the value of [parent][crate::model::BatchDeleteIntentsRequest::parent].
16345        ///
16346        /// This is a **required** field for requests.
16347        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16348            self.0.request.parent = v.into();
16349            self
16350        }
16351
16352        /// Sets the value of [intents][crate::model::BatchDeleteIntentsRequest::intents].
16353        ///
16354        /// This is a **required** field for requests.
16355        pub fn set_intents<T, V>(mut self, v: T) -> Self
16356        where
16357            T: std::iter::IntoIterator<Item = V>,
16358            V: std::convert::Into<crate::model::Intent>,
16359        {
16360            use std::iter::Iterator;
16361            self.0.request.intents = v.into_iter().map(|i| i.into()).collect();
16362            self
16363        }
16364    }
16365
16366    #[doc(hidden)]
16367    impl crate::RequestBuilder for BatchDeleteIntents {
16368        fn request_options(&mut self) -> &mut crate::RequestOptions {
16369            &mut self.0.options
16370        }
16371    }
16372
16373    /// The request builder for [Intents::list_locations][crate::client::Intents::list_locations] calls.
16374    ///
16375    /// # Example
16376    /// ```
16377    /// # use google_cloud_dialogflow_v2::builder::intents::ListLocations;
16378    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16379    /// use google_cloud_gax::paginator::ItemPaginator;
16380    ///
16381    /// let builder = prepare_request_builder();
16382    /// let mut items = builder.by_item();
16383    /// while let Some(result) = items.next().await {
16384    ///   let item = result?;
16385    /// }
16386    /// # Ok(()) }
16387    ///
16388    /// fn prepare_request_builder() -> ListLocations {
16389    ///   # panic!();
16390    ///   // ... details omitted ...
16391    /// }
16392    /// ```
16393    #[derive(Clone, Debug)]
16394    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
16395
16396    impl ListLocations {
16397        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16398            Self(RequestBuilder::new(stub))
16399        }
16400
16401        /// Sets the full request, replacing any prior values.
16402        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
16403            mut self,
16404            v: V,
16405        ) -> Self {
16406            self.0.request = v.into();
16407            self
16408        }
16409
16410        /// Sets all the options, replacing any prior values.
16411        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16412            self.0.options = v.into();
16413            self
16414        }
16415
16416        /// Sends the request.
16417        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
16418            (*self.0.stub)
16419                .list_locations(self.0.request, self.0.options)
16420                .await
16421                .map(crate::Response::into_body)
16422        }
16423
16424        /// Streams each page in the collection.
16425        pub fn by_page(
16426            self,
16427        ) -> impl google_cloud_gax::paginator::Paginator<
16428            google_cloud_location::model::ListLocationsResponse,
16429            crate::Error,
16430        > {
16431            use std::clone::Clone;
16432            let token = self.0.request.page_token.clone();
16433            let execute = move |token: String| {
16434                let mut builder = self.clone();
16435                builder.0.request = builder.0.request.set_page_token(token);
16436                builder.send()
16437            };
16438            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16439        }
16440
16441        /// Streams each item in the collection.
16442        pub fn by_item(
16443            self,
16444        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16445            google_cloud_location::model::ListLocationsResponse,
16446            crate::Error,
16447        > {
16448            use google_cloud_gax::paginator::Paginator;
16449            self.by_page().items()
16450        }
16451
16452        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
16453        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16454            self.0.request.name = v.into();
16455            self
16456        }
16457
16458        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
16459        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16460            self.0.request.filter = v.into();
16461            self
16462        }
16463
16464        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
16465        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16466            self.0.request.page_size = v.into();
16467            self
16468        }
16469
16470        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
16471        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16472            self.0.request.page_token = v.into();
16473            self
16474        }
16475    }
16476
16477    #[doc(hidden)]
16478    impl crate::RequestBuilder for ListLocations {
16479        fn request_options(&mut self) -> &mut crate::RequestOptions {
16480            &mut self.0.options
16481        }
16482    }
16483
16484    /// The request builder for [Intents::get_location][crate::client::Intents::get_location] calls.
16485    ///
16486    /// # Example
16487    /// ```
16488    /// # use google_cloud_dialogflow_v2::builder::intents::GetLocation;
16489    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16490    ///
16491    /// let builder = prepare_request_builder();
16492    /// let response = builder.send().await?;
16493    /// # Ok(()) }
16494    ///
16495    /// fn prepare_request_builder() -> GetLocation {
16496    ///   # panic!();
16497    ///   // ... details omitted ...
16498    /// }
16499    /// ```
16500    #[derive(Clone, Debug)]
16501    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
16502
16503    impl GetLocation {
16504        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16505            Self(RequestBuilder::new(stub))
16506        }
16507
16508        /// Sets the full request, replacing any prior values.
16509        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
16510            mut self,
16511            v: V,
16512        ) -> Self {
16513            self.0.request = v.into();
16514            self
16515        }
16516
16517        /// Sets all the options, replacing any prior values.
16518        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16519            self.0.options = v.into();
16520            self
16521        }
16522
16523        /// Sends the request.
16524        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
16525            (*self.0.stub)
16526                .get_location(self.0.request, self.0.options)
16527                .await
16528                .map(crate::Response::into_body)
16529        }
16530
16531        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
16532        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16533            self.0.request.name = v.into();
16534            self
16535        }
16536    }
16537
16538    #[doc(hidden)]
16539    impl crate::RequestBuilder for GetLocation {
16540        fn request_options(&mut self) -> &mut crate::RequestOptions {
16541            &mut self.0.options
16542        }
16543    }
16544
16545    /// The request builder for [Intents::list_operations][crate::client::Intents::list_operations] calls.
16546    ///
16547    /// # Example
16548    /// ```
16549    /// # use google_cloud_dialogflow_v2::builder::intents::ListOperations;
16550    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16551    /// use google_cloud_gax::paginator::ItemPaginator;
16552    ///
16553    /// let builder = prepare_request_builder();
16554    /// let mut items = builder.by_item();
16555    /// while let Some(result) = items.next().await {
16556    ///   let item = result?;
16557    /// }
16558    /// # Ok(()) }
16559    ///
16560    /// fn prepare_request_builder() -> ListOperations {
16561    ///   # panic!();
16562    ///   // ... details omitted ...
16563    /// }
16564    /// ```
16565    #[derive(Clone, Debug)]
16566    pub struct ListOperations(
16567        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
16568    );
16569
16570    impl ListOperations {
16571        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16572            Self(RequestBuilder::new(stub))
16573        }
16574
16575        /// Sets the full request, replacing any prior values.
16576        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
16577            mut self,
16578            v: V,
16579        ) -> Self {
16580            self.0.request = v.into();
16581            self
16582        }
16583
16584        /// Sets all the options, replacing any prior values.
16585        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16586            self.0.options = v.into();
16587            self
16588        }
16589
16590        /// Sends the request.
16591        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
16592            (*self.0.stub)
16593                .list_operations(self.0.request, self.0.options)
16594                .await
16595                .map(crate::Response::into_body)
16596        }
16597
16598        /// Streams each page in the collection.
16599        pub fn by_page(
16600            self,
16601        ) -> impl google_cloud_gax::paginator::Paginator<
16602            google_cloud_longrunning::model::ListOperationsResponse,
16603            crate::Error,
16604        > {
16605            use std::clone::Clone;
16606            let token = self.0.request.page_token.clone();
16607            let execute = move |token: String| {
16608                let mut builder = self.clone();
16609                builder.0.request = builder.0.request.set_page_token(token);
16610                builder.send()
16611            };
16612            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16613        }
16614
16615        /// Streams each item in the collection.
16616        pub fn by_item(
16617            self,
16618        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16619            google_cloud_longrunning::model::ListOperationsResponse,
16620            crate::Error,
16621        > {
16622            use google_cloud_gax::paginator::Paginator;
16623            self.by_page().items()
16624        }
16625
16626        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
16627        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16628            self.0.request.name = v.into();
16629            self
16630        }
16631
16632        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
16633        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16634            self.0.request.filter = v.into();
16635            self
16636        }
16637
16638        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
16639        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16640            self.0.request.page_size = v.into();
16641            self
16642        }
16643
16644        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
16645        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16646            self.0.request.page_token = v.into();
16647            self
16648        }
16649
16650        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
16651        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16652            self.0.request.return_partial_success = v.into();
16653            self
16654        }
16655    }
16656
16657    #[doc(hidden)]
16658    impl crate::RequestBuilder for ListOperations {
16659        fn request_options(&mut self) -> &mut crate::RequestOptions {
16660            &mut self.0.options
16661        }
16662    }
16663
16664    /// The request builder for [Intents::get_operation][crate::client::Intents::get_operation] calls.
16665    ///
16666    /// # Example
16667    /// ```
16668    /// # use google_cloud_dialogflow_v2::builder::intents::GetOperation;
16669    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16670    ///
16671    /// let builder = prepare_request_builder();
16672    /// let response = builder.send().await?;
16673    /// # Ok(()) }
16674    ///
16675    /// fn prepare_request_builder() -> GetOperation {
16676    ///   # panic!();
16677    ///   // ... details omitted ...
16678    /// }
16679    /// ```
16680    #[derive(Clone, Debug)]
16681    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
16682
16683    impl GetOperation {
16684        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16685            Self(RequestBuilder::new(stub))
16686        }
16687
16688        /// Sets the full request, replacing any prior values.
16689        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
16690            mut self,
16691            v: V,
16692        ) -> Self {
16693            self.0.request = v.into();
16694            self
16695        }
16696
16697        /// Sets all the options, replacing any prior values.
16698        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16699            self.0.options = v.into();
16700            self
16701        }
16702
16703        /// Sends the request.
16704        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16705            (*self.0.stub)
16706                .get_operation(self.0.request, self.0.options)
16707                .await
16708                .map(crate::Response::into_body)
16709        }
16710
16711        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
16712        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16713            self.0.request.name = v.into();
16714            self
16715        }
16716    }
16717
16718    #[doc(hidden)]
16719    impl crate::RequestBuilder for GetOperation {
16720        fn request_options(&mut self) -> &mut crate::RequestOptions {
16721            &mut self.0.options
16722        }
16723    }
16724
16725    /// The request builder for [Intents::cancel_operation][crate::client::Intents::cancel_operation] calls.
16726    ///
16727    /// # Example
16728    /// ```
16729    /// # use google_cloud_dialogflow_v2::builder::intents::CancelOperation;
16730    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16731    ///
16732    /// let builder = prepare_request_builder();
16733    /// let response = builder.send().await?;
16734    /// # Ok(()) }
16735    ///
16736    /// fn prepare_request_builder() -> CancelOperation {
16737    ///   # panic!();
16738    ///   // ... details omitted ...
16739    /// }
16740    /// ```
16741    #[derive(Clone, Debug)]
16742    pub struct CancelOperation(
16743        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
16744    );
16745
16746    impl CancelOperation {
16747        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16748            Self(RequestBuilder::new(stub))
16749        }
16750
16751        /// Sets the full request, replacing any prior values.
16752        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
16753            mut self,
16754            v: V,
16755        ) -> Self {
16756            self.0.request = v.into();
16757            self
16758        }
16759
16760        /// Sets all the options, replacing any prior values.
16761        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16762            self.0.options = v.into();
16763            self
16764        }
16765
16766        /// Sends the request.
16767        pub async fn send(self) -> Result<()> {
16768            (*self.0.stub)
16769                .cancel_operation(self.0.request, self.0.options)
16770                .await
16771                .map(crate::Response::into_body)
16772        }
16773
16774        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
16775        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16776            self.0.request.name = v.into();
16777            self
16778        }
16779    }
16780
16781    #[doc(hidden)]
16782    impl crate::RequestBuilder for CancelOperation {
16783        fn request_options(&mut self) -> &mut crate::RequestOptions {
16784            &mut self.0.options
16785        }
16786    }
16787}
16788
16789/// Request and client builders for [KnowledgeBases][crate::client::KnowledgeBases].
16790#[cfg(feature = "knowledge-bases")]
16791#[cfg_attr(docsrs, doc(cfg(feature = "knowledge-bases")))]
16792pub mod knowledge_bases {
16793    use crate::Result;
16794
16795    /// A builder for [KnowledgeBases][crate::client::KnowledgeBases].
16796    ///
16797    /// ```
16798    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16799    /// # use google_cloud_dialogflow_v2::*;
16800    /// # use builder::knowledge_bases::ClientBuilder;
16801    /// # use client::KnowledgeBases;
16802    /// let builder : ClientBuilder = KnowledgeBases::builder();
16803    /// let client = builder
16804    ///     .with_endpoint("https://dialogflow.googleapis.com")
16805    ///     .build().await?;
16806    /// # Ok(()) }
16807    /// ```
16808    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16809
16810    pub(crate) mod client {
16811        use super::super::super::client::KnowledgeBases;
16812        pub struct Factory;
16813        impl crate::ClientFactory for Factory {
16814            type Client = KnowledgeBases;
16815            type Credentials = gaxi::options::Credentials;
16816            async fn build(
16817                self,
16818                config: gaxi::options::ClientConfig,
16819            ) -> crate::ClientBuilderResult<Self::Client> {
16820                Self::Client::new(config).await
16821            }
16822        }
16823    }
16824
16825    /// Common implementation for [crate::client::KnowledgeBases] request builders.
16826    #[derive(Clone, Debug)]
16827    pub(crate) struct RequestBuilder<R: std::default::Default> {
16828        stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16829        request: R,
16830        options: crate::RequestOptions,
16831    }
16832
16833    impl<R> RequestBuilder<R>
16834    where
16835        R: std::default::Default,
16836    {
16837        pub(crate) fn new(
16838            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16839        ) -> Self {
16840            Self {
16841                stub,
16842                request: R::default(),
16843                options: crate::RequestOptions::default(),
16844            }
16845        }
16846    }
16847
16848    /// The request builder for [KnowledgeBases::list_knowledge_bases][crate::client::KnowledgeBases::list_knowledge_bases] calls.
16849    ///
16850    /// # Example
16851    /// ```
16852    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListKnowledgeBases;
16853    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16854    /// use google_cloud_gax::paginator::ItemPaginator;
16855    ///
16856    /// let builder = prepare_request_builder();
16857    /// let mut items = builder.by_item();
16858    /// while let Some(result) = items.next().await {
16859    ///   let item = result?;
16860    /// }
16861    /// # Ok(()) }
16862    ///
16863    /// fn prepare_request_builder() -> ListKnowledgeBases {
16864    ///   # panic!();
16865    ///   // ... details omitted ...
16866    /// }
16867    /// ```
16868    #[derive(Clone, Debug)]
16869    pub struct ListKnowledgeBases(RequestBuilder<crate::model::ListKnowledgeBasesRequest>);
16870
16871    impl ListKnowledgeBases {
16872        pub(crate) fn new(
16873            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16874        ) -> Self {
16875            Self(RequestBuilder::new(stub))
16876        }
16877
16878        /// Sets the full request, replacing any prior values.
16879        pub fn with_request<V: Into<crate::model::ListKnowledgeBasesRequest>>(
16880            mut self,
16881            v: V,
16882        ) -> Self {
16883            self.0.request = v.into();
16884            self
16885        }
16886
16887        /// Sets all the options, replacing any prior values.
16888        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16889            self.0.options = v.into();
16890            self
16891        }
16892
16893        /// Sends the request.
16894        pub async fn send(self) -> Result<crate::model::ListKnowledgeBasesResponse> {
16895            (*self.0.stub)
16896                .list_knowledge_bases(self.0.request, self.0.options)
16897                .await
16898                .map(crate::Response::into_body)
16899        }
16900
16901        /// Streams each page in the collection.
16902        pub fn by_page(
16903            self,
16904        ) -> impl google_cloud_gax::paginator::Paginator<
16905            crate::model::ListKnowledgeBasesResponse,
16906            crate::Error,
16907        > {
16908            use std::clone::Clone;
16909            let token = self.0.request.page_token.clone();
16910            let execute = move |token: String| {
16911                let mut builder = self.clone();
16912                builder.0.request = builder.0.request.set_page_token(token);
16913                builder.send()
16914            };
16915            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16916        }
16917
16918        /// Streams each item in the collection.
16919        pub fn by_item(
16920            self,
16921        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16922            crate::model::ListKnowledgeBasesResponse,
16923            crate::Error,
16924        > {
16925            use google_cloud_gax::paginator::Paginator;
16926            self.by_page().items()
16927        }
16928
16929        /// Sets the value of [parent][crate::model::ListKnowledgeBasesRequest::parent].
16930        ///
16931        /// This is a **required** field for requests.
16932        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16933            self.0.request.parent = v.into();
16934            self
16935        }
16936
16937        /// Sets the value of [page_size][crate::model::ListKnowledgeBasesRequest::page_size].
16938        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16939            self.0.request.page_size = v.into();
16940            self
16941        }
16942
16943        /// Sets the value of [page_token][crate::model::ListKnowledgeBasesRequest::page_token].
16944        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16945            self.0.request.page_token = v.into();
16946            self
16947        }
16948
16949        /// Sets the value of [filter][crate::model::ListKnowledgeBasesRequest::filter].
16950        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16951            self.0.request.filter = v.into();
16952            self
16953        }
16954    }
16955
16956    #[doc(hidden)]
16957    impl crate::RequestBuilder for ListKnowledgeBases {
16958        fn request_options(&mut self) -> &mut crate::RequestOptions {
16959            &mut self.0.options
16960        }
16961    }
16962
16963    /// The request builder for [KnowledgeBases::get_knowledge_base][crate::client::KnowledgeBases::get_knowledge_base] calls.
16964    ///
16965    /// # Example
16966    /// ```
16967    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetKnowledgeBase;
16968    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16969    ///
16970    /// let builder = prepare_request_builder();
16971    /// let response = builder.send().await?;
16972    /// # Ok(()) }
16973    ///
16974    /// fn prepare_request_builder() -> GetKnowledgeBase {
16975    ///   # panic!();
16976    ///   // ... details omitted ...
16977    /// }
16978    /// ```
16979    #[derive(Clone, Debug)]
16980    pub struct GetKnowledgeBase(RequestBuilder<crate::model::GetKnowledgeBaseRequest>);
16981
16982    impl GetKnowledgeBase {
16983        pub(crate) fn new(
16984            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16985        ) -> Self {
16986            Self(RequestBuilder::new(stub))
16987        }
16988
16989        /// Sets the full request, replacing any prior values.
16990        pub fn with_request<V: Into<crate::model::GetKnowledgeBaseRequest>>(
16991            mut self,
16992            v: V,
16993        ) -> Self {
16994            self.0.request = v.into();
16995            self
16996        }
16997
16998        /// Sets all the options, replacing any prior values.
16999        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17000            self.0.options = v.into();
17001            self
17002        }
17003
17004        /// Sends the request.
17005        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17006            (*self.0.stub)
17007                .get_knowledge_base(self.0.request, self.0.options)
17008                .await
17009                .map(crate::Response::into_body)
17010        }
17011
17012        /// Sets the value of [name][crate::model::GetKnowledgeBaseRequest::name].
17013        ///
17014        /// This is a **required** field for requests.
17015        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17016            self.0.request.name = v.into();
17017            self
17018        }
17019    }
17020
17021    #[doc(hidden)]
17022    impl crate::RequestBuilder for GetKnowledgeBase {
17023        fn request_options(&mut self) -> &mut crate::RequestOptions {
17024            &mut self.0.options
17025        }
17026    }
17027
17028    /// The request builder for [KnowledgeBases::create_knowledge_base][crate::client::KnowledgeBases::create_knowledge_base] calls.
17029    ///
17030    /// # Example
17031    /// ```
17032    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::CreateKnowledgeBase;
17033    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17034    ///
17035    /// let builder = prepare_request_builder();
17036    /// let response = builder.send().await?;
17037    /// # Ok(()) }
17038    ///
17039    /// fn prepare_request_builder() -> CreateKnowledgeBase {
17040    ///   # panic!();
17041    ///   // ... details omitted ...
17042    /// }
17043    /// ```
17044    #[derive(Clone, Debug)]
17045    pub struct CreateKnowledgeBase(RequestBuilder<crate::model::CreateKnowledgeBaseRequest>);
17046
17047    impl CreateKnowledgeBase {
17048        pub(crate) fn new(
17049            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17050        ) -> Self {
17051            Self(RequestBuilder::new(stub))
17052        }
17053
17054        /// Sets the full request, replacing any prior values.
17055        pub fn with_request<V: Into<crate::model::CreateKnowledgeBaseRequest>>(
17056            mut self,
17057            v: V,
17058        ) -> Self {
17059            self.0.request = v.into();
17060            self
17061        }
17062
17063        /// Sets all the options, replacing any prior values.
17064        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17065            self.0.options = v.into();
17066            self
17067        }
17068
17069        /// Sends the request.
17070        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17071            (*self.0.stub)
17072                .create_knowledge_base(self.0.request, self.0.options)
17073                .await
17074                .map(crate::Response::into_body)
17075        }
17076
17077        /// Sets the value of [parent][crate::model::CreateKnowledgeBaseRequest::parent].
17078        ///
17079        /// This is a **required** field for requests.
17080        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17081            self.0.request.parent = v.into();
17082            self
17083        }
17084
17085        /// Sets the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
17086        ///
17087        /// This is a **required** field for requests.
17088        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
17089        where
17090            T: std::convert::Into<crate::model::KnowledgeBase>,
17091        {
17092            self.0.request.knowledge_base = std::option::Option::Some(v.into());
17093            self
17094        }
17095
17096        /// Sets or clears the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
17097        ///
17098        /// This is a **required** field for requests.
17099        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
17100        where
17101            T: std::convert::Into<crate::model::KnowledgeBase>,
17102        {
17103            self.0.request.knowledge_base = v.map(|x| x.into());
17104            self
17105        }
17106    }
17107
17108    #[doc(hidden)]
17109    impl crate::RequestBuilder for CreateKnowledgeBase {
17110        fn request_options(&mut self) -> &mut crate::RequestOptions {
17111            &mut self.0.options
17112        }
17113    }
17114
17115    /// The request builder for [KnowledgeBases::delete_knowledge_base][crate::client::KnowledgeBases::delete_knowledge_base] calls.
17116    ///
17117    /// # Example
17118    /// ```
17119    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::DeleteKnowledgeBase;
17120    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17121    ///
17122    /// let builder = prepare_request_builder();
17123    /// let response = builder.send().await?;
17124    /// # Ok(()) }
17125    ///
17126    /// fn prepare_request_builder() -> DeleteKnowledgeBase {
17127    ///   # panic!();
17128    ///   // ... details omitted ...
17129    /// }
17130    /// ```
17131    #[derive(Clone, Debug)]
17132    pub struct DeleteKnowledgeBase(RequestBuilder<crate::model::DeleteKnowledgeBaseRequest>);
17133
17134    impl DeleteKnowledgeBase {
17135        pub(crate) fn new(
17136            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17137        ) -> Self {
17138            Self(RequestBuilder::new(stub))
17139        }
17140
17141        /// Sets the full request, replacing any prior values.
17142        pub fn with_request<V: Into<crate::model::DeleteKnowledgeBaseRequest>>(
17143            mut self,
17144            v: V,
17145        ) -> Self {
17146            self.0.request = v.into();
17147            self
17148        }
17149
17150        /// Sets all the options, replacing any prior values.
17151        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17152            self.0.options = v.into();
17153            self
17154        }
17155
17156        /// Sends the request.
17157        pub async fn send(self) -> Result<()> {
17158            (*self.0.stub)
17159                .delete_knowledge_base(self.0.request, self.0.options)
17160                .await
17161                .map(crate::Response::into_body)
17162        }
17163
17164        /// Sets the value of [name][crate::model::DeleteKnowledgeBaseRequest::name].
17165        ///
17166        /// This is a **required** field for requests.
17167        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17168            self.0.request.name = v.into();
17169            self
17170        }
17171
17172        /// Sets the value of [force][crate::model::DeleteKnowledgeBaseRequest::force].
17173        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
17174            self.0.request.force = v.into();
17175            self
17176        }
17177    }
17178
17179    #[doc(hidden)]
17180    impl crate::RequestBuilder for DeleteKnowledgeBase {
17181        fn request_options(&mut self) -> &mut crate::RequestOptions {
17182            &mut self.0.options
17183        }
17184    }
17185
17186    /// The request builder for [KnowledgeBases::update_knowledge_base][crate::client::KnowledgeBases::update_knowledge_base] calls.
17187    ///
17188    /// # Example
17189    /// ```
17190    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::UpdateKnowledgeBase;
17191    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17192    ///
17193    /// let builder = prepare_request_builder();
17194    /// let response = builder.send().await?;
17195    /// # Ok(()) }
17196    ///
17197    /// fn prepare_request_builder() -> UpdateKnowledgeBase {
17198    ///   # panic!();
17199    ///   // ... details omitted ...
17200    /// }
17201    /// ```
17202    #[derive(Clone, Debug)]
17203    pub struct UpdateKnowledgeBase(RequestBuilder<crate::model::UpdateKnowledgeBaseRequest>);
17204
17205    impl UpdateKnowledgeBase {
17206        pub(crate) fn new(
17207            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17208        ) -> Self {
17209            Self(RequestBuilder::new(stub))
17210        }
17211
17212        /// Sets the full request, replacing any prior values.
17213        pub fn with_request<V: Into<crate::model::UpdateKnowledgeBaseRequest>>(
17214            mut self,
17215            v: V,
17216        ) -> Self {
17217            self.0.request = v.into();
17218            self
17219        }
17220
17221        /// Sets all the options, replacing any prior values.
17222        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17223            self.0.options = v.into();
17224            self
17225        }
17226
17227        /// Sends the request.
17228        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17229            (*self.0.stub)
17230                .update_knowledge_base(self.0.request, self.0.options)
17231                .await
17232                .map(crate::Response::into_body)
17233        }
17234
17235        /// Sets the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
17236        ///
17237        /// This is a **required** field for requests.
17238        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
17239        where
17240            T: std::convert::Into<crate::model::KnowledgeBase>,
17241        {
17242            self.0.request.knowledge_base = std::option::Option::Some(v.into());
17243            self
17244        }
17245
17246        /// Sets or clears the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
17247        ///
17248        /// This is a **required** field for requests.
17249        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
17250        where
17251            T: std::convert::Into<crate::model::KnowledgeBase>,
17252        {
17253            self.0.request.knowledge_base = v.map(|x| x.into());
17254            self
17255        }
17256
17257        /// Sets the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
17258        pub fn set_update_mask<T>(mut self, v: T) -> Self
17259        where
17260            T: std::convert::Into<wkt::FieldMask>,
17261        {
17262            self.0.request.update_mask = std::option::Option::Some(v.into());
17263            self
17264        }
17265
17266        /// Sets or clears the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
17267        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17268        where
17269            T: std::convert::Into<wkt::FieldMask>,
17270        {
17271            self.0.request.update_mask = v.map(|x| x.into());
17272            self
17273        }
17274    }
17275
17276    #[doc(hidden)]
17277    impl crate::RequestBuilder for UpdateKnowledgeBase {
17278        fn request_options(&mut self) -> &mut crate::RequestOptions {
17279            &mut self.0.options
17280        }
17281    }
17282
17283    /// The request builder for [KnowledgeBases::list_locations][crate::client::KnowledgeBases::list_locations] calls.
17284    ///
17285    /// # Example
17286    /// ```
17287    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListLocations;
17288    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17289    /// use google_cloud_gax::paginator::ItemPaginator;
17290    ///
17291    /// let builder = prepare_request_builder();
17292    /// let mut items = builder.by_item();
17293    /// while let Some(result) = items.next().await {
17294    ///   let item = result?;
17295    /// }
17296    /// # Ok(()) }
17297    ///
17298    /// fn prepare_request_builder() -> ListLocations {
17299    ///   # panic!();
17300    ///   // ... details omitted ...
17301    /// }
17302    /// ```
17303    #[derive(Clone, Debug)]
17304    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
17305
17306    impl ListLocations {
17307        pub(crate) fn new(
17308            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17309        ) -> Self {
17310            Self(RequestBuilder::new(stub))
17311        }
17312
17313        /// Sets the full request, replacing any prior values.
17314        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
17315            mut self,
17316            v: V,
17317        ) -> Self {
17318            self.0.request = v.into();
17319            self
17320        }
17321
17322        /// Sets all the options, replacing any prior values.
17323        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17324            self.0.options = v.into();
17325            self
17326        }
17327
17328        /// Sends the request.
17329        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
17330            (*self.0.stub)
17331                .list_locations(self.0.request, self.0.options)
17332                .await
17333                .map(crate::Response::into_body)
17334        }
17335
17336        /// Streams each page in the collection.
17337        pub fn by_page(
17338            self,
17339        ) -> impl google_cloud_gax::paginator::Paginator<
17340            google_cloud_location::model::ListLocationsResponse,
17341            crate::Error,
17342        > {
17343            use std::clone::Clone;
17344            let token = self.0.request.page_token.clone();
17345            let execute = move |token: String| {
17346                let mut builder = self.clone();
17347                builder.0.request = builder.0.request.set_page_token(token);
17348                builder.send()
17349            };
17350            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17351        }
17352
17353        /// Streams each item in the collection.
17354        pub fn by_item(
17355            self,
17356        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17357            google_cloud_location::model::ListLocationsResponse,
17358            crate::Error,
17359        > {
17360            use google_cloud_gax::paginator::Paginator;
17361            self.by_page().items()
17362        }
17363
17364        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
17365        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17366            self.0.request.name = v.into();
17367            self
17368        }
17369
17370        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
17371        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17372            self.0.request.filter = v.into();
17373            self
17374        }
17375
17376        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
17377        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17378            self.0.request.page_size = v.into();
17379            self
17380        }
17381
17382        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
17383        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17384            self.0.request.page_token = v.into();
17385            self
17386        }
17387    }
17388
17389    #[doc(hidden)]
17390    impl crate::RequestBuilder for ListLocations {
17391        fn request_options(&mut self) -> &mut crate::RequestOptions {
17392            &mut self.0.options
17393        }
17394    }
17395
17396    /// The request builder for [KnowledgeBases::get_location][crate::client::KnowledgeBases::get_location] calls.
17397    ///
17398    /// # Example
17399    /// ```
17400    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetLocation;
17401    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17402    ///
17403    /// let builder = prepare_request_builder();
17404    /// let response = builder.send().await?;
17405    /// # Ok(()) }
17406    ///
17407    /// fn prepare_request_builder() -> GetLocation {
17408    ///   # panic!();
17409    ///   // ... details omitted ...
17410    /// }
17411    /// ```
17412    #[derive(Clone, Debug)]
17413    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
17414
17415    impl GetLocation {
17416        pub(crate) fn new(
17417            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17418        ) -> Self {
17419            Self(RequestBuilder::new(stub))
17420        }
17421
17422        /// Sets the full request, replacing any prior values.
17423        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
17424            mut self,
17425            v: V,
17426        ) -> Self {
17427            self.0.request = v.into();
17428            self
17429        }
17430
17431        /// Sets all the options, replacing any prior values.
17432        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17433            self.0.options = v.into();
17434            self
17435        }
17436
17437        /// Sends the request.
17438        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
17439            (*self.0.stub)
17440                .get_location(self.0.request, self.0.options)
17441                .await
17442                .map(crate::Response::into_body)
17443        }
17444
17445        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
17446        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17447            self.0.request.name = v.into();
17448            self
17449        }
17450    }
17451
17452    #[doc(hidden)]
17453    impl crate::RequestBuilder for GetLocation {
17454        fn request_options(&mut self) -> &mut crate::RequestOptions {
17455            &mut self.0.options
17456        }
17457    }
17458
17459    /// The request builder for [KnowledgeBases::list_operations][crate::client::KnowledgeBases::list_operations] calls.
17460    ///
17461    /// # Example
17462    /// ```
17463    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListOperations;
17464    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17465    /// use google_cloud_gax::paginator::ItemPaginator;
17466    ///
17467    /// let builder = prepare_request_builder();
17468    /// let mut items = builder.by_item();
17469    /// while let Some(result) = items.next().await {
17470    ///   let item = result?;
17471    /// }
17472    /// # Ok(()) }
17473    ///
17474    /// fn prepare_request_builder() -> ListOperations {
17475    ///   # panic!();
17476    ///   // ... details omitted ...
17477    /// }
17478    /// ```
17479    #[derive(Clone, Debug)]
17480    pub struct ListOperations(
17481        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
17482    );
17483
17484    impl ListOperations {
17485        pub(crate) fn new(
17486            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17487        ) -> Self {
17488            Self(RequestBuilder::new(stub))
17489        }
17490
17491        /// Sets the full request, replacing any prior values.
17492        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
17493            mut self,
17494            v: V,
17495        ) -> Self {
17496            self.0.request = v.into();
17497            self
17498        }
17499
17500        /// Sets all the options, replacing any prior values.
17501        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17502            self.0.options = v.into();
17503            self
17504        }
17505
17506        /// Sends the request.
17507        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
17508            (*self.0.stub)
17509                .list_operations(self.0.request, self.0.options)
17510                .await
17511                .map(crate::Response::into_body)
17512        }
17513
17514        /// Streams each page in the collection.
17515        pub fn by_page(
17516            self,
17517        ) -> impl google_cloud_gax::paginator::Paginator<
17518            google_cloud_longrunning::model::ListOperationsResponse,
17519            crate::Error,
17520        > {
17521            use std::clone::Clone;
17522            let token = self.0.request.page_token.clone();
17523            let execute = move |token: String| {
17524                let mut builder = self.clone();
17525                builder.0.request = builder.0.request.set_page_token(token);
17526                builder.send()
17527            };
17528            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17529        }
17530
17531        /// Streams each item in the collection.
17532        pub fn by_item(
17533            self,
17534        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17535            google_cloud_longrunning::model::ListOperationsResponse,
17536            crate::Error,
17537        > {
17538            use google_cloud_gax::paginator::Paginator;
17539            self.by_page().items()
17540        }
17541
17542        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
17543        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17544            self.0.request.name = v.into();
17545            self
17546        }
17547
17548        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
17549        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17550            self.0.request.filter = v.into();
17551            self
17552        }
17553
17554        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
17555        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17556            self.0.request.page_size = v.into();
17557            self
17558        }
17559
17560        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
17561        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17562            self.0.request.page_token = v.into();
17563            self
17564        }
17565
17566        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
17567        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17568            self.0.request.return_partial_success = v.into();
17569            self
17570        }
17571    }
17572
17573    #[doc(hidden)]
17574    impl crate::RequestBuilder for ListOperations {
17575        fn request_options(&mut self) -> &mut crate::RequestOptions {
17576            &mut self.0.options
17577        }
17578    }
17579
17580    /// The request builder for [KnowledgeBases::get_operation][crate::client::KnowledgeBases::get_operation] calls.
17581    ///
17582    /// # Example
17583    /// ```
17584    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetOperation;
17585    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17586    ///
17587    /// let builder = prepare_request_builder();
17588    /// let response = builder.send().await?;
17589    /// # Ok(()) }
17590    ///
17591    /// fn prepare_request_builder() -> GetOperation {
17592    ///   # panic!();
17593    ///   // ... details omitted ...
17594    /// }
17595    /// ```
17596    #[derive(Clone, Debug)]
17597    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17598
17599    impl GetOperation {
17600        pub(crate) fn new(
17601            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17602        ) -> Self {
17603            Self(RequestBuilder::new(stub))
17604        }
17605
17606        /// Sets the full request, replacing any prior values.
17607        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17608            mut self,
17609            v: V,
17610        ) -> Self {
17611            self.0.request = v.into();
17612            self
17613        }
17614
17615        /// Sets all the options, replacing any prior values.
17616        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17617            self.0.options = v.into();
17618            self
17619        }
17620
17621        /// Sends the request.
17622        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17623            (*self.0.stub)
17624                .get_operation(self.0.request, self.0.options)
17625                .await
17626                .map(crate::Response::into_body)
17627        }
17628
17629        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
17630        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17631            self.0.request.name = v.into();
17632            self
17633        }
17634    }
17635
17636    #[doc(hidden)]
17637    impl crate::RequestBuilder for GetOperation {
17638        fn request_options(&mut self) -> &mut crate::RequestOptions {
17639            &mut self.0.options
17640        }
17641    }
17642
17643    /// The request builder for [KnowledgeBases::cancel_operation][crate::client::KnowledgeBases::cancel_operation] calls.
17644    ///
17645    /// # Example
17646    /// ```
17647    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::CancelOperation;
17648    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17649    ///
17650    /// let builder = prepare_request_builder();
17651    /// let response = builder.send().await?;
17652    /// # Ok(()) }
17653    ///
17654    /// fn prepare_request_builder() -> CancelOperation {
17655    ///   # panic!();
17656    ///   // ... details omitted ...
17657    /// }
17658    /// ```
17659    #[derive(Clone, Debug)]
17660    pub struct CancelOperation(
17661        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17662    );
17663
17664    impl CancelOperation {
17665        pub(crate) fn new(
17666            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17667        ) -> Self {
17668            Self(RequestBuilder::new(stub))
17669        }
17670
17671        /// Sets the full request, replacing any prior values.
17672        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17673            mut self,
17674            v: V,
17675        ) -> Self {
17676            self.0.request = v.into();
17677            self
17678        }
17679
17680        /// Sets all the options, replacing any prior values.
17681        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17682            self.0.options = v.into();
17683            self
17684        }
17685
17686        /// Sends the request.
17687        pub async fn send(self) -> Result<()> {
17688            (*self.0.stub)
17689                .cancel_operation(self.0.request, self.0.options)
17690                .await
17691                .map(crate::Response::into_body)
17692        }
17693
17694        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
17695        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17696            self.0.request.name = v.into();
17697            self
17698        }
17699    }
17700
17701    #[doc(hidden)]
17702    impl crate::RequestBuilder for CancelOperation {
17703        fn request_options(&mut self) -> &mut crate::RequestOptions {
17704            &mut self.0.options
17705        }
17706    }
17707}
17708
17709/// Request and client builders for [Participants][crate::client::Participants].
17710#[cfg(feature = "participants")]
17711#[cfg_attr(docsrs, doc(cfg(feature = "participants")))]
17712pub mod participants {
17713    use crate::Result;
17714
17715    /// A builder for [Participants][crate::client::Participants].
17716    ///
17717    /// ```
17718    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17719    /// # use google_cloud_dialogflow_v2::*;
17720    /// # use builder::participants::ClientBuilder;
17721    /// # use client::Participants;
17722    /// let builder : ClientBuilder = Participants::builder();
17723    /// let client = builder
17724    ///     .with_endpoint("https://dialogflow.googleapis.com")
17725    ///     .build().await?;
17726    /// # Ok(()) }
17727    /// ```
17728    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17729
17730    pub(crate) mod client {
17731        use super::super::super::client::Participants;
17732        pub struct Factory;
17733        impl crate::ClientFactory for Factory {
17734            type Client = Participants;
17735            type Credentials = gaxi::options::Credentials;
17736            async fn build(
17737                self,
17738                config: gaxi::options::ClientConfig,
17739            ) -> crate::ClientBuilderResult<Self::Client> {
17740                Self::Client::new(config).await
17741            }
17742        }
17743    }
17744
17745    /// Common implementation for [crate::client::Participants] request builders.
17746    #[derive(Clone, Debug)]
17747    pub(crate) struct RequestBuilder<R: std::default::Default> {
17748        stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17749        request: R,
17750        options: crate::RequestOptions,
17751    }
17752
17753    impl<R> RequestBuilder<R>
17754    where
17755        R: std::default::Default,
17756    {
17757        pub(crate) fn new(
17758            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17759        ) -> Self {
17760            Self {
17761                stub,
17762                request: R::default(),
17763                options: crate::RequestOptions::default(),
17764            }
17765        }
17766    }
17767
17768    /// The request builder for [Participants::create_participant][crate::client::Participants::create_participant] calls.
17769    ///
17770    /// # Example
17771    /// ```
17772    /// # use google_cloud_dialogflow_v2::builder::participants::CreateParticipant;
17773    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17774    ///
17775    /// let builder = prepare_request_builder();
17776    /// let response = builder.send().await?;
17777    /// # Ok(()) }
17778    ///
17779    /// fn prepare_request_builder() -> CreateParticipant {
17780    ///   # panic!();
17781    ///   // ... details omitted ...
17782    /// }
17783    /// ```
17784    #[derive(Clone, Debug)]
17785    pub struct CreateParticipant(RequestBuilder<crate::model::CreateParticipantRequest>);
17786
17787    impl CreateParticipant {
17788        pub(crate) fn new(
17789            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17790        ) -> Self {
17791            Self(RequestBuilder::new(stub))
17792        }
17793
17794        /// Sets the full request, replacing any prior values.
17795        pub fn with_request<V: Into<crate::model::CreateParticipantRequest>>(
17796            mut self,
17797            v: V,
17798        ) -> Self {
17799            self.0.request = v.into();
17800            self
17801        }
17802
17803        /// Sets all the options, replacing any prior values.
17804        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17805            self.0.options = v.into();
17806            self
17807        }
17808
17809        /// Sends the request.
17810        pub async fn send(self) -> Result<crate::model::Participant> {
17811            (*self.0.stub)
17812                .create_participant(self.0.request, self.0.options)
17813                .await
17814                .map(crate::Response::into_body)
17815        }
17816
17817        /// Sets the value of [parent][crate::model::CreateParticipantRequest::parent].
17818        ///
17819        /// This is a **required** field for requests.
17820        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17821            self.0.request.parent = v.into();
17822            self
17823        }
17824
17825        /// Sets the value of [participant][crate::model::CreateParticipantRequest::participant].
17826        ///
17827        /// This is a **required** field for requests.
17828        pub fn set_participant<T>(mut self, v: T) -> Self
17829        where
17830            T: std::convert::Into<crate::model::Participant>,
17831        {
17832            self.0.request.participant = std::option::Option::Some(v.into());
17833            self
17834        }
17835
17836        /// Sets or clears the value of [participant][crate::model::CreateParticipantRequest::participant].
17837        ///
17838        /// This is a **required** field for requests.
17839        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
17840        where
17841            T: std::convert::Into<crate::model::Participant>,
17842        {
17843            self.0.request.participant = v.map(|x| x.into());
17844            self
17845        }
17846    }
17847
17848    #[doc(hidden)]
17849    impl crate::RequestBuilder for CreateParticipant {
17850        fn request_options(&mut self) -> &mut crate::RequestOptions {
17851            &mut self.0.options
17852        }
17853    }
17854
17855    /// The request builder for [Participants::get_participant][crate::client::Participants::get_participant] calls.
17856    ///
17857    /// # Example
17858    /// ```
17859    /// # use google_cloud_dialogflow_v2::builder::participants::GetParticipant;
17860    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17861    ///
17862    /// let builder = prepare_request_builder();
17863    /// let response = builder.send().await?;
17864    /// # Ok(()) }
17865    ///
17866    /// fn prepare_request_builder() -> GetParticipant {
17867    ///   # panic!();
17868    ///   // ... details omitted ...
17869    /// }
17870    /// ```
17871    #[derive(Clone, Debug)]
17872    pub struct GetParticipant(RequestBuilder<crate::model::GetParticipantRequest>);
17873
17874    impl GetParticipant {
17875        pub(crate) fn new(
17876            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17877        ) -> Self {
17878            Self(RequestBuilder::new(stub))
17879        }
17880
17881        /// Sets the full request, replacing any prior values.
17882        pub fn with_request<V: Into<crate::model::GetParticipantRequest>>(mut self, v: V) -> Self {
17883            self.0.request = v.into();
17884            self
17885        }
17886
17887        /// Sets all the options, replacing any prior values.
17888        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17889            self.0.options = v.into();
17890            self
17891        }
17892
17893        /// Sends the request.
17894        pub async fn send(self) -> Result<crate::model::Participant> {
17895            (*self.0.stub)
17896                .get_participant(self.0.request, self.0.options)
17897                .await
17898                .map(crate::Response::into_body)
17899        }
17900
17901        /// Sets the value of [name][crate::model::GetParticipantRequest::name].
17902        ///
17903        /// This is a **required** field for requests.
17904        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17905            self.0.request.name = v.into();
17906            self
17907        }
17908    }
17909
17910    #[doc(hidden)]
17911    impl crate::RequestBuilder for GetParticipant {
17912        fn request_options(&mut self) -> &mut crate::RequestOptions {
17913            &mut self.0.options
17914        }
17915    }
17916
17917    /// The request builder for [Participants::list_participants][crate::client::Participants::list_participants] calls.
17918    ///
17919    /// # Example
17920    /// ```
17921    /// # use google_cloud_dialogflow_v2::builder::participants::ListParticipants;
17922    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17923    /// use google_cloud_gax::paginator::ItemPaginator;
17924    ///
17925    /// let builder = prepare_request_builder();
17926    /// let mut items = builder.by_item();
17927    /// while let Some(result) = items.next().await {
17928    ///   let item = result?;
17929    /// }
17930    /// # Ok(()) }
17931    ///
17932    /// fn prepare_request_builder() -> ListParticipants {
17933    ///   # panic!();
17934    ///   // ... details omitted ...
17935    /// }
17936    /// ```
17937    #[derive(Clone, Debug)]
17938    pub struct ListParticipants(RequestBuilder<crate::model::ListParticipantsRequest>);
17939
17940    impl ListParticipants {
17941        pub(crate) fn new(
17942            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17943        ) -> Self {
17944            Self(RequestBuilder::new(stub))
17945        }
17946
17947        /// Sets the full request, replacing any prior values.
17948        pub fn with_request<V: Into<crate::model::ListParticipantsRequest>>(
17949            mut self,
17950            v: V,
17951        ) -> Self {
17952            self.0.request = v.into();
17953            self
17954        }
17955
17956        /// Sets all the options, replacing any prior values.
17957        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17958            self.0.options = v.into();
17959            self
17960        }
17961
17962        /// Sends the request.
17963        pub async fn send(self) -> Result<crate::model::ListParticipantsResponse> {
17964            (*self.0.stub)
17965                .list_participants(self.0.request, self.0.options)
17966                .await
17967                .map(crate::Response::into_body)
17968        }
17969
17970        /// Streams each page in the collection.
17971        pub fn by_page(
17972            self,
17973        ) -> impl google_cloud_gax::paginator::Paginator<
17974            crate::model::ListParticipantsResponse,
17975            crate::Error,
17976        > {
17977            use std::clone::Clone;
17978            let token = self.0.request.page_token.clone();
17979            let execute = move |token: String| {
17980                let mut builder = self.clone();
17981                builder.0.request = builder.0.request.set_page_token(token);
17982                builder.send()
17983            };
17984            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17985        }
17986
17987        /// Streams each item in the collection.
17988        pub fn by_item(
17989            self,
17990        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17991            crate::model::ListParticipantsResponse,
17992            crate::Error,
17993        > {
17994            use google_cloud_gax::paginator::Paginator;
17995            self.by_page().items()
17996        }
17997
17998        /// Sets the value of [parent][crate::model::ListParticipantsRequest::parent].
17999        ///
18000        /// This is a **required** field for requests.
18001        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18002            self.0.request.parent = v.into();
18003            self
18004        }
18005
18006        /// Sets the value of [page_size][crate::model::ListParticipantsRequest::page_size].
18007        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18008            self.0.request.page_size = v.into();
18009            self
18010        }
18011
18012        /// Sets the value of [page_token][crate::model::ListParticipantsRequest::page_token].
18013        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18014            self.0.request.page_token = v.into();
18015            self
18016        }
18017    }
18018
18019    #[doc(hidden)]
18020    impl crate::RequestBuilder for ListParticipants {
18021        fn request_options(&mut self) -> &mut crate::RequestOptions {
18022            &mut self.0.options
18023        }
18024    }
18025
18026    /// The request builder for [Participants::update_participant][crate::client::Participants::update_participant] calls.
18027    ///
18028    /// # Example
18029    /// ```
18030    /// # use google_cloud_dialogflow_v2::builder::participants::UpdateParticipant;
18031    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18032    ///
18033    /// let builder = prepare_request_builder();
18034    /// let response = builder.send().await?;
18035    /// # Ok(()) }
18036    ///
18037    /// fn prepare_request_builder() -> UpdateParticipant {
18038    ///   # panic!();
18039    ///   // ... details omitted ...
18040    /// }
18041    /// ```
18042    #[derive(Clone, Debug)]
18043    pub struct UpdateParticipant(RequestBuilder<crate::model::UpdateParticipantRequest>);
18044
18045    impl UpdateParticipant {
18046        pub(crate) fn new(
18047            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18048        ) -> Self {
18049            Self(RequestBuilder::new(stub))
18050        }
18051
18052        /// Sets the full request, replacing any prior values.
18053        pub fn with_request<V: Into<crate::model::UpdateParticipantRequest>>(
18054            mut self,
18055            v: V,
18056        ) -> Self {
18057            self.0.request = v.into();
18058            self
18059        }
18060
18061        /// Sets all the options, replacing any prior values.
18062        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18063            self.0.options = v.into();
18064            self
18065        }
18066
18067        /// Sends the request.
18068        pub async fn send(self) -> Result<crate::model::Participant> {
18069            (*self.0.stub)
18070                .update_participant(self.0.request, self.0.options)
18071                .await
18072                .map(crate::Response::into_body)
18073        }
18074
18075        /// Sets the value of [participant][crate::model::UpdateParticipantRequest::participant].
18076        ///
18077        /// This is a **required** field for requests.
18078        pub fn set_participant<T>(mut self, v: T) -> Self
18079        where
18080            T: std::convert::Into<crate::model::Participant>,
18081        {
18082            self.0.request.participant = std::option::Option::Some(v.into());
18083            self
18084        }
18085
18086        /// Sets or clears the value of [participant][crate::model::UpdateParticipantRequest::participant].
18087        ///
18088        /// This is a **required** field for requests.
18089        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
18090        where
18091            T: std::convert::Into<crate::model::Participant>,
18092        {
18093            self.0.request.participant = v.map(|x| x.into());
18094            self
18095        }
18096
18097        /// Sets the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
18098        ///
18099        /// This is a **required** field for requests.
18100        pub fn set_update_mask<T>(mut self, v: T) -> Self
18101        where
18102            T: std::convert::Into<wkt::FieldMask>,
18103        {
18104            self.0.request.update_mask = std::option::Option::Some(v.into());
18105            self
18106        }
18107
18108        /// Sets or clears the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
18109        ///
18110        /// This is a **required** field for requests.
18111        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18112        where
18113            T: std::convert::Into<wkt::FieldMask>,
18114        {
18115            self.0.request.update_mask = v.map(|x| x.into());
18116            self
18117        }
18118    }
18119
18120    #[doc(hidden)]
18121    impl crate::RequestBuilder for UpdateParticipant {
18122        fn request_options(&mut self) -> &mut crate::RequestOptions {
18123            &mut self.0.options
18124        }
18125    }
18126
18127    /// The request builder for [Participants::analyze_content][crate::client::Participants::analyze_content] calls.
18128    ///
18129    /// # Example
18130    /// ```
18131    /// # use google_cloud_dialogflow_v2::builder::participants::AnalyzeContent;
18132    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18133    ///
18134    /// let builder = prepare_request_builder();
18135    /// let response = builder.send().await?;
18136    /// # Ok(()) }
18137    ///
18138    /// fn prepare_request_builder() -> AnalyzeContent {
18139    ///   # panic!();
18140    ///   // ... details omitted ...
18141    /// }
18142    /// ```
18143    #[derive(Clone, Debug)]
18144    pub struct AnalyzeContent(RequestBuilder<crate::model::AnalyzeContentRequest>);
18145
18146    impl AnalyzeContent {
18147        pub(crate) fn new(
18148            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18149        ) -> Self {
18150            Self(RequestBuilder::new(stub))
18151        }
18152
18153        /// Sets the full request, replacing any prior values.
18154        pub fn with_request<V: Into<crate::model::AnalyzeContentRequest>>(mut self, v: V) -> Self {
18155            self.0.request = v.into();
18156            self
18157        }
18158
18159        /// Sets all the options, replacing any prior values.
18160        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18161            self.0.options = v.into();
18162            self
18163        }
18164
18165        /// Sends the request.
18166        pub async fn send(self) -> Result<crate::model::AnalyzeContentResponse> {
18167            (*self.0.stub)
18168                .analyze_content(self.0.request, self.0.options)
18169                .await
18170                .map(crate::Response::into_body)
18171        }
18172
18173        /// Sets the value of [participant][crate::model::AnalyzeContentRequest::participant].
18174        ///
18175        /// This is a **required** field for requests.
18176        pub fn set_participant<T: Into<std::string::String>>(mut self, v: T) -> Self {
18177            self.0.request.participant = v.into();
18178            self
18179        }
18180
18181        /// Sets the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
18182        pub fn set_reply_audio_config<T>(mut self, v: T) -> Self
18183        where
18184            T: std::convert::Into<crate::model::OutputAudioConfig>,
18185        {
18186            self.0.request.reply_audio_config = std::option::Option::Some(v.into());
18187            self
18188        }
18189
18190        /// Sets or clears the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
18191        pub fn set_or_clear_reply_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
18192        where
18193            T: std::convert::Into<crate::model::OutputAudioConfig>,
18194        {
18195            self.0.request.reply_audio_config = v.map(|x| x.into());
18196            self
18197        }
18198
18199        /// Sets the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
18200        pub fn set_query_params<T>(mut self, v: T) -> Self
18201        where
18202            T: std::convert::Into<crate::model::QueryParameters>,
18203        {
18204            self.0.request.query_params = std::option::Option::Some(v.into());
18205            self
18206        }
18207
18208        /// Sets or clears the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
18209        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18210        where
18211            T: std::convert::Into<crate::model::QueryParameters>,
18212        {
18213            self.0.request.query_params = v.map(|x| x.into());
18214            self
18215        }
18216
18217        /// Sets the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
18218        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18219        where
18220            T: std::convert::Into<crate::model::AssistQueryParameters>,
18221        {
18222            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18223            self
18224        }
18225
18226        /// Sets or clears the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
18227        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18228        where
18229            T: std::convert::Into<crate::model::AssistQueryParameters>,
18230        {
18231            self.0.request.assist_query_params = v.map(|x| x.into());
18232            self
18233        }
18234
18235        /// Sets the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
18236        pub fn set_cx_parameters<T>(mut self, v: T) -> Self
18237        where
18238            T: std::convert::Into<wkt::Struct>,
18239        {
18240            self.0.request.cx_parameters = std::option::Option::Some(v.into());
18241            self
18242        }
18243
18244        /// Sets or clears the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
18245        pub fn set_or_clear_cx_parameters<T>(mut self, v: std::option::Option<T>) -> Self
18246        where
18247            T: std::convert::Into<wkt::Struct>,
18248        {
18249            self.0.request.cx_parameters = v.map(|x| x.into());
18250            self
18251        }
18252
18253        /// Sets the value of [request_id][crate::model::AnalyzeContentRequest::request_id].
18254        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18255            self.0.request.request_id = v.into();
18256            self
18257        }
18258
18259        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input].
18260        ///
18261        /// Note that all the setters affecting `input` are
18262        /// mutually exclusive.
18263        pub fn set_input<T: Into<Option<crate::model::analyze_content_request::Input>>>(
18264            mut self,
18265            v: T,
18266        ) -> Self {
18267            self.0.request.input = v.into();
18268            self
18269        }
18270
18271        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18272        /// to hold a `TextInput`.
18273        ///
18274        /// Note that all the setters affecting `input` are
18275        /// mutually exclusive.
18276        pub fn set_text_input<T: std::convert::Into<std::boxed::Box<crate::model::TextInput>>>(
18277            mut self,
18278            v: T,
18279        ) -> Self {
18280            self.0.request = self.0.request.set_text_input(v);
18281            self
18282        }
18283
18284        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18285        /// to hold a `AudioInput`.
18286        ///
18287        /// Note that all the setters affecting `input` are
18288        /// mutually exclusive.
18289        pub fn set_audio_input<T: std::convert::Into<std::boxed::Box<crate::model::AudioInput>>>(
18290            mut self,
18291            v: T,
18292        ) -> Self {
18293            self.0.request = self.0.request.set_audio_input(v);
18294            self
18295        }
18296
18297        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18298        /// to hold a `EventInput`.
18299        ///
18300        /// Note that all the setters affecting `input` are
18301        /// mutually exclusive.
18302        pub fn set_event_input<T: std::convert::Into<std::boxed::Box<crate::model::EventInput>>>(
18303            mut self,
18304            v: T,
18305        ) -> Self {
18306            self.0.request = self.0.request.set_event_input(v);
18307            self
18308        }
18309
18310        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18311        /// to hold a `SuggestionInput`.
18312        ///
18313        /// Note that all the setters affecting `input` are
18314        /// mutually exclusive.
18315        pub fn set_suggestion_input<
18316            T: std::convert::Into<std::boxed::Box<crate::model::SuggestionInput>>,
18317        >(
18318            mut self,
18319            v: T,
18320        ) -> Self {
18321            self.0.request = self.0.request.set_suggestion_input(v);
18322            self
18323        }
18324    }
18325
18326    #[doc(hidden)]
18327    impl crate::RequestBuilder for AnalyzeContent {
18328        fn request_options(&mut self) -> &mut crate::RequestOptions {
18329            &mut self.0.options
18330        }
18331    }
18332
18333    /// The request builder for [Participants::suggest_articles][crate::client::Participants::suggest_articles] calls.
18334    ///
18335    /// # Example
18336    /// ```
18337    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestArticles;
18338    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18339    ///
18340    /// let builder = prepare_request_builder();
18341    /// let response = builder.send().await?;
18342    /// # Ok(()) }
18343    ///
18344    /// fn prepare_request_builder() -> SuggestArticles {
18345    ///   # panic!();
18346    ///   // ... details omitted ...
18347    /// }
18348    /// ```
18349    #[derive(Clone, Debug)]
18350    pub struct SuggestArticles(RequestBuilder<crate::model::SuggestArticlesRequest>);
18351
18352    impl SuggestArticles {
18353        pub(crate) fn new(
18354            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18355        ) -> Self {
18356            Self(RequestBuilder::new(stub))
18357        }
18358
18359        /// Sets the full request, replacing any prior values.
18360        pub fn with_request<V: Into<crate::model::SuggestArticlesRequest>>(mut self, v: V) -> Self {
18361            self.0.request = v.into();
18362            self
18363        }
18364
18365        /// Sets all the options, replacing any prior values.
18366        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18367            self.0.options = v.into();
18368            self
18369        }
18370
18371        /// Sends the request.
18372        pub async fn send(self) -> Result<crate::model::SuggestArticlesResponse> {
18373            (*self.0.stub)
18374                .suggest_articles(self.0.request, self.0.options)
18375                .await
18376                .map(crate::Response::into_body)
18377        }
18378
18379        /// Sets the value of [parent][crate::model::SuggestArticlesRequest::parent].
18380        ///
18381        /// This is a **required** field for requests.
18382        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18383            self.0.request.parent = v.into();
18384            self
18385        }
18386
18387        /// Sets the value of [latest_message][crate::model::SuggestArticlesRequest::latest_message].
18388        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18389            self.0.request.latest_message = v.into();
18390            self
18391        }
18392
18393        /// Sets the value of [context_size][crate::model::SuggestArticlesRequest::context_size].
18394        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18395            self.0.request.context_size = v.into();
18396            self
18397        }
18398
18399        /// Sets the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
18400        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18401        where
18402            T: std::convert::Into<crate::model::AssistQueryParameters>,
18403        {
18404            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18405            self
18406        }
18407
18408        /// Sets or clears the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
18409        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18410        where
18411            T: std::convert::Into<crate::model::AssistQueryParameters>,
18412        {
18413            self.0.request.assist_query_params = v.map(|x| x.into());
18414            self
18415        }
18416    }
18417
18418    #[doc(hidden)]
18419    impl crate::RequestBuilder for SuggestArticles {
18420        fn request_options(&mut self) -> &mut crate::RequestOptions {
18421            &mut self.0.options
18422        }
18423    }
18424
18425    /// The request builder for [Participants::suggest_faq_answers][crate::client::Participants::suggest_faq_answers] calls.
18426    ///
18427    /// # Example
18428    /// ```
18429    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestFaqAnswers;
18430    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18431    ///
18432    /// let builder = prepare_request_builder();
18433    /// let response = builder.send().await?;
18434    /// # Ok(()) }
18435    ///
18436    /// fn prepare_request_builder() -> SuggestFaqAnswers {
18437    ///   # panic!();
18438    ///   // ... details omitted ...
18439    /// }
18440    /// ```
18441    #[derive(Clone, Debug)]
18442    pub struct SuggestFaqAnswers(RequestBuilder<crate::model::SuggestFaqAnswersRequest>);
18443
18444    impl SuggestFaqAnswers {
18445        pub(crate) fn new(
18446            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18447        ) -> Self {
18448            Self(RequestBuilder::new(stub))
18449        }
18450
18451        /// Sets the full request, replacing any prior values.
18452        pub fn with_request<V: Into<crate::model::SuggestFaqAnswersRequest>>(
18453            mut self,
18454            v: V,
18455        ) -> Self {
18456            self.0.request = v.into();
18457            self
18458        }
18459
18460        /// Sets all the options, replacing any prior values.
18461        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18462            self.0.options = v.into();
18463            self
18464        }
18465
18466        /// Sends the request.
18467        pub async fn send(self) -> Result<crate::model::SuggestFaqAnswersResponse> {
18468            (*self.0.stub)
18469                .suggest_faq_answers(self.0.request, self.0.options)
18470                .await
18471                .map(crate::Response::into_body)
18472        }
18473
18474        /// Sets the value of [parent][crate::model::SuggestFaqAnswersRequest::parent].
18475        ///
18476        /// This is a **required** field for requests.
18477        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18478            self.0.request.parent = v.into();
18479            self
18480        }
18481
18482        /// Sets the value of [latest_message][crate::model::SuggestFaqAnswersRequest::latest_message].
18483        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18484            self.0.request.latest_message = v.into();
18485            self
18486        }
18487
18488        /// Sets the value of [context_size][crate::model::SuggestFaqAnswersRequest::context_size].
18489        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18490            self.0.request.context_size = v.into();
18491            self
18492        }
18493
18494        /// Sets the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
18495        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18496        where
18497            T: std::convert::Into<crate::model::AssistQueryParameters>,
18498        {
18499            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18500            self
18501        }
18502
18503        /// Sets or clears the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
18504        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18505        where
18506            T: std::convert::Into<crate::model::AssistQueryParameters>,
18507        {
18508            self.0.request.assist_query_params = v.map(|x| x.into());
18509            self
18510        }
18511    }
18512
18513    #[doc(hidden)]
18514    impl crate::RequestBuilder for SuggestFaqAnswers {
18515        fn request_options(&mut self) -> &mut crate::RequestOptions {
18516            &mut self.0.options
18517        }
18518    }
18519
18520    /// The request builder for [Participants::suggest_smart_replies][crate::client::Participants::suggest_smart_replies] calls.
18521    ///
18522    /// # Example
18523    /// ```
18524    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestSmartReplies;
18525    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18526    ///
18527    /// let builder = prepare_request_builder();
18528    /// let response = builder.send().await?;
18529    /// # Ok(()) }
18530    ///
18531    /// fn prepare_request_builder() -> SuggestSmartReplies {
18532    ///   # panic!();
18533    ///   // ... details omitted ...
18534    /// }
18535    /// ```
18536    #[derive(Clone, Debug)]
18537    pub struct SuggestSmartReplies(RequestBuilder<crate::model::SuggestSmartRepliesRequest>);
18538
18539    impl SuggestSmartReplies {
18540        pub(crate) fn new(
18541            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18542        ) -> Self {
18543            Self(RequestBuilder::new(stub))
18544        }
18545
18546        /// Sets the full request, replacing any prior values.
18547        pub fn with_request<V: Into<crate::model::SuggestSmartRepliesRequest>>(
18548            mut self,
18549            v: V,
18550        ) -> Self {
18551            self.0.request = v.into();
18552            self
18553        }
18554
18555        /// Sets all the options, replacing any prior values.
18556        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18557            self.0.options = v.into();
18558            self
18559        }
18560
18561        /// Sends the request.
18562        pub async fn send(self) -> Result<crate::model::SuggestSmartRepliesResponse> {
18563            (*self.0.stub)
18564                .suggest_smart_replies(self.0.request, self.0.options)
18565                .await
18566                .map(crate::Response::into_body)
18567        }
18568
18569        /// Sets the value of [parent][crate::model::SuggestSmartRepliesRequest::parent].
18570        ///
18571        /// This is a **required** field for requests.
18572        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18573            self.0.request.parent = v.into();
18574            self
18575        }
18576
18577        /// Sets the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
18578        pub fn set_current_text_input<T>(mut self, v: T) -> Self
18579        where
18580            T: std::convert::Into<crate::model::TextInput>,
18581        {
18582            self.0.request.current_text_input = std::option::Option::Some(v.into());
18583            self
18584        }
18585
18586        /// Sets or clears the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
18587        pub fn set_or_clear_current_text_input<T>(mut self, v: std::option::Option<T>) -> Self
18588        where
18589            T: std::convert::Into<crate::model::TextInput>,
18590        {
18591            self.0.request.current_text_input = v.map(|x| x.into());
18592            self
18593        }
18594
18595        /// Sets the value of [latest_message][crate::model::SuggestSmartRepliesRequest::latest_message].
18596        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18597            self.0.request.latest_message = v.into();
18598            self
18599        }
18600
18601        /// Sets the value of [context_size][crate::model::SuggestSmartRepliesRequest::context_size].
18602        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18603            self.0.request.context_size = v.into();
18604            self
18605        }
18606    }
18607
18608    #[doc(hidden)]
18609    impl crate::RequestBuilder for SuggestSmartReplies {
18610        fn request_options(&mut self) -> &mut crate::RequestOptions {
18611            &mut self.0.options
18612        }
18613    }
18614
18615    /// The request builder for [Participants::suggest_knowledge_assist][crate::client::Participants::suggest_knowledge_assist] calls.
18616    ///
18617    /// # Example
18618    /// ```
18619    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestKnowledgeAssist;
18620    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18621    ///
18622    /// let builder = prepare_request_builder();
18623    /// let response = builder.send().await?;
18624    /// # Ok(()) }
18625    ///
18626    /// fn prepare_request_builder() -> SuggestKnowledgeAssist {
18627    ///   # panic!();
18628    ///   // ... details omitted ...
18629    /// }
18630    /// ```
18631    #[derive(Clone, Debug)]
18632    pub struct SuggestKnowledgeAssist(RequestBuilder<crate::model::SuggestKnowledgeAssistRequest>);
18633
18634    impl SuggestKnowledgeAssist {
18635        pub(crate) fn new(
18636            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18637        ) -> Self {
18638            Self(RequestBuilder::new(stub))
18639        }
18640
18641        /// Sets the full request, replacing any prior values.
18642        pub fn with_request<V: Into<crate::model::SuggestKnowledgeAssistRequest>>(
18643            mut self,
18644            v: V,
18645        ) -> Self {
18646            self.0.request = v.into();
18647            self
18648        }
18649
18650        /// Sets all the options, replacing any prior values.
18651        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18652            self.0.options = v.into();
18653            self
18654        }
18655
18656        /// Sends the request.
18657        pub async fn send(self) -> Result<crate::model::SuggestKnowledgeAssistResponse> {
18658            (*self.0.stub)
18659                .suggest_knowledge_assist(self.0.request, self.0.options)
18660                .await
18661                .map(crate::Response::into_body)
18662        }
18663
18664        /// Sets the value of [parent][crate::model::SuggestKnowledgeAssistRequest::parent].
18665        ///
18666        /// This is a **required** field for requests.
18667        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18668            self.0.request.parent = v.into();
18669            self
18670        }
18671
18672        /// Sets the value of [latest_message][crate::model::SuggestKnowledgeAssistRequest::latest_message].
18673        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18674            self.0.request.latest_message = v.into();
18675            self
18676        }
18677
18678        /// Sets the value of [context_size][crate::model::SuggestKnowledgeAssistRequest::context_size].
18679        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18680            self.0.request.context_size = v.into();
18681            self
18682        }
18683
18684        /// Sets the value of [previous_suggested_query][crate::model::SuggestKnowledgeAssistRequest::previous_suggested_query].
18685        pub fn set_previous_suggested_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
18686            self.0.request.previous_suggested_query = v.into();
18687            self
18688        }
18689    }
18690
18691    #[doc(hidden)]
18692    impl crate::RequestBuilder for SuggestKnowledgeAssist {
18693        fn request_options(&mut self) -> &mut crate::RequestOptions {
18694            &mut self.0.options
18695        }
18696    }
18697
18698    /// The request builder for [Participants::list_locations][crate::client::Participants::list_locations] calls.
18699    ///
18700    /// # Example
18701    /// ```
18702    /// # use google_cloud_dialogflow_v2::builder::participants::ListLocations;
18703    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18704    /// use google_cloud_gax::paginator::ItemPaginator;
18705    ///
18706    /// let builder = prepare_request_builder();
18707    /// let mut items = builder.by_item();
18708    /// while let Some(result) = items.next().await {
18709    ///   let item = result?;
18710    /// }
18711    /// # Ok(()) }
18712    ///
18713    /// fn prepare_request_builder() -> ListLocations {
18714    ///   # panic!();
18715    ///   // ... details omitted ...
18716    /// }
18717    /// ```
18718    #[derive(Clone, Debug)]
18719    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18720
18721    impl ListLocations {
18722        pub(crate) fn new(
18723            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18724        ) -> Self {
18725            Self(RequestBuilder::new(stub))
18726        }
18727
18728        /// Sets the full request, replacing any prior values.
18729        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18730            mut self,
18731            v: V,
18732        ) -> Self {
18733            self.0.request = v.into();
18734            self
18735        }
18736
18737        /// Sets all the options, replacing any prior values.
18738        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18739            self.0.options = v.into();
18740            self
18741        }
18742
18743        /// Sends the request.
18744        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
18745            (*self.0.stub)
18746                .list_locations(self.0.request, self.0.options)
18747                .await
18748                .map(crate::Response::into_body)
18749        }
18750
18751        /// Streams each page in the collection.
18752        pub fn by_page(
18753            self,
18754        ) -> impl google_cloud_gax::paginator::Paginator<
18755            google_cloud_location::model::ListLocationsResponse,
18756            crate::Error,
18757        > {
18758            use std::clone::Clone;
18759            let token = self.0.request.page_token.clone();
18760            let execute = move |token: String| {
18761                let mut builder = self.clone();
18762                builder.0.request = builder.0.request.set_page_token(token);
18763                builder.send()
18764            };
18765            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18766        }
18767
18768        /// Streams each item in the collection.
18769        pub fn by_item(
18770            self,
18771        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18772            google_cloud_location::model::ListLocationsResponse,
18773            crate::Error,
18774        > {
18775            use google_cloud_gax::paginator::Paginator;
18776            self.by_page().items()
18777        }
18778
18779        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
18780        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18781            self.0.request.name = v.into();
18782            self
18783        }
18784
18785        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
18786        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18787            self.0.request.filter = v.into();
18788            self
18789        }
18790
18791        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
18792        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18793            self.0.request.page_size = v.into();
18794            self
18795        }
18796
18797        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
18798        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18799            self.0.request.page_token = v.into();
18800            self
18801        }
18802    }
18803
18804    #[doc(hidden)]
18805    impl crate::RequestBuilder for ListLocations {
18806        fn request_options(&mut self) -> &mut crate::RequestOptions {
18807            &mut self.0.options
18808        }
18809    }
18810
18811    /// The request builder for [Participants::get_location][crate::client::Participants::get_location] calls.
18812    ///
18813    /// # Example
18814    /// ```
18815    /// # use google_cloud_dialogflow_v2::builder::participants::GetLocation;
18816    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18817    ///
18818    /// let builder = prepare_request_builder();
18819    /// let response = builder.send().await?;
18820    /// # Ok(()) }
18821    ///
18822    /// fn prepare_request_builder() -> GetLocation {
18823    ///   # panic!();
18824    ///   // ... details omitted ...
18825    /// }
18826    /// ```
18827    #[derive(Clone, Debug)]
18828    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
18829
18830    impl GetLocation {
18831        pub(crate) fn new(
18832            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18833        ) -> Self {
18834            Self(RequestBuilder::new(stub))
18835        }
18836
18837        /// Sets the full request, replacing any prior values.
18838        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
18839            mut self,
18840            v: V,
18841        ) -> Self {
18842            self.0.request = v.into();
18843            self
18844        }
18845
18846        /// Sets all the options, replacing any prior values.
18847        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18848            self.0.options = v.into();
18849            self
18850        }
18851
18852        /// Sends the request.
18853        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
18854            (*self.0.stub)
18855                .get_location(self.0.request, self.0.options)
18856                .await
18857                .map(crate::Response::into_body)
18858        }
18859
18860        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
18861        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18862            self.0.request.name = v.into();
18863            self
18864        }
18865    }
18866
18867    #[doc(hidden)]
18868    impl crate::RequestBuilder for GetLocation {
18869        fn request_options(&mut self) -> &mut crate::RequestOptions {
18870            &mut self.0.options
18871        }
18872    }
18873
18874    /// The request builder for [Participants::list_operations][crate::client::Participants::list_operations] calls.
18875    ///
18876    /// # Example
18877    /// ```
18878    /// # use google_cloud_dialogflow_v2::builder::participants::ListOperations;
18879    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18880    /// use google_cloud_gax::paginator::ItemPaginator;
18881    ///
18882    /// let builder = prepare_request_builder();
18883    /// let mut items = builder.by_item();
18884    /// while let Some(result) = items.next().await {
18885    ///   let item = result?;
18886    /// }
18887    /// # Ok(()) }
18888    ///
18889    /// fn prepare_request_builder() -> ListOperations {
18890    ///   # panic!();
18891    ///   // ... details omitted ...
18892    /// }
18893    /// ```
18894    #[derive(Clone, Debug)]
18895    pub struct ListOperations(
18896        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
18897    );
18898
18899    impl ListOperations {
18900        pub(crate) fn new(
18901            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18902        ) -> Self {
18903            Self(RequestBuilder::new(stub))
18904        }
18905
18906        /// Sets the full request, replacing any prior values.
18907        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
18908            mut self,
18909            v: V,
18910        ) -> Self {
18911            self.0.request = v.into();
18912            self
18913        }
18914
18915        /// Sets all the options, replacing any prior values.
18916        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18917            self.0.options = v.into();
18918            self
18919        }
18920
18921        /// Sends the request.
18922        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
18923            (*self.0.stub)
18924                .list_operations(self.0.request, self.0.options)
18925                .await
18926                .map(crate::Response::into_body)
18927        }
18928
18929        /// Streams each page in the collection.
18930        pub fn by_page(
18931            self,
18932        ) -> impl google_cloud_gax::paginator::Paginator<
18933            google_cloud_longrunning::model::ListOperationsResponse,
18934            crate::Error,
18935        > {
18936            use std::clone::Clone;
18937            let token = self.0.request.page_token.clone();
18938            let execute = move |token: String| {
18939                let mut builder = self.clone();
18940                builder.0.request = builder.0.request.set_page_token(token);
18941                builder.send()
18942            };
18943            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18944        }
18945
18946        /// Streams each item in the collection.
18947        pub fn by_item(
18948            self,
18949        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18950            google_cloud_longrunning::model::ListOperationsResponse,
18951            crate::Error,
18952        > {
18953            use google_cloud_gax::paginator::Paginator;
18954            self.by_page().items()
18955        }
18956
18957        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
18958        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18959            self.0.request.name = v.into();
18960            self
18961        }
18962
18963        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
18964        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18965            self.0.request.filter = v.into();
18966            self
18967        }
18968
18969        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
18970        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18971            self.0.request.page_size = v.into();
18972            self
18973        }
18974
18975        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
18976        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18977            self.0.request.page_token = v.into();
18978            self
18979        }
18980
18981        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
18982        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
18983            self.0.request.return_partial_success = v.into();
18984            self
18985        }
18986    }
18987
18988    #[doc(hidden)]
18989    impl crate::RequestBuilder for ListOperations {
18990        fn request_options(&mut self) -> &mut crate::RequestOptions {
18991            &mut self.0.options
18992        }
18993    }
18994
18995    /// The request builder for [Participants::get_operation][crate::client::Participants::get_operation] calls.
18996    ///
18997    /// # Example
18998    /// ```
18999    /// # use google_cloud_dialogflow_v2::builder::participants::GetOperation;
19000    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19001    ///
19002    /// let builder = prepare_request_builder();
19003    /// let response = builder.send().await?;
19004    /// # Ok(()) }
19005    ///
19006    /// fn prepare_request_builder() -> GetOperation {
19007    ///   # panic!();
19008    ///   // ... details omitted ...
19009    /// }
19010    /// ```
19011    #[derive(Clone, Debug)]
19012    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19013
19014    impl GetOperation {
19015        pub(crate) fn new(
19016            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19017        ) -> Self {
19018            Self(RequestBuilder::new(stub))
19019        }
19020
19021        /// Sets the full request, replacing any prior values.
19022        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19023            mut self,
19024            v: V,
19025        ) -> Self {
19026            self.0.request = v.into();
19027            self
19028        }
19029
19030        /// Sets all the options, replacing any prior values.
19031        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19032            self.0.options = v.into();
19033            self
19034        }
19035
19036        /// Sends the request.
19037        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19038            (*self.0.stub)
19039                .get_operation(self.0.request, self.0.options)
19040                .await
19041                .map(crate::Response::into_body)
19042        }
19043
19044        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19045        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19046            self.0.request.name = v.into();
19047            self
19048        }
19049    }
19050
19051    #[doc(hidden)]
19052    impl crate::RequestBuilder for GetOperation {
19053        fn request_options(&mut self) -> &mut crate::RequestOptions {
19054            &mut self.0.options
19055        }
19056    }
19057
19058    /// The request builder for [Participants::cancel_operation][crate::client::Participants::cancel_operation] calls.
19059    ///
19060    /// # Example
19061    /// ```
19062    /// # use google_cloud_dialogflow_v2::builder::participants::CancelOperation;
19063    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19064    ///
19065    /// let builder = prepare_request_builder();
19066    /// let response = builder.send().await?;
19067    /// # Ok(()) }
19068    ///
19069    /// fn prepare_request_builder() -> CancelOperation {
19070    ///   # panic!();
19071    ///   // ... details omitted ...
19072    /// }
19073    /// ```
19074    #[derive(Clone, Debug)]
19075    pub struct CancelOperation(
19076        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19077    );
19078
19079    impl CancelOperation {
19080        pub(crate) fn new(
19081            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19082        ) -> Self {
19083            Self(RequestBuilder::new(stub))
19084        }
19085
19086        /// Sets the full request, replacing any prior values.
19087        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19088            mut self,
19089            v: V,
19090        ) -> Self {
19091            self.0.request = v.into();
19092            self
19093        }
19094
19095        /// Sets all the options, replacing any prior values.
19096        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19097            self.0.options = v.into();
19098            self
19099        }
19100
19101        /// Sends the request.
19102        pub async fn send(self) -> Result<()> {
19103            (*self.0.stub)
19104                .cancel_operation(self.0.request, self.0.options)
19105                .await
19106                .map(crate::Response::into_body)
19107        }
19108
19109        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19110        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19111            self.0.request.name = v.into();
19112            self
19113        }
19114    }
19115
19116    #[doc(hidden)]
19117    impl crate::RequestBuilder for CancelOperation {
19118        fn request_options(&mut self) -> &mut crate::RequestOptions {
19119            &mut self.0.options
19120        }
19121    }
19122}
19123
19124/// Request and client builders for [Sessions][crate::client::Sessions].
19125#[cfg(feature = "sessions")]
19126#[cfg_attr(docsrs, doc(cfg(feature = "sessions")))]
19127pub mod sessions {
19128    use crate::Result;
19129
19130    /// A builder for [Sessions][crate::client::Sessions].
19131    ///
19132    /// ```
19133    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19134    /// # use google_cloud_dialogflow_v2::*;
19135    /// # use builder::sessions::ClientBuilder;
19136    /// # use client::Sessions;
19137    /// let builder : ClientBuilder = Sessions::builder();
19138    /// let client = builder
19139    ///     .with_endpoint("https://dialogflow.googleapis.com")
19140    ///     .build().await?;
19141    /// # Ok(()) }
19142    /// ```
19143    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19144
19145    pub(crate) mod client {
19146        use super::super::super::client::Sessions;
19147        pub struct Factory;
19148        impl crate::ClientFactory for Factory {
19149            type Client = Sessions;
19150            type Credentials = gaxi::options::Credentials;
19151            async fn build(
19152                self,
19153                config: gaxi::options::ClientConfig,
19154            ) -> crate::ClientBuilderResult<Self::Client> {
19155                Self::Client::new(config).await
19156            }
19157        }
19158    }
19159
19160    /// Common implementation for [crate::client::Sessions] request builders.
19161    #[derive(Clone, Debug)]
19162    pub(crate) struct RequestBuilder<R: std::default::Default> {
19163        stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>,
19164        request: R,
19165        options: crate::RequestOptions,
19166    }
19167
19168    impl<R> RequestBuilder<R>
19169    where
19170        R: std::default::Default,
19171    {
19172        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19173            Self {
19174                stub,
19175                request: R::default(),
19176                options: crate::RequestOptions::default(),
19177            }
19178        }
19179    }
19180
19181    /// The request builder for [Sessions::detect_intent][crate::client::Sessions::detect_intent] calls.
19182    ///
19183    /// # Example
19184    /// ```
19185    /// # use google_cloud_dialogflow_v2::builder::sessions::DetectIntent;
19186    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19187    ///
19188    /// let builder = prepare_request_builder();
19189    /// let response = builder.send().await?;
19190    /// # Ok(()) }
19191    ///
19192    /// fn prepare_request_builder() -> DetectIntent {
19193    ///   # panic!();
19194    ///   // ... details omitted ...
19195    /// }
19196    /// ```
19197    #[derive(Clone, Debug)]
19198    pub struct DetectIntent(RequestBuilder<crate::model::DetectIntentRequest>);
19199
19200    impl DetectIntent {
19201        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19202            Self(RequestBuilder::new(stub))
19203        }
19204
19205        /// Sets the full request, replacing any prior values.
19206        pub fn with_request<V: Into<crate::model::DetectIntentRequest>>(mut self, v: V) -> Self {
19207            self.0.request = v.into();
19208            self
19209        }
19210
19211        /// Sets all the options, replacing any prior values.
19212        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19213            self.0.options = v.into();
19214            self
19215        }
19216
19217        /// Sends the request.
19218        pub async fn send(self) -> Result<crate::model::DetectIntentResponse> {
19219            (*self.0.stub)
19220                .detect_intent(self.0.request, self.0.options)
19221                .await
19222                .map(crate::Response::into_body)
19223        }
19224
19225        /// Sets the value of [session][crate::model::DetectIntentRequest::session].
19226        ///
19227        /// This is a **required** field for requests.
19228        pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
19229            self.0.request.session = v.into();
19230            self
19231        }
19232
19233        /// Sets the value of [query_params][crate::model::DetectIntentRequest::query_params].
19234        pub fn set_query_params<T>(mut self, v: T) -> Self
19235        where
19236            T: std::convert::Into<crate::model::QueryParameters>,
19237        {
19238            self.0.request.query_params = std::option::Option::Some(v.into());
19239            self
19240        }
19241
19242        /// Sets or clears the value of [query_params][crate::model::DetectIntentRequest::query_params].
19243        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
19244        where
19245            T: std::convert::Into<crate::model::QueryParameters>,
19246        {
19247            self.0.request.query_params = v.map(|x| x.into());
19248            self
19249        }
19250
19251        /// Sets the value of [query_input][crate::model::DetectIntentRequest::query_input].
19252        ///
19253        /// This is a **required** field for requests.
19254        pub fn set_query_input<T>(mut self, v: T) -> Self
19255        where
19256            T: std::convert::Into<crate::model::QueryInput>,
19257        {
19258            self.0.request.query_input = std::option::Option::Some(v.into());
19259            self
19260        }
19261
19262        /// Sets or clears the value of [query_input][crate::model::DetectIntentRequest::query_input].
19263        ///
19264        /// This is a **required** field for requests.
19265        pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
19266        where
19267            T: std::convert::Into<crate::model::QueryInput>,
19268        {
19269            self.0.request.query_input = v.map(|x| x.into());
19270            self
19271        }
19272
19273        /// Sets the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
19274        pub fn set_output_audio_config<T>(mut self, v: T) -> Self
19275        where
19276            T: std::convert::Into<crate::model::OutputAudioConfig>,
19277        {
19278            self.0.request.output_audio_config = std::option::Option::Some(v.into());
19279            self
19280        }
19281
19282        /// Sets or clears the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
19283        pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
19284        where
19285            T: std::convert::Into<crate::model::OutputAudioConfig>,
19286        {
19287            self.0.request.output_audio_config = v.map(|x| x.into());
19288            self
19289        }
19290
19291        /// Sets the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
19292        pub fn set_output_audio_config_mask<T>(mut self, v: T) -> Self
19293        where
19294            T: std::convert::Into<wkt::FieldMask>,
19295        {
19296            self.0.request.output_audio_config_mask = std::option::Option::Some(v.into());
19297            self
19298        }
19299
19300        /// Sets or clears the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
19301        pub fn set_or_clear_output_audio_config_mask<T>(mut self, v: std::option::Option<T>) -> Self
19302        where
19303            T: std::convert::Into<wkt::FieldMask>,
19304        {
19305            self.0.request.output_audio_config_mask = v.map(|x| x.into());
19306            self
19307        }
19308
19309        /// Sets the value of [input_audio][crate::model::DetectIntentRequest::input_audio].
19310        pub fn set_input_audio<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
19311            self.0.request.input_audio = v.into();
19312            self
19313        }
19314    }
19315
19316    #[doc(hidden)]
19317    impl crate::RequestBuilder for DetectIntent {
19318        fn request_options(&mut self) -> &mut crate::RequestOptions {
19319            &mut self.0.options
19320        }
19321    }
19322
19323    /// The request builder for [Sessions::list_locations][crate::client::Sessions::list_locations] calls.
19324    ///
19325    /// # Example
19326    /// ```
19327    /// # use google_cloud_dialogflow_v2::builder::sessions::ListLocations;
19328    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19329    /// use google_cloud_gax::paginator::ItemPaginator;
19330    ///
19331    /// let builder = prepare_request_builder();
19332    /// let mut items = builder.by_item();
19333    /// while let Some(result) = items.next().await {
19334    ///   let item = result?;
19335    /// }
19336    /// # Ok(()) }
19337    ///
19338    /// fn prepare_request_builder() -> ListLocations {
19339    ///   # panic!();
19340    ///   // ... details omitted ...
19341    /// }
19342    /// ```
19343    #[derive(Clone, Debug)]
19344    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
19345
19346    impl ListLocations {
19347        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19348            Self(RequestBuilder::new(stub))
19349        }
19350
19351        /// Sets the full request, replacing any prior values.
19352        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19353            mut self,
19354            v: V,
19355        ) -> Self {
19356            self.0.request = v.into();
19357            self
19358        }
19359
19360        /// Sets all the options, replacing any prior values.
19361        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19362            self.0.options = v.into();
19363            self
19364        }
19365
19366        /// Sends the request.
19367        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19368            (*self.0.stub)
19369                .list_locations(self.0.request, self.0.options)
19370                .await
19371                .map(crate::Response::into_body)
19372        }
19373
19374        /// Streams each page in the collection.
19375        pub fn by_page(
19376            self,
19377        ) -> impl google_cloud_gax::paginator::Paginator<
19378            google_cloud_location::model::ListLocationsResponse,
19379            crate::Error,
19380        > {
19381            use std::clone::Clone;
19382            let token = self.0.request.page_token.clone();
19383            let execute = move |token: String| {
19384                let mut builder = self.clone();
19385                builder.0.request = builder.0.request.set_page_token(token);
19386                builder.send()
19387            };
19388            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19389        }
19390
19391        /// Streams each item in the collection.
19392        pub fn by_item(
19393            self,
19394        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19395            google_cloud_location::model::ListLocationsResponse,
19396            crate::Error,
19397        > {
19398            use google_cloud_gax::paginator::Paginator;
19399            self.by_page().items()
19400        }
19401
19402        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
19403        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19404            self.0.request.name = v.into();
19405            self
19406        }
19407
19408        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
19409        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19410            self.0.request.filter = v.into();
19411            self
19412        }
19413
19414        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
19415        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19416            self.0.request.page_size = v.into();
19417            self
19418        }
19419
19420        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
19421        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19422            self.0.request.page_token = v.into();
19423            self
19424        }
19425    }
19426
19427    #[doc(hidden)]
19428    impl crate::RequestBuilder for ListLocations {
19429        fn request_options(&mut self) -> &mut crate::RequestOptions {
19430            &mut self.0.options
19431        }
19432    }
19433
19434    /// The request builder for [Sessions::get_location][crate::client::Sessions::get_location] calls.
19435    ///
19436    /// # Example
19437    /// ```
19438    /// # use google_cloud_dialogflow_v2::builder::sessions::GetLocation;
19439    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19440    ///
19441    /// let builder = prepare_request_builder();
19442    /// let response = builder.send().await?;
19443    /// # Ok(()) }
19444    ///
19445    /// fn prepare_request_builder() -> GetLocation {
19446    ///   # panic!();
19447    ///   // ... details omitted ...
19448    /// }
19449    /// ```
19450    #[derive(Clone, Debug)]
19451    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19452
19453    impl GetLocation {
19454        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19455            Self(RequestBuilder::new(stub))
19456        }
19457
19458        /// Sets the full request, replacing any prior values.
19459        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19460            mut self,
19461            v: V,
19462        ) -> Self {
19463            self.0.request = v.into();
19464            self
19465        }
19466
19467        /// Sets all the options, replacing any prior values.
19468        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19469            self.0.options = v.into();
19470            self
19471        }
19472
19473        /// Sends the request.
19474        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19475            (*self.0.stub)
19476                .get_location(self.0.request, self.0.options)
19477                .await
19478                .map(crate::Response::into_body)
19479        }
19480
19481        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
19482        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19483            self.0.request.name = v.into();
19484            self
19485        }
19486    }
19487
19488    #[doc(hidden)]
19489    impl crate::RequestBuilder for GetLocation {
19490        fn request_options(&mut self) -> &mut crate::RequestOptions {
19491            &mut self.0.options
19492        }
19493    }
19494
19495    /// The request builder for [Sessions::list_operations][crate::client::Sessions::list_operations] calls.
19496    ///
19497    /// # Example
19498    /// ```
19499    /// # use google_cloud_dialogflow_v2::builder::sessions::ListOperations;
19500    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19501    /// use google_cloud_gax::paginator::ItemPaginator;
19502    ///
19503    /// let builder = prepare_request_builder();
19504    /// let mut items = builder.by_item();
19505    /// while let Some(result) = items.next().await {
19506    ///   let item = result?;
19507    /// }
19508    /// # Ok(()) }
19509    ///
19510    /// fn prepare_request_builder() -> ListOperations {
19511    ///   # panic!();
19512    ///   // ... details omitted ...
19513    /// }
19514    /// ```
19515    #[derive(Clone, Debug)]
19516    pub struct ListOperations(
19517        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19518    );
19519
19520    impl ListOperations {
19521        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19522            Self(RequestBuilder::new(stub))
19523        }
19524
19525        /// Sets the full request, replacing any prior values.
19526        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19527            mut self,
19528            v: V,
19529        ) -> Self {
19530            self.0.request = v.into();
19531            self
19532        }
19533
19534        /// Sets all the options, replacing any prior values.
19535        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19536            self.0.options = v.into();
19537            self
19538        }
19539
19540        /// Sends the request.
19541        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19542            (*self.0.stub)
19543                .list_operations(self.0.request, self.0.options)
19544                .await
19545                .map(crate::Response::into_body)
19546        }
19547
19548        /// Streams each page in the collection.
19549        pub fn by_page(
19550            self,
19551        ) -> impl google_cloud_gax::paginator::Paginator<
19552            google_cloud_longrunning::model::ListOperationsResponse,
19553            crate::Error,
19554        > {
19555            use std::clone::Clone;
19556            let token = self.0.request.page_token.clone();
19557            let execute = move |token: String| {
19558                let mut builder = self.clone();
19559                builder.0.request = builder.0.request.set_page_token(token);
19560                builder.send()
19561            };
19562            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19563        }
19564
19565        /// Streams each item in the collection.
19566        pub fn by_item(
19567            self,
19568        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19569            google_cloud_longrunning::model::ListOperationsResponse,
19570            crate::Error,
19571        > {
19572            use google_cloud_gax::paginator::Paginator;
19573            self.by_page().items()
19574        }
19575
19576        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
19577        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19578            self.0.request.name = v.into();
19579            self
19580        }
19581
19582        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
19583        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19584            self.0.request.filter = v.into();
19585            self
19586        }
19587
19588        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
19589        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19590            self.0.request.page_size = v.into();
19591            self
19592        }
19593
19594        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
19595        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19596            self.0.request.page_token = v.into();
19597            self
19598        }
19599
19600        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
19601        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19602            self.0.request.return_partial_success = v.into();
19603            self
19604        }
19605    }
19606
19607    #[doc(hidden)]
19608    impl crate::RequestBuilder for ListOperations {
19609        fn request_options(&mut self) -> &mut crate::RequestOptions {
19610            &mut self.0.options
19611        }
19612    }
19613
19614    /// The request builder for [Sessions::get_operation][crate::client::Sessions::get_operation] calls.
19615    ///
19616    /// # Example
19617    /// ```
19618    /// # use google_cloud_dialogflow_v2::builder::sessions::GetOperation;
19619    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19620    ///
19621    /// let builder = prepare_request_builder();
19622    /// let response = builder.send().await?;
19623    /// # Ok(()) }
19624    ///
19625    /// fn prepare_request_builder() -> GetOperation {
19626    ///   # panic!();
19627    ///   // ... details omitted ...
19628    /// }
19629    /// ```
19630    #[derive(Clone, Debug)]
19631    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19632
19633    impl GetOperation {
19634        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19635            Self(RequestBuilder::new(stub))
19636        }
19637
19638        /// Sets the full request, replacing any prior values.
19639        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19640            mut self,
19641            v: V,
19642        ) -> Self {
19643            self.0.request = v.into();
19644            self
19645        }
19646
19647        /// Sets all the options, replacing any prior values.
19648        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19649            self.0.options = v.into();
19650            self
19651        }
19652
19653        /// Sends the request.
19654        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19655            (*self.0.stub)
19656                .get_operation(self.0.request, self.0.options)
19657                .await
19658                .map(crate::Response::into_body)
19659        }
19660
19661        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19662        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19663            self.0.request.name = v.into();
19664            self
19665        }
19666    }
19667
19668    #[doc(hidden)]
19669    impl crate::RequestBuilder for GetOperation {
19670        fn request_options(&mut self) -> &mut crate::RequestOptions {
19671            &mut self.0.options
19672        }
19673    }
19674
19675    /// The request builder for [Sessions::cancel_operation][crate::client::Sessions::cancel_operation] calls.
19676    ///
19677    /// # Example
19678    /// ```
19679    /// # use google_cloud_dialogflow_v2::builder::sessions::CancelOperation;
19680    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19681    ///
19682    /// let builder = prepare_request_builder();
19683    /// let response = builder.send().await?;
19684    /// # Ok(()) }
19685    ///
19686    /// fn prepare_request_builder() -> CancelOperation {
19687    ///   # panic!();
19688    ///   // ... details omitted ...
19689    /// }
19690    /// ```
19691    #[derive(Clone, Debug)]
19692    pub struct CancelOperation(
19693        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19694    );
19695
19696    impl CancelOperation {
19697        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19698            Self(RequestBuilder::new(stub))
19699        }
19700
19701        /// Sets the full request, replacing any prior values.
19702        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19703            mut self,
19704            v: V,
19705        ) -> Self {
19706            self.0.request = v.into();
19707            self
19708        }
19709
19710        /// Sets all the options, replacing any prior values.
19711        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19712            self.0.options = v.into();
19713            self
19714        }
19715
19716        /// Sends the request.
19717        pub async fn send(self) -> Result<()> {
19718            (*self.0.stub)
19719                .cancel_operation(self.0.request, self.0.options)
19720                .await
19721                .map(crate::Response::into_body)
19722        }
19723
19724        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19725        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19726            self.0.request.name = v.into();
19727            self
19728        }
19729    }
19730
19731    #[doc(hidden)]
19732    impl crate::RequestBuilder for CancelOperation {
19733        fn request_options(&mut self) -> &mut crate::RequestOptions {
19734            &mut self.0.options
19735        }
19736    }
19737}
19738
19739/// Request and client builders for [SessionEntityTypes][crate::client::SessionEntityTypes].
19740#[cfg(feature = "session-entity-types")]
19741#[cfg_attr(docsrs, doc(cfg(feature = "session-entity-types")))]
19742pub mod session_entity_types {
19743    use crate::Result;
19744
19745    /// A builder for [SessionEntityTypes][crate::client::SessionEntityTypes].
19746    ///
19747    /// ```
19748    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19749    /// # use google_cloud_dialogflow_v2::*;
19750    /// # use builder::session_entity_types::ClientBuilder;
19751    /// # use client::SessionEntityTypes;
19752    /// let builder : ClientBuilder = SessionEntityTypes::builder();
19753    /// let client = builder
19754    ///     .with_endpoint("https://dialogflow.googleapis.com")
19755    ///     .build().await?;
19756    /// # Ok(()) }
19757    /// ```
19758    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19759
19760    pub(crate) mod client {
19761        use super::super::super::client::SessionEntityTypes;
19762        pub struct Factory;
19763        impl crate::ClientFactory for Factory {
19764            type Client = SessionEntityTypes;
19765            type Credentials = gaxi::options::Credentials;
19766            async fn build(
19767                self,
19768                config: gaxi::options::ClientConfig,
19769            ) -> crate::ClientBuilderResult<Self::Client> {
19770                Self::Client::new(config).await
19771            }
19772        }
19773    }
19774
19775    /// Common implementation for [crate::client::SessionEntityTypes] request builders.
19776    #[derive(Clone, Debug)]
19777    pub(crate) struct RequestBuilder<R: std::default::Default> {
19778        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19779        request: R,
19780        options: crate::RequestOptions,
19781    }
19782
19783    impl<R> RequestBuilder<R>
19784    where
19785        R: std::default::Default,
19786    {
19787        pub(crate) fn new(
19788            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19789        ) -> Self {
19790            Self {
19791                stub,
19792                request: R::default(),
19793                options: crate::RequestOptions::default(),
19794            }
19795        }
19796    }
19797
19798    /// The request builder for [SessionEntityTypes::list_session_entity_types][crate::client::SessionEntityTypes::list_session_entity_types] calls.
19799    ///
19800    /// # Example
19801    /// ```
19802    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListSessionEntityTypes;
19803    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19804    /// use google_cloud_gax::paginator::ItemPaginator;
19805    ///
19806    /// let builder = prepare_request_builder();
19807    /// let mut items = builder.by_item();
19808    /// while let Some(result) = items.next().await {
19809    ///   let item = result?;
19810    /// }
19811    /// # Ok(()) }
19812    ///
19813    /// fn prepare_request_builder() -> ListSessionEntityTypes {
19814    ///   # panic!();
19815    ///   // ... details omitted ...
19816    /// }
19817    /// ```
19818    #[derive(Clone, Debug)]
19819    pub struct ListSessionEntityTypes(RequestBuilder<crate::model::ListSessionEntityTypesRequest>);
19820
19821    impl ListSessionEntityTypes {
19822        pub(crate) fn new(
19823            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19824        ) -> Self {
19825            Self(RequestBuilder::new(stub))
19826        }
19827
19828        /// Sets the full request, replacing any prior values.
19829        pub fn with_request<V: Into<crate::model::ListSessionEntityTypesRequest>>(
19830            mut self,
19831            v: V,
19832        ) -> Self {
19833            self.0.request = v.into();
19834            self
19835        }
19836
19837        /// Sets all the options, replacing any prior values.
19838        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19839            self.0.options = v.into();
19840            self
19841        }
19842
19843        /// Sends the request.
19844        pub async fn send(self) -> Result<crate::model::ListSessionEntityTypesResponse> {
19845            (*self.0.stub)
19846                .list_session_entity_types(self.0.request, self.0.options)
19847                .await
19848                .map(crate::Response::into_body)
19849        }
19850
19851        /// Streams each page in the collection.
19852        pub fn by_page(
19853            self,
19854        ) -> impl google_cloud_gax::paginator::Paginator<
19855            crate::model::ListSessionEntityTypesResponse,
19856            crate::Error,
19857        > {
19858            use std::clone::Clone;
19859            let token = self.0.request.page_token.clone();
19860            let execute = move |token: String| {
19861                let mut builder = self.clone();
19862                builder.0.request = builder.0.request.set_page_token(token);
19863                builder.send()
19864            };
19865            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19866        }
19867
19868        /// Streams each item in the collection.
19869        pub fn by_item(
19870            self,
19871        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19872            crate::model::ListSessionEntityTypesResponse,
19873            crate::Error,
19874        > {
19875            use google_cloud_gax::paginator::Paginator;
19876            self.by_page().items()
19877        }
19878
19879        /// Sets the value of [parent][crate::model::ListSessionEntityTypesRequest::parent].
19880        ///
19881        /// This is a **required** field for requests.
19882        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19883            self.0.request.parent = v.into();
19884            self
19885        }
19886
19887        /// Sets the value of [page_size][crate::model::ListSessionEntityTypesRequest::page_size].
19888        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19889            self.0.request.page_size = v.into();
19890            self
19891        }
19892
19893        /// Sets the value of [page_token][crate::model::ListSessionEntityTypesRequest::page_token].
19894        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19895            self.0.request.page_token = v.into();
19896            self
19897        }
19898    }
19899
19900    #[doc(hidden)]
19901    impl crate::RequestBuilder for ListSessionEntityTypes {
19902        fn request_options(&mut self) -> &mut crate::RequestOptions {
19903            &mut self.0.options
19904        }
19905    }
19906
19907    /// The request builder for [SessionEntityTypes::get_session_entity_type][crate::client::SessionEntityTypes::get_session_entity_type] calls.
19908    ///
19909    /// # Example
19910    /// ```
19911    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetSessionEntityType;
19912    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19913    ///
19914    /// let builder = prepare_request_builder();
19915    /// let response = builder.send().await?;
19916    /// # Ok(()) }
19917    ///
19918    /// fn prepare_request_builder() -> GetSessionEntityType {
19919    ///   # panic!();
19920    ///   // ... details omitted ...
19921    /// }
19922    /// ```
19923    #[derive(Clone, Debug)]
19924    pub struct GetSessionEntityType(RequestBuilder<crate::model::GetSessionEntityTypeRequest>);
19925
19926    impl GetSessionEntityType {
19927        pub(crate) fn new(
19928            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19929        ) -> Self {
19930            Self(RequestBuilder::new(stub))
19931        }
19932
19933        /// Sets the full request, replacing any prior values.
19934        pub fn with_request<V: Into<crate::model::GetSessionEntityTypeRequest>>(
19935            mut self,
19936            v: V,
19937        ) -> Self {
19938            self.0.request = v.into();
19939            self
19940        }
19941
19942        /// Sets all the options, replacing any prior values.
19943        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19944            self.0.options = v.into();
19945            self
19946        }
19947
19948        /// Sends the request.
19949        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
19950            (*self.0.stub)
19951                .get_session_entity_type(self.0.request, self.0.options)
19952                .await
19953                .map(crate::Response::into_body)
19954        }
19955
19956        /// Sets the value of [name][crate::model::GetSessionEntityTypeRequest::name].
19957        ///
19958        /// This is a **required** field for requests.
19959        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19960            self.0.request.name = v.into();
19961            self
19962        }
19963    }
19964
19965    #[doc(hidden)]
19966    impl crate::RequestBuilder for GetSessionEntityType {
19967        fn request_options(&mut self) -> &mut crate::RequestOptions {
19968            &mut self.0.options
19969        }
19970    }
19971
19972    /// The request builder for [SessionEntityTypes::create_session_entity_type][crate::client::SessionEntityTypes::create_session_entity_type] calls.
19973    ///
19974    /// # Example
19975    /// ```
19976    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::CreateSessionEntityType;
19977    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19978    ///
19979    /// let builder = prepare_request_builder();
19980    /// let response = builder.send().await?;
19981    /// # Ok(()) }
19982    ///
19983    /// fn prepare_request_builder() -> CreateSessionEntityType {
19984    ///   # panic!();
19985    ///   // ... details omitted ...
19986    /// }
19987    /// ```
19988    #[derive(Clone, Debug)]
19989    pub struct CreateSessionEntityType(
19990        RequestBuilder<crate::model::CreateSessionEntityTypeRequest>,
19991    );
19992
19993    impl CreateSessionEntityType {
19994        pub(crate) fn new(
19995            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19996        ) -> Self {
19997            Self(RequestBuilder::new(stub))
19998        }
19999
20000        /// Sets the full request, replacing any prior values.
20001        pub fn with_request<V: Into<crate::model::CreateSessionEntityTypeRequest>>(
20002            mut self,
20003            v: V,
20004        ) -> Self {
20005            self.0.request = v.into();
20006            self
20007        }
20008
20009        /// Sets all the options, replacing any prior values.
20010        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20011            self.0.options = v.into();
20012            self
20013        }
20014
20015        /// Sends the request.
20016        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20017            (*self.0.stub)
20018                .create_session_entity_type(self.0.request, self.0.options)
20019                .await
20020                .map(crate::Response::into_body)
20021        }
20022
20023        /// Sets the value of [parent][crate::model::CreateSessionEntityTypeRequest::parent].
20024        ///
20025        /// This is a **required** field for requests.
20026        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20027            self.0.request.parent = v.into();
20028            self
20029        }
20030
20031        /// Sets the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
20032        ///
20033        /// This is a **required** field for requests.
20034        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
20035        where
20036            T: std::convert::Into<crate::model::SessionEntityType>,
20037        {
20038            self.0.request.session_entity_type = std::option::Option::Some(v.into());
20039            self
20040        }
20041
20042        /// Sets or clears the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
20043        ///
20044        /// This is a **required** field for requests.
20045        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
20046        where
20047            T: std::convert::Into<crate::model::SessionEntityType>,
20048        {
20049            self.0.request.session_entity_type = v.map(|x| x.into());
20050            self
20051        }
20052    }
20053
20054    #[doc(hidden)]
20055    impl crate::RequestBuilder for CreateSessionEntityType {
20056        fn request_options(&mut self) -> &mut crate::RequestOptions {
20057            &mut self.0.options
20058        }
20059    }
20060
20061    /// The request builder for [SessionEntityTypes::update_session_entity_type][crate::client::SessionEntityTypes::update_session_entity_type] calls.
20062    ///
20063    /// # Example
20064    /// ```
20065    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::UpdateSessionEntityType;
20066    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20067    ///
20068    /// let builder = prepare_request_builder();
20069    /// let response = builder.send().await?;
20070    /// # Ok(()) }
20071    ///
20072    /// fn prepare_request_builder() -> UpdateSessionEntityType {
20073    ///   # panic!();
20074    ///   // ... details omitted ...
20075    /// }
20076    /// ```
20077    #[derive(Clone, Debug)]
20078    pub struct UpdateSessionEntityType(
20079        RequestBuilder<crate::model::UpdateSessionEntityTypeRequest>,
20080    );
20081
20082    impl UpdateSessionEntityType {
20083        pub(crate) fn new(
20084            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20085        ) -> Self {
20086            Self(RequestBuilder::new(stub))
20087        }
20088
20089        /// Sets the full request, replacing any prior values.
20090        pub fn with_request<V: Into<crate::model::UpdateSessionEntityTypeRequest>>(
20091            mut self,
20092            v: V,
20093        ) -> Self {
20094            self.0.request = v.into();
20095            self
20096        }
20097
20098        /// Sets all the options, replacing any prior values.
20099        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20100            self.0.options = v.into();
20101            self
20102        }
20103
20104        /// Sends the request.
20105        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20106            (*self.0.stub)
20107                .update_session_entity_type(self.0.request, self.0.options)
20108                .await
20109                .map(crate::Response::into_body)
20110        }
20111
20112        /// Sets the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
20113        ///
20114        /// This is a **required** field for requests.
20115        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
20116        where
20117            T: std::convert::Into<crate::model::SessionEntityType>,
20118        {
20119            self.0.request.session_entity_type = std::option::Option::Some(v.into());
20120            self
20121        }
20122
20123        /// Sets or clears the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
20124        ///
20125        /// This is a **required** field for requests.
20126        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
20127        where
20128            T: std::convert::Into<crate::model::SessionEntityType>,
20129        {
20130            self.0.request.session_entity_type = v.map(|x| x.into());
20131            self
20132        }
20133
20134        /// Sets the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
20135        pub fn set_update_mask<T>(mut self, v: T) -> Self
20136        where
20137            T: std::convert::Into<wkt::FieldMask>,
20138        {
20139            self.0.request.update_mask = std::option::Option::Some(v.into());
20140            self
20141        }
20142
20143        /// Sets or clears the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
20144        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20145        where
20146            T: std::convert::Into<wkt::FieldMask>,
20147        {
20148            self.0.request.update_mask = v.map(|x| x.into());
20149            self
20150        }
20151    }
20152
20153    #[doc(hidden)]
20154    impl crate::RequestBuilder for UpdateSessionEntityType {
20155        fn request_options(&mut self) -> &mut crate::RequestOptions {
20156            &mut self.0.options
20157        }
20158    }
20159
20160    /// The request builder for [SessionEntityTypes::delete_session_entity_type][crate::client::SessionEntityTypes::delete_session_entity_type] calls.
20161    ///
20162    /// # Example
20163    /// ```
20164    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::DeleteSessionEntityType;
20165    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20166    ///
20167    /// let builder = prepare_request_builder();
20168    /// let response = builder.send().await?;
20169    /// # Ok(()) }
20170    ///
20171    /// fn prepare_request_builder() -> DeleteSessionEntityType {
20172    ///   # panic!();
20173    ///   // ... details omitted ...
20174    /// }
20175    /// ```
20176    #[derive(Clone, Debug)]
20177    pub struct DeleteSessionEntityType(
20178        RequestBuilder<crate::model::DeleteSessionEntityTypeRequest>,
20179    );
20180
20181    impl DeleteSessionEntityType {
20182        pub(crate) fn new(
20183            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20184        ) -> Self {
20185            Self(RequestBuilder::new(stub))
20186        }
20187
20188        /// Sets the full request, replacing any prior values.
20189        pub fn with_request<V: Into<crate::model::DeleteSessionEntityTypeRequest>>(
20190            mut self,
20191            v: V,
20192        ) -> Self {
20193            self.0.request = v.into();
20194            self
20195        }
20196
20197        /// Sets all the options, replacing any prior values.
20198        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20199            self.0.options = v.into();
20200            self
20201        }
20202
20203        /// Sends the request.
20204        pub async fn send(self) -> Result<()> {
20205            (*self.0.stub)
20206                .delete_session_entity_type(self.0.request, self.0.options)
20207                .await
20208                .map(crate::Response::into_body)
20209        }
20210
20211        /// Sets the value of [name][crate::model::DeleteSessionEntityTypeRequest::name].
20212        ///
20213        /// This is a **required** field for requests.
20214        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20215            self.0.request.name = v.into();
20216            self
20217        }
20218    }
20219
20220    #[doc(hidden)]
20221    impl crate::RequestBuilder for DeleteSessionEntityType {
20222        fn request_options(&mut self) -> &mut crate::RequestOptions {
20223            &mut self.0.options
20224        }
20225    }
20226
20227    /// The request builder for [SessionEntityTypes::list_locations][crate::client::SessionEntityTypes::list_locations] calls.
20228    ///
20229    /// # Example
20230    /// ```
20231    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListLocations;
20232    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20233    /// use google_cloud_gax::paginator::ItemPaginator;
20234    ///
20235    /// let builder = prepare_request_builder();
20236    /// let mut items = builder.by_item();
20237    /// while let Some(result) = items.next().await {
20238    ///   let item = result?;
20239    /// }
20240    /// # Ok(()) }
20241    ///
20242    /// fn prepare_request_builder() -> ListLocations {
20243    ///   # panic!();
20244    ///   // ... details omitted ...
20245    /// }
20246    /// ```
20247    #[derive(Clone, Debug)]
20248    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20249
20250    impl ListLocations {
20251        pub(crate) fn new(
20252            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20253        ) -> Self {
20254            Self(RequestBuilder::new(stub))
20255        }
20256
20257        /// Sets the full request, replacing any prior values.
20258        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20259            mut self,
20260            v: V,
20261        ) -> Self {
20262            self.0.request = v.into();
20263            self
20264        }
20265
20266        /// Sets all the options, replacing any prior values.
20267        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20268            self.0.options = v.into();
20269            self
20270        }
20271
20272        /// Sends the request.
20273        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20274            (*self.0.stub)
20275                .list_locations(self.0.request, self.0.options)
20276                .await
20277                .map(crate::Response::into_body)
20278        }
20279
20280        /// Streams each page in the collection.
20281        pub fn by_page(
20282            self,
20283        ) -> impl google_cloud_gax::paginator::Paginator<
20284            google_cloud_location::model::ListLocationsResponse,
20285            crate::Error,
20286        > {
20287            use std::clone::Clone;
20288            let token = self.0.request.page_token.clone();
20289            let execute = move |token: String| {
20290                let mut builder = self.clone();
20291                builder.0.request = builder.0.request.set_page_token(token);
20292                builder.send()
20293            };
20294            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20295        }
20296
20297        /// Streams each item in the collection.
20298        pub fn by_item(
20299            self,
20300        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20301            google_cloud_location::model::ListLocationsResponse,
20302            crate::Error,
20303        > {
20304            use google_cloud_gax::paginator::Paginator;
20305            self.by_page().items()
20306        }
20307
20308        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
20309        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20310            self.0.request.name = v.into();
20311            self
20312        }
20313
20314        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
20315        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20316            self.0.request.filter = v.into();
20317            self
20318        }
20319
20320        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
20321        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20322            self.0.request.page_size = v.into();
20323            self
20324        }
20325
20326        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
20327        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20328            self.0.request.page_token = v.into();
20329            self
20330        }
20331    }
20332
20333    #[doc(hidden)]
20334    impl crate::RequestBuilder for ListLocations {
20335        fn request_options(&mut self) -> &mut crate::RequestOptions {
20336            &mut self.0.options
20337        }
20338    }
20339
20340    /// The request builder for [SessionEntityTypes::get_location][crate::client::SessionEntityTypes::get_location] calls.
20341    ///
20342    /// # Example
20343    /// ```
20344    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetLocation;
20345    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20346    ///
20347    /// let builder = prepare_request_builder();
20348    /// let response = builder.send().await?;
20349    /// # Ok(()) }
20350    ///
20351    /// fn prepare_request_builder() -> GetLocation {
20352    ///   # panic!();
20353    ///   // ... details omitted ...
20354    /// }
20355    /// ```
20356    #[derive(Clone, Debug)]
20357    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20358
20359    impl GetLocation {
20360        pub(crate) fn new(
20361            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20362        ) -> Self {
20363            Self(RequestBuilder::new(stub))
20364        }
20365
20366        /// Sets the full request, replacing any prior values.
20367        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20368            mut self,
20369            v: V,
20370        ) -> Self {
20371            self.0.request = v.into();
20372            self
20373        }
20374
20375        /// Sets all the options, replacing any prior values.
20376        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20377            self.0.options = v.into();
20378            self
20379        }
20380
20381        /// Sends the request.
20382        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20383            (*self.0.stub)
20384                .get_location(self.0.request, self.0.options)
20385                .await
20386                .map(crate::Response::into_body)
20387        }
20388
20389        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
20390        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20391            self.0.request.name = v.into();
20392            self
20393        }
20394    }
20395
20396    #[doc(hidden)]
20397    impl crate::RequestBuilder for GetLocation {
20398        fn request_options(&mut self) -> &mut crate::RequestOptions {
20399            &mut self.0.options
20400        }
20401    }
20402
20403    /// The request builder for [SessionEntityTypes::list_operations][crate::client::SessionEntityTypes::list_operations] calls.
20404    ///
20405    /// # Example
20406    /// ```
20407    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListOperations;
20408    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20409    /// use google_cloud_gax::paginator::ItemPaginator;
20410    ///
20411    /// let builder = prepare_request_builder();
20412    /// let mut items = builder.by_item();
20413    /// while let Some(result) = items.next().await {
20414    ///   let item = result?;
20415    /// }
20416    /// # Ok(()) }
20417    ///
20418    /// fn prepare_request_builder() -> ListOperations {
20419    ///   # panic!();
20420    ///   // ... details omitted ...
20421    /// }
20422    /// ```
20423    #[derive(Clone, Debug)]
20424    pub struct ListOperations(
20425        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20426    );
20427
20428    impl ListOperations {
20429        pub(crate) fn new(
20430            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20431        ) -> Self {
20432            Self(RequestBuilder::new(stub))
20433        }
20434
20435        /// Sets the full request, replacing any prior values.
20436        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20437            mut self,
20438            v: V,
20439        ) -> Self {
20440            self.0.request = v.into();
20441            self
20442        }
20443
20444        /// Sets all the options, replacing any prior values.
20445        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20446            self.0.options = v.into();
20447            self
20448        }
20449
20450        /// Sends the request.
20451        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20452            (*self.0.stub)
20453                .list_operations(self.0.request, self.0.options)
20454                .await
20455                .map(crate::Response::into_body)
20456        }
20457
20458        /// Streams each page in the collection.
20459        pub fn by_page(
20460            self,
20461        ) -> impl google_cloud_gax::paginator::Paginator<
20462            google_cloud_longrunning::model::ListOperationsResponse,
20463            crate::Error,
20464        > {
20465            use std::clone::Clone;
20466            let token = self.0.request.page_token.clone();
20467            let execute = move |token: String| {
20468                let mut builder = self.clone();
20469                builder.0.request = builder.0.request.set_page_token(token);
20470                builder.send()
20471            };
20472            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20473        }
20474
20475        /// Streams each item in the collection.
20476        pub fn by_item(
20477            self,
20478        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20479            google_cloud_longrunning::model::ListOperationsResponse,
20480            crate::Error,
20481        > {
20482            use google_cloud_gax::paginator::Paginator;
20483            self.by_page().items()
20484        }
20485
20486        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
20487        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20488            self.0.request.name = v.into();
20489            self
20490        }
20491
20492        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
20493        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20494            self.0.request.filter = v.into();
20495            self
20496        }
20497
20498        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
20499        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20500            self.0.request.page_size = v.into();
20501            self
20502        }
20503
20504        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
20505        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20506            self.0.request.page_token = v.into();
20507            self
20508        }
20509
20510        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
20511        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20512            self.0.request.return_partial_success = v.into();
20513            self
20514        }
20515    }
20516
20517    #[doc(hidden)]
20518    impl crate::RequestBuilder for ListOperations {
20519        fn request_options(&mut self) -> &mut crate::RequestOptions {
20520            &mut self.0.options
20521        }
20522    }
20523
20524    /// The request builder for [SessionEntityTypes::get_operation][crate::client::SessionEntityTypes::get_operation] calls.
20525    ///
20526    /// # Example
20527    /// ```
20528    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetOperation;
20529    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20530    ///
20531    /// let builder = prepare_request_builder();
20532    /// let response = builder.send().await?;
20533    /// # Ok(()) }
20534    ///
20535    /// fn prepare_request_builder() -> GetOperation {
20536    ///   # panic!();
20537    ///   // ... details omitted ...
20538    /// }
20539    /// ```
20540    #[derive(Clone, Debug)]
20541    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20542
20543    impl GetOperation {
20544        pub(crate) fn new(
20545            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20546        ) -> Self {
20547            Self(RequestBuilder::new(stub))
20548        }
20549
20550        /// Sets the full request, replacing any prior values.
20551        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20552            mut self,
20553            v: V,
20554        ) -> Self {
20555            self.0.request = v.into();
20556            self
20557        }
20558
20559        /// Sets all the options, replacing any prior values.
20560        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20561            self.0.options = v.into();
20562            self
20563        }
20564
20565        /// Sends the request.
20566        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20567            (*self.0.stub)
20568                .get_operation(self.0.request, self.0.options)
20569                .await
20570                .map(crate::Response::into_body)
20571        }
20572
20573        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
20574        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20575            self.0.request.name = v.into();
20576            self
20577        }
20578    }
20579
20580    #[doc(hidden)]
20581    impl crate::RequestBuilder for GetOperation {
20582        fn request_options(&mut self) -> &mut crate::RequestOptions {
20583            &mut self.0.options
20584        }
20585    }
20586
20587    /// The request builder for [SessionEntityTypes::cancel_operation][crate::client::SessionEntityTypes::cancel_operation] calls.
20588    ///
20589    /// # Example
20590    /// ```
20591    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::CancelOperation;
20592    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20593    ///
20594    /// let builder = prepare_request_builder();
20595    /// let response = builder.send().await?;
20596    /// # Ok(()) }
20597    ///
20598    /// fn prepare_request_builder() -> CancelOperation {
20599    ///   # panic!();
20600    ///   // ... details omitted ...
20601    /// }
20602    /// ```
20603    #[derive(Clone, Debug)]
20604    pub struct CancelOperation(
20605        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20606    );
20607
20608    impl CancelOperation {
20609        pub(crate) fn new(
20610            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20611        ) -> Self {
20612            Self(RequestBuilder::new(stub))
20613        }
20614
20615        /// Sets the full request, replacing any prior values.
20616        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20617            mut self,
20618            v: V,
20619        ) -> Self {
20620            self.0.request = v.into();
20621            self
20622        }
20623
20624        /// Sets all the options, replacing any prior values.
20625        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20626            self.0.options = v.into();
20627            self
20628        }
20629
20630        /// Sends the request.
20631        pub async fn send(self) -> Result<()> {
20632            (*self.0.stub)
20633                .cancel_operation(self.0.request, self.0.options)
20634                .await
20635                .map(crate::Response::into_body)
20636        }
20637
20638        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
20639        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20640            self.0.request.name = v.into();
20641            self
20642        }
20643    }
20644
20645    #[doc(hidden)]
20646    impl crate::RequestBuilder for CancelOperation {
20647        fn request_options(&mut self) -> &mut crate::RequestOptions {
20648            &mut self.0.options
20649        }
20650    }
20651}
20652
20653/// Request and client builders for [SipTrunks][crate::client::SipTrunks].
20654#[cfg(feature = "sip-trunks")]
20655#[cfg_attr(docsrs, doc(cfg(feature = "sip-trunks")))]
20656pub mod sip_trunks {
20657    use crate::Result;
20658
20659    /// A builder for [SipTrunks][crate::client::SipTrunks].
20660    ///
20661    /// ```
20662    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20663    /// # use google_cloud_dialogflow_v2::*;
20664    /// # use builder::sip_trunks::ClientBuilder;
20665    /// # use client::SipTrunks;
20666    /// let builder : ClientBuilder = SipTrunks::builder();
20667    /// let client = builder
20668    ///     .with_endpoint("https://dialogflow.googleapis.com")
20669    ///     .build().await?;
20670    /// # Ok(()) }
20671    /// ```
20672    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20673
20674    pub(crate) mod client {
20675        use super::super::super::client::SipTrunks;
20676        pub struct Factory;
20677        impl crate::ClientFactory for Factory {
20678            type Client = SipTrunks;
20679            type Credentials = gaxi::options::Credentials;
20680            async fn build(
20681                self,
20682                config: gaxi::options::ClientConfig,
20683            ) -> crate::ClientBuilderResult<Self::Client> {
20684                Self::Client::new(config).await
20685            }
20686        }
20687    }
20688
20689    /// Common implementation for [crate::client::SipTrunks] request builders.
20690    #[derive(Clone, Debug)]
20691    pub(crate) struct RequestBuilder<R: std::default::Default> {
20692        stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20693        request: R,
20694        options: crate::RequestOptions,
20695    }
20696
20697    impl<R> RequestBuilder<R>
20698    where
20699        R: std::default::Default,
20700    {
20701        pub(crate) fn new(
20702            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20703        ) -> Self {
20704            Self {
20705                stub,
20706                request: R::default(),
20707                options: crate::RequestOptions::default(),
20708            }
20709        }
20710    }
20711
20712    /// The request builder for [SipTrunks::create_sip_trunk][crate::client::SipTrunks::create_sip_trunk] calls.
20713    ///
20714    /// # Example
20715    /// ```
20716    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::CreateSipTrunk;
20717    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20718    ///
20719    /// let builder = prepare_request_builder();
20720    /// let response = builder.send().await?;
20721    /// # Ok(()) }
20722    ///
20723    /// fn prepare_request_builder() -> CreateSipTrunk {
20724    ///   # panic!();
20725    ///   // ... details omitted ...
20726    /// }
20727    /// ```
20728    #[derive(Clone, Debug)]
20729    pub struct CreateSipTrunk(RequestBuilder<crate::model::CreateSipTrunkRequest>);
20730
20731    impl CreateSipTrunk {
20732        pub(crate) fn new(
20733            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20734        ) -> Self {
20735            Self(RequestBuilder::new(stub))
20736        }
20737
20738        /// Sets the full request, replacing any prior values.
20739        pub fn with_request<V: Into<crate::model::CreateSipTrunkRequest>>(mut self, v: V) -> Self {
20740            self.0.request = v.into();
20741            self
20742        }
20743
20744        /// Sets all the options, replacing any prior values.
20745        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20746            self.0.options = v.into();
20747            self
20748        }
20749
20750        /// Sends the request.
20751        pub async fn send(self) -> Result<crate::model::SipTrunk> {
20752            (*self.0.stub)
20753                .create_sip_trunk(self.0.request, self.0.options)
20754                .await
20755                .map(crate::Response::into_body)
20756        }
20757
20758        /// Sets the value of [parent][crate::model::CreateSipTrunkRequest::parent].
20759        ///
20760        /// This is a **required** field for requests.
20761        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20762            self.0.request.parent = v.into();
20763            self
20764        }
20765
20766        /// Sets the value of [sip_trunk][crate::model::CreateSipTrunkRequest::sip_trunk].
20767        ///
20768        /// This is a **required** field for requests.
20769        pub fn set_sip_trunk<T>(mut self, v: T) -> Self
20770        where
20771            T: std::convert::Into<crate::model::SipTrunk>,
20772        {
20773            self.0.request.sip_trunk = std::option::Option::Some(v.into());
20774            self
20775        }
20776
20777        /// Sets or clears the value of [sip_trunk][crate::model::CreateSipTrunkRequest::sip_trunk].
20778        ///
20779        /// This is a **required** field for requests.
20780        pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
20781        where
20782            T: std::convert::Into<crate::model::SipTrunk>,
20783        {
20784            self.0.request.sip_trunk = v.map(|x| x.into());
20785            self
20786        }
20787    }
20788
20789    #[doc(hidden)]
20790    impl crate::RequestBuilder for CreateSipTrunk {
20791        fn request_options(&mut self) -> &mut crate::RequestOptions {
20792            &mut self.0.options
20793        }
20794    }
20795
20796    /// The request builder for [SipTrunks::delete_sip_trunk][crate::client::SipTrunks::delete_sip_trunk] calls.
20797    ///
20798    /// # Example
20799    /// ```
20800    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::DeleteSipTrunk;
20801    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20802    ///
20803    /// let builder = prepare_request_builder();
20804    /// let response = builder.send().await?;
20805    /// # Ok(()) }
20806    ///
20807    /// fn prepare_request_builder() -> DeleteSipTrunk {
20808    ///   # panic!();
20809    ///   // ... details omitted ...
20810    /// }
20811    /// ```
20812    #[derive(Clone, Debug)]
20813    pub struct DeleteSipTrunk(RequestBuilder<crate::model::DeleteSipTrunkRequest>);
20814
20815    impl DeleteSipTrunk {
20816        pub(crate) fn new(
20817            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20818        ) -> Self {
20819            Self(RequestBuilder::new(stub))
20820        }
20821
20822        /// Sets the full request, replacing any prior values.
20823        pub fn with_request<V: Into<crate::model::DeleteSipTrunkRequest>>(mut self, v: V) -> Self {
20824            self.0.request = v.into();
20825            self
20826        }
20827
20828        /// Sets all the options, replacing any prior values.
20829        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20830            self.0.options = v.into();
20831            self
20832        }
20833
20834        /// Sends the request.
20835        pub async fn send(self) -> Result<()> {
20836            (*self.0.stub)
20837                .delete_sip_trunk(self.0.request, self.0.options)
20838                .await
20839                .map(crate::Response::into_body)
20840        }
20841
20842        /// Sets the value of [name][crate::model::DeleteSipTrunkRequest::name].
20843        ///
20844        /// This is a **required** field for requests.
20845        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20846            self.0.request.name = v.into();
20847            self
20848        }
20849    }
20850
20851    #[doc(hidden)]
20852    impl crate::RequestBuilder for DeleteSipTrunk {
20853        fn request_options(&mut self) -> &mut crate::RequestOptions {
20854            &mut self.0.options
20855        }
20856    }
20857
20858    /// The request builder for [SipTrunks::list_sip_trunks][crate::client::SipTrunks::list_sip_trunks] calls.
20859    ///
20860    /// # Example
20861    /// ```
20862    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListSipTrunks;
20863    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20864    /// use google_cloud_gax::paginator::ItemPaginator;
20865    ///
20866    /// let builder = prepare_request_builder();
20867    /// let mut items = builder.by_item();
20868    /// while let Some(result) = items.next().await {
20869    ///   let item = result?;
20870    /// }
20871    /// # Ok(()) }
20872    ///
20873    /// fn prepare_request_builder() -> ListSipTrunks {
20874    ///   # panic!();
20875    ///   // ... details omitted ...
20876    /// }
20877    /// ```
20878    #[derive(Clone, Debug)]
20879    pub struct ListSipTrunks(RequestBuilder<crate::model::ListSipTrunksRequest>);
20880
20881    impl ListSipTrunks {
20882        pub(crate) fn new(
20883            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20884        ) -> Self {
20885            Self(RequestBuilder::new(stub))
20886        }
20887
20888        /// Sets the full request, replacing any prior values.
20889        pub fn with_request<V: Into<crate::model::ListSipTrunksRequest>>(mut self, v: V) -> Self {
20890            self.0.request = v.into();
20891            self
20892        }
20893
20894        /// Sets all the options, replacing any prior values.
20895        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20896            self.0.options = v.into();
20897            self
20898        }
20899
20900        /// Sends the request.
20901        pub async fn send(self) -> Result<crate::model::ListSipTrunksResponse> {
20902            (*self.0.stub)
20903                .list_sip_trunks(self.0.request, self.0.options)
20904                .await
20905                .map(crate::Response::into_body)
20906        }
20907
20908        /// Streams each page in the collection.
20909        pub fn by_page(
20910            self,
20911        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSipTrunksResponse, crate::Error>
20912        {
20913            use std::clone::Clone;
20914            let token = self.0.request.page_token.clone();
20915            let execute = move |token: String| {
20916                let mut builder = self.clone();
20917                builder.0.request = builder.0.request.set_page_token(token);
20918                builder.send()
20919            };
20920            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20921        }
20922
20923        /// Streams each item in the collection.
20924        pub fn by_item(
20925            self,
20926        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20927            crate::model::ListSipTrunksResponse,
20928            crate::Error,
20929        > {
20930            use google_cloud_gax::paginator::Paginator;
20931            self.by_page().items()
20932        }
20933
20934        /// Sets the value of [parent][crate::model::ListSipTrunksRequest::parent].
20935        ///
20936        /// This is a **required** field for requests.
20937        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20938            self.0.request.parent = v.into();
20939            self
20940        }
20941
20942        /// Sets the value of [page_size][crate::model::ListSipTrunksRequest::page_size].
20943        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20944            self.0.request.page_size = v.into();
20945            self
20946        }
20947
20948        /// Sets the value of [page_token][crate::model::ListSipTrunksRequest::page_token].
20949        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20950            self.0.request.page_token = v.into();
20951            self
20952        }
20953    }
20954
20955    #[doc(hidden)]
20956    impl crate::RequestBuilder for ListSipTrunks {
20957        fn request_options(&mut self) -> &mut crate::RequestOptions {
20958            &mut self.0.options
20959        }
20960    }
20961
20962    /// The request builder for [SipTrunks::get_sip_trunk][crate::client::SipTrunks::get_sip_trunk] calls.
20963    ///
20964    /// # Example
20965    /// ```
20966    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetSipTrunk;
20967    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20968    ///
20969    /// let builder = prepare_request_builder();
20970    /// let response = builder.send().await?;
20971    /// # Ok(()) }
20972    ///
20973    /// fn prepare_request_builder() -> GetSipTrunk {
20974    ///   # panic!();
20975    ///   // ... details omitted ...
20976    /// }
20977    /// ```
20978    #[derive(Clone, Debug)]
20979    pub struct GetSipTrunk(RequestBuilder<crate::model::GetSipTrunkRequest>);
20980
20981    impl GetSipTrunk {
20982        pub(crate) fn new(
20983            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20984        ) -> Self {
20985            Self(RequestBuilder::new(stub))
20986        }
20987
20988        /// Sets the full request, replacing any prior values.
20989        pub fn with_request<V: Into<crate::model::GetSipTrunkRequest>>(mut self, v: V) -> Self {
20990            self.0.request = v.into();
20991            self
20992        }
20993
20994        /// Sets all the options, replacing any prior values.
20995        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20996            self.0.options = v.into();
20997            self
20998        }
20999
21000        /// Sends the request.
21001        pub async fn send(self) -> Result<crate::model::SipTrunk> {
21002            (*self.0.stub)
21003                .get_sip_trunk(self.0.request, self.0.options)
21004                .await
21005                .map(crate::Response::into_body)
21006        }
21007
21008        /// Sets the value of [name][crate::model::GetSipTrunkRequest::name].
21009        ///
21010        /// This is a **required** field for requests.
21011        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21012            self.0.request.name = v.into();
21013            self
21014        }
21015    }
21016
21017    #[doc(hidden)]
21018    impl crate::RequestBuilder for GetSipTrunk {
21019        fn request_options(&mut self) -> &mut crate::RequestOptions {
21020            &mut self.0.options
21021        }
21022    }
21023
21024    /// The request builder for [SipTrunks::update_sip_trunk][crate::client::SipTrunks::update_sip_trunk] calls.
21025    ///
21026    /// # Example
21027    /// ```
21028    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::UpdateSipTrunk;
21029    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21030    ///
21031    /// let builder = prepare_request_builder();
21032    /// let response = builder.send().await?;
21033    /// # Ok(()) }
21034    ///
21035    /// fn prepare_request_builder() -> UpdateSipTrunk {
21036    ///   # panic!();
21037    ///   // ... details omitted ...
21038    /// }
21039    /// ```
21040    #[derive(Clone, Debug)]
21041    pub struct UpdateSipTrunk(RequestBuilder<crate::model::UpdateSipTrunkRequest>);
21042
21043    impl UpdateSipTrunk {
21044        pub(crate) fn new(
21045            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21046        ) -> Self {
21047            Self(RequestBuilder::new(stub))
21048        }
21049
21050        /// Sets the full request, replacing any prior values.
21051        pub fn with_request<V: Into<crate::model::UpdateSipTrunkRequest>>(mut self, v: V) -> Self {
21052            self.0.request = v.into();
21053            self
21054        }
21055
21056        /// Sets all the options, replacing any prior values.
21057        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21058            self.0.options = v.into();
21059            self
21060        }
21061
21062        /// Sends the request.
21063        pub async fn send(self) -> Result<crate::model::SipTrunk> {
21064            (*self.0.stub)
21065                .update_sip_trunk(self.0.request, self.0.options)
21066                .await
21067                .map(crate::Response::into_body)
21068        }
21069
21070        /// Sets the value of [sip_trunk][crate::model::UpdateSipTrunkRequest::sip_trunk].
21071        ///
21072        /// This is a **required** field for requests.
21073        pub fn set_sip_trunk<T>(mut self, v: T) -> Self
21074        where
21075            T: std::convert::Into<crate::model::SipTrunk>,
21076        {
21077            self.0.request.sip_trunk = std::option::Option::Some(v.into());
21078            self
21079        }
21080
21081        /// Sets or clears the value of [sip_trunk][crate::model::UpdateSipTrunkRequest::sip_trunk].
21082        ///
21083        /// This is a **required** field for requests.
21084        pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
21085        where
21086            T: std::convert::Into<crate::model::SipTrunk>,
21087        {
21088            self.0.request.sip_trunk = v.map(|x| x.into());
21089            self
21090        }
21091
21092        /// Sets the value of [update_mask][crate::model::UpdateSipTrunkRequest::update_mask].
21093        pub fn set_update_mask<T>(mut self, v: T) -> Self
21094        where
21095            T: std::convert::Into<wkt::FieldMask>,
21096        {
21097            self.0.request.update_mask = std::option::Option::Some(v.into());
21098            self
21099        }
21100
21101        /// Sets or clears the value of [update_mask][crate::model::UpdateSipTrunkRequest::update_mask].
21102        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21103        where
21104            T: std::convert::Into<wkt::FieldMask>,
21105        {
21106            self.0.request.update_mask = v.map(|x| x.into());
21107            self
21108        }
21109    }
21110
21111    #[doc(hidden)]
21112    impl crate::RequestBuilder for UpdateSipTrunk {
21113        fn request_options(&mut self) -> &mut crate::RequestOptions {
21114            &mut self.0.options
21115        }
21116    }
21117
21118    /// The request builder for [SipTrunks::list_locations][crate::client::SipTrunks::list_locations] calls.
21119    ///
21120    /// # Example
21121    /// ```
21122    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListLocations;
21123    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21124    /// use google_cloud_gax::paginator::ItemPaginator;
21125    ///
21126    /// let builder = prepare_request_builder();
21127    /// let mut items = builder.by_item();
21128    /// while let Some(result) = items.next().await {
21129    ///   let item = result?;
21130    /// }
21131    /// # Ok(()) }
21132    ///
21133    /// fn prepare_request_builder() -> ListLocations {
21134    ///   # panic!();
21135    ///   // ... details omitted ...
21136    /// }
21137    /// ```
21138    #[derive(Clone, Debug)]
21139    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21140
21141    impl ListLocations {
21142        pub(crate) fn new(
21143            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21144        ) -> Self {
21145            Self(RequestBuilder::new(stub))
21146        }
21147
21148        /// Sets the full request, replacing any prior values.
21149        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21150            mut self,
21151            v: V,
21152        ) -> Self {
21153            self.0.request = v.into();
21154            self
21155        }
21156
21157        /// Sets all the options, replacing any prior values.
21158        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21159            self.0.options = v.into();
21160            self
21161        }
21162
21163        /// Sends the request.
21164        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21165            (*self.0.stub)
21166                .list_locations(self.0.request, self.0.options)
21167                .await
21168                .map(crate::Response::into_body)
21169        }
21170
21171        /// Streams each page in the collection.
21172        pub fn by_page(
21173            self,
21174        ) -> impl google_cloud_gax::paginator::Paginator<
21175            google_cloud_location::model::ListLocationsResponse,
21176            crate::Error,
21177        > {
21178            use std::clone::Clone;
21179            let token = self.0.request.page_token.clone();
21180            let execute = move |token: String| {
21181                let mut builder = self.clone();
21182                builder.0.request = builder.0.request.set_page_token(token);
21183                builder.send()
21184            };
21185            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21186        }
21187
21188        /// Streams each item in the collection.
21189        pub fn by_item(
21190            self,
21191        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21192            google_cloud_location::model::ListLocationsResponse,
21193            crate::Error,
21194        > {
21195            use google_cloud_gax::paginator::Paginator;
21196            self.by_page().items()
21197        }
21198
21199        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
21200        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21201            self.0.request.name = v.into();
21202            self
21203        }
21204
21205        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
21206        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21207            self.0.request.filter = v.into();
21208            self
21209        }
21210
21211        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
21212        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21213            self.0.request.page_size = v.into();
21214            self
21215        }
21216
21217        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
21218        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21219            self.0.request.page_token = v.into();
21220            self
21221        }
21222    }
21223
21224    #[doc(hidden)]
21225    impl crate::RequestBuilder for ListLocations {
21226        fn request_options(&mut self) -> &mut crate::RequestOptions {
21227            &mut self.0.options
21228        }
21229    }
21230
21231    /// The request builder for [SipTrunks::get_location][crate::client::SipTrunks::get_location] calls.
21232    ///
21233    /// # Example
21234    /// ```
21235    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetLocation;
21236    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21237    ///
21238    /// let builder = prepare_request_builder();
21239    /// let response = builder.send().await?;
21240    /// # Ok(()) }
21241    ///
21242    /// fn prepare_request_builder() -> GetLocation {
21243    ///   # panic!();
21244    ///   // ... details omitted ...
21245    /// }
21246    /// ```
21247    #[derive(Clone, Debug)]
21248    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21249
21250    impl GetLocation {
21251        pub(crate) fn new(
21252            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21253        ) -> Self {
21254            Self(RequestBuilder::new(stub))
21255        }
21256
21257        /// Sets the full request, replacing any prior values.
21258        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21259            mut self,
21260            v: V,
21261        ) -> Self {
21262            self.0.request = v.into();
21263            self
21264        }
21265
21266        /// Sets all the options, replacing any prior values.
21267        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21268            self.0.options = v.into();
21269            self
21270        }
21271
21272        /// Sends the request.
21273        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21274            (*self.0.stub)
21275                .get_location(self.0.request, self.0.options)
21276                .await
21277                .map(crate::Response::into_body)
21278        }
21279
21280        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
21281        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21282            self.0.request.name = v.into();
21283            self
21284        }
21285    }
21286
21287    #[doc(hidden)]
21288    impl crate::RequestBuilder for GetLocation {
21289        fn request_options(&mut self) -> &mut crate::RequestOptions {
21290            &mut self.0.options
21291        }
21292    }
21293
21294    /// The request builder for [SipTrunks::list_operations][crate::client::SipTrunks::list_operations] calls.
21295    ///
21296    /// # Example
21297    /// ```
21298    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListOperations;
21299    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21300    /// use google_cloud_gax::paginator::ItemPaginator;
21301    ///
21302    /// let builder = prepare_request_builder();
21303    /// let mut items = builder.by_item();
21304    /// while let Some(result) = items.next().await {
21305    ///   let item = result?;
21306    /// }
21307    /// # Ok(()) }
21308    ///
21309    /// fn prepare_request_builder() -> ListOperations {
21310    ///   # panic!();
21311    ///   // ... details omitted ...
21312    /// }
21313    /// ```
21314    #[derive(Clone, Debug)]
21315    pub struct ListOperations(
21316        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21317    );
21318
21319    impl ListOperations {
21320        pub(crate) fn new(
21321            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21322        ) -> Self {
21323            Self(RequestBuilder::new(stub))
21324        }
21325
21326        /// Sets the full request, replacing any prior values.
21327        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21328            mut self,
21329            v: V,
21330        ) -> Self {
21331            self.0.request = v.into();
21332            self
21333        }
21334
21335        /// Sets all the options, replacing any prior values.
21336        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21337            self.0.options = v.into();
21338            self
21339        }
21340
21341        /// Sends the request.
21342        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21343            (*self.0.stub)
21344                .list_operations(self.0.request, self.0.options)
21345                .await
21346                .map(crate::Response::into_body)
21347        }
21348
21349        /// Streams each page in the collection.
21350        pub fn by_page(
21351            self,
21352        ) -> impl google_cloud_gax::paginator::Paginator<
21353            google_cloud_longrunning::model::ListOperationsResponse,
21354            crate::Error,
21355        > {
21356            use std::clone::Clone;
21357            let token = self.0.request.page_token.clone();
21358            let execute = move |token: String| {
21359                let mut builder = self.clone();
21360                builder.0.request = builder.0.request.set_page_token(token);
21361                builder.send()
21362            };
21363            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21364        }
21365
21366        /// Streams each item in the collection.
21367        pub fn by_item(
21368            self,
21369        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21370            google_cloud_longrunning::model::ListOperationsResponse,
21371            crate::Error,
21372        > {
21373            use google_cloud_gax::paginator::Paginator;
21374            self.by_page().items()
21375        }
21376
21377        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
21378        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21379            self.0.request.name = v.into();
21380            self
21381        }
21382
21383        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
21384        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21385            self.0.request.filter = v.into();
21386            self
21387        }
21388
21389        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
21390        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21391            self.0.request.page_size = v.into();
21392            self
21393        }
21394
21395        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
21396        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21397            self.0.request.page_token = v.into();
21398            self
21399        }
21400
21401        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
21402        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21403            self.0.request.return_partial_success = v.into();
21404            self
21405        }
21406    }
21407
21408    #[doc(hidden)]
21409    impl crate::RequestBuilder for ListOperations {
21410        fn request_options(&mut self) -> &mut crate::RequestOptions {
21411            &mut self.0.options
21412        }
21413    }
21414
21415    /// The request builder for [SipTrunks::get_operation][crate::client::SipTrunks::get_operation] calls.
21416    ///
21417    /// # Example
21418    /// ```
21419    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetOperation;
21420    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21421    ///
21422    /// let builder = prepare_request_builder();
21423    /// let response = builder.send().await?;
21424    /// # Ok(()) }
21425    ///
21426    /// fn prepare_request_builder() -> GetOperation {
21427    ///   # panic!();
21428    ///   // ... details omitted ...
21429    /// }
21430    /// ```
21431    #[derive(Clone, Debug)]
21432    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21433
21434    impl GetOperation {
21435        pub(crate) fn new(
21436            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21437        ) -> Self {
21438            Self(RequestBuilder::new(stub))
21439        }
21440
21441        /// Sets the full request, replacing any prior values.
21442        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21443            mut self,
21444            v: V,
21445        ) -> Self {
21446            self.0.request = v.into();
21447            self
21448        }
21449
21450        /// Sets all the options, replacing any prior values.
21451        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21452            self.0.options = v.into();
21453            self
21454        }
21455
21456        /// Sends the request.
21457        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21458            (*self.0.stub)
21459                .get_operation(self.0.request, self.0.options)
21460                .await
21461                .map(crate::Response::into_body)
21462        }
21463
21464        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
21465        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21466            self.0.request.name = v.into();
21467            self
21468        }
21469    }
21470
21471    #[doc(hidden)]
21472    impl crate::RequestBuilder for GetOperation {
21473        fn request_options(&mut self) -> &mut crate::RequestOptions {
21474            &mut self.0.options
21475        }
21476    }
21477
21478    /// The request builder for [SipTrunks::cancel_operation][crate::client::SipTrunks::cancel_operation] calls.
21479    ///
21480    /// # Example
21481    /// ```
21482    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::CancelOperation;
21483    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21484    ///
21485    /// let builder = prepare_request_builder();
21486    /// let response = builder.send().await?;
21487    /// # Ok(()) }
21488    ///
21489    /// fn prepare_request_builder() -> CancelOperation {
21490    ///   # panic!();
21491    ///   // ... details omitted ...
21492    /// }
21493    /// ```
21494    #[derive(Clone, Debug)]
21495    pub struct CancelOperation(
21496        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21497    );
21498
21499    impl CancelOperation {
21500        pub(crate) fn new(
21501            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21502        ) -> Self {
21503            Self(RequestBuilder::new(stub))
21504        }
21505
21506        /// Sets the full request, replacing any prior values.
21507        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21508            mut self,
21509            v: V,
21510        ) -> Self {
21511            self.0.request = v.into();
21512            self
21513        }
21514
21515        /// Sets all the options, replacing any prior values.
21516        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21517            self.0.options = v.into();
21518            self
21519        }
21520
21521        /// Sends the request.
21522        pub async fn send(self) -> Result<()> {
21523            (*self.0.stub)
21524                .cancel_operation(self.0.request, self.0.options)
21525                .await
21526                .map(crate::Response::into_body)
21527        }
21528
21529        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
21530        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21531            self.0.request.name = v.into();
21532            self
21533        }
21534    }
21535
21536    #[doc(hidden)]
21537    impl crate::RequestBuilder for CancelOperation {
21538        fn request_options(&mut self) -> &mut crate::RequestOptions {
21539            &mut self.0.options
21540        }
21541    }
21542}
21543
21544/// Request and client builders for [Tools][crate::client::Tools].
21545#[cfg(feature = "tools")]
21546#[cfg_attr(docsrs, doc(cfg(feature = "tools")))]
21547pub mod tools {
21548    use crate::Result;
21549
21550    /// A builder for [Tools][crate::client::Tools].
21551    ///
21552    /// ```
21553    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
21554    /// # use google_cloud_dialogflow_v2::*;
21555    /// # use builder::tools::ClientBuilder;
21556    /// # use client::Tools;
21557    /// let builder : ClientBuilder = Tools::builder();
21558    /// let client = builder
21559    ///     .with_endpoint("https://dialogflow.googleapis.com")
21560    ///     .build().await?;
21561    /// # Ok(()) }
21562    /// ```
21563    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
21564
21565    pub(crate) mod client {
21566        use super::super::super::client::Tools;
21567        pub struct Factory;
21568        impl crate::ClientFactory for Factory {
21569            type Client = Tools;
21570            type Credentials = gaxi::options::Credentials;
21571            async fn build(
21572                self,
21573                config: gaxi::options::ClientConfig,
21574            ) -> crate::ClientBuilderResult<Self::Client> {
21575                Self::Client::new(config).await
21576            }
21577        }
21578    }
21579
21580    /// Common implementation for [crate::client::Tools] request builders.
21581    #[derive(Clone, Debug)]
21582    pub(crate) struct RequestBuilder<R: std::default::Default> {
21583        stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>,
21584        request: R,
21585        options: crate::RequestOptions,
21586    }
21587
21588    impl<R> RequestBuilder<R>
21589    where
21590        R: std::default::Default,
21591    {
21592        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21593            Self {
21594                stub,
21595                request: R::default(),
21596                options: crate::RequestOptions::default(),
21597            }
21598        }
21599    }
21600
21601    /// The request builder for [Tools::create_tool][crate::client::Tools::create_tool] calls.
21602    ///
21603    /// # Example
21604    /// ```
21605    /// # use google_cloud_dialogflow_v2::builder::tools::CreateTool;
21606    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21607    ///
21608    /// let builder = prepare_request_builder();
21609    /// let response = builder.send().await?;
21610    /// # Ok(()) }
21611    ///
21612    /// fn prepare_request_builder() -> CreateTool {
21613    ///   # panic!();
21614    ///   // ... details omitted ...
21615    /// }
21616    /// ```
21617    #[derive(Clone, Debug)]
21618    pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
21619
21620    impl CreateTool {
21621        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21622            Self(RequestBuilder::new(stub))
21623        }
21624
21625        /// Sets the full request, replacing any prior values.
21626        pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> Self {
21627            self.0.request = v.into();
21628            self
21629        }
21630
21631        /// Sets all the options, replacing any prior values.
21632        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21633            self.0.options = v.into();
21634            self
21635        }
21636
21637        /// Sends the request.
21638        pub async fn send(self) -> Result<crate::model::Tool> {
21639            (*self.0.stub)
21640                .create_tool(self.0.request, self.0.options)
21641                .await
21642                .map(crate::Response::into_body)
21643        }
21644
21645        /// Sets the value of [parent][crate::model::CreateToolRequest::parent].
21646        ///
21647        /// This is a **required** field for requests.
21648        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21649            self.0.request.parent = v.into();
21650            self
21651        }
21652
21653        /// Sets the value of [tool][crate::model::CreateToolRequest::tool].
21654        ///
21655        /// This is a **required** field for requests.
21656        pub fn set_tool<T>(mut self, v: T) -> Self
21657        where
21658            T: std::convert::Into<crate::model::Tool>,
21659        {
21660            self.0.request.tool = std::option::Option::Some(v.into());
21661            self
21662        }
21663
21664        /// Sets or clears the value of [tool][crate::model::CreateToolRequest::tool].
21665        ///
21666        /// This is a **required** field for requests.
21667        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
21668        where
21669            T: std::convert::Into<crate::model::Tool>,
21670        {
21671            self.0.request.tool = v.map(|x| x.into());
21672            self
21673        }
21674
21675        /// Sets the value of [tool_id][crate::model::CreateToolRequest::tool_id].
21676        pub fn set_tool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21677            self.0.request.tool_id = v.into();
21678            self
21679        }
21680    }
21681
21682    #[doc(hidden)]
21683    impl crate::RequestBuilder for CreateTool {
21684        fn request_options(&mut self) -> &mut crate::RequestOptions {
21685            &mut self.0.options
21686        }
21687    }
21688
21689    /// The request builder for [Tools::get_tool][crate::client::Tools::get_tool] calls.
21690    ///
21691    /// # Example
21692    /// ```
21693    /// # use google_cloud_dialogflow_v2::builder::tools::GetTool;
21694    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21695    ///
21696    /// let builder = prepare_request_builder();
21697    /// let response = builder.send().await?;
21698    /// # Ok(()) }
21699    ///
21700    /// fn prepare_request_builder() -> GetTool {
21701    ///   # panic!();
21702    ///   // ... details omitted ...
21703    /// }
21704    /// ```
21705    #[derive(Clone, Debug)]
21706    pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
21707
21708    impl GetTool {
21709        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21710            Self(RequestBuilder::new(stub))
21711        }
21712
21713        /// Sets the full request, replacing any prior values.
21714        pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> Self {
21715            self.0.request = v.into();
21716            self
21717        }
21718
21719        /// Sets all the options, replacing any prior values.
21720        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21721            self.0.options = v.into();
21722            self
21723        }
21724
21725        /// Sends the request.
21726        pub async fn send(self) -> Result<crate::model::Tool> {
21727            (*self.0.stub)
21728                .get_tool(self.0.request, self.0.options)
21729                .await
21730                .map(crate::Response::into_body)
21731        }
21732
21733        /// Sets the value of [name][crate::model::GetToolRequest::name].
21734        ///
21735        /// This is a **required** field for requests.
21736        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21737            self.0.request.name = v.into();
21738            self
21739        }
21740    }
21741
21742    #[doc(hidden)]
21743    impl crate::RequestBuilder for GetTool {
21744        fn request_options(&mut self) -> &mut crate::RequestOptions {
21745            &mut self.0.options
21746        }
21747    }
21748
21749    /// The request builder for [Tools::list_tools][crate::client::Tools::list_tools] calls.
21750    ///
21751    /// # Example
21752    /// ```
21753    /// # use google_cloud_dialogflow_v2::builder::tools::ListTools;
21754    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21755    /// use google_cloud_gax::paginator::ItemPaginator;
21756    ///
21757    /// let builder = prepare_request_builder();
21758    /// let mut items = builder.by_item();
21759    /// while let Some(result) = items.next().await {
21760    ///   let item = result?;
21761    /// }
21762    /// # Ok(()) }
21763    ///
21764    /// fn prepare_request_builder() -> ListTools {
21765    ///   # panic!();
21766    ///   // ... details omitted ...
21767    /// }
21768    /// ```
21769    #[derive(Clone, Debug)]
21770    pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
21771
21772    impl ListTools {
21773        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21774            Self(RequestBuilder::new(stub))
21775        }
21776
21777        /// Sets the full request, replacing any prior values.
21778        pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
21779            self.0.request = v.into();
21780            self
21781        }
21782
21783        /// Sets all the options, replacing any prior values.
21784        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21785            self.0.options = v.into();
21786            self
21787        }
21788
21789        /// Sends the request.
21790        pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
21791            (*self.0.stub)
21792                .list_tools(self.0.request, self.0.options)
21793                .await
21794                .map(crate::Response::into_body)
21795        }
21796
21797        /// Streams each page in the collection.
21798        pub fn by_page(
21799            self,
21800        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsResponse, crate::Error>
21801        {
21802            use std::clone::Clone;
21803            let token = self.0.request.page_token.clone();
21804            let execute = move |token: String| {
21805                let mut builder = self.clone();
21806                builder.0.request = builder.0.request.set_page_token(token);
21807                builder.send()
21808            };
21809            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21810        }
21811
21812        /// Streams each item in the collection.
21813        pub fn by_item(
21814            self,
21815        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListToolsResponse, crate::Error>
21816        {
21817            use google_cloud_gax::paginator::Paginator;
21818            self.by_page().items()
21819        }
21820
21821        /// Sets the value of [parent][crate::model::ListToolsRequest::parent].
21822        ///
21823        /// This is a **required** field for requests.
21824        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21825            self.0.request.parent = v.into();
21826            self
21827        }
21828
21829        /// Sets the value of [page_size][crate::model::ListToolsRequest::page_size].
21830        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21831            self.0.request.page_size = v.into();
21832            self
21833        }
21834
21835        /// Sets the value of [page_token][crate::model::ListToolsRequest::page_token].
21836        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21837            self.0.request.page_token = v.into();
21838            self
21839        }
21840    }
21841
21842    #[doc(hidden)]
21843    impl crate::RequestBuilder for ListTools {
21844        fn request_options(&mut self) -> &mut crate::RequestOptions {
21845            &mut self.0.options
21846        }
21847    }
21848
21849    /// The request builder for [Tools::delete_tool][crate::client::Tools::delete_tool] calls.
21850    ///
21851    /// # Example
21852    /// ```
21853    /// # use google_cloud_dialogflow_v2::builder::tools::DeleteTool;
21854    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21855    ///
21856    /// let builder = prepare_request_builder();
21857    /// let response = builder.send().await?;
21858    /// # Ok(()) }
21859    ///
21860    /// fn prepare_request_builder() -> DeleteTool {
21861    ///   # panic!();
21862    ///   // ... details omitted ...
21863    /// }
21864    /// ```
21865    #[derive(Clone, Debug)]
21866    pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
21867
21868    impl DeleteTool {
21869        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21870            Self(RequestBuilder::new(stub))
21871        }
21872
21873        /// Sets the full request, replacing any prior values.
21874        pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
21875            self.0.request = v.into();
21876            self
21877        }
21878
21879        /// Sets all the options, replacing any prior values.
21880        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21881            self.0.options = v.into();
21882            self
21883        }
21884
21885        /// Sends the request.
21886        pub async fn send(self) -> Result<()> {
21887            (*self.0.stub)
21888                .delete_tool(self.0.request, self.0.options)
21889                .await
21890                .map(crate::Response::into_body)
21891        }
21892
21893        /// Sets the value of [name][crate::model::DeleteToolRequest::name].
21894        ///
21895        /// This is a **required** field for requests.
21896        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21897            self.0.request.name = v.into();
21898            self
21899        }
21900    }
21901
21902    #[doc(hidden)]
21903    impl crate::RequestBuilder for DeleteTool {
21904        fn request_options(&mut self) -> &mut crate::RequestOptions {
21905            &mut self.0.options
21906        }
21907    }
21908
21909    /// The request builder for [Tools::update_tool][crate::client::Tools::update_tool] calls.
21910    ///
21911    /// # Example
21912    /// ```
21913    /// # use google_cloud_dialogflow_v2::builder::tools::UpdateTool;
21914    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21915    ///
21916    /// let builder = prepare_request_builder();
21917    /// let response = builder.send().await?;
21918    /// # Ok(()) }
21919    ///
21920    /// fn prepare_request_builder() -> UpdateTool {
21921    ///   # panic!();
21922    ///   // ... details omitted ...
21923    /// }
21924    /// ```
21925    #[derive(Clone, Debug)]
21926    pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
21927
21928    impl UpdateTool {
21929        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21930            Self(RequestBuilder::new(stub))
21931        }
21932
21933        /// Sets the full request, replacing any prior values.
21934        pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
21935            self.0.request = v.into();
21936            self
21937        }
21938
21939        /// Sets all the options, replacing any prior values.
21940        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21941            self.0.options = v.into();
21942            self
21943        }
21944
21945        /// Sends the request.
21946        pub async fn send(self) -> Result<crate::model::Tool> {
21947            (*self.0.stub)
21948                .update_tool(self.0.request, self.0.options)
21949                .await
21950                .map(crate::Response::into_body)
21951        }
21952
21953        /// Sets the value of [tool][crate::model::UpdateToolRequest::tool].
21954        ///
21955        /// This is a **required** field for requests.
21956        pub fn set_tool<T>(mut self, v: T) -> Self
21957        where
21958            T: std::convert::Into<crate::model::Tool>,
21959        {
21960            self.0.request.tool = std::option::Option::Some(v.into());
21961            self
21962        }
21963
21964        /// Sets or clears the value of [tool][crate::model::UpdateToolRequest::tool].
21965        ///
21966        /// This is a **required** field for requests.
21967        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
21968        where
21969            T: std::convert::Into<crate::model::Tool>,
21970        {
21971            self.0.request.tool = v.map(|x| x.into());
21972            self
21973        }
21974
21975        /// Sets the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
21976        pub fn set_update_mask<T>(mut self, v: T) -> Self
21977        where
21978            T: std::convert::Into<wkt::FieldMask>,
21979        {
21980            self.0.request.update_mask = std::option::Option::Some(v.into());
21981            self
21982        }
21983
21984        /// Sets or clears the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
21985        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21986        where
21987            T: std::convert::Into<wkt::FieldMask>,
21988        {
21989            self.0.request.update_mask = v.map(|x| x.into());
21990            self
21991        }
21992    }
21993
21994    #[doc(hidden)]
21995    impl crate::RequestBuilder for UpdateTool {
21996        fn request_options(&mut self) -> &mut crate::RequestOptions {
21997            &mut self.0.options
21998        }
21999    }
22000
22001    /// The request builder for [Tools::list_locations][crate::client::Tools::list_locations] calls.
22002    ///
22003    /// # Example
22004    /// ```
22005    /// # use google_cloud_dialogflow_v2::builder::tools::ListLocations;
22006    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22007    /// use google_cloud_gax::paginator::ItemPaginator;
22008    ///
22009    /// let builder = prepare_request_builder();
22010    /// let mut items = builder.by_item();
22011    /// while let Some(result) = items.next().await {
22012    ///   let item = result?;
22013    /// }
22014    /// # Ok(()) }
22015    ///
22016    /// fn prepare_request_builder() -> ListLocations {
22017    ///   # panic!();
22018    ///   // ... details omitted ...
22019    /// }
22020    /// ```
22021    #[derive(Clone, Debug)]
22022    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
22023
22024    impl ListLocations {
22025        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22026            Self(RequestBuilder::new(stub))
22027        }
22028
22029        /// Sets the full request, replacing any prior values.
22030        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
22031            mut self,
22032            v: V,
22033        ) -> Self {
22034            self.0.request = v.into();
22035            self
22036        }
22037
22038        /// Sets all the options, replacing any prior values.
22039        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22040            self.0.options = v.into();
22041            self
22042        }
22043
22044        /// Sends the request.
22045        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
22046            (*self.0.stub)
22047                .list_locations(self.0.request, self.0.options)
22048                .await
22049                .map(crate::Response::into_body)
22050        }
22051
22052        /// Streams each page in the collection.
22053        pub fn by_page(
22054            self,
22055        ) -> impl google_cloud_gax::paginator::Paginator<
22056            google_cloud_location::model::ListLocationsResponse,
22057            crate::Error,
22058        > {
22059            use std::clone::Clone;
22060            let token = self.0.request.page_token.clone();
22061            let execute = move |token: String| {
22062                let mut builder = self.clone();
22063                builder.0.request = builder.0.request.set_page_token(token);
22064                builder.send()
22065            };
22066            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22067        }
22068
22069        /// Streams each item in the collection.
22070        pub fn by_item(
22071            self,
22072        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22073            google_cloud_location::model::ListLocationsResponse,
22074            crate::Error,
22075        > {
22076            use google_cloud_gax::paginator::Paginator;
22077            self.by_page().items()
22078        }
22079
22080        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
22081        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22082            self.0.request.name = v.into();
22083            self
22084        }
22085
22086        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
22087        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22088            self.0.request.filter = v.into();
22089            self
22090        }
22091
22092        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
22093        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22094            self.0.request.page_size = v.into();
22095            self
22096        }
22097
22098        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
22099        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22100            self.0.request.page_token = v.into();
22101            self
22102        }
22103    }
22104
22105    #[doc(hidden)]
22106    impl crate::RequestBuilder for ListLocations {
22107        fn request_options(&mut self) -> &mut crate::RequestOptions {
22108            &mut self.0.options
22109        }
22110    }
22111
22112    /// The request builder for [Tools::get_location][crate::client::Tools::get_location] calls.
22113    ///
22114    /// # Example
22115    /// ```
22116    /// # use google_cloud_dialogflow_v2::builder::tools::GetLocation;
22117    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22118    ///
22119    /// let builder = prepare_request_builder();
22120    /// let response = builder.send().await?;
22121    /// # Ok(()) }
22122    ///
22123    /// fn prepare_request_builder() -> GetLocation {
22124    ///   # panic!();
22125    ///   // ... details omitted ...
22126    /// }
22127    /// ```
22128    #[derive(Clone, Debug)]
22129    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
22130
22131    impl GetLocation {
22132        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22133            Self(RequestBuilder::new(stub))
22134        }
22135
22136        /// Sets the full request, replacing any prior values.
22137        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
22138            mut self,
22139            v: V,
22140        ) -> Self {
22141            self.0.request = v.into();
22142            self
22143        }
22144
22145        /// Sets all the options, replacing any prior values.
22146        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22147            self.0.options = v.into();
22148            self
22149        }
22150
22151        /// Sends the request.
22152        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
22153            (*self.0.stub)
22154                .get_location(self.0.request, self.0.options)
22155                .await
22156                .map(crate::Response::into_body)
22157        }
22158
22159        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
22160        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22161            self.0.request.name = v.into();
22162            self
22163        }
22164    }
22165
22166    #[doc(hidden)]
22167    impl crate::RequestBuilder for GetLocation {
22168        fn request_options(&mut self) -> &mut crate::RequestOptions {
22169            &mut self.0.options
22170        }
22171    }
22172
22173    /// The request builder for [Tools::list_operations][crate::client::Tools::list_operations] calls.
22174    ///
22175    /// # Example
22176    /// ```
22177    /// # use google_cloud_dialogflow_v2::builder::tools::ListOperations;
22178    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22179    /// use google_cloud_gax::paginator::ItemPaginator;
22180    ///
22181    /// let builder = prepare_request_builder();
22182    /// let mut items = builder.by_item();
22183    /// while let Some(result) = items.next().await {
22184    ///   let item = result?;
22185    /// }
22186    /// # Ok(()) }
22187    ///
22188    /// fn prepare_request_builder() -> ListOperations {
22189    ///   # panic!();
22190    ///   // ... details omitted ...
22191    /// }
22192    /// ```
22193    #[derive(Clone, Debug)]
22194    pub struct ListOperations(
22195        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
22196    );
22197
22198    impl ListOperations {
22199        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22200            Self(RequestBuilder::new(stub))
22201        }
22202
22203        /// Sets the full request, replacing any prior values.
22204        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
22205            mut self,
22206            v: V,
22207        ) -> Self {
22208            self.0.request = v.into();
22209            self
22210        }
22211
22212        /// Sets all the options, replacing any prior values.
22213        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22214            self.0.options = v.into();
22215            self
22216        }
22217
22218        /// Sends the request.
22219        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
22220            (*self.0.stub)
22221                .list_operations(self.0.request, self.0.options)
22222                .await
22223                .map(crate::Response::into_body)
22224        }
22225
22226        /// Streams each page in the collection.
22227        pub fn by_page(
22228            self,
22229        ) -> impl google_cloud_gax::paginator::Paginator<
22230            google_cloud_longrunning::model::ListOperationsResponse,
22231            crate::Error,
22232        > {
22233            use std::clone::Clone;
22234            let token = self.0.request.page_token.clone();
22235            let execute = move |token: String| {
22236                let mut builder = self.clone();
22237                builder.0.request = builder.0.request.set_page_token(token);
22238                builder.send()
22239            };
22240            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22241        }
22242
22243        /// Streams each item in the collection.
22244        pub fn by_item(
22245            self,
22246        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22247            google_cloud_longrunning::model::ListOperationsResponse,
22248            crate::Error,
22249        > {
22250            use google_cloud_gax::paginator::Paginator;
22251            self.by_page().items()
22252        }
22253
22254        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
22255        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22256            self.0.request.name = v.into();
22257            self
22258        }
22259
22260        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
22261        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22262            self.0.request.filter = v.into();
22263            self
22264        }
22265
22266        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
22267        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22268            self.0.request.page_size = v.into();
22269            self
22270        }
22271
22272        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
22273        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22274            self.0.request.page_token = v.into();
22275            self
22276        }
22277
22278        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
22279        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22280            self.0.request.return_partial_success = v.into();
22281            self
22282        }
22283    }
22284
22285    #[doc(hidden)]
22286    impl crate::RequestBuilder for ListOperations {
22287        fn request_options(&mut self) -> &mut crate::RequestOptions {
22288            &mut self.0.options
22289        }
22290    }
22291
22292    /// The request builder for [Tools::get_operation][crate::client::Tools::get_operation] calls.
22293    ///
22294    /// # Example
22295    /// ```
22296    /// # use google_cloud_dialogflow_v2::builder::tools::GetOperation;
22297    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22298    ///
22299    /// let builder = prepare_request_builder();
22300    /// let response = builder.send().await?;
22301    /// # Ok(()) }
22302    ///
22303    /// fn prepare_request_builder() -> GetOperation {
22304    ///   # panic!();
22305    ///   // ... details omitted ...
22306    /// }
22307    /// ```
22308    #[derive(Clone, Debug)]
22309    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22310
22311    impl GetOperation {
22312        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22313            Self(RequestBuilder::new(stub))
22314        }
22315
22316        /// Sets the full request, replacing any prior values.
22317        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22318            mut self,
22319            v: V,
22320        ) -> Self {
22321            self.0.request = v.into();
22322            self
22323        }
22324
22325        /// Sets all the options, replacing any prior values.
22326        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22327            self.0.options = v.into();
22328            self
22329        }
22330
22331        /// Sends the request.
22332        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22333            (*self.0.stub)
22334                .get_operation(self.0.request, self.0.options)
22335                .await
22336                .map(crate::Response::into_body)
22337        }
22338
22339        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
22340        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22341            self.0.request.name = v.into();
22342            self
22343        }
22344    }
22345
22346    #[doc(hidden)]
22347    impl crate::RequestBuilder for GetOperation {
22348        fn request_options(&mut self) -> &mut crate::RequestOptions {
22349            &mut self.0.options
22350        }
22351    }
22352
22353    /// The request builder for [Tools::cancel_operation][crate::client::Tools::cancel_operation] calls.
22354    ///
22355    /// # Example
22356    /// ```
22357    /// # use google_cloud_dialogflow_v2::builder::tools::CancelOperation;
22358    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22359    ///
22360    /// let builder = prepare_request_builder();
22361    /// let response = builder.send().await?;
22362    /// # Ok(()) }
22363    ///
22364    /// fn prepare_request_builder() -> CancelOperation {
22365    ///   # panic!();
22366    ///   // ... details omitted ...
22367    /// }
22368    /// ```
22369    #[derive(Clone, Debug)]
22370    pub struct CancelOperation(
22371        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22372    );
22373
22374    impl CancelOperation {
22375        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22376            Self(RequestBuilder::new(stub))
22377        }
22378
22379        /// Sets the full request, replacing any prior values.
22380        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22381            mut self,
22382            v: V,
22383        ) -> Self {
22384            self.0.request = v.into();
22385            self
22386        }
22387
22388        /// Sets all the options, replacing any prior values.
22389        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22390            self.0.options = v.into();
22391            self
22392        }
22393
22394        /// Sends the request.
22395        pub async fn send(self) -> Result<()> {
22396            (*self.0.stub)
22397                .cancel_operation(self.0.request, self.0.options)
22398                .await
22399                .map(crate::Response::into_body)
22400        }
22401
22402        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
22403        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22404            self.0.request.name = v.into();
22405            self
22406        }
22407    }
22408
22409    #[doc(hidden)]
22410    impl crate::RequestBuilder for CancelOperation {
22411        fn request_options(&mut self) -> &mut crate::RequestOptions {
22412            &mut self.0.options
22413        }
22414    }
22415}
22416
22417/// Request and client builders for [Versions][crate::client::Versions].
22418#[cfg(feature = "versions")]
22419#[cfg_attr(docsrs, doc(cfg(feature = "versions")))]
22420pub mod versions {
22421    use crate::Result;
22422
22423    /// A builder for [Versions][crate::client::Versions].
22424    ///
22425    /// ```
22426    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
22427    /// # use google_cloud_dialogflow_v2::*;
22428    /// # use builder::versions::ClientBuilder;
22429    /// # use client::Versions;
22430    /// let builder : ClientBuilder = Versions::builder();
22431    /// let client = builder
22432    ///     .with_endpoint("https://dialogflow.googleapis.com")
22433    ///     .build().await?;
22434    /// # Ok(()) }
22435    /// ```
22436    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22437
22438    pub(crate) mod client {
22439        use super::super::super::client::Versions;
22440        pub struct Factory;
22441        impl crate::ClientFactory for Factory {
22442            type Client = Versions;
22443            type Credentials = gaxi::options::Credentials;
22444            async fn build(
22445                self,
22446                config: gaxi::options::ClientConfig,
22447            ) -> crate::ClientBuilderResult<Self::Client> {
22448                Self::Client::new(config).await
22449            }
22450        }
22451    }
22452
22453    /// Common implementation for [crate::client::Versions] request builders.
22454    #[derive(Clone, Debug)]
22455    pub(crate) struct RequestBuilder<R: std::default::Default> {
22456        stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
22457        request: R,
22458        options: crate::RequestOptions,
22459    }
22460
22461    impl<R> RequestBuilder<R>
22462    where
22463        R: std::default::Default,
22464    {
22465        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22466            Self {
22467                stub,
22468                request: R::default(),
22469                options: crate::RequestOptions::default(),
22470            }
22471        }
22472    }
22473
22474    /// The request builder for [Versions::list_versions][crate::client::Versions::list_versions] calls.
22475    ///
22476    /// # Example
22477    /// ```
22478    /// # use google_cloud_dialogflow_v2::builder::versions::ListVersions;
22479    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22480    /// use google_cloud_gax::paginator::ItemPaginator;
22481    ///
22482    /// let builder = prepare_request_builder();
22483    /// let mut items = builder.by_item();
22484    /// while let Some(result) = items.next().await {
22485    ///   let item = result?;
22486    /// }
22487    /// # Ok(()) }
22488    ///
22489    /// fn prepare_request_builder() -> ListVersions {
22490    ///   # panic!();
22491    ///   // ... details omitted ...
22492    /// }
22493    /// ```
22494    #[derive(Clone, Debug)]
22495    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
22496
22497    impl ListVersions {
22498        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22499            Self(RequestBuilder::new(stub))
22500        }
22501
22502        /// Sets the full request, replacing any prior values.
22503        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
22504            self.0.request = v.into();
22505            self
22506        }
22507
22508        /// Sets all the options, replacing any prior values.
22509        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22510            self.0.options = v.into();
22511            self
22512        }
22513
22514        /// Sends the request.
22515        pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
22516            (*self.0.stub)
22517                .list_versions(self.0.request, self.0.options)
22518                .await
22519                .map(crate::Response::into_body)
22520        }
22521
22522        /// Streams each page in the collection.
22523        pub fn by_page(
22524            self,
22525        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
22526        {
22527            use std::clone::Clone;
22528            let token = self.0.request.page_token.clone();
22529            let execute = move |token: String| {
22530                let mut builder = self.clone();
22531                builder.0.request = builder.0.request.set_page_token(token);
22532                builder.send()
22533            };
22534            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22535        }
22536
22537        /// Streams each item in the collection.
22538        pub fn by_item(
22539            self,
22540        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22541            crate::model::ListVersionsResponse,
22542            crate::Error,
22543        > {
22544            use google_cloud_gax::paginator::Paginator;
22545            self.by_page().items()
22546        }
22547
22548        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
22549        ///
22550        /// This is a **required** field for requests.
22551        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22552            self.0.request.parent = v.into();
22553            self
22554        }
22555
22556        /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
22557        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22558            self.0.request.page_size = v.into();
22559            self
22560        }
22561
22562        /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
22563        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22564            self.0.request.page_token = v.into();
22565            self
22566        }
22567    }
22568
22569    #[doc(hidden)]
22570    impl crate::RequestBuilder for ListVersions {
22571        fn request_options(&mut self) -> &mut crate::RequestOptions {
22572            &mut self.0.options
22573        }
22574    }
22575
22576    /// The request builder for [Versions::get_version][crate::client::Versions::get_version] calls.
22577    ///
22578    /// # Example
22579    /// ```
22580    /// # use google_cloud_dialogflow_v2::builder::versions::GetVersion;
22581    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22582    ///
22583    /// let builder = prepare_request_builder();
22584    /// let response = builder.send().await?;
22585    /// # Ok(()) }
22586    ///
22587    /// fn prepare_request_builder() -> GetVersion {
22588    ///   # panic!();
22589    ///   // ... details omitted ...
22590    /// }
22591    /// ```
22592    #[derive(Clone, Debug)]
22593    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
22594
22595    impl GetVersion {
22596        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22597            Self(RequestBuilder::new(stub))
22598        }
22599
22600        /// Sets the full request, replacing any prior values.
22601        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
22602            self.0.request = v.into();
22603            self
22604        }
22605
22606        /// Sets all the options, replacing any prior values.
22607        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22608            self.0.options = v.into();
22609            self
22610        }
22611
22612        /// Sends the request.
22613        pub async fn send(self) -> Result<crate::model::Version> {
22614            (*self.0.stub)
22615                .get_version(self.0.request, self.0.options)
22616                .await
22617                .map(crate::Response::into_body)
22618        }
22619
22620        /// Sets the value of [name][crate::model::GetVersionRequest::name].
22621        ///
22622        /// This is a **required** field for requests.
22623        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22624            self.0.request.name = v.into();
22625            self
22626        }
22627    }
22628
22629    #[doc(hidden)]
22630    impl crate::RequestBuilder for GetVersion {
22631        fn request_options(&mut self) -> &mut crate::RequestOptions {
22632            &mut self.0.options
22633        }
22634    }
22635
22636    /// The request builder for [Versions::create_version][crate::client::Versions::create_version] calls.
22637    ///
22638    /// # Example
22639    /// ```
22640    /// # use google_cloud_dialogflow_v2::builder::versions::CreateVersion;
22641    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22642    ///
22643    /// let builder = prepare_request_builder();
22644    /// let response = builder.send().await?;
22645    /// # Ok(()) }
22646    ///
22647    /// fn prepare_request_builder() -> CreateVersion {
22648    ///   # panic!();
22649    ///   // ... details omitted ...
22650    /// }
22651    /// ```
22652    #[derive(Clone, Debug)]
22653    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
22654
22655    impl CreateVersion {
22656        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22657            Self(RequestBuilder::new(stub))
22658        }
22659
22660        /// Sets the full request, replacing any prior values.
22661        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
22662            self.0.request = v.into();
22663            self
22664        }
22665
22666        /// Sets all the options, replacing any prior values.
22667        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22668            self.0.options = v.into();
22669            self
22670        }
22671
22672        /// Sends the request.
22673        pub async fn send(self) -> Result<crate::model::Version> {
22674            (*self.0.stub)
22675                .create_version(self.0.request, self.0.options)
22676                .await
22677                .map(crate::Response::into_body)
22678        }
22679
22680        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
22681        ///
22682        /// This is a **required** field for requests.
22683        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22684            self.0.request.parent = v.into();
22685            self
22686        }
22687
22688        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
22689        ///
22690        /// This is a **required** field for requests.
22691        pub fn set_version<T>(mut self, v: T) -> Self
22692        where
22693            T: std::convert::Into<crate::model::Version>,
22694        {
22695            self.0.request.version = std::option::Option::Some(v.into());
22696            self
22697        }
22698
22699        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
22700        ///
22701        /// This is a **required** field for requests.
22702        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
22703        where
22704            T: std::convert::Into<crate::model::Version>,
22705        {
22706            self.0.request.version = v.map(|x| x.into());
22707            self
22708        }
22709    }
22710
22711    #[doc(hidden)]
22712    impl crate::RequestBuilder for CreateVersion {
22713        fn request_options(&mut self) -> &mut crate::RequestOptions {
22714            &mut self.0.options
22715        }
22716    }
22717
22718    /// The request builder for [Versions::update_version][crate::client::Versions::update_version] calls.
22719    ///
22720    /// # Example
22721    /// ```
22722    /// # use google_cloud_dialogflow_v2::builder::versions::UpdateVersion;
22723    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22724    ///
22725    /// let builder = prepare_request_builder();
22726    /// let response = builder.send().await?;
22727    /// # Ok(()) }
22728    ///
22729    /// fn prepare_request_builder() -> UpdateVersion {
22730    ///   # panic!();
22731    ///   // ... details omitted ...
22732    /// }
22733    /// ```
22734    #[derive(Clone, Debug)]
22735    pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
22736
22737    impl UpdateVersion {
22738        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22739            Self(RequestBuilder::new(stub))
22740        }
22741
22742        /// Sets the full request, replacing any prior values.
22743        pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
22744            self.0.request = v.into();
22745            self
22746        }
22747
22748        /// Sets all the options, replacing any prior values.
22749        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22750            self.0.options = v.into();
22751            self
22752        }
22753
22754        /// Sends the request.
22755        pub async fn send(self) -> Result<crate::model::Version> {
22756            (*self.0.stub)
22757                .update_version(self.0.request, self.0.options)
22758                .await
22759                .map(crate::Response::into_body)
22760        }
22761
22762        /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
22763        ///
22764        /// This is a **required** field for requests.
22765        pub fn set_version<T>(mut self, v: T) -> Self
22766        where
22767            T: std::convert::Into<crate::model::Version>,
22768        {
22769            self.0.request.version = std::option::Option::Some(v.into());
22770            self
22771        }
22772
22773        /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
22774        ///
22775        /// This is a **required** field for requests.
22776        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
22777        where
22778            T: std::convert::Into<crate::model::Version>,
22779        {
22780            self.0.request.version = v.map(|x| x.into());
22781            self
22782        }
22783
22784        /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
22785        ///
22786        /// This is a **required** field for requests.
22787        pub fn set_update_mask<T>(mut self, v: T) -> Self
22788        where
22789            T: std::convert::Into<wkt::FieldMask>,
22790        {
22791            self.0.request.update_mask = std::option::Option::Some(v.into());
22792            self
22793        }
22794
22795        /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
22796        ///
22797        /// This is a **required** field for requests.
22798        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22799        where
22800            T: std::convert::Into<wkt::FieldMask>,
22801        {
22802            self.0.request.update_mask = v.map(|x| x.into());
22803            self
22804        }
22805    }
22806
22807    #[doc(hidden)]
22808    impl crate::RequestBuilder for UpdateVersion {
22809        fn request_options(&mut self) -> &mut crate::RequestOptions {
22810            &mut self.0.options
22811        }
22812    }
22813
22814    /// The request builder for [Versions::delete_version][crate::client::Versions::delete_version] calls.
22815    ///
22816    /// # Example
22817    /// ```
22818    /// # use google_cloud_dialogflow_v2::builder::versions::DeleteVersion;
22819    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22820    ///
22821    /// let builder = prepare_request_builder();
22822    /// let response = builder.send().await?;
22823    /// # Ok(()) }
22824    ///
22825    /// fn prepare_request_builder() -> DeleteVersion {
22826    ///   # panic!();
22827    ///   // ... details omitted ...
22828    /// }
22829    /// ```
22830    #[derive(Clone, Debug)]
22831    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
22832
22833    impl DeleteVersion {
22834        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22835            Self(RequestBuilder::new(stub))
22836        }
22837
22838        /// Sets the full request, replacing any prior values.
22839        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
22840            self.0.request = v.into();
22841            self
22842        }
22843
22844        /// Sets all the options, replacing any prior values.
22845        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22846            self.0.options = v.into();
22847            self
22848        }
22849
22850        /// Sends the request.
22851        pub async fn send(self) -> Result<()> {
22852            (*self.0.stub)
22853                .delete_version(self.0.request, self.0.options)
22854                .await
22855                .map(crate::Response::into_body)
22856        }
22857
22858        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
22859        ///
22860        /// This is a **required** field for requests.
22861        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22862            self.0.request.name = v.into();
22863            self
22864        }
22865    }
22866
22867    #[doc(hidden)]
22868    impl crate::RequestBuilder for DeleteVersion {
22869        fn request_options(&mut self) -> &mut crate::RequestOptions {
22870            &mut self.0.options
22871        }
22872    }
22873
22874    /// The request builder for [Versions::list_locations][crate::client::Versions::list_locations] calls.
22875    ///
22876    /// # Example
22877    /// ```
22878    /// # use google_cloud_dialogflow_v2::builder::versions::ListLocations;
22879    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22880    /// use google_cloud_gax::paginator::ItemPaginator;
22881    ///
22882    /// let builder = prepare_request_builder();
22883    /// let mut items = builder.by_item();
22884    /// while let Some(result) = items.next().await {
22885    ///   let item = result?;
22886    /// }
22887    /// # Ok(()) }
22888    ///
22889    /// fn prepare_request_builder() -> ListLocations {
22890    ///   # panic!();
22891    ///   // ... details omitted ...
22892    /// }
22893    /// ```
22894    #[derive(Clone, Debug)]
22895    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
22896
22897    impl ListLocations {
22898        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22899            Self(RequestBuilder::new(stub))
22900        }
22901
22902        /// Sets the full request, replacing any prior values.
22903        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
22904            mut self,
22905            v: V,
22906        ) -> Self {
22907            self.0.request = v.into();
22908            self
22909        }
22910
22911        /// Sets all the options, replacing any prior values.
22912        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22913            self.0.options = v.into();
22914            self
22915        }
22916
22917        /// Sends the request.
22918        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
22919            (*self.0.stub)
22920                .list_locations(self.0.request, self.0.options)
22921                .await
22922                .map(crate::Response::into_body)
22923        }
22924
22925        /// Streams each page in the collection.
22926        pub fn by_page(
22927            self,
22928        ) -> impl google_cloud_gax::paginator::Paginator<
22929            google_cloud_location::model::ListLocationsResponse,
22930            crate::Error,
22931        > {
22932            use std::clone::Clone;
22933            let token = self.0.request.page_token.clone();
22934            let execute = move |token: String| {
22935                let mut builder = self.clone();
22936                builder.0.request = builder.0.request.set_page_token(token);
22937                builder.send()
22938            };
22939            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22940        }
22941
22942        /// Streams each item in the collection.
22943        pub fn by_item(
22944            self,
22945        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22946            google_cloud_location::model::ListLocationsResponse,
22947            crate::Error,
22948        > {
22949            use google_cloud_gax::paginator::Paginator;
22950            self.by_page().items()
22951        }
22952
22953        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
22954        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22955            self.0.request.name = v.into();
22956            self
22957        }
22958
22959        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
22960        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22961            self.0.request.filter = v.into();
22962            self
22963        }
22964
22965        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
22966        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22967            self.0.request.page_size = v.into();
22968            self
22969        }
22970
22971        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
22972        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22973            self.0.request.page_token = v.into();
22974            self
22975        }
22976    }
22977
22978    #[doc(hidden)]
22979    impl crate::RequestBuilder for ListLocations {
22980        fn request_options(&mut self) -> &mut crate::RequestOptions {
22981            &mut self.0.options
22982        }
22983    }
22984
22985    /// The request builder for [Versions::get_location][crate::client::Versions::get_location] calls.
22986    ///
22987    /// # Example
22988    /// ```
22989    /// # use google_cloud_dialogflow_v2::builder::versions::GetLocation;
22990    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22991    ///
22992    /// let builder = prepare_request_builder();
22993    /// let response = builder.send().await?;
22994    /// # Ok(()) }
22995    ///
22996    /// fn prepare_request_builder() -> GetLocation {
22997    ///   # panic!();
22998    ///   // ... details omitted ...
22999    /// }
23000    /// ```
23001    #[derive(Clone, Debug)]
23002    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
23003
23004    impl GetLocation {
23005        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23006            Self(RequestBuilder::new(stub))
23007        }
23008
23009        /// Sets the full request, replacing any prior values.
23010        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
23011            mut self,
23012            v: V,
23013        ) -> Self {
23014            self.0.request = v.into();
23015            self
23016        }
23017
23018        /// Sets all the options, replacing any prior values.
23019        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23020            self.0.options = v.into();
23021            self
23022        }
23023
23024        /// Sends the request.
23025        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
23026            (*self.0.stub)
23027                .get_location(self.0.request, self.0.options)
23028                .await
23029                .map(crate::Response::into_body)
23030        }
23031
23032        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
23033        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23034            self.0.request.name = v.into();
23035            self
23036        }
23037    }
23038
23039    #[doc(hidden)]
23040    impl crate::RequestBuilder for GetLocation {
23041        fn request_options(&mut self) -> &mut crate::RequestOptions {
23042            &mut self.0.options
23043        }
23044    }
23045
23046    /// The request builder for [Versions::list_operations][crate::client::Versions::list_operations] calls.
23047    ///
23048    /// # Example
23049    /// ```
23050    /// # use google_cloud_dialogflow_v2::builder::versions::ListOperations;
23051    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23052    /// use google_cloud_gax::paginator::ItemPaginator;
23053    ///
23054    /// let builder = prepare_request_builder();
23055    /// let mut items = builder.by_item();
23056    /// while let Some(result) = items.next().await {
23057    ///   let item = result?;
23058    /// }
23059    /// # Ok(()) }
23060    ///
23061    /// fn prepare_request_builder() -> ListOperations {
23062    ///   # panic!();
23063    ///   // ... details omitted ...
23064    /// }
23065    /// ```
23066    #[derive(Clone, Debug)]
23067    pub struct ListOperations(
23068        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
23069    );
23070
23071    impl ListOperations {
23072        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23073            Self(RequestBuilder::new(stub))
23074        }
23075
23076        /// Sets the full request, replacing any prior values.
23077        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
23078            mut self,
23079            v: V,
23080        ) -> Self {
23081            self.0.request = v.into();
23082            self
23083        }
23084
23085        /// Sets all the options, replacing any prior values.
23086        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23087            self.0.options = v.into();
23088            self
23089        }
23090
23091        /// Sends the request.
23092        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
23093            (*self.0.stub)
23094                .list_operations(self.0.request, self.0.options)
23095                .await
23096                .map(crate::Response::into_body)
23097        }
23098
23099        /// Streams each page in the collection.
23100        pub fn by_page(
23101            self,
23102        ) -> impl google_cloud_gax::paginator::Paginator<
23103            google_cloud_longrunning::model::ListOperationsResponse,
23104            crate::Error,
23105        > {
23106            use std::clone::Clone;
23107            let token = self.0.request.page_token.clone();
23108            let execute = move |token: String| {
23109                let mut builder = self.clone();
23110                builder.0.request = builder.0.request.set_page_token(token);
23111                builder.send()
23112            };
23113            google_cloud_gax::paginator::internal::new_paginator(token, execute)
23114        }
23115
23116        /// Streams each item in the collection.
23117        pub fn by_item(
23118            self,
23119        ) -> impl google_cloud_gax::paginator::ItemPaginator<
23120            google_cloud_longrunning::model::ListOperationsResponse,
23121            crate::Error,
23122        > {
23123            use google_cloud_gax::paginator::Paginator;
23124            self.by_page().items()
23125        }
23126
23127        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
23128        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23129            self.0.request.name = v.into();
23130            self
23131        }
23132
23133        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
23134        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
23135            self.0.request.filter = v.into();
23136            self
23137        }
23138
23139        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
23140        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23141            self.0.request.page_size = v.into();
23142            self
23143        }
23144
23145        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
23146        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23147            self.0.request.page_token = v.into();
23148            self
23149        }
23150
23151        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
23152        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
23153            self.0.request.return_partial_success = v.into();
23154            self
23155        }
23156    }
23157
23158    #[doc(hidden)]
23159    impl crate::RequestBuilder for ListOperations {
23160        fn request_options(&mut self) -> &mut crate::RequestOptions {
23161            &mut self.0.options
23162        }
23163    }
23164
23165    /// The request builder for [Versions::get_operation][crate::client::Versions::get_operation] calls.
23166    ///
23167    /// # Example
23168    /// ```
23169    /// # use google_cloud_dialogflow_v2::builder::versions::GetOperation;
23170    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23171    ///
23172    /// let builder = prepare_request_builder();
23173    /// let response = builder.send().await?;
23174    /// # Ok(()) }
23175    ///
23176    /// fn prepare_request_builder() -> GetOperation {
23177    ///   # panic!();
23178    ///   // ... details omitted ...
23179    /// }
23180    /// ```
23181    #[derive(Clone, Debug)]
23182    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
23183
23184    impl GetOperation {
23185        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23186            Self(RequestBuilder::new(stub))
23187        }
23188
23189        /// Sets the full request, replacing any prior values.
23190        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
23191            mut self,
23192            v: V,
23193        ) -> Self {
23194            self.0.request = v.into();
23195            self
23196        }
23197
23198        /// Sets all the options, replacing any prior values.
23199        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23200            self.0.options = v.into();
23201            self
23202        }
23203
23204        /// Sends the request.
23205        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23206            (*self.0.stub)
23207                .get_operation(self.0.request, self.0.options)
23208                .await
23209                .map(crate::Response::into_body)
23210        }
23211
23212        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
23213        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23214            self.0.request.name = v.into();
23215            self
23216        }
23217    }
23218
23219    #[doc(hidden)]
23220    impl crate::RequestBuilder for GetOperation {
23221        fn request_options(&mut self) -> &mut crate::RequestOptions {
23222            &mut self.0.options
23223        }
23224    }
23225
23226    /// The request builder for [Versions::cancel_operation][crate::client::Versions::cancel_operation] calls.
23227    ///
23228    /// # Example
23229    /// ```
23230    /// # use google_cloud_dialogflow_v2::builder::versions::CancelOperation;
23231    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23232    ///
23233    /// let builder = prepare_request_builder();
23234    /// let response = builder.send().await?;
23235    /// # Ok(()) }
23236    ///
23237    /// fn prepare_request_builder() -> CancelOperation {
23238    ///   # panic!();
23239    ///   // ... details omitted ...
23240    /// }
23241    /// ```
23242    #[derive(Clone, Debug)]
23243    pub struct CancelOperation(
23244        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
23245    );
23246
23247    impl CancelOperation {
23248        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23249            Self(RequestBuilder::new(stub))
23250        }
23251
23252        /// Sets the full request, replacing any prior values.
23253        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
23254            mut self,
23255            v: V,
23256        ) -> Self {
23257            self.0.request = v.into();
23258            self
23259        }
23260
23261        /// Sets all the options, replacing any prior values.
23262        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23263            self.0.options = v.into();
23264            self
23265        }
23266
23267        /// Sends the request.
23268        pub async fn send(self) -> Result<()> {
23269            (*self.0.stub)
23270                .cancel_operation(self.0.request, self.0.options)
23271                .await
23272                .map(crate::Response::into_body)
23273        }
23274
23275        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
23276        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23277            self.0.request.name = v.into();
23278            self
23279        }
23280    }
23281
23282    #[doc(hidden)]
23283    impl crate::RequestBuilder for CancelOperation {
23284        fn request_options(&mut self) -> &mut crate::RequestOptions {
23285            &mut self.0.options
23286        }
23287    }
23288}