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#[cfg(feature = "agents")]
18#[cfg_attr(docsrs, doc(cfg(feature = "agents")))]
19pub mod agents {
20    use crate::Result;
21
22    /// A builder for [Agents][crate::client::Agents].
23    ///
24    /// ```
25    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
26    /// # use google_cloud_dialogflow_v2::*;
27    /// # use builder::agents::ClientBuilder;
28    /// # use client::Agents;
29    /// let builder : ClientBuilder = Agents::builder();
30    /// let client = builder
31    ///     .with_endpoint("https://dialogflow.googleapis.com")
32    ///     .build().await?;
33    /// # Ok(()) }
34    /// ```
35    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
36
37    pub(crate) mod client {
38        use super::super::super::client::Agents;
39        pub struct Factory;
40        impl crate::ClientFactory for Factory {
41            type Client = Agents;
42            type Credentials = gaxi::options::Credentials;
43            async fn build(
44                self,
45                config: gaxi::options::ClientConfig,
46            ) -> crate::ClientBuilderResult<Self::Client> {
47                Self::Client::new(config).await
48            }
49        }
50    }
51
52    /// Common implementation for [crate::client::Agents] request builders.
53    #[derive(Clone, Debug)]
54    pub(crate) struct RequestBuilder<R: std::default::Default> {
55        stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>,
56        request: R,
57        options: crate::RequestOptions,
58    }
59
60    impl<R> RequestBuilder<R>
61    where
62        R: std::default::Default,
63    {
64        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
65            Self {
66                stub,
67                request: R::default(),
68                options: crate::RequestOptions::default(),
69            }
70        }
71    }
72
73    /// The request builder for [Agents::get_agent][crate::client::Agents::get_agent] calls.
74    ///
75    /// # Example
76    /// ```
77    /// # use google_cloud_dialogflow_v2::builder::agents::GetAgent;
78    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
79    ///
80    /// let builder = prepare_request_builder();
81    /// let response = builder.send().await?;
82    /// # Ok(()) }
83    ///
84    /// fn prepare_request_builder() -> GetAgent {
85    ///   # panic!();
86    ///   // ... details omitted ...
87    /// }
88    /// ```
89    #[derive(Clone, Debug)]
90    pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
91
92    impl GetAgent {
93        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
94            Self(RequestBuilder::new(stub))
95        }
96
97        /// Sets the full request, replacing any prior values.
98        pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
99            self.0.request = v.into();
100            self
101        }
102
103        /// Sets all the options, replacing any prior values.
104        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
105            self.0.options = v.into();
106            self
107        }
108
109        /// Sends the request.
110        pub async fn send(self) -> Result<crate::model::Agent> {
111            (*self.0.stub)
112                .get_agent(self.0.request, self.0.options)
113                .await
114                .map(crate::Response::into_body)
115        }
116
117        /// Sets the value of [parent][crate::model::GetAgentRequest::parent].
118        ///
119        /// This is a **required** field for requests.
120        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
121            self.0.request.parent = v.into();
122            self
123        }
124    }
125
126    #[doc(hidden)]
127    impl crate::RequestBuilder for GetAgent {
128        fn request_options(&mut self) -> &mut crate::RequestOptions {
129            &mut self.0.options
130        }
131    }
132
133    /// The request builder for [Agents::set_agent][crate::client::Agents::set_agent] calls.
134    ///
135    /// # Example
136    /// ```
137    /// # use google_cloud_dialogflow_v2::builder::agents::SetAgent;
138    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
139    ///
140    /// let builder = prepare_request_builder();
141    /// let response = builder.send().await?;
142    /// # Ok(()) }
143    ///
144    /// fn prepare_request_builder() -> SetAgent {
145    ///   # panic!();
146    ///   // ... details omitted ...
147    /// }
148    /// ```
149    #[derive(Clone, Debug)]
150    pub struct SetAgent(RequestBuilder<crate::model::SetAgentRequest>);
151
152    impl SetAgent {
153        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
154            Self(RequestBuilder::new(stub))
155        }
156
157        /// Sets the full request, replacing any prior values.
158        pub fn with_request<V: Into<crate::model::SetAgentRequest>>(mut self, v: V) -> Self {
159            self.0.request = v.into();
160            self
161        }
162
163        /// Sets all the options, replacing any prior values.
164        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
165            self.0.options = v.into();
166            self
167        }
168
169        /// Sends the request.
170        pub async fn send(self) -> Result<crate::model::Agent> {
171            (*self.0.stub)
172                .set_agent(self.0.request, self.0.options)
173                .await
174                .map(crate::Response::into_body)
175        }
176
177        /// Sets the value of [agent][crate::model::SetAgentRequest::agent].
178        ///
179        /// This is a **required** field for requests.
180        pub fn set_agent<T>(mut self, v: T) -> Self
181        where
182            T: std::convert::Into<crate::model::Agent>,
183        {
184            self.0.request.agent = std::option::Option::Some(v.into());
185            self
186        }
187
188        /// Sets or clears the value of [agent][crate::model::SetAgentRequest::agent].
189        ///
190        /// This is a **required** field for requests.
191        pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
192        where
193            T: std::convert::Into<crate::model::Agent>,
194        {
195            self.0.request.agent = v.map(|x| x.into());
196            self
197        }
198
199        /// Sets the value of [update_mask][crate::model::SetAgentRequest::update_mask].
200        pub fn set_update_mask<T>(mut self, v: T) -> Self
201        where
202            T: std::convert::Into<wkt::FieldMask>,
203        {
204            self.0.request.update_mask = std::option::Option::Some(v.into());
205            self
206        }
207
208        /// Sets or clears the value of [update_mask][crate::model::SetAgentRequest::update_mask].
209        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
210        where
211            T: std::convert::Into<wkt::FieldMask>,
212        {
213            self.0.request.update_mask = v.map(|x| x.into());
214            self
215        }
216    }
217
218    #[doc(hidden)]
219    impl crate::RequestBuilder for SetAgent {
220        fn request_options(&mut self) -> &mut crate::RequestOptions {
221            &mut self.0.options
222        }
223    }
224
225    /// The request builder for [Agents::delete_agent][crate::client::Agents::delete_agent] calls.
226    ///
227    /// # Example
228    /// ```
229    /// # use google_cloud_dialogflow_v2::builder::agents::DeleteAgent;
230    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
231    ///
232    /// let builder = prepare_request_builder();
233    /// let response = builder.send().await?;
234    /// # Ok(()) }
235    ///
236    /// fn prepare_request_builder() -> DeleteAgent {
237    ///   # panic!();
238    ///   // ... details omitted ...
239    /// }
240    /// ```
241    #[derive(Clone, Debug)]
242    pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
243
244    impl DeleteAgent {
245        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
246            Self(RequestBuilder::new(stub))
247        }
248
249        /// Sets the full request, replacing any prior values.
250        pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
251            self.0.request = v.into();
252            self
253        }
254
255        /// Sets all the options, replacing any prior values.
256        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
257            self.0.options = v.into();
258            self
259        }
260
261        /// Sends the request.
262        pub async fn send(self) -> Result<()> {
263            (*self.0.stub)
264                .delete_agent(self.0.request, self.0.options)
265                .await
266                .map(crate::Response::into_body)
267        }
268
269        /// Sets the value of [parent][crate::model::DeleteAgentRequest::parent].
270        ///
271        /// This is a **required** field for requests.
272        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
273            self.0.request.parent = v.into();
274            self
275        }
276    }
277
278    #[doc(hidden)]
279    impl crate::RequestBuilder for DeleteAgent {
280        fn request_options(&mut self) -> &mut crate::RequestOptions {
281            &mut self.0.options
282        }
283    }
284
285    /// The request builder for [Agents::search_agents][crate::client::Agents::search_agents] calls.
286    ///
287    /// # Example
288    /// ```
289    /// # use google_cloud_dialogflow_v2::builder::agents::SearchAgents;
290    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
291    /// use google_cloud_gax::paginator::ItemPaginator;
292    ///
293    /// let builder = prepare_request_builder();
294    /// let mut items = builder.by_item();
295    /// while let Some(result) = items.next().await {
296    ///   let item = result?;
297    /// }
298    /// # Ok(()) }
299    ///
300    /// fn prepare_request_builder() -> SearchAgents {
301    ///   # panic!();
302    ///   // ... details omitted ...
303    /// }
304    /// ```
305    #[derive(Clone, Debug)]
306    pub struct SearchAgents(RequestBuilder<crate::model::SearchAgentsRequest>);
307
308    impl SearchAgents {
309        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
310            Self(RequestBuilder::new(stub))
311        }
312
313        /// Sets the full request, replacing any prior values.
314        pub fn with_request<V: Into<crate::model::SearchAgentsRequest>>(mut self, v: V) -> Self {
315            self.0.request = v.into();
316            self
317        }
318
319        /// Sets all the options, replacing any prior values.
320        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
321            self.0.options = v.into();
322            self
323        }
324
325        /// Sends the request.
326        pub async fn send(self) -> Result<crate::model::SearchAgentsResponse> {
327            (*self.0.stub)
328                .search_agents(self.0.request, self.0.options)
329                .await
330                .map(crate::Response::into_body)
331        }
332
333        /// Streams each page in the collection.
334        pub fn by_page(
335            self,
336        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchAgentsResponse, crate::Error>
337        {
338            use std::clone::Clone;
339            let token = self.0.request.page_token.clone();
340            let execute = move |token: String| {
341                let mut builder = self.clone();
342                builder.0.request = builder.0.request.set_page_token(token);
343                builder.send()
344            };
345            google_cloud_gax::paginator::internal::new_paginator(token, execute)
346        }
347
348        /// Streams each item in the collection.
349        pub fn by_item(
350            self,
351        ) -> impl google_cloud_gax::paginator::ItemPaginator<
352            crate::model::SearchAgentsResponse,
353            crate::Error,
354        > {
355            use google_cloud_gax::paginator::Paginator;
356            self.by_page().items()
357        }
358
359        /// Sets the value of [parent][crate::model::SearchAgentsRequest::parent].
360        ///
361        /// This is a **required** field for requests.
362        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
363            self.0.request.parent = v.into();
364            self
365        }
366
367        /// Sets the value of [page_size][crate::model::SearchAgentsRequest::page_size].
368        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
369            self.0.request.page_size = v.into();
370            self
371        }
372
373        /// Sets the value of [page_token][crate::model::SearchAgentsRequest::page_token].
374        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
375            self.0.request.page_token = v.into();
376            self
377        }
378    }
379
380    #[doc(hidden)]
381    impl crate::RequestBuilder for SearchAgents {
382        fn request_options(&mut self) -> &mut crate::RequestOptions {
383            &mut self.0.options
384        }
385    }
386
387    /// The request builder for [Agents::train_agent][crate::client::Agents::train_agent] calls.
388    ///
389    /// # Example
390    /// ```
391    /// # use google_cloud_dialogflow_v2::builder::agents::TrainAgent;
392    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
393    /// use google_cloud_lro::Poller;
394    ///
395    /// let builder = prepare_request_builder();
396    /// let response = builder.poller().until_done().await?;
397    /// # Ok(()) }
398    ///
399    /// fn prepare_request_builder() -> TrainAgent {
400    ///   # panic!();
401    ///   // ... details omitted ...
402    /// }
403    /// ```
404    #[derive(Clone, Debug)]
405    pub struct TrainAgent(RequestBuilder<crate::model::TrainAgentRequest>);
406
407    impl TrainAgent {
408        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
409            Self(RequestBuilder::new(stub))
410        }
411
412        /// Sets the full request, replacing any prior values.
413        pub fn with_request<V: Into<crate::model::TrainAgentRequest>>(mut self, v: V) -> Self {
414            self.0.request = v.into();
415            self
416        }
417
418        /// Sets all the options, replacing any prior values.
419        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
420            self.0.options = v.into();
421            self
422        }
423
424        /// Sends the request.
425        ///
426        /// # Long running operations
427        ///
428        /// This starts, but does not poll, a longrunning operation. More information
429        /// on [train_agent][crate::client::Agents::train_agent].
430        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
431            (*self.0.stub)
432                .train_agent(self.0.request, self.0.options)
433                .await
434                .map(crate::Response::into_body)
435        }
436
437        /// Creates a [Poller][google_cloud_lro::Poller] to work with `train_agent`.
438        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
439            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
440            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
441            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
442
443            let stub = self.0.stub.clone();
444            let mut options = self.0.options.clone();
445            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
446            let query = move |name| {
447                let stub = stub.clone();
448                let options = options.clone();
449                async {
450                    let op = GetOperation::new(stub)
451                        .set_name(name)
452                        .with_options(options)
453                        .send()
454                        .await?;
455                    Ok(Operation::new(op))
456                }
457            };
458
459            let start = move || async {
460                let op = self.send().await?;
461                Ok(Operation::new(op))
462            };
463
464            google_cloud_lro::internal::new_unit_response_poller(
465                polling_error_policy,
466                polling_backoff_policy,
467                start,
468                query,
469            )
470        }
471
472        /// Sets the value of [parent][crate::model::TrainAgentRequest::parent].
473        ///
474        /// This is a **required** field for requests.
475        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
476            self.0.request.parent = v.into();
477            self
478        }
479    }
480
481    #[doc(hidden)]
482    impl crate::RequestBuilder for TrainAgent {
483        fn request_options(&mut self) -> &mut crate::RequestOptions {
484            &mut self.0.options
485        }
486    }
487
488    /// The request builder for [Agents::export_agent][crate::client::Agents::export_agent] calls.
489    ///
490    /// # Example
491    /// ```
492    /// # use google_cloud_dialogflow_v2::builder::agents::ExportAgent;
493    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
494    /// use google_cloud_lro::Poller;
495    ///
496    /// let builder = prepare_request_builder();
497    /// let response = builder.poller().until_done().await?;
498    /// # Ok(()) }
499    ///
500    /// fn prepare_request_builder() -> ExportAgent {
501    ///   # panic!();
502    ///   // ... details omitted ...
503    /// }
504    /// ```
505    #[derive(Clone, Debug)]
506    pub struct ExportAgent(RequestBuilder<crate::model::ExportAgentRequest>);
507
508    impl ExportAgent {
509        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
510            Self(RequestBuilder::new(stub))
511        }
512
513        /// Sets the full request, replacing any prior values.
514        pub fn with_request<V: Into<crate::model::ExportAgentRequest>>(mut self, v: V) -> Self {
515            self.0.request = v.into();
516            self
517        }
518
519        /// Sets all the options, replacing any prior values.
520        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
521            self.0.options = v.into();
522            self
523        }
524
525        /// Sends the request.
526        ///
527        /// # Long running operations
528        ///
529        /// This starts, but does not poll, a longrunning operation. More information
530        /// on [export_agent][crate::client::Agents::export_agent].
531        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
532            (*self.0.stub)
533                .export_agent(self.0.request, self.0.options)
534                .await
535                .map(crate::Response::into_body)
536        }
537
538        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_agent`.
539        pub fn poller(
540            self,
541        ) -> impl google_cloud_lro::Poller<crate::model::ExportAgentResponse, wkt::Struct> {
542            type Operation = google_cloud_lro::internal::Operation<
543                crate::model::ExportAgentResponse,
544                wkt::Struct,
545            >;
546            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
547            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
548
549            let stub = self.0.stub.clone();
550            let mut options = self.0.options.clone();
551            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
552            let query = move |name| {
553                let stub = stub.clone();
554                let options = options.clone();
555                async {
556                    let op = GetOperation::new(stub)
557                        .set_name(name)
558                        .with_options(options)
559                        .send()
560                        .await?;
561                    Ok(Operation::new(op))
562                }
563            };
564
565            let start = move || async {
566                let op = self.send().await?;
567                Ok(Operation::new(op))
568            };
569
570            google_cloud_lro::internal::new_poller(
571                polling_error_policy,
572                polling_backoff_policy,
573                start,
574                query,
575            )
576        }
577
578        /// Sets the value of [parent][crate::model::ExportAgentRequest::parent].
579        ///
580        /// This is a **required** field for requests.
581        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
582            self.0.request.parent = v.into();
583            self
584        }
585
586        /// Sets the value of [agent_uri][crate::model::ExportAgentRequest::agent_uri].
587        ///
588        /// This is a **required** field for requests.
589        pub fn set_agent_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
590            self.0.request.agent_uri = v.into();
591            self
592        }
593    }
594
595    #[doc(hidden)]
596    impl crate::RequestBuilder for ExportAgent {
597        fn request_options(&mut self) -> &mut crate::RequestOptions {
598            &mut self.0.options
599        }
600    }
601
602    /// The request builder for [Agents::import_agent][crate::client::Agents::import_agent] calls.
603    ///
604    /// # Example
605    /// ```
606    /// # use google_cloud_dialogflow_v2::builder::agents::ImportAgent;
607    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
608    /// use google_cloud_lro::Poller;
609    ///
610    /// let builder = prepare_request_builder();
611    /// let response = builder.poller().until_done().await?;
612    /// # Ok(()) }
613    ///
614    /// fn prepare_request_builder() -> ImportAgent {
615    ///   # panic!();
616    ///   // ... details omitted ...
617    /// }
618    /// ```
619    #[derive(Clone, Debug)]
620    pub struct ImportAgent(RequestBuilder<crate::model::ImportAgentRequest>);
621
622    impl ImportAgent {
623        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
624            Self(RequestBuilder::new(stub))
625        }
626
627        /// Sets the full request, replacing any prior values.
628        pub fn with_request<V: Into<crate::model::ImportAgentRequest>>(mut self, v: V) -> Self {
629            self.0.request = v.into();
630            self
631        }
632
633        /// Sets all the options, replacing any prior values.
634        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
635            self.0.options = v.into();
636            self
637        }
638
639        /// Sends the request.
640        ///
641        /// # Long running operations
642        ///
643        /// This starts, but does not poll, a longrunning operation. More information
644        /// on [import_agent][crate::client::Agents::import_agent].
645        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
646            (*self.0.stub)
647                .import_agent(self.0.request, self.0.options)
648                .await
649                .map(crate::Response::into_body)
650        }
651
652        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_agent`.
653        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
654            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
655            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
656            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
657
658            let stub = self.0.stub.clone();
659            let mut options = self.0.options.clone();
660            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
661            let query = move |name| {
662                let stub = stub.clone();
663                let options = options.clone();
664                async {
665                    let op = GetOperation::new(stub)
666                        .set_name(name)
667                        .with_options(options)
668                        .send()
669                        .await?;
670                    Ok(Operation::new(op))
671                }
672            };
673
674            let start = move || async {
675                let op = self.send().await?;
676                Ok(Operation::new(op))
677            };
678
679            google_cloud_lro::internal::new_unit_response_poller(
680                polling_error_policy,
681                polling_backoff_policy,
682                start,
683                query,
684            )
685        }
686
687        /// Sets the value of [parent][crate::model::ImportAgentRequest::parent].
688        ///
689        /// This is a **required** field for requests.
690        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
691            self.0.request.parent = v.into();
692            self
693        }
694
695        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent].
696        ///
697        /// Note that all the setters affecting `agent` are
698        /// mutually exclusive.
699        pub fn set_agent<T: Into<Option<crate::model::import_agent_request::Agent>>>(
700            mut self,
701            v: T,
702        ) -> Self {
703            self.0.request.agent = v.into();
704            self
705        }
706
707        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
708        /// to hold a `AgentUri`.
709        ///
710        /// Note that all the setters affecting `agent` are
711        /// mutually exclusive.
712        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
713            self.0.request = self.0.request.set_agent_uri(v);
714            self
715        }
716
717        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
718        /// to hold a `AgentContent`.
719        ///
720        /// Note that all the setters affecting `agent` are
721        /// mutually exclusive.
722        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
723            self.0.request = self.0.request.set_agent_content(v);
724            self
725        }
726    }
727
728    #[doc(hidden)]
729    impl crate::RequestBuilder for ImportAgent {
730        fn request_options(&mut self) -> &mut crate::RequestOptions {
731            &mut self.0.options
732        }
733    }
734
735    /// The request builder for [Agents::restore_agent][crate::client::Agents::restore_agent] calls.
736    ///
737    /// # Example
738    /// ```
739    /// # use google_cloud_dialogflow_v2::builder::agents::RestoreAgent;
740    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
741    /// use google_cloud_lro::Poller;
742    ///
743    /// let builder = prepare_request_builder();
744    /// let response = builder.poller().until_done().await?;
745    /// # Ok(()) }
746    ///
747    /// fn prepare_request_builder() -> RestoreAgent {
748    ///   # panic!();
749    ///   // ... details omitted ...
750    /// }
751    /// ```
752    #[derive(Clone, Debug)]
753    pub struct RestoreAgent(RequestBuilder<crate::model::RestoreAgentRequest>);
754
755    impl RestoreAgent {
756        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
757            Self(RequestBuilder::new(stub))
758        }
759
760        /// Sets the full request, replacing any prior values.
761        pub fn with_request<V: Into<crate::model::RestoreAgentRequest>>(mut self, v: V) -> Self {
762            self.0.request = v.into();
763            self
764        }
765
766        /// Sets all the options, replacing any prior values.
767        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
768            self.0.options = v.into();
769            self
770        }
771
772        /// Sends the request.
773        ///
774        /// # Long running operations
775        ///
776        /// This starts, but does not poll, a longrunning operation. More information
777        /// on [restore_agent][crate::client::Agents::restore_agent].
778        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
779            (*self.0.stub)
780                .restore_agent(self.0.request, self.0.options)
781                .await
782                .map(crate::Response::into_body)
783        }
784
785        /// Creates a [Poller][google_cloud_lro::Poller] to work with `restore_agent`.
786        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
787            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
788            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
789            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
790
791            let stub = self.0.stub.clone();
792            let mut options = self.0.options.clone();
793            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
794            let query = move |name| {
795                let stub = stub.clone();
796                let options = options.clone();
797                async {
798                    let op = GetOperation::new(stub)
799                        .set_name(name)
800                        .with_options(options)
801                        .send()
802                        .await?;
803                    Ok(Operation::new(op))
804                }
805            };
806
807            let start = move || async {
808                let op = self.send().await?;
809                Ok(Operation::new(op))
810            };
811
812            google_cloud_lro::internal::new_unit_response_poller(
813                polling_error_policy,
814                polling_backoff_policy,
815                start,
816                query,
817            )
818        }
819
820        /// Sets the value of [parent][crate::model::RestoreAgentRequest::parent].
821        ///
822        /// This is a **required** field for requests.
823        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
824            self.0.request.parent = v.into();
825            self
826        }
827
828        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent].
829        ///
830        /// Note that all the setters affecting `agent` are
831        /// mutually exclusive.
832        pub fn set_agent<T: Into<Option<crate::model::restore_agent_request::Agent>>>(
833            mut self,
834            v: T,
835        ) -> Self {
836            self.0.request.agent = v.into();
837            self
838        }
839
840        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
841        /// to hold a `AgentUri`.
842        ///
843        /// Note that all the setters affecting `agent` are
844        /// mutually exclusive.
845        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
846            self.0.request = self.0.request.set_agent_uri(v);
847            self
848        }
849
850        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
851        /// to hold a `AgentContent`.
852        ///
853        /// Note that all the setters affecting `agent` are
854        /// mutually exclusive.
855        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
856            self.0.request = self.0.request.set_agent_content(v);
857            self
858        }
859    }
860
861    #[doc(hidden)]
862    impl crate::RequestBuilder for RestoreAgent {
863        fn request_options(&mut self) -> &mut crate::RequestOptions {
864            &mut self.0.options
865        }
866    }
867
868    /// The request builder for [Agents::get_validation_result][crate::client::Agents::get_validation_result] calls.
869    ///
870    /// # Example
871    /// ```
872    /// # use google_cloud_dialogflow_v2::builder::agents::GetValidationResult;
873    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
874    ///
875    /// let builder = prepare_request_builder();
876    /// let response = builder.send().await?;
877    /// # Ok(()) }
878    ///
879    /// fn prepare_request_builder() -> GetValidationResult {
880    ///   # panic!();
881    ///   // ... details omitted ...
882    /// }
883    /// ```
884    #[derive(Clone, Debug)]
885    pub struct GetValidationResult(RequestBuilder<crate::model::GetValidationResultRequest>);
886
887    impl GetValidationResult {
888        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
889            Self(RequestBuilder::new(stub))
890        }
891
892        /// Sets the full request, replacing any prior values.
893        pub fn with_request<V: Into<crate::model::GetValidationResultRequest>>(
894            mut self,
895            v: V,
896        ) -> Self {
897            self.0.request = v.into();
898            self
899        }
900
901        /// Sets all the options, replacing any prior values.
902        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
903            self.0.options = v.into();
904            self
905        }
906
907        /// Sends the request.
908        pub async fn send(self) -> Result<crate::model::ValidationResult> {
909            (*self.0.stub)
910                .get_validation_result(self.0.request, self.0.options)
911                .await
912                .map(crate::Response::into_body)
913        }
914
915        /// Sets the value of [parent][crate::model::GetValidationResultRequest::parent].
916        ///
917        /// This is a **required** field for requests.
918        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
919            self.0.request.parent = v.into();
920            self
921        }
922
923        /// Sets the value of [language_code][crate::model::GetValidationResultRequest::language_code].
924        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
925            self.0.request.language_code = v.into();
926            self
927        }
928    }
929
930    #[doc(hidden)]
931    impl crate::RequestBuilder for GetValidationResult {
932        fn request_options(&mut self) -> &mut crate::RequestOptions {
933            &mut self.0.options
934        }
935    }
936
937    /// The request builder for [Agents::list_locations][crate::client::Agents::list_locations] calls.
938    ///
939    /// # Example
940    /// ```
941    /// # use google_cloud_dialogflow_v2::builder::agents::ListLocations;
942    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
943    /// use google_cloud_gax::paginator::ItemPaginator;
944    ///
945    /// let builder = prepare_request_builder();
946    /// let mut items = builder.by_item();
947    /// while let Some(result) = items.next().await {
948    ///   let item = result?;
949    /// }
950    /// # Ok(()) }
951    ///
952    /// fn prepare_request_builder() -> ListLocations {
953    ///   # panic!();
954    ///   // ... details omitted ...
955    /// }
956    /// ```
957    #[derive(Clone, Debug)]
958    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
959
960    impl ListLocations {
961        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
962            Self(RequestBuilder::new(stub))
963        }
964
965        /// Sets the full request, replacing any prior values.
966        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
967            mut self,
968            v: V,
969        ) -> Self {
970            self.0.request = v.into();
971            self
972        }
973
974        /// Sets all the options, replacing any prior values.
975        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
976            self.0.options = v.into();
977            self
978        }
979
980        /// Sends the request.
981        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
982            (*self.0.stub)
983                .list_locations(self.0.request, self.0.options)
984                .await
985                .map(crate::Response::into_body)
986        }
987
988        /// Streams each page in the collection.
989        pub fn by_page(
990            self,
991        ) -> impl google_cloud_gax::paginator::Paginator<
992            google_cloud_location::model::ListLocationsResponse,
993            crate::Error,
994        > {
995            use std::clone::Clone;
996            let token = self.0.request.page_token.clone();
997            let execute = move |token: String| {
998                let mut builder = self.clone();
999                builder.0.request = builder.0.request.set_page_token(token);
1000                builder.send()
1001            };
1002            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1003        }
1004
1005        /// Streams each item in the collection.
1006        pub fn by_item(
1007            self,
1008        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1009            google_cloud_location::model::ListLocationsResponse,
1010            crate::Error,
1011        > {
1012            use google_cloud_gax::paginator::Paginator;
1013            self.by_page().items()
1014        }
1015
1016        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1017        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1018            self.0.request.name = v.into();
1019            self
1020        }
1021
1022        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1023        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1024            self.0.request.filter = v.into();
1025            self
1026        }
1027
1028        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1029        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1030            self.0.request.page_size = v.into();
1031            self
1032        }
1033
1034        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1035        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1036            self.0.request.page_token = v.into();
1037            self
1038        }
1039    }
1040
1041    #[doc(hidden)]
1042    impl crate::RequestBuilder for ListLocations {
1043        fn request_options(&mut self) -> &mut crate::RequestOptions {
1044            &mut self.0.options
1045        }
1046    }
1047
1048    /// The request builder for [Agents::get_location][crate::client::Agents::get_location] calls.
1049    ///
1050    /// # Example
1051    /// ```
1052    /// # use google_cloud_dialogflow_v2::builder::agents::GetLocation;
1053    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1054    ///
1055    /// let builder = prepare_request_builder();
1056    /// let response = builder.send().await?;
1057    /// # Ok(()) }
1058    ///
1059    /// fn prepare_request_builder() -> GetLocation {
1060    ///   # panic!();
1061    ///   // ... details omitted ...
1062    /// }
1063    /// ```
1064    #[derive(Clone, Debug)]
1065    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1066
1067    impl GetLocation {
1068        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1069            Self(RequestBuilder::new(stub))
1070        }
1071
1072        /// Sets the full request, replacing any prior values.
1073        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1074            mut self,
1075            v: V,
1076        ) -> Self {
1077            self.0.request = v.into();
1078            self
1079        }
1080
1081        /// Sets all the options, replacing any prior values.
1082        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1083            self.0.options = v.into();
1084            self
1085        }
1086
1087        /// Sends the request.
1088        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1089            (*self.0.stub)
1090                .get_location(self.0.request, self.0.options)
1091                .await
1092                .map(crate::Response::into_body)
1093        }
1094
1095        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1096        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1097            self.0.request.name = v.into();
1098            self
1099        }
1100    }
1101
1102    #[doc(hidden)]
1103    impl crate::RequestBuilder for GetLocation {
1104        fn request_options(&mut self) -> &mut crate::RequestOptions {
1105            &mut self.0.options
1106        }
1107    }
1108
1109    /// The request builder for [Agents::list_operations][crate::client::Agents::list_operations] calls.
1110    ///
1111    /// # Example
1112    /// ```
1113    /// # use google_cloud_dialogflow_v2::builder::agents::ListOperations;
1114    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1115    /// use google_cloud_gax::paginator::ItemPaginator;
1116    ///
1117    /// let builder = prepare_request_builder();
1118    /// let mut items = builder.by_item();
1119    /// while let Some(result) = items.next().await {
1120    ///   let item = result?;
1121    /// }
1122    /// # Ok(()) }
1123    ///
1124    /// fn prepare_request_builder() -> ListOperations {
1125    ///   # panic!();
1126    ///   // ... details omitted ...
1127    /// }
1128    /// ```
1129    #[derive(Clone, Debug)]
1130    pub struct ListOperations(
1131        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1132    );
1133
1134    impl ListOperations {
1135        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1136            Self(RequestBuilder::new(stub))
1137        }
1138
1139        /// Sets the full request, replacing any prior values.
1140        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1141            mut self,
1142            v: V,
1143        ) -> Self {
1144            self.0.request = v.into();
1145            self
1146        }
1147
1148        /// Sets all the options, replacing any prior values.
1149        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1150            self.0.options = v.into();
1151            self
1152        }
1153
1154        /// Sends the request.
1155        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1156            (*self.0.stub)
1157                .list_operations(self.0.request, self.0.options)
1158                .await
1159                .map(crate::Response::into_body)
1160        }
1161
1162        /// Streams each page in the collection.
1163        pub fn by_page(
1164            self,
1165        ) -> impl google_cloud_gax::paginator::Paginator<
1166            google_cloud_longrunning::model::ListOperationsResponse,
1167            crate::Error,
1168        > {
1169            use std::clone::Clone;
1170            let token = self.0.request.page_token.clone();
1171            let execute = move |token: String| {
1172                let mut builder = self.clone();
1173                builder.0.request = builder.0.request.set_page_token(token);
1174                builder.send()
1175            };
1176            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1177        }
1178
1179        /// Streams each item in the collection.
1180        pub fn by_item(
1181            self,
1182        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1183            google_cloud_longrunning::model::ListOperationsResponse,
1184            crate::Error,
1185        > {
1186            use google_cloud_gax::paginator::Paginator;
1187            self.by_page().items()
1188        }
1189
1190        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1191        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1192            self.0.request.name = v.into();
1193            self
1194        }
1195
1196        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1197        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1198            self.0.request.filter = v.into();
1199            self
1200        }
1201
1202        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1203        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1204            self.0.request.page_size = v.into();
1205            self
1206        }
1207
1208        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1209        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1210            self.0.request.page_token = v.into();
1211            self
1212        }
1213
1214        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1215        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1216            self.0.request.return_partial_success = v.into();
1217            self
1218        }
1219    }
1220
1221    #[doc(hidden)]
1222    impl crate::RequestBuilder for ListOperations {
1223        fn request_options(&mut self) -> &mut crate::RequestOptions {
1224            &mut self.0.options
1225        }
1226    }
1227
1228    /// The request builder for [Agents::get_operation][crate::client::Agents::get_operation] calls.
1229    ///
1230    /// # Example
1231    /// ```
1232    /// # use google_cloud_dialogflow_v2::builder::agents::GetOperation;
1233    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1234    ///
1235    /// let builder = prepare_request_builder();
1236    /// let response = builder.send().await?;
1237    /// # Ok(()) }
1238    ///
1239    /// fn prepare_request_builder() -> GetOperation {
1240    ///   # panic!();
1241    ///   // ... details omitted ...
1242    /// }
1243    /// ```
1244    #[derive(Clone, Debug)]
1245    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1246
1247    impl GetOperation {
1248        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1249            Self(RequestBuilder::new(stub))
1250        }
1251
1252        /// Sets the full request, replacing any prior values.
1253        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1254            mut self,
1255            v: V,
1256        ) -> Self {
1257            self.0.request = v.into();
1258            self
1259        }
1260
1261        /// Sets all the options, replacing any prior values.
1262        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1263            self.0.options = v.into();
1264            self
1265        }
1266
1267        /// Sends the request.
1268        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1269            (*self.0.stub)
1270                .get_operation(self.0.request, self.0.options)
1271                .await
1272                .map(crate::Response::into_body)
1273        }
1274
1275        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1276        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1277            self.0.request.name = v.into();
1278            self
1279        }
1280    }
1281
1282    #[doc(hidden)]
1283    impl crate::RequestBuilder for GetOperation {
1284        fn request_options(&mut self) -> &mut crate::RequestOptions {
1285            &mut self.0.options
1286        }
1287    }
1288
1289    /// The request builder for [Agents::cancel_operation][crate::client::Agents::cancel_operation] calls.
1290    ///
1291    /// # Example
1292    /// ```
1293    /// # use google_cloud_dialogflow_v2::builder::agents::CancelOperation;
1294    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1295    ///
1296    /// let builder = prepare_request_builder();
1297    /// let response = builder.send().await?;
1298    /// # Ok(()) }
1299    ///
1300    /// fn prepare_request_builder() -> CancelOperation {
1301    ///   # panic!();
1302    ///   // ... details omitted ...
1303    /// }
1304    /// ```
1305    #[derive(Clone, Debug)]
1306    pub struct CancelOperation(
1307        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1308    );
1309
1310    impl CancelOperation {
1311        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1312            Self(RequestBuilder::new(stub))
1313        }
1314
1315        /// Sets the full request, replacing any prior values.
1316        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1317            mut self,
1318            v: V,
1319        ) -> Self {
1320            self.0.request = v.into();
1321            self
1322        }
1323
1324        /// Sets all the options, replacing any prior values.
1325        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1326            self.0.options = v.into();
1327            self
1328        }
1329
1330        /// Sends the request.
1331        pub async fn send(self) -> Result<()> {
1332            (*self.0.stub)
1333                .cancel_operation(self.0.request, self.0.options)
1334                .await
1335                .map(crate::Response::into_body)
1336        }
1337
1338        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1339        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1340            self.0.request.name = v.into();
1341            self
1342        }
1343    }
1344
1345    #[doc(hidden)]
1346    impl crate::RequestBuilder for CancelOperation {
1347        fn request_options(&mut self) -> &mut crate::RequestOptions {
1348            &mut self.0.options
1349        }
1350    }
1351}
1352
1353#[cfg(feature = "answer-records")]
1354#[cfg_attr(docsrs, doc(cfg(feature = "answer-records")))]
1355pub mod answer_records {
1356    use crate::Result;
1357
1358    /// A builder for [AnswerRecords][crate::client::AnswerRecords].
1359    ///
1360    /// ```
1361    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1362    /// # use google_cloud_dialogflow_v2::*;
1363    /// # use builder::answer_records::ClientBuilder;
1364    /// # use client::AnswerRecords;
1365    /// let builder : ClientBuilder = AnswerRecords::builder();
1366    /// let client = builder
1367    ///     .with_endpoint("https://dialogflow.googleapis.com")
1368    ///     .build().await?;
1369    /// # Ok(()) }
1370    /// ```
1371    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1372
1373    pub(crate) mod client {
1374        use super::super::super::client::AnswerRecords;
1375        pub struct Factory;
1376        impl crate::ClientFactory for Factory {
1377            type Client = AnswerRecords;
1378            type Credentials = gaxi::options::Credentials;
1379            async fn build(
1380                self,
1381                config: gaxi::options::ClientConfig,
1382            ) -> crate::ClientBuilderResult<Self::Client> {
1383                Self::Client::new(config).await
1384            }
1385        }
1386    }
1387
1388    /// Common implementation for [crate::client::AnswerRecords] request builders.
1389    #[derive(Clone, Debug)]
1390    pub(crate) struct RequestBuilder<R: std::default::Default> {
1391        stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1392        request: R,
1393        options: crate::RequestOptions,
1394    }
1395
1396    impl<R> RequestBuilder<R>
1397    where
1398        R: std::default::Default,
1399    {
1400        pub(crate) fn new(
1401            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1402        ) -> Self {
1403            Self {
1404                stub,
1405                request: R::default(),
1406                options: crate::RequestOptions::default(),
1407            }
1408        }
1409    }
1410
1411    /// The request builder for [AnswerRecords::list_answer_records][crate::client::AnswerRecords::list_answer_records] calls.
1412    ///
1413    /// # Example
1414    /// ```
1415    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListAnswerRecords;
1416    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1417    /// use google_cloud_gax::paginator::ItemPaginator;
1418    ///
1419    /// let builder = prepare_request_builder();
1420    /// let mut items = builder.by_item();
1421    /// while let Some(result) = items.next().await {
1422    ///   let item = result?;
1423    /// }
1424    /// # Ok(()) }
1425    ///
1426    /// fn prepare_request_builder() -> ListAnswerRecords {
1427    ///   # panic!();
1428    ///   // ... details omitted ...
1429    /// }
1430    /// ```
1431    #[derive(Clone, Debug)]
1432    pub struct ListAnswerRecords(RequestBuilder<crate::model::ListAnswerRecordsRequest>);
1433
1434    impl ListAnswerRecords {
1435        pub(crate) fn new(
1436            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1437        ) -> Self {
1438            Self(RequestBuilder::new(stub))
1439        }
1440
1441        /// Sets the full request, replacing any prior values.
1442        pub fn with_request<V: Into<crate::model::ListAnswerRecordsRequest>>(
1443            mut self,
1444            v: V,
1445        ) -> Self {
1446            self.0.request = v.into();
1447            self
1448        }
1449
1450        /// Sets all the options, replacing any prior values.
1451        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1452            self.0.options = v.into();
1453            self
1454        }
1455
1456        /// Sends the request.
1457        pub async fn send(self) -> Result<crate::model::ListAnswerRecordsResponse> {
1458            (*self.0.stub)
1459                .list_answer_records(self.0.request, self.0.options)
1460                .await
1461                .map(crate::Response::into_body)
1462        }
1463
1464        /// Streams each page in the collection.
1465        pub fn by_page(
1466            self,
1467        ) -> impl google_cloud_gax::paginator::Paginator<
1468            crate::model::ListAnswerRecordsResponse,
1469            crate::Error,
1470        > {
1471            use std::clone::Clone;
1472            let token = self.0.request.page_token.clone();
1473            let execute = move |token: String| {
1474                let mut builder = self.clone();
1475                builder.0.request = builder.0.request.set_page_token(token);
1476                builder.send()
1477            };
1478            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1479        }
1480
1481        /// Streams each item in the collection.
1482        pub fn by_item(
1483            self,
1484        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1485            crate::model::ListAnswerRecordsResponse,
1486            crate::Error,
1487        > {
1488            use google_cloud_gax::paginator::Paginator;
1489            self.by_page().items()
1490        }
1491
1492        /// Sets the value of [parent][crate::model::ListAnswerRecordsRequest::parent].
1493        ///
1494        /// This is a **required** field for requests.
1495        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496            self.0.request.parent = v.into();
1497            self
1498        }
1499
1500        /// Sets the value of [filter][crate::model::ListAnswerRecordsRequest::filter].
1501        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1502            self.0.request.filter = v.into();
1503            self
1504        }
1505
1506        /// Sets the value of [page_size][crate::model::ListAnswerRecordsRequest::page_size].
1507        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1508            self.0.request.page_size = v.into();
1509            self
1510        }
1511
1512        /// Sets the value of [page_token][crate::model::ListAnswerRecordsRequest::page_token].
1513        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1514            self.0.request.page_token = v.into();
1515            self
1516        }
1517    }
1518
1519    #[doc(hidden)]
1520    impl crate::RequestBuilder for ListAnswerRecords {
1521        fn request_options(&mut self) -> &mut crate::RequestOptions {
1522            &mut self.0.options
1523        }
1524    }
1525
1526    /// The request builder for [AnswerRecords::update_answer_record][crate::client::AnswerRecords::update_answer_record] calls.
1527    ///
1528    /// # Example
1529    /// ```
1530    /// # use google_cloud_dialogflow_v2::builder::answer_records::UpdateAnswerRecord;
1531    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1532    ///
1533    /// let builder = prepare_request_builder();
1534    /// let response = builder.send().await?;
1535    /// # Ok(()) }
1536    ///
1537    /// fn prepare_request_builder() -> UpdateAnswerRecord {
1538    ///   # panic!();
1539    ///   // ... details omitted ...
1540    /// }
1541    /// ```
1542    #[derive(Clone, Debug)]
1543    pub struct UpdateAnswerRecord(RequestBuilder<crate::model::UpdateAnswerRecordRequest>);
1544
1545    impl UpdateAnswerRecord {
1546        pub(crate) fn new(
1547            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1548        ) -> Self {
1549            Self(RequestBuilder::new(stub))
1550        }
1551
1552        /// Sets the full request, replacing any prior values.
1553        pub fn with_request<V: Into<crate::model::UpdateAnswerRecordRequest>>(
1554            mut self,
1555            v: V,
1556        ) -> Self {
1557            self.0.request = v.into();
1558            self
1559        }
1560
1561        /// Sets all the options, replacing any prior values.
1562        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1563            self.0.options = v.into();
1564            self
1565        }
1566
1567        /// Sends the request.
1568        pub async fn send(self) -> Result<crate::model::AnswerRecord> {
1569            (*self.0.stub)
1570                .update_answer_record(self.0.request, self.0.options)
1571                .await
1572                .map(crate::Response::into_body)
1573        }
1574
1575        /// Sets the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1576        ///
1577        /// This is a **required** field for requests.
1578        pub fn set_answer_record<T>(mut self, v: T) -> Self
1579        where
1580            T: std::convert::Into<crate::model::AnswerRecord>,
1581        {
1582            self.0.request.answer_record = std::option::Option::Some(v.into());
1583            self
1584        }
1585
1586        /// Sets or clears the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1587        ///
1588        /// This is a **required** field for requests.
1589        pub fn set_or_clear_answer_record<T>(mut self, v: std::option::Option<T>) -> Self
1590        where
1591            T: std::convert::Into<crate::model::AnswerRecord>,
1592        {
1593            self.0.request.answer_record = v.map(|x| x.into());
1594            self
1595        }
1596
1597        /// Sets the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1598        ///
1599        /// This is a **required** field for requests.
1600        pub fn set_update_mask<T>(mut self, v: T) -> Self
1601        where
1602            T: std::convert::Into<wkt::FieldMask>,
1603        {
1604            self.0.request.update_mask = std::option::Option::Some(v.into());
1605            self
1606        }
1607
1608        /// Sets or clears the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1609        ///
1610        /// This is a **required** field for requests.
1611        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1612        where
1613            T: std::convert::Into<wkt::FieldMask>,
1614        {
1615            self.0.request.update_mask = v.map(|x| x.into());
1616            self
1617        }
1618    }
1619
1620    #[doc(hidden)]
1621    impl crate::RequestBuilder for UpdateAnswerRecord {
1622        fn request_options(&mut self) -> &mut crate::RequestOptions {
1623            &mut self.0.options
1624        }
1625    }
1626
1627    /// The request builder for [AnswerRecords::list_locations][crate::client::AnswerRecords::list_locations] calls.
1628    ///
1629    /// # Example
1630    /// ```
1631    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListLocations;
1632    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1633    /// use google_cloud_gax::paginator::ItemPaginator;
1634    ///
1635    /// let builder = prepare_request_builder();
1636    /// let mut items = builder.by_item();
1637    /// while let Some(result) = items.next().await {
1638    ///   let item = result?;
1639    /// }
1640    /// # Ok(()) }
1641    ///
1642    /// fn prepare_request_builder() -> ListLocations {
1643    ///   # panic!();
1644    ///   // ... details omitted ...
1645    /// }
1646    /// ```
1647    #[derive(Clone, Debug)]
1648    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1649
1650    impl ListLocations {
1651        pub(crate) fn new(
1652            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1653        ) -> Self {
1654            Self(RequestBuilder::new(stub))
1655        }
1656
1657        /// Sets the full request, replacing any prior values.
1658        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1659            mut self,
1660            v: V,
1661        ) -> Self {
1662            self.0.request = v.into();
1663            self
1664        }
1665
1666        /// Sets all the options, replacing any prior values.
1667        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1668            self.0.options = v.into();
1669            self
1670        }
1671
1672        /// Sends the request.
1673        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1674            (*self.0.stub)
1675                .list_locations(self.0.request, self.0.options)
1676                .await
1677                .map(crate::Response::into_body)
1678        }
1679
1680        /// Streams each page in the collection.
1681        pub fn by_page(
1682            self,
1683        ) -> impl google_cloud_gax::paginator::Paginator<
1684            google_cloud_location::model::ListLocationsResponse,
1685            crate::Error,
1686        > {
1687            use std::clone::Clone;
1688            let token = self.0.request.page_token.clone();
1689            let execute = move |token: String| {
1690                let mut builder = self.clone();
1691                builder.0.request = builder.0.request.set_page_token(token);
1692                builder.send()
1693            };
1694            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1695        }
1696
1697        /// Streams each item in the collection.
1698        pub fn by_item(
1699            self,
1700        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1701            google_cloud_location::model::ListLocationsResponse,
1702            crate::Error,
1703        > {
1704            use google_cloud_gax::paginator::Paginator;
1705            self.by_page().items()
1706        }
1707
1708        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1709        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1710            self.0.request.name = v.into();
1711            self
1712        }
1713
1714        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1715        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1716            self.0.request.filter = v.into();
1717            self
1718        }
1719
1720        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1721        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1722            self.0.request.page_size = v.into();
1723            self
1724        }
1725
1726        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1727        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1728            self.0.request.page_token = v.into();
1729            self
1730        }
1731    }
1732
1733    #[doc(hidden)]
1734    impl crate::RequestBuilder for ListLocations {
1735        fn request_options(&mut self) -> &mut crate::RequestOptions {
1736            &mut self.0.options
1737        }
1738    }
1739
1740    /// The request builder for [AnswerRecords::get_location][crate::client::AnswerRecords::get_location] calls.
1741    ///
1742    /// # Example
1743    /// ```
1744    /// # use google_cloud_dialogflow_v2::builder::answer_records::GetLocation;
1745    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1746    ///
1747    /// let builder = prepare_request_builder();
1748    /// let response = builder.send().await?;
1749    /// # Ok(()) }
1750    ///
1751    /// fn prepare_request_builder() -> GetLocation {
1752    ///   # panic!();
1753    ///   // ... details omitted ...
1754    /// }
1755    /// ```
1756    #[derive(Clone, Debug)]
1757    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1758
1759    impl GetLocation {
1760        pub(crate) fn new(
1761            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1762        ) -> Self {
1763            Self(RequestBuilder::new(stub))
1764        }
1765
1766        /// Sets the full request, replacing any prior values.
1767        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1768            mut self,
1769            v: V,
1770        ) -> Self {
1771            self.0.request = v.into();
1772            self
1773        }
1774
1775        /// Sets all the options, replacing any prior values.
1776        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1777            self.0.options = v.into();
1778            self
1779        }
1780
1781        /// Sends the request.
1782        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1783            (*self.0.stub)
1784                .get_location(self.0.request, self.0.options)
1785                .await
1786                .map(crate::Response::into_body)
1787        }
1788
1789        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1790        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1791            self.0.request.name = v.into();
1792            self
1793        }
1794    }
1795
1796    #[doc(hidden)]
1797    impl crate::RequestBuilder for GetLocation {
1798        fn request_options(&mut self) -> &mut crate::RequestOptions {
1799            &mut self.0.options
1800        }
1801    }
1802
1803    /// The request builder for [AnswerRecords::list_operations][crate::client::AnswerRecords::list_operations] calls.
1804    ///
1805    /// # Example
1806    /// ```
1807    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListOperations;
1808    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1809    /// use google_cloud_gax::paginator::ItemPaginator;
1810    ///
1811    /// let builder = prepare_request_builder();
1812    /// let mut items = builder.by_item();
1813    /// while let Some(result) = items.next().await {
1814    ///   let item = result?;
1815    /// }
1816    /// # Ok(()) }
1817    ///
1818    /// fn prepare_request_builder() -> ListOperations {
1819    ///   # panic!();
1820    ///   // ... details omitted ...
1821    /// }
1822    /// ```
1823    #[derive(Clone, Debug)]
1824    pub struct ListOperations(
1825        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1826    );
1827
1828    impl ListOperations {
1829        pub(crate) fn new(
1830            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1831        ) -> Self {
1832            Self(RequestBuilder::new(stub))
1833        }
1834
1835        /// Sets the full request, replacing any prior values.
1836        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1837            mut self,
1838            v: V,
1839        ) -> Self {
1840            self.0.request = v.into();
1841            self
1842        }
1843
1844        /// Sets all the options, replacing any prior values.
1845        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1846            self.0.options = v.into();
1847            self
1848        }
1849
1850        /// Sends the request.
1851        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1852            (*self.0.stub)
1853                .list_operations(self.0.request, self.0.options)
1854                .await
1855                .map(crate::Response::into_body)
1856        }
1857
1858        /// Streams each page in the collection.
1859        pub fn by_page(
1860            self,
1861        ) -> impl google_cloud_gax::paginator::Paginator<
1862            google_cloud_longrunning::model::ListOperationsResponse,
1863            crate::Error,
1864        > {
1865            use std::clone::Clone;
1866            let token = self.0.request.page_token.clone();
1867            let execute = move |token: String| {
1868                let mut builder = self.clone();
1869                builder.0.request = builder.0.request.set_page_token(token);
1870                builder.send()
1871            };
1872            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1873        }
1874
1875        /// Streams each item in the collection.
1876        pub fn by_item(
1877            self,
1878        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1879            google_cloud_longrunning::model::ListOperationsResponse,
1880            crate::Error,
1881        > {
1882            use google_cloud_gax::paginator::Paginator;
1883            self.by_page().items()
1884        }
1885
1886        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1887        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1888            self.0.request.name = v.into();
1889            self
1890        }
1891
1892        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1893        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1894            self.0.request.filter = v.into();
1895            self
1896        }
1897
1898        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1899        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1900            self.0.request.page_size = v.into();
1901            self
1902        }
1903
1904        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1905        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1906            self.0.request.page_token = v.into();
1907            self
1908        }
1909
1910        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1911        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1912            self.0.request.return_partial_success = v.into();
1913            self
1914        }
1915    }
1916
1917    #[doc(hidden)]
1918    impl crate::RequestBuilder for ListOperations {
1919        fn request_options(&mut self) -> &mut crate::RequestOptions {
1920            &mut self.0.options
1921        }
1922    }
1923
1924    /// The request builder for [AnswerRecords::get_operation][crate::client::AnswerRecords::get_operation] calls.
1925    ///
1926    /// # Example
1927    /// ```
1928    /// # use google_cloud_dialogflow_v2::builder::answer_records::GetOperation;
1929    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1930    ///
1931    /// let builder = prepare_request_builder();
1932    /// let response = builder.send().await?;
1933    /// # Ok(()) }
1934    ///
1935    /// fn prepare_request_builder() -> GetOperation {
1936    ///   # panic!();
1937    ///   // ... details omitted ...
1938    /// }
1939    /// ```
1940    #[derive(Clone, Debug)]
1941    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1942
1943    impl GetOperation {
1944        pub(crate) fn new(
1945            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1946        ) -> Self {
1947            Self(RequestBuilder::new(stub))
1948        }
1949
1950        /// Sets the full request, replacing any prior values.
1951        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1952            mut self,
1953            v: V,
1954        ) -> Self {
1955            self.0.request = v.into();
1956            self
1957        }
1958
1959        /// Sets all the options, replacing any prior values.
1960        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1961            self.0.options = v.into();
1962            self
1963        }
1964
1965        /// Sends the request.
1966        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1967            (*self.0.stub)
1968                .get_operation(self.0.request, self.0.options)
1969                .await
1970                .map(crate::Response::into_body)
1971        }
1972
1973        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1974        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1975            self.0.request.name = v.into();
1976            self
1977        }
1978    }
1979
1980    #[doc(hidden)]
1981    impl crate::RequestBuilder for GetOperation {
1982        fn request_options(&mut self) -> &mut crate::RequestOptions {
1983            &mut self.0.options
1984        }
1985    }
1986
1987    /// The request builder for [AnswerRecords::cancel_operation][crate::client::AnswerRecords::cancel_operation] calls.
1988    ///
1989    /// # Example
1990    /// ```
1991    /// # use google_cloud_dialogflow_v2::builder::answer_records::CancelOperation;
1992    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
1993    ///
1994    /// let builder = prepare_request_builder();
1995    /// let response = builder.send().await?;
1996    /// # Ok(()) }
1997    ///
1998    /// fn prepare_request_builder() -> CancelOperation {
1999    ///   # panic!();
2000    ///   // ... details omitted ...
2001    /// }
2002    /// ```
2003    #[derive(Clone, Debug)]
2004    pub struct CancelOperation(
2005        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2006    );
2007
2008    impl CancelOperation {
2009        pub(crate) fn new(
2010            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
2011        ) -> Self {
2012            Self(RequestBuilder::new(stub))
2013        }
2014
2015        /// Sets the full request, replacing any prior values.
2016        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2017            mut self,
2018            v: V,
2019        ) -> Self {
2020            self.0.request = v.into();
2021            self
2022        }
2023
2024        /// Sets all the options, replacing any prior values.
2025        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2026            self.0.options = v.into();
2027            self
2028        }
2029
2030        /// Sends the request.
2031        pub async fn send(self) -> Result<()> {
2032            (*self.0.stub)
2033                .cancel_operation(self.0.request, self.0.options)
2034                .await
2035                .map(crate::Response::into_body)
2036        }
2037
2038        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2039        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2040            self.0.request.name = v.into();
2041            self
2042        }
2043    }
2044
2045    #[doc(hidden)]
2046    impl crate::RequestBuilder for CancelOperation {
2047        fn request_options(&mut self) -> &mut crate::RequestOptions {
2048            &mut self.0.options
2049        }
2050    }
2051}
2052
2053#[cfg(feature = "contexts")]
2054#[cfg_attr(docsrs, doc(cfg(feature = "contexts")))]
2055pub mod contexts {
2056    use crate::Result;
2057
2058    /// A builder for [Contexts][crate::client::Contexts].
2059    ///
2060    /// ```
2061    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2062    /// # use google_cloud_dialogflow_v2::*;
2063    /// # use builder::contexts::ClientBuilder;
2064    /// # use client::Contexts;
2065    /// let builder : ClientBuilder = Contexts::builder();
2066    /// let client = builder
2067    ///     .with_endpoint("https://dialogflow.googleapis.com")
2068    ///     .build().await?;
2069    /// # Ok(()) }
2070    /// ```
2071    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2072
2073    pub(crate) mod client {
2074        use super::super::super::client::Contexts;
2075        pub struct Factory;
2076        impl crate::ClientFactory for Factory {
2077            type Client = Contexts;
2078            type Credentials = gaxi::options::Credentials;
2079            async fn build(
2080                self,
2081                config: gaxi::options::ClientConfig,
2082            ) -> crate::ClientBuilderResult<Self::Client> {
2083                Self::Client::new(config).await
2084            }
2085        }
2086    }
2087
2088    /// Common implementation for [crate::client::Contexts] request builders.
2089    #[derive(Clone, Debug)]
2090    pub(crate) struct RequestBuilder<R: std::default::Default> {
2091        stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>,
2092        request: R,
2093        options: crate::RequestOptions,
2094    }
2095
2096    impl<R> RequestBuilder<R>
2097    where
2098        R: std::default::Default,
2099    {
2100        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2101            Self {
2102                stub,
2103                request: R::default(),
2104                options: crate::RequestOptions::default(),
2105            }
2106        }
2107    }
2108
2109    /// The request builder for [Contexts::list_contexts][crate::client::Contexts::list_contexts] calls.
2110    ///
2111    /// # Example
2112    /// ```
2113    /// # use google_cloud_dialogflow_v2::builder::contexts::ListContexts;
2114    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2115    /// use google_cloud_gax::paginator::ItemPaginator;
2116    ///
2117    /// let builder = prepare_request_builder();
2118    /// let mut items = builder.by_item();
2119    /// while let Some(result) = items.next().await {
2120    ///   let item = result?;
2121    /// }
2122    /// # Ok(()) }
2123    ///
2124    /// fn prepare_request_builder() -> ListContexts {
2125    ///   # panic!();
2126    ///   // ... details omitted ...
2127    /// }
2128    /// ```
2129    #[derive(Clone, Debug)]
2130    pub struct ListContexts(RequestBuilder<crate::model::ListContextsRequest>);
2131
2132    impl ListContexts {
2133        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2134            Self(RequestBuilder::new(stub))
2135        }
2136
2137        /// Sets the full request, replacing any prior values.
2138        pub fn with_request<V: Into<crate::model::ListContextsRequest>>(mut self, v: V) -> Self {
2139            self.0.request = v.into();
2140            self
2141        }
2142
2143        /// Sets all the options, replacing any prior values.
2144        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2145            self.0.options = v.into();
2146            self
2147        }
2148
2149        /// Sends the request.
2150        pub async fn send(self) -> Result<crate::model::ListContextsResponse> {
2151            (*self.0.stub)
2152                .list_contexts(self.0.request, self.0.options)
2153                .await
2154                .map(crate::Response::into_body)
2155        }
2156
2157        /// Streams each page in the collection.
2158        pub fn by_page(
2159            self,
2160        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListContextsResponse, crate::Error>
2161        {
2162            use std::clone::Clone;
2163            let token = self.0.request.page_token.clone();
2164            let execute = move |token: String| {
2165                let mut builder = self.clone();
2166                builder.0.request = builder.0.request.set_page_token(token);
2167                builder.send()
2168            };
2169            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2170        }
2171
2172        /// Streams each item in the collection.
2173        pub fn by_item(
2174            self,
2175        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2176            crate::model::ListContextsResponse,
2177            crate::Error,
2178        > {
2179            use google_cloud_gax::paginator::Paginator;
2180            self.by_page().items()
2181        }
2182
2183        /// Sets the value of [parent][crate::model::ListContextsRequest::parent].
2184        ///
2185        /// This is a **required** field for requests.
2186        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2187            self.0.request.parent = v.into();
2188            self
2189        }
2190
2191        /// Sets the value of [page_size][crate::model::ListContextsRequest::page_size].
2192        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2193            self.0.request.page_size = v.into();
2194            self
2195        }
2196
2197        /// Sets the value of [page_token][crate::model::ListContextsRequest::page_token].
2198        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2199            self.0.request.page_token = v.into();
2200            self
2201        }
2202    }
2203
2204    #[doc(hidden)]
2205    impl crate::RequestBuilder for ListContexts {
2206        fn request_options(&mut self) -> &mut crate::RequestOptions {
2207            &mut self.0.options
2208        }
2209    }
2210
2211    /// The request builder for [Contexts::get_context][crate::client::Contexts::get_context] calls.
2212    ///
2213    /// # Example
2214    /// ```
2215    /// # use google_cloud_dialogflow_v2::builder::contexts::GetContext;
2216    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2217    ///
2218    /// let builder = prepare_request_builder();
2219    /// let response = builder.send().await?;
2220    /// # Ok(()) }
2221    ///
2222    /// fn prepare_request_builder() -> GetContext {
2223    ///   # panic!();
2224    ///   // ... details omitted ...
2225    /// }
2226    /// ```
2227    #[derive(Clone, Debug)]
2228    pub struct GetContext(RequestBuilder<crate::model::GetContextRequest>);
2229
2230    impl GetContext {
2231        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2232            Self(RequestBuilder::new(stub))
2233        }
2234
2235        /// Sets the full request, replacing any prior values.
2236        pub fn with_request<V: Into<crate::model::GetContextRequest>>(mut self, v: V) -> Self {
2237            self.0.request = v.into();
2238            self
2239        }
2240
2241        /// Sets all the options, replacing any prior values.
2242        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2243            self.0.options = v.into();
2244            self
2245        }
2246
2247        /// Sends the request.
2248        pub async fn send(self) -> Result<crate::model::Context> {
2249            (*self.0.stub)
2250                .get_context(self.0.request, self.0.options)
2251                .await
2252                .map(crate::Response::into_body)
2253        }
2254
2255        /// Sets the value of [name][crate::model::GetContextRequest::name].
2256        ///
2257        /// This is a **required** field for requests.
2258        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2259            self.0.request.name = v.into();
2260            self
2261        }
2262    }
2263
2264    #[doc(hidden)]
2265    impl crate::RequestBuilder for GetContext {
2266        fn request_options(&mut self) -> &mut crate::RequestOptions {
2267            &mut self.0.options
2268        }
2269    }
2270
2271    /// The request builder for [Contexts::create_context][crate::client::Contexts::create_context] calls.
2272    ///
2273    /// # Example
2274    /// ```
2275    /// # use google_cloud_dialogflow_v2::builder::contexts::CreateContext;
2276    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2277    ///
2278    /// let builder = prepare_request_builder();
2279    /// let response = builder.send().await?;
2280    /// # Ok(()) }
2281    ///
2282    /// fn prepare_request_builder() -> CreateContext {
2283    ///   # panic!();
2284    ///   // ... details omitted ...
2285    /// }
2286    /// ```
2287    #[derive(Clone, Debug)]
2288    pub struct CreateContext(RequestBuilder<crate::model::CreateContextRequest>);
2289
2290    impl CreateContext {
2291        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2292            Self(RequestBuilder::new(stub))
2293        }
2294
2295        /// Sets the full request, replacing any prior values.
2296        pub fn with_request<V: Into<crate::model::CreateContextRequest>>(mut self, v: V) -> Self {
2297            self.0.request = v.into();
2298            self
2299        }
2300
2301        /// Sets all the options, replacing any prior values.
2302        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2303            self.0.options = v.into();
2304            self
2305        }
2306
2307        /// Sends the request.
2308        pub async fn send(self) -> Result<crate::model::Context> {
2309            (*self.0.stub)
2310                .create_context(self.0.request, self.0.options)
2311                .await
2312                .map(crate::Response::into_body)
2313        }
2314
2315        /// Sets the value of [parent][crate::model::CreateContextRequest::parent].
2316        ///
2317        /// This is a **required** field for requests.
2318        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2319            self.0.request.parent = v.into();
2320            self
2321        }
2322
2323        /// Sets the value of [context][crate::model::CreateContextRequest::context].
2324        ///
2325        /// This is a **required** field for requests.
2326        pub fn set_context<T>(mut self, v: T) -> Self
2327        where
2328            T: std::convert::Into<crate::model::Context>,
2329        {
2330            self.0.request.context = std::option::Option::Some(v.into());
2331            self
2332        }
2333
2334        /// Sets or clears the value of [context][crate::model::CreateContextRequest::context].
2335        ///
2336        /// This is a **required** field for requests.
2337        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2338        where
2339            T: std::convert::Into<crate::model::Context>,
2340        {
2341            self.0.request.context = v.map(|x| x.into());
2342            self
2343        }
2344    }
2345
2346    #[doc(hidden)]
2347    impl crate::RequestBuilder for CreateContext {
2348        fn request_options(&mut self) -> &mut crate::RequestOptions {
2349            &mut self.0.options
2350        }
2351    }
2352
2353    /// The request builder for [Contexts::update_context][crate::client::Contexts::update_context] calls.
2354    ///
2355    /// # Example
2356    /// ```
2357    /// # use google_cloud_dialogflow_v2::builder::contexts::UpdateContext;
2358    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2359    ///
2360    /// let builder = prepare_request_builder();
2361    /// let response = builder.send().await?;
2362    /// # Ok(()) }
2363    ///
2364    /// fn prepare_request_builder() -> UpdateContext {
2365    ///   # panic!();
2366    ///   // ... details omitted ...
2367    /// }
2368    /// ```
2369    #[derive(Clone, Debug)]
2370    pub struct UpdateContext(RequestBuilder<crate::model::UpdateContextRequest>);
2371
2372    impl UpdateContext {
2373        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2374            Self(RequestBuilder::new(stub))
2375        }
2376
2377        /// Sets the full request, replacing any prior values.
2378        pub fn with_request<V: Into<crate::model::UpdateContextRequest>>(mut self, v: V) -> Self {
2379            self.0.request = v.into();
2380            self
2381        }
2382
2383        /// Sets all the options, replacing any prior values.
2384        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2385            self.0.options = v.into();
2386            self
2387        }
2388
2389        /// Sends the request.
2390        pub async fn send(self) -> Result<crate::model::Context> {
2391            (*self.0.stub)
2392                .update_context(self.0.request, self.0.options)
2393                .await
2394                .map(crate::Response::into_body)
2395        }
2396
2397        /// Sets the value of [context][crate::model::UpdateContextRequest::context].
2398        ///
2399        /// This is a **required** field for requests.
2400        pub fn set_context<T>(mut self, v: T) -> Self
2401        where
2402            T: std::convert::Into<crate::model::Context>,
2403        {
2404            self.0.request.context = std::option::Option::Some(v.into());
2405            self
2406        }
2407
2408        /// Sets or clears the value of [context][crate::model::UpdateContextRequest::context].
2409        ///
2410        /// This is a **required** field for requests.
2411        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2412        where
2413            T: std::convert::Into<crate::model::Context>,
2414        {
2415            self.0.request.context = v.map(|x| x.into());
2416            self
2417        }
2418
2419        /// Sets the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2420        pub fn set_update_mask<T>(mut self, v: T) -> Self
2421        where
2422            T: std::convert::Into<wkt::FieldMask>,
2423        {
2424            self.0.request.update_mask = std::option::Option::Some(v.into());
2425            self
2426        }
2427
2428        /// Sets or clears the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2429        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2430        where
2431            T: std::convert::Into<wkt::FieldMask>,
2432        {
2433            self.0.request.update_mask = v.map(|x| x.into());
2434            self
2435        }
2436    }
2437
2438    #[doc(hidden)]
2439    impl crate::RequestBuilder for UpdateContext {
2440        fn request_options(&mut self) -> &mut crate::RequestOptions {
2441            &mut self.0.options
2442        }
2443    }
2444
2445    /// The request builder for [Contexts::delete_context][crate::client::Contexts::delete_context] calls.
2446    ///
2447    /// # Example
2448    /// ```
2449    /// # use google_cloud_dialogflow_v2::builder::contexts::DeleteContext;
2450    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2451    ///
2452    /// let builder = prepare_request_builder();
2453    /// let response = builder.send().await?;
2454    /// # Ok(()) }
2455    ///
2456    /// fn prepare_request_builder() -> DeleteContext {
2457    ///   # panic!();
2458    ///   // ... details omitted ...
2459    /// }
2460    /// ```
2461    #[derive(Clone, Debug)]
2462    pub struct DeleteContext(RequestBuilder<crate::model::DeleteContextRequest>);
2463
2464    impl DeleteContext {
2465        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2466            Self(RequestBuilder::new(stub))
2467        }
2468
2469        /// Sets the full request, replacing any prior values.
2470        pub fn with_request<V: Into<crate::model::DeleteContextRequest>>(mut self, v: V) -> Self {
2471            self.0.request = v.into();
2472            self
2473        }
2474
2475        /// Sets all the options, replacing any prior values.
2476        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2477            self.0.options = v.into();
2478            self
2479        }
2480
2481        /// Sends the request.
2482        pub async fn send(self) -> Result<()> {
2483            (*self.0.stub)
2484                .delete_context(self.0.request, self.0.options)
2485                .await
2486                .map(crate::Response::into_body)
2487        }
2488
2489        /// Sets the value of [name][crate::model::DeleteContextRequest::name].
2490        ///
2491        /// This is a **required** field for requests.
2492        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2493            self.0.request.name = v.into();
2494            self
2495        }
2496    }
2497
2498    #[doc(hidden)]
2499    impl crate::RequestBuilder for DeleteContext {
2500        fn request_options(&mut self) -> &mut crate::RequestOptions {
2501            &mut self.0.options
2502        }
2503    }
2504
2505    /// The request builder for [Contexts::delete_all_contexts][crate::client::Contexts::delete_all_contexts] calls.
2506    ///
2507    /// # Example
2508    /// ```
2509    /// # use google_cloud_dialogflow_v2::builder::contexts::DeleteAllContexts;
2510    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2511    ///
2512    /// let builder = prepare_request_builder();
2513    /// let response = builder.send().await?;
2514    /// # Ok(()) }
2515    ///
2516    /// fn prepare_request_builder() -> DeleteAllContexts {
2517    ///   # panic!();
2518    ///   // ... details omitted ...
2519    /// }
2520    /// ```
2521    #[derive(Clone, Debug)]
2522    pub struct DeleteAllContexts(RequestBuilder<crate::model::DeleteAllContextsRequest>);
2523
2524    impl DeleteAllContexts {
2525        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2526            Self(RequestBuilder::new(stub))
2527        }
2528
2529        /// Sets the full request, replacing any prior values.
2530        pub fn with_request<V: Into<crate::model::DeleteAllContextsRequest>>(
2531            mut self,
2532            v: V,
2533        ) -> Self {
2534            self.0.request = v.into();
2535            self
2536        }
2537
2538        /// Sets all the options, replacing any prior values.
2539        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2540            self.0.options = v.into();
2541            self
2542        }
2543
2544        /// Sends the request.
2545        pub async fn send(self) -> Result<()> {
2546            (*self.0.stub)
2547                .delete_all_contexts(self.0.request, self.0.options)
2548                .await
2549                .map(crate::Response::into_body)
2550        }
2551
2552        /// Sets the value of [parent][crate::model::DeleteAllContextsRequest::parent].
2553        ///
2554        /// This is a **required** field for requests.
2555        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2556            self.0.request.parent = v.into();
2557            self
2558        }
2559    }
2560
2561    #[doc(hidden)]
2562    impl crate::RequestBuilder for DeleteAllContexts {
2563        fn request_options(&mut self) -> &mut crate::RequestOptions {
2564            &mut self.0.options
2565        }
2566    }
2567
2568    /// The request builder for [Contexts::list_locations][crate::client::Contexts::list_locations] calls.
2569    ///
2570    /// # Example
2571    /// ```
2572    /// # use google_cloud_dialogflow_v2::builder::contexts::ListLocations;
2573    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2574    /// use google_cloud_gax::paginator::ItemPaginator;
2575    ///
2576    /// let builder = prepare_request_builder();
2577    /// let mut items = builder.by_item();
2578    /// while let Some(result) = items.next().await {
2579    ///   let item = result?;
2580    /// }
2581    /// # Ok(()) }
2582    ///
2583    /// fn prepare_request_builder() -> ListLocations {
2584    ///   # panic!();
2585    ///   // ... details omitted ...
2586    /// }
2587    /// ```
2588    #[derive(Clone, Debug)]
2589    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2590
2591    impl ListLocations {
2592        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2593            Self(RequestBuilder::new(stub))
2594        }
2595
2596        /// Sets the full request, replacing any prior values.
2597        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2598            mut self,
2599            v: V,
2600        ) -> Self {
2601            self.0.request = v.into();
2602            self
2603        }
2604
2605        /// Sets all the options, replacing any prior values.
2606        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2607            self.0.options = v.into();
2608            self
2609        }
2610
2611        /// Sends the request.
2612        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2613            (*self.0.stub)
2614                .list_locations(self.0.request, self.0.options)
2615                .await
2616                .map(crate::Response::into_body)
2617        }
2618
2619        /// Streams each page in the collection.
2620        pub fn by_page(
2621            self,
2622        ) -> impl google_cloud_gax::paginator::Paginator<
2623            google_cloud_location::model::ListLocationsResponse,
2624            crate::Error,
2625        > {
2626            use std::clone::Clone;
2627            let token = self.0.request.page_token.clone();
2628            let execute = move |token: String| {
2629                let mut builder = self.clone();
2630                builder.0.request = builder.0.request.set_page_token(token);
2631                builder.send()
2632            };
2633            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2634        }
2635
2636        /// Streams each item in the collection.
2637        pub fn by_item(
2638            self,
2639        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2640            google_cloud_location::model::ListLocationsResponse,
2641            crate::Error,
2642        > {
2643            use google_cloud_gax::paginator::Paginator;
2644            self.by_page().items()
2645        }
2646
2647        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2648        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2649            self.0.request.name = v.into();
2650            self
2651        }
2652
2653        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2654        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2655            self.0.request.filter = v.into();
2656            self
2657        }
2658
2659        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2660        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2661            self.0.request.page_size = v.into();
2662            self
2663        }
2664
2665        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2666        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2667            self.0.request.page_token = v.into();
2668            self
2669        }
2670    }
2671
2672    #[doc(hidden)]
2673    impl crate::RequestBuilder for ListLocations {
2674        fn request_options(&mut self) -> &mut crate::RequestOptions {
2675            &mut self.0.options
2676        }
2677    }
2678
2679    /// The request builder for [Contexts::get_location][crate::client::Contexts::get_location] calls.
2680    ///
2681    /// # Example
2682    /// ```
2683    /// # use google_cloud_dialogflow_v2::builder::contexts::GetLocation;
2684    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2685    ///
2686    /// let builder = prepare_request_builder();
2687    /// let response = builder.send().await?;
2688    /// # Ok(()) }
2689    ///
2690    /// fn prepare_request_builder() -> GetLocation {
2691    ///   # panic!();
2692    ///   // ... details omitted ...
2693    /// }
2694    /// ```
2695    #[derive(Clone, Debug)]
2696    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2697
2698    impl GetLocation {
2699        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2700            Self(RequestBuilder::new(stub))
2701        }
2702
2703        /// Sets the full request, replacing any prior values.
2704        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2705            mut self,
2706            v: V,
2707        ) -> Self {
2708            self.0.request = v.into();
2709            self
2710        }
2711
2712        /// Sets all the options, replacing any prior values.
2713        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2714            self.0.options = v.into();
2715            self
2716        }
2717
2718        /// Sends the request.
2719        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2720            (*self.0.stub)
2721                .get_location(self.0.request, self.0.options)
2722                .await
2723                .map(crate::Response::into_body)
2724        }
2725
2726        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2727        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2728            self.0.request.name = v.into();
2729            self
2730        }
2731    }
2732
2733    #[doc(hidden)]
2734    impl crate::RequestBuilder for GetLocation {
2735        fn request_options(&mut self) -> &mut crate::RequestOptions {
2736            &mut self.0.options
2737        }
2738    }
2739
2740    /// The request builder for [Contexts::list_operations][crate::client::Contexts::list_operations] calls.
2741    ///
2742    /// # Example
2743    /// ```
2744    /// # use google_cloud_dialogflow_v2::builder::contexts::ListOperations;
2745    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2746    /// use google_cloud_gax::paginator::ItemPaginator;
2747    ///
2748    /// let builder = prepare_request_builder();
2749    /// let mut items = builder.by_item();
2750    /// while let Some(result) = items.next().await {
2751    ///   let item = result?;
2752    /// }
2753    /// # Ok(()) }
2754    ///
2755    /// fn prepare_request_builder() -> ListOperations {
2756    ///   # panic!();
2757    ///   // ... details omitted ...
2758    /// }
2759    /// ```
2760    #[derive(Clone, Debug)]
2761    pub struct ListOperations(
2762        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2763    );
2764
2765    impl ListOperations {
2766        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2767            Self(RequestBuilder::new(stub))
2768        }
2769
2770        /// Sets the full request, replacing any prior values.
2771        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2772            mut self,
2773            v: V,
2774        ) -> Self {
2775            self.0.request = v.into();
2776            self
2777        }
2778
2779        /// Sets all the options, replacing any prior values.
2780        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2781            self.0.options = v.into();
2782            self
2783        }
2784
2785        /// Sends the request.
2786        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2787            (*self.0.stub)
2788                .list_operations(self.0.request, self.0.options)
2789                .await
2790                .map(crate::Response::into_body)
2791        }
2792
2793        /// Streams each page in the collection.
2794        pub fn by_page(
2795            self,
2796        ) -> impl google_cloud_gax::paginator::Paginator<
2797            google_cloud_longrunning::model::ListOperationsResponse,
2798            crate::Error,
2799        > {
2800            use std::clone::Clone;
2801            let token = self.0.request.page_token.clone();
2802            let execute = move |token: String| {
2803                let mut builder = self.clone();
2804                builder.0.request = builder.0.request.set_page_token(token);
2805                builder.send()
2806            };
2807            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2808        }
2809
2810        /// Streams each item in the collection.
2811        pub fn by_item(
2812            self,
2813        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2814            google_cloud_longrunning::model::ListOperationsResponse,
2815            crate::Error,
2816        > {
2817            use google_cloud_gax::paginator::Paginator;
2818            self.by_page().items()
2819        }
2820
2821        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2822        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2823            self.0.request.name = v.into();
2824            self
2825        }
2826
2827        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2828        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2829            self.0.request.filter = v.into();
2830            self
2831        }
2832
2833        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2834        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2835            self.0.request.page_size = v.into();
2836            self
2837        }
2838
2839        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2840        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2841            self.0.request.page_token = v.into();
2842            self
2843        }
2844
2845        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2846        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2847            self.0.request.return_partial_success = v.into();
2848            self
2849        }
2850    }
2851
2852    #[doc(hidden)]
2853    impl crate::RequestBuilder for ListOperations {
2854        fn request_options(&mut self) -> &mut crate::RequestOptions {
2855            &mut self.0.options
2856        }
2857    }
2858
2859    /// The request builder for [Contexts::get_operation][crate::client::Contexts::get_operation] calls.
2860    ///
2861    /// # Example
2862    /// ```
2863    /// # use google_cloud_dialogflow_v2::builder::contexts::GetOperation;
2864    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2865    ///
2866    /// let builder = prepare_request_builder();
2867    /// let response = builder.send().await?;
2868    /// # Ok(()) }
2869    ///
2870    /// fn prepare_request_builder() -> GetOperation {
2871    ///   # panic!();
2872    ///   // ... details omitted ...
2873    /// }
2874    /// ```
2875    #[derive(Clone, Debug)]
2876    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2877
2878    impl GetOperation {
2879        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2880            Self(RequestBuilder::new(stub))
2881        }
2882
2883        /// Sets the full request, replacing any prior values.
2884        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2885            mut self,
2886            v: V,
2887        ) -> Self {
2888            self.0.request = v.into();
2889            self
2890        }
2891
2892        /// Sets all the options, replacing any prior values.
2893        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2894            self.0.options = v.into();
2895            self
2896        }
2897
2898        /// Sends the request.
2899        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2900            (*self.0.stub)
2901                .get_operation(self.0.request, self.0.options)
2902                .await
2903                .map(crate::Response::into_body)
2904        }
2905
2906        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2907        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2908            self.0.request.name = v.into();
2909            self
2910        }
2911    }
2912
2913    #[doc(hidden)]
2914    impl crate::RequestBuilder for GetOperation {
2915        fn request_options(&mut self) -> &mut crate::RequestOptions {
2916            &mut self.0.options
2917        }
2918    }
2919
2920    /// The request builder for [Contexts::cancel_operation][crate::client::Contexts::cancel_operation] calls.
2921    ///
2922    /// # Example
2923    /// ```
2924    /// # use google_cloud_dialogflow_v2::builder::contexts::CancelOperation;
2925    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
2926    ///
2927    /// let builder = prepare_request_builder();
2928    /// let response = builder.send().await?;
2929    /// # Ok(()) }
2930    ///
2931    /// fn prepare_request_builder() -> CancelOperation {
2932    ///   # panic!();
2933    ///   // ... details omitted ...
2934    /// }
2935    /// ```
2936    #[derive(Clone, Debug)]
2937    pub struct CancelOperation(
2938        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2939    );
2940
2941    impl CancelOperation {
2942        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2943            Self(RequestBuilder::new(stub))
2944        }
2945
2946        /// Sets the full request, replacing any prior values.
2947        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2948            mut self,
2949            v: V,
2950        ) -> Self {
2951            self.0.request = v.into();
2952            self
2953        }
2954
2955        /// Sets all the options, replacing any prior values.
2956        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2957            self.0.options = v.into();
2958            self
2959        }
2960
2961        /// Sends the request.
2962        pub async fn send(self) -> Result<()> {
2963            (*self.0.stub)
2964                .cancel_operation(self.0.request, self.0.options)
2965                .await
2966                .map(crate::Response::into_body)
2967        }
2968
2969        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2970        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2971            self.0.request.name = v.into();
2972            self
2973        }
2974    }
2975
2976    #[doc(hidden)]
2977    impl crate::RequestBuilder for CancelOperation {
2978        fn request_options(&mut self) -> &mut crate::RequestOptions {
2979            &mut self.0.options
2980        }
2981    }
2982}
2983
2984#[cfg(feature = "conversations")]
2985#[cfg_attr(docsrs, doc(cfg(feature = "conversations")))]
2986pub mod conversations {
2987    use crate::Result;
2988
2989    /// A builder for [Conversations][crate::client::Conversations].
2990    ///
2991    /// ```
2992    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2993    /// # use google_cloud_dialogflow_v2::*;
2994    /// # use builder::conversations::ClientBuilder;
2995    /// # use client::Conversations;
2996    /// let builder : ClientBuilder = Conversations::builder();
2997    /// let client = builder
2998    ///     .with_endpoint("https://dialogflow.googleapis.com")
2999    ///     .build().await?;
3000    /// # Ok(()) }
3001    /// ```
3002    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3003
3004    pub(crate) mod client {
3005        use super::super::super::client::Conversations;
3006        pub struct Factory;
3007        impl crate::ClientFactory for Factory {
3008            type Client = Conversations;
3009            type Credentials = gaxi::options::Credentials;
3010            async fn build(
3011                self,
3012                config: gaxi::options::ClientConfig,
3013            ) -> crate::ClientBuilderResult<Self::Client> {
3014                Self::Client::new(config).await
3015            }
3016        }
3017    }
3018
3019    /// Common implementation for [crate::client::Conversations] request builders.
3020    #[derive(Clone, Debug)]
3021    pub(crate) struct RequestBuilder<R: std::default::Default> {
3022        stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3023        request: R,
3024        options: crate::RequestOptions,
3025    }
3026
3027    impl<R> RequestBuilder<R>
3028    where
3029        R: std::default::Default,
3030    {
3031        pub(crate) fn new(
3032            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3033        ) -> Self {
3034            Self {
3035                stub,
3036                request: R::default(),
3037                options: crate::RequestOptions::default(),
3038            }
3039        }
3040    }
3041
3042    /// The request builder for [Conversations::create_conversation][crate::client::Conversations::create_conversation] calls.
3043    ///
3044    /// # Example
3045    /// ```
3046    /// # use google_cloud_dialogflow_v2::builder::conversations::CreateConversation;
3047    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3048    ///
3049    /// let builder = prepare_request_builder();
3050    /// let response = builder.send().await?;
3051    /// # Ok(()) }
3052    ///
3053    /// fn prepare_request_builder() -> CreateConversation {
3054    ///   # panic!();
3055    ///   // ... details omitted ...
3056    /// }
3057    /// ```
3058    #[derive(Clone, Debug)]
3059    pub struct CreateConversation(RequestBuilder<crate::model::CreateConversationRequest>);
3060
3061    impl CreateConversation {
3062        pub(crate) fn new(
3063            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3064        ) -> Self {
3065            Self(RequestBuilder::new(stub))
3066        }
3067
3068        /// Sets the full request, replacing any prior values.
3069        pub fn with_request<V: Into<crate::model::CreateConversationRequest>>(
3070            mut self,
3071            v: V,
3072        ) -> Self {
3073            self.0.request = v.into();
3074            self
3075        }
3076
3077        /// Sets all the options, replacing any prior values.
3078        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3079            self.0.options = v.into();
3080            self
3081        }
3082
3083        /// Sends the request.
3084        pub async fn send(self) -> Result<crate::model::Conversation> {
3085            (*self.0.stub)
3086                .create_conversation(self.0.request, self.0.options)
3087                .await
3088                .map(crate::Response::into_body)
3089        }
3090
3091        /// Sets the value of [parent][crate::model::CreateConversationRequest::parent].
3092        ///
3093        /// This is a **required** field for requests.
3094        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3095            self.0.request.parent = v.into();
3096            self
3097        }
3098
3099        /// Sets the value of [conversation][crate::model::CreateConversationRequest::conversation].
3100        ///
3101        /// This is a **required** field for requests.
3102        pub fn set_conversation<T>(mut self, v: T) -> Self
3103        where
3104            T: std::convert::Into<crate::model::Conversation>,
3105        {
3106            self.0.request.conversation = std::option::Option::Some(v.into());
3107            self
3108        }
3109
3110        /// Sets or clears the value of [conversation][crate::model::CreateConversationRequest::conversation].
3111        ///
3112        /// This is a **required** field for requests.
3113        pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3114        where
3115            T: std::convert::Into<crate::model::Conversation>,
3116        {
3117            self.0.request.conversation = v.map(|x| x.into());
3118            self
3119        }
3120
3121        /// Sets the value of [conversation_id][crate::model::CreateConversationRequest::conversation_id].
3122        pub fn set_conversation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3123            self.0.request.conversation_id = v.into();
3124            self
3125        }
3126    }
3127
3128    #[doc(hidden)]
3129    impl crate::RequestBuilder for CreateConversation {
3130        fn request_options(&mut self) -> &mut crate::RequestOptions {
3131            &mut self.0.options
3132        }
3133    }
3134
3135    /// The request builder for [Conversations::list_conversations][crate::client::Conversations::list_conversations] calls.
3136    ///
3137    /// # Example
3138    /// ```
3139    /// # use google_cloud_dialogflow_v2::builder::conversations::ListConversations;
3140    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3141    /// use google_cloud_gax::paginator::ItemPaginator;
3142    ///
3143    /// let builder = prepare_request_builder();
3144    /// let mut items = builder.by_item();
3145    /// while let Some(result) = items.next().await {
3146    ///   let item = result?;
3147    /// }
3148    /// # Ok(()) }
3149    ///
3150    /// fn prepare_request_builder() -> ListConversations {
3151    ///   # panic!();
3152    ///   // ... details omitted ...
3153    /// }
3154    /// ```
3155    #[derive(Clone, Debug)]
3156    pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);
3157
3158    impl ListConversations {
3159        pub(crate) fn new(
3160            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3161        ) -> Self {
3162            Self(RequestBuilder::new(stub))
3163        }
3164
3165        /// Sets the full request, replacing any prior values.
3166        pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
3167            mut self,
3168            v: V,
3169        ) -> Self {
3170            self.0.request = v.into();
3171            self
3172        }
3173
3174        /// Sets all the options, replacing any prior values.
3175        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3176            self.0.options = v.into();
3177            self
3178        }
3179
3180        /// Sends the request.
3181        pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
3182            (*self.0.stub)
3183                .list_conversations(self.0.request, self.0.options)
3184                .await
3185                .map(crate::Response::into_body)
3186        }
3187
3188        /// Streams each page in the collection.
3189        pub fn by_page(
3190            self,
3191        ) -> impl google_cloud_gax::paginator::Paginator<
3192            crate::model::ListConversationsResponse,
3193            crate::Error,
3194        > {
3195            use std::clone::Clone;
3196            let token = self.0.request.page_token.clone();
3197            let execute = move |token: String| {
3198                let mut builder = self.clone();
3199                builder.0.request = builder.0.request.set_page_token(token);
3200                builder.send()
3201            };
3202            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3203        }
3204
3205        /// Streams each item in the collection.
3206        pub fn by_item(
3207            self,
3208        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3209            crate::model::ListConversationsResponse,
3210            crate::Error,
3211        > {
3212            use google_cloud_gax::paginator::Paginator;
3213            self.by_page().items()
3214        }
3215
3216        /// Sets the value of [parent][crate::model::ListConversationsRequest::parent].
3217        ///
3218        /// This is a **required** field for requests.
3219        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3220            self.0.request.parent = v.into();
3221            self
3222        }
3223
3224        /// Sets the value of [page_size][crate::model::ListConversationsRequest::page_size].
3225        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3226            self.0.request.page_size = v.into();
3227            self
3228        }
3229
3230        /// Sets the value of [page_token][crate::model::ListConversationsRequest::page_token].
3231        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3232            self.0.request.page_token = v.into();
3233            self
3234        }
3235
3236        /// Sets the value of [filter][crate::model::ListConversationsRequest::filter].
3237        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3238            self.0.request.filter = v.into();
3239            self
3240        }
3241    }
3242
3243    #[doc(hidden)]
3244    impl crate::RequestBuilder for ListConversations {
3245        fn request_options(&mut self) -> &mut crate::RequestOptions {
3246            &mut self.0.options
3247        }
3248    }
3249
3250    /// The request builder for [Conversations::get_conversation][crate::client::Conversations::get_conversation] calls.
3251    ///
3252    /// # Example
3253    /// ```
3254    /// # use google_cloud_dialogflow_v2::builder::conversations::GetConversation;
3255    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3256    ///
3257    /// let builder = prepare_request_builder();
3258    /// let response = builder.send().await?;
3259    /// # Ok(()) }
3260    ///
3261    /// fn prepare_request_builder() -> GetConversation {
3262    ///   # panic!();
3263    ///   // ... details omitted ...
3264    /// }
3265    /// ```
3266    #[derive(Clone, Debug)]
3267    pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);
3268
3269    impl GetConversation {
3270        pub(crate) fn new(
3271            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3272        ) -> Self {
3273            Self(RequestBuilder::new(stub))
3274        }
3275
3276        /// Sets the full request, replacing any prior values.
3277        pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
3278            self.0.request = v.into();
3279            self
3280        }
3281
3282        /// Sets all the options, replacing any prior values.
3283        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3284            self.0.options = v.into();
3285            self
3286        }
3287
3288        /// Sends the request.
3289        pub async fn send(self) -> Result<crate::model::Conversation> {
3290            (*self.0.stub)
3291                .get_conversation(self.0.request, self.0.options)
3292                .await
3293                .map(crate::Response::into_body)
3294        }
3295
3296        /// Sets the value of [name][crate::model::GetConversationRequest::name].
3297        ///
3298        /// This is a **required** field for requests.
3299        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3300            self.0.request.name = v.into();
3301            self
3302        }
3303    }
3304
3305    #[doc(hidden)]
3306    impl crate::RequestBuilder for GetConversation {
3307        fn request_options(&mut self) -> &mut crate::RequestOptions {
3308            &mut self.0.options
3309        }
3310    }
3311
3312    /// The request builder for [Conversations::complete_conversation][crate::client::Conversations::complete_conversation] calls.
3313    ///
3314    /// # Example
3315    /// ```
3316    /// # use google_cloud_dialogflow_v2::builder::conversations::CompleteConversation;
3317    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3318    ///
3319    /// let builder = prepare_request_builder();
3320    /// let response = builder.send().await?;
3321    /// # Ok(()) }
3322    ///
3323    /// fn prepare_request_builder() -> CompleteConversation {
3324    ///   # panic!();
3325    ///   // ... details omitted ...
3326    /// }
3327    /// ```
3328    #[derive(Clone, Debug)]
3329    pub struct CompleteConversation(RequestBuilder<crate::model::CompleteConversationRequest>);
3330
3331    impl CompleteConversation {
3332        pub(crate) fn new(
3333            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3334        ) -> Self {
3335            Self(RequestBuilder::new(stub))
3336        }
3337
3338        /// Sets the full request, replacing any prior values.
3339        pub fn with_request<V: Into<crate::model::CompleteConversationRequest>>(
3340            mut self,
3341            v: V,
3342        ) -> Self {
3343            self.0.request = v.into();
3344            self
3345        }
3346
3347        /// Sets all the options, replacing any prior values.
3348        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3349            self.0.options = v.into();
3350            self
3351        }
3352
3353        /// Sends the request.
3354        pub async fn send(self) -> Result<crate::model::Conversation> {
3355            (*self.0.stub)
3356                .complete_conversation(self.0.request, self.0.options)
3357                .await
3358                .map(crate::Response::into_body)
3359        }
3360
3361        /// Sets the value of [name][crate::model::CompleteConversationRequest::name].
3362        ///
3363        /// This is a **required** field for requests.
3364        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3365            self.0.request.name = v.into();
3366            self
3367        }
3368    }
3369
3370    #[doc(hidden)]
3371    impl crate::RequestBuilder for CompleteConversation {
3372        fn request_options(&mut self) -> &mut crate::RequestOptions {
3373            &mut self.0.options
3374        }
3375    }
3376
3377    /// The request builder for [Conversations::ingest_context_references][crate::client::Conversations::ingest_context_references] calls.
3378    ///
3379    /// # Example
3380    /// ```
3381    /// # use google_cloud_dialogflow_v2::builder::conversations::IngestContextReferences;
3382    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3383    ///
3384    /// let builder = prepare_request_builder();
3385    /// let response = builder.send().await?;
3386    /// # Ok(()) }
3387    ///
3388    /// fn prepare_request_builder() -> IngestContextReferences {
3389    ///   # panic!();
3390    ///   // ... details omitted ...
3391    /// }
3392    /// ```
3393    #[derive(Clone, Debug)]
3394    pub struct IngestContextReferences(
3395        RequestBuilder<crate::model::IngestContextReferencesRequest>,
3396    );
3397
3398    impl IngestContextReferences {
3399        pub(crate) fn new(
3400            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3401        ) -> Self {
3402            Self(RequestBuilder::new(stub))
3403        }
3404
3405        /// Sets the full request, replacing any prior values.
3406        pub fn with_request<V: Into<crate::model::IngestContextReferencesRequest>>(
3407            mut self,
3408            v: V,
3409        ) -> Self {
3410            self.0.request = v.into();
3411            self
3412        }
3413
3414        /// Sets all the options, replacing any prior values.
3415        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3416            self.0.options = v.into();
3417            self
3418        }
3419
3420        /// Sends the request.
3421        pub async fn send(self) -> Result<crate::model::IngestContextReferencesResponse> {
3422            (*self.0.stub)
3423                .ingest_context_references(self.0.request, self.0.options)
3424                .await
3425                .map(crate::Response::into_body)
3426        }
3427
3428        /// Sets the value of [conversation][crate::model::IngestContextReferencesRequest::conversation].
3429        ///
3430        /// This is a **required** field for requests.
3431        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3432            self.0.request.conversation = v.into();
3433            self
3434        }
3435
3436        /// Sets the value of [context_references][crate::model::IngestContextReferencesRequest::context_references].
3437        ///
3438        /// This is a **required** field for requests.
3439        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3440        where
3441            T: std::iter::IntoIterator<Item = (K, V)>,
3442            K: std::convert::Into<std::string::String>,
3443            V: std::convert::Into<crate::model::conversation::ContextReference>,
3444        {
3445            self.0.request.context_references =
3446                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3447            self
3448        }
3449    }
3450
3451    #[doc(hidden)]
3452    impl crate::RequestBuilder for IngestContextReferences {
3453        fn request_options(&mut self) -> &mut crate::RequestOptions {
3454            &mut self.0.options
3455        }
3456    }
3457
3458    /// The request builder for [Conversations::list_messages][crate::client::Conversations::list_messages] calls.
3459    ///
3460    /// # Example
3461    /// ```
3462    /// # use google_cloud_dialogflow_v2::builder::conversations::ListMessages;
3463    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3464    /// use google_cloud_gax::paginator::ItemPaginator;
3465    ///
3466    /// let builder = prepare_request_builder();
3467    /// let mut items = builder.by_item();
3468    /// while let Some(result) = items.next().await {
3469    ///   let item = result?;
3470    /// }
3471    /// # Ok(()) }
3472    ///
3473    /// fn prepare_request_builder() -> ListMessages {
3474    ///   # panic!();
3475    ///   // ... details omitted ...
3476    /// }
3477    /// ```
3478    #[derive(Clone, Debug)]
3479    pub struct ListMessages(RequestBuilder<crate::model::ListMessagesRequest>);
3480
3481    impl ListMessages {
3482        pub(crate) fn new(
3483            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3484        ) -> Self {
3485            Self(RequestBuilder::new(stub))
3486        }
3487
3488        /// Sets the full request, replacing any prior values.
3489        pub fn with_request<V: Into<crate::model::ListMessagesRequest>>(mut self, v: V) -> Self {
3490            self.0.request = v.into();
3491            self
3492        }
3493
3494        /// Sets all the options, replacing any prior values.
3495        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3496            self.0.options = v.into();
3497            self
3498        }
3499
3500        /// Sends the request.
3501        pub async fn send(self) -> Result<crate::model::ListMessagesResponse> {
3502            (*self.0.stub)
3503                .list_messages(self.0.request, self.0.options)
3504                .await
3505                .map(crate::Response::into_body)
3506        }
3507
3508        /// Streams each page in the collection.
3509        pub fn by_page(
3510            self,
3511        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListMessagesResponse, crate::Error>
3512        {
3513            use std::clone::Clone;
3514            let token = self.0.request.page_token.clone();
3515            let execute = move |token: String| {
3516                let mut builder = self.clone();
3517                builder.0.request = builder.0.request.set_page_token(token);
3518                builder.send()
3519            };
3520            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3521        }
3522
3523        /// Streams each item in the collection.
3524        pub fn by_item(
3525            self,
3526        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3527            crate::model::ListMessagesResponse,
3528            crate::Error,
3529        > {
3530            use google_cloud_gax::paginator::Paginator;
3531            self.by_page().items()
3532        }
3533
3534        /// Sets the value of [parent][crate::model::ListMessagesRequest::parent].
3535        ///
3536        /// This is a **required** field for requests.
3537        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3538            self.0.request.parent = v.into();
3539            self
3540        }
3541
3542        /// Sets the value of [filter][crate::model::ListMessagesRequest::filter].
3543        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3544            self.0.request.filter = v.into();
3545            self
3546        }
3547
3548        /// Sets the value of [page_size][crate::model::ListMessagesRequest::page_size].
3549        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3550            self.0.request.page_size = v.into();
3551            self
3552        }
3553
3554        /// Sets the value of [page_token][crate::model::ListMessagesRequest::page_token].
3555        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3556            self.0.request.page_token = v.into();
3557            self
3558        }
3559    }
3560
3561    #[doc(hidden)]
3562    impl crate::RequestBuilder for ListMessages {
3563        fn request_options(&mut self) -> &mut crate::RequestOptions {
3564            &mut self.0.options
3565        }
3566    }
3567
3568    /// The request builder for [Conversations::suggest_conversation_summary][crate::client::Conversations::suggest_conversation_summary] calls.
3569    ///
3570    /// # Example
3571    /// ```
3572    /// # use google_cloud_dialogflow_v2::builder::conversations::SuggestConversationSummary;
3573    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3574    ///
3575    /// let builder = prepare_request_builder();
3576    /// let response = builder.send().await?;
3577    /// # Ok(()) }
3578    ///
3579    /// fn prepare_request_builder() -> SuggestConversationSummary {
3580    ///   # panic!();
3581    ///   // ... details omitted ...
3582    /// }
3583    /// ```
3584    #[derive(Clone, Debug)]
3585    pub struct SuggestConversationSummary(
3586        RequestBuilder<crate::model::SuggestConversationSummaryRequest>,
3587    );
3588
3589    impl SuggestConversationSummary {
3590        pub(crate) fn new(
3591            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3592        ) -> Self {
3593            Self(RequestBuilder::new(stub))
3594        }
3595
3596        /// Sets the full request, replacing any prior values.
3597        pub fn with_request<V: Into<crate::model::SuggestConversationSummaryRequest>>(
3598            mut self,
3599            v: V,
3600        ) -> Self {
3601            self.0.request = v.into();
3602            self
3603        }
3604
3605        /// Sets all the options, replacing any prior values.
3606        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3607            self.0.options = v.into();
3608            self
3609        }
3610
3611        /// Sends the request.
3612        pub async fn send(self) -> Result<crate::model::SuggestConversationSummaryResponse> {
3613            (*self.0.stub)
3614                .suggest_conversation_summary(self.0.request, self.0.options)
3615                .await
3616                .map(crate::Response::into_body)
3617        }
3618
3619        /// Sets the value of [conversation][crate::model::SuggestConversationSummaryRequest::conversation].
3620        ///
3621        /// This is a **required** field for requests.
3622        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3623            self.0.request.conversation = v.into();
3624            self
3625        }
3626
3627        /// Sets the value of [latest_message][crate::model::SuggestConversationSummaryRequest::latest_message].
3628        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3629            self.0.request.latest_message = v.into();
3630            self
3631        }
3632
3633        /// Sets the value of [context_size][crate::model::SuggestConversationSummaryRequest::context_size].
3634        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3635            self.0.request.context_size = v.into();
3636            self
3637        }
3638
3639        /// Sets the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3640        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
3641        where
3642            T: std::convert::Into<crate::model::AssistQueryParameters>,
3643        {
3644            self.0.request.assist_query_params = std::option::Option::Some(v.into());
3645            self
3646        }
3647
3648        /// Sets or clears the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3649        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
3650        where
3651            T: std::convert::Into<crate::model::AssistQueryParameters>,
3652        {
3653            self.0.request.assist_query_params = v.map(|x| x.into());
3654            self
3655        }
3656    }
3657
3658    #[doc(hidden)]
3659    impl crate::RequestBuilder for SuggestConversationSummary {
3660        fn request_options(&mut self) -> &mut crate::RequestOptions {
3661            &mut self.0.options
3662        }
3663    }
3664
3665    /// The request builder for [Conversations::generate_stateless_summary][crate::client::Conversations::generate_stateless_summary] calls.
3666    ///
3667    /// # Example
3668    /// ```
3669    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateStatelessSummary;
3670    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3671    ///
3672    /// let builder = prepare_request_builder();
3673    /// let response = builder.send().await?;
3674    /// # Ok(()) }
3675    ///
3676    /// fn prepare_request_builder() -> GenerateStatelessSummary {
3677    ///   # panic!();
3678    ///   // ... details omitted ...
3679    /// }
3680    /// ```
3681    #[derive(Clone, Debug)]
3682    pub struct GenerateStatelessSummary(
3683        RequestBuilder<crate::model::GenerateStatelessSummaryRequest>,
3684    );
3685
3686    impl GenerateStatelessSummary {
3687        pub(crate) fn new(
3688            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3689        ) -> Self {
3690            Self(RequestBuilder::new(stub))
3691        }
3692
3693        /// Sets the full request, replacing any prior values.
3694        pub fn with_request<V: Into<crate::model::GenerateStatelessSummaryRequest>>(
3695            mut self,
3696            v: V,
3697        ) -> Self {
3698            self.0.request = v.into();
3699            self
3700        }
3701
3702        /// Sets all the options, replacing any prior values.
3703        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3704            self.0.options = v.into();
3705            self
3706        }
3707
3708        /// Sends the request.
3709        pub async fn send(self) -> Result<crate::model::GenerateStatelessSummaryResponse> {
3710            (*self.0.stub)
3711                .generate_stateless_summary(self.0.request, self.0.options)
3712                .await
3713                .map(crate::Response::into_body)
3714        }
3715
3716        /// Sets the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3717        ///
3718        /// This is a **required** field for requests.
3719        pub fn set_stateless_conversation<T>(mut self, v: T) -> Self
3720        where
3721            T: std::convert::Into<
3722                    crate::model::generate_stateless_summary_request::MinimalConversation,
3723                >,
3724        {
3725            self.0.request.stateless_conversation = std::option::Option::Some(v.into());
3726            self
3727        }
3728
3729        /// Sets or clears the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3730        ///
3731        /// This is a **required** field for requests.
3732        pub fn set_or_clear_stateless_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3733        where
3734            T: std::convert::Into<
3735                    crate::model::generate_stateless_summary_request::MinimalConversation,
3736                >,
3737        {
3738            self.0.request.stateless_conversation = v.map(|x| x.into());
3739            self
3740        }
3741
3742        /// Sets the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3743        ///
3744        /// This is a **required** field for requests.
3745        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
3746        where
3747            T: std::convert::Into<crate::model::ConversationProfile>,
3748        {
3749            self.0.request.conversation_profile = std::option::Option::Some(v.into());
3750            self
3751        }
3752
3753        /// Sets or clears the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3754        ///
3755        /// This is a **required** field for requests.
3756        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
3757        where
3758            T: std::convert::Into<crate::model::ConversationProfile>,
3759        {
3760            self.0.request.conversation_profile = v.map(|x| x.into());
3761            self
3762        }
3763
3764        /// Sets the value of [latest_message][crate::model::GenerateStatelessSummaryRequest::latest_message].
3765        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3766            self.0.request.latest_message = v.into();
3767            self
3768        }
3769
3770        /// Sets the value of [max_context_size][crate::model::GenerateStatelessSummaryRequest::max_context_size].
3771        pub fn set_max_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3772            self.0.request.max_context_size = v.into();
3773            self
3774        }
3775    }
3776
3777    #[doc(hidden)]
3778    impl crate::RequestBuilder for GenerateStatelessSummary {
3779        fn request_options(&mut self) -> &mut crate::RequestOptions {
3780            &mut self.0.options
3781        }
3782    }
3783
3784    /// The request builder for [Conversations::generate_stateless_suggestion][crate::client::Conversations::generate_stateless_suggestion] calls.
3785    ///
3786    /// # Example
3787    /// ```
3788    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateStatelessSuggestion;
3789    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3790    ///
3791    /// let builder = prepare_request_builder();
3792    /// let response = builder.send().await?;
3793    /// # Ok(()) }
3794    ///
3795    /// fn prepare_request_builder() -> GenerateStatelessSuggestion {
3796    ///   # panic!();
3797    ///   // ... details omitted ...
3798    /// }
3799    /// ```
3800    #[derive(Clone, Debug)]
3801    pub struct GenerateStatelessSuggestion(
3802        RequestBuilder<crate::model::GenerateStatelessSuggestionRequest>,
3803    );
3804
3805    impl GenerateStatelessSuggestion {
3806        pub(crate) fn new(
3807            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3808        ) -> Self {
3809            Self(RequestBuilder::new(stub))
3810        }
3811
3812        /// Sets the full request, replacing any prior values.
3813        pub fn with_request<V: Into<crate::model::GenerateStatelessSuggestionRequest>>(
3814            mut self,
3815            v: V,
3816        ) -> Self {
3817            self.0.request = v.into();
3818            self
3819        }
3820
3821        /// Sets all the options, replacing any prior values.
3822        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3823            self.0.options = v.into();
3824            self
3825        }
3826
3827        /// Sends the request.
3828        pub async fn send(self) -> Result<crate::model::GenerateStatelessSuggestionResponse> {
3829            (*self.0.stub)
3830                .generate_stateless_suggestion(self.0.request, self.0.options)
3831                .await
3832                .map(crate::Response::into_body)
3833        }
3834
3835        /// Sets the value of [parent][crate::model::GenerateStatelessSuggestionRequest::parent].
3836        ///
3837        /// This is a **required** field for requests.
3838        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3839            self.0.request.parent = v.into();
3840            self
3841        }
3842
3843        /// Sets the value of [context_references][crate::model::GenerateStatelessSuggestionRequest::context_references].
3844        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3845        where
3846            T: std::iter::IntoIterator<Item = (K, V)>,
3847            K: std::convert::Into<std::string::String>,
3848            V: std::convert::Into<crate::model::conversation::ContextReference>,
3849        {
3850            self.0.request.context_references =
3851                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3852            self
3853        }
3854
3855        /// Sets the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3856        pub fn set_conversation_context<T>(mut self, v: T) -> Self
3857        where
3858            T: std::convert::Into<crate::model::ConversationContext>,
3859        {
3860            self.0.request.conversation_context = std::option::Option::Some(v.into());
3861            self
3862        }
3863
3864        /// Sets or clears the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3865        pub fn set_or_clear_conversation_context<T>(mut self, v: std::option::Option<T>) -> Self
3866        where
3867            T: std::convert::Into<crate::model::ConversationContext>,
3868        {
3869            self.0.request.conversation_context = v.map(|x| x.into());
3870            self
3871        }
3872
3873        /// Sets the value of [trigger_events][crate::model::GenerateStatelessSuggestionRequest::trigger_events].
3874        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
3875        where
3876            T: std::iter::IntoIterator<Item = V>,
3877            V: std::convert::Into<crate::model::TriggerEvent>,
3878        {
3879            use std::iter::Iterator;
3880            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
3881            self
3882        }
3883
3884        /// Sets the value of [security_settings][crate::model::GenerateStatelessSuggestionRequest::security_settings].
3885        pub fn set_security_settings<T: Into<std::string::String>>(mut self, v: T) -> Self {
3886            self.0.request.security_settings = v.into();
3887            self
3888        }
3889
3890        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource].
3891        ///
3892        /// Note that all the setters affecting `generator_resource` are
3893        /// mutually exclusive.
3894        pub fn set_generator_resource<
3895            T: Into<Option<crate::model::generate_stateless_suggestion_request::GeneratorResource>>,
3896        >(
3897            mut self,
3898            v: T,
3899        ) -> Self {
3900            self.0.request.generator_resource = v.into();
3901            self
3902        }
3903
3904        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3905        /// to hold a `Generator`.
3906        ///
3907        /// Note that all the setters affecting `generator_resource` are
3908        /// mutually exclusive.
3909        pub fn set_generator<T: std::convert::Into<std::boxed::Box<crate::model::Generator>>>(
3910            mut self,
3911            v: T,
3912        ) -> Self {
3913            self.0.request = self.0.request.set_generator(v);
3914            self
3915        }
3916
3917        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3918        /// to hold a `GeneratorName`.
3919        ///
3920        /// Note that all the setters affecting `generator_resource` are
3921        /// mutually exclusive.
3922        pub fn set_generator_name<T: std::convert::Into<std::string::String>>(
3923            mut self,
3924            v: T,
3925        ) -> Self {
3926            self.0.request = self.0.request.set_generator_name(v);
3927            self
3928        }
3929    }
3930
3931    #[doc(hidden)]
3932    impl crate::RequestBuilder for GenerateStatelessSuggestion {
3933        fn request_options(&mut self) -> &mut crate::RequestOptions {
3934            &mut self.0.options
3935        }
3936    }
3937
3938    /// The request builder for [Conversations::search_knowledge][crate::client::Conversations::search_knowledge] calls.
3939    ///
3940    /// # Example
3941    /// ```
3942    /// # use google_cloud_dialogflow_v2::builder::conversations::SearchKnowledge;
3943    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
3944    ///
3945    /// let builder = prepare_request_builder();
3946    /// let response = builder.send().await?;
3947    /// # Ok(()) }
3948    ///
3949    /// fn prepare_request_builder() -> SearchKnowledge {
3950    ///   # panic!();
3951    ///   // ... details omitted ...
3952    /// }
3953    /// ```
3954    #[derive(Clone, Debug)]
3955    pub struct SearchKnowledge(RequestBuilder<crate::model::SearchKnowledgeRequest>);
3956
3957    impl SearchKnowledge {
3958        pub(crate) fn new(
3959            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3960        ) -> Self {
3961            Self(RequestBuilder::new(stub))
3962        }
3963
3964        /// Sets the full request, replacing any prior values.
3965        pub fn with_request<V: Into<crate::model::SearchKnowledgeRequest>>(mut self, v: V) -> Self {
3966            self.0.request = v.into();
3967            self
3968        }
3969
3970        /// Sets all the options, replacing any prior values.
3971        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3972            self.0.options = v.into();
3973            self
3974        }
3975
3976        /// Sends the request.
3977        pub async fn send(self) -> Result<crate::model::SearchKnowledgeResponse> {
3978            (*self.0.stub)
3979                .search_knowledge(self.0.request, self.0.options)
3980                .await
3981                .map(crate::Response::into_body)
3982        }
3983
3984        /// Sets the value of [parent][crate::model::SearchKnowledgeRequest::parent].
3985        ///
3986        /// This is a **required** field for requests.
3987        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3988            self.0.request.parent = v.into();
3989            self
3990        }
3991
3992        /// Sets the value of [query][crate::model::SearchKnowledgeRequest::query].
3993        ///
3994        /// This is a **required** field for requests.
3995        pub fn set_query<T>(mut self, v: T) -> Self
3996        where
3997            T: std::convert::Into<crate::model::TextInput>,
3998        {
3999            self.0.request.query = std::option::Option::Some(v.into());
4000            self
4001        }
4002
4003        /// Sets or clears the value of [query][crate::model::SearchKnowledgeRequest::query].
4004        ///
4005        /// This is a **required** field for requests.
4006        pub fn set_or_clear_query<T>(mut self, v: std::option::Option<T>) -> Self
4007        where
4008            T: std::convert::Into<crate::model::TextInput>,
4009        {
4010            self.0.request.query = v.map(|x| x.into());
4011            self
4012        }
4013
4014        /// Sets the value of [conversation_profile][crate::model::SearchKnowledgeRequest::conversation_profile].
4015        ///
4016        /// This is a **required** field for requests.
4017        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
4018            self.0.request.conversation_profile = v.into();
4019            self
4020        }
4021
4022        /// Sets the value of [session_id][crate::model::SearchKnowledgeRequest::session_id].
4023        ///
4024        /// This is a **required** field for requests.
4025        pub fn set_session_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4026            self.0.request.session_id = v.into();
4027            self
4028        }
4029
4030        /// Sets the value of [conversation][crate::model::SearchKnowledgeRequest::conversation].
4031        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4032            self.0.request.conversation = v.into();
4033            self
4034        }
4035
4036        /// Sets the value of [latest_message][crate::model::SearchKnowledgeRequest::latest_message].
4037        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4038            self.0.request.latest_message = v.into();
4039            self
4040        }
4041
4042        /// Sets the value of [query_source][crate::model::SearchKnowledgeRequest::query_source].
4043        pub fn set_query_source<T: Into<crate::model::search_knowledge_request::QuerySource>>(
4044            mut self,
4045            v: T,
4046        ) -> Self {
4047            self.0.request.query_source = v.into();
4048            self
4049        }
4050
4051        /// Sets the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4052        pub fn set_end_user_metadata<T>(mut self, v: T) -> Self
4053        where
4054            T: std::convert::Into<wkt::Struct>,
4055        {
4056            self.0.request.end_user_metadata = std::option::Option::Some(v.into());
4057            self
4058        }
4059
4060        /// Sets or clears the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4061        pub fn set_or_clear_end_user_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4062        where
4063            T: std::convert::Into<wkt::Struct>,
4064        {
4065            self.0.request.end_user_metadata = v.map(|x| x.into());
4066            self
4067        }
4068
4069        /// Sets the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4070        pub fn set_search_config<T>(mut self, v: T) -> Self
4071        where
4072            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4073        {
4074            self.0.request.search_config = std::option::Option::Some(v.into());
4075            self
4076        }
4077
4078        /// Sets or clears the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4079        pub fn set_or_clear_search_config<T>(mut self, v: std::option::Option<T>) -> Self
4080        where
4081            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4082        {
4083            self.0.request.search_config = v.map(|x| x.into());
4084            self
4085        }
4086
4087        /// Sets the value of [exact_search][crate::model::SearchKnowledgeRequest::exact_search].
4088        pub fn set_exact_search<T: Into<bool>>(mut self, v: T) -> Self {
4089            self.0.request.exact_search = v.into();
4090            self
4091        }
4092    }
4093
4094    #[doc(hidden)]
4095    impl crate::RequestBuilder for SearchKnowledge {
4096        fn request_options(&mut self) -> &mut crate::RequestOptions {
4097            &mut self.0.options
4098        }
4099    }
4100
4101    /// The request builder for [Conversations::generate_suggestions][crate::client::Conversations::generate_suggestions] calls.
4102    ///
4103    /// # Example
4104    /// ```
4105    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateSuggestions;
4106    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4107    ///
4108    /// let builder = prepare_request_builder();
4109    /// let response = builder.send().await?;
4110    /// # Ok(()) }
4111    ///
4112    /// fn prepare_request_builder() -> GenerateSuggestions {
4113    ///   # panic!();
4114    ///   // ... details omitted ...
4115    /// }
4116    /// ```
4117    #[derive(Clone, Debug)]
4118    pub struct GenerateSuggestions(RequestBuilder<crate::model::GenerateSuggestionsRequest>);
4119
4120    impl GenerateSuggestions {
4121        pub(crate) fn new(
4122            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4123        ) -> Self {
4124            Self(RequestBuilder::new(stub))
4125        }
4126
4127        /// Sets the full request, replacing any prior values.
4128        pub fn with_request<V: Into<crate::model::GenerateSuggestionsRequest>>(
4129            mut self,
4130            v: V,
4131        ) -> Self {
4132            self.0.request = v.into();
4133            self
4134        }
4135
4136        /// Sets all the options, replacing any prior values.
4137        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4138            self.0.options = v.into();
4139            self
4140        }
4141
4142        /// Sends the request.
4143        pub async fn send(self) -> Result<crate::model::GenerateSuggestionsResponse> {
4144            (*self.0.stub)
4145                .generate_suggestions(self.0.request, self.0.options)
4146                .await
4147                .map(crate::Response::into_body)
4148        }
4149
4150        /// Sets the value of [conversation][crate::model::GenerateSuggestionsRequest::conversation].
4151        ///
4152        /// This is a **required** field for requests.
4153        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4154            self.0.request.conversation = v.into();
4155            self
4156        }
4157
4158        /// Sets the value of [latest_message][crate::model::GenerateSuggestionsRequest::latest_message].
4159        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4160            self.0.request.latest_message = v.into();
4161            self
4162        }
4163
4164        /// Sets the value of [trigger_events][crate::model::GenerateSuggestionsRequest::trigger_events].
4165        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
4166        where
4167            T: std::iter::IntoIterator<Item = V>,
4168            V: std::convert::Into<crate::model::TriggerEvent>,
4169        {
4170            use std::iter::Iterator;
4171            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
4172            self
4173        }
4174    }
4175
4176    #[doc(hidden)]
4177    impl crate::RequestBuilder for GenerateSuggestions {
4178        fn request_options(&mut self) -> &mut crate::RequestOptions {
4179            &mut self.0.options
4180        }
4181    }
4182
4183    /// The request builder for [Conversations::list_locations][crate::client::Conversations::list_locations] calls.
4184    ///
4185    /// # Example
4186    /// ```
4187    /// # use google_cloud_dialogflow_v2::builder::conversations::ListLocations;
4188    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4189    /// use google_cloud_gax::paginator::ItemPaginator;
4190    ///
4191    /// let builder = prepare_request_builder();
4192    /// let mut items = builder.by_item();
4193    /// while let Some(result) = items.next().await {
4194    ///   let item = result?;
4195    /// }
4196    /// # Ok(()) }
4197    ///
4198    /// fn prepare_request_builder() -> ListLocations {
4199    ///   # panic!();
4200    ///   // ... details omitted ...
4201    /// }
4202    /// ```
4203    #[derive(Clone, Debug)]
4204    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4205
4206    impl ListLocations {
4207        pub(crate) fn new(
4208            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4209        ) -> Self {
4210            Self(RequestBuilder::new(stub))
4211        }
4212
4213        /// Sets the full request, replacing any prior values.
4214        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4215            mut self,
4216            v: V,
4217        ) -> Self {
4218            self.0.request = v.into();
4219            self
4220        }
4221
4222        /// Sets all the options, replacing any prior values.
4223        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4224            self.0.options = v.into();
4225            self
4226        }
4227
4228        /// Sends the request.
4229        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4230            (*self.0.stub)
4231                .list_locations(self.0.request, self.0.options)
4232                .await
4233                .map(crate::Response::into_body)
4234        }
4235
4236        /// Streams each page in the collection.
4237        pub fn by_page(
4238            self,
4239        ) -> impl google_cloud_gax::paginator::Paginator<
4240            google_cloud_location::model::ListLocationsResponse,
4241            crate::Error,
4242        > {
4243            use std::clone::Clone;
4244            let token = self.0.request.page_token.clone();
4245            let execute = move |token: String| {
4246                let mut builder = self.clone();
4247                builder.0.request = builder.0.request.set_page_token(token);
4248                builder.send()
4249            };
4250            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4251        }
4252
4253        /// Streams each item in the collection.
4254        pub fn by_item(
4255            self,
4256        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4257            google_cloud_location::model::ListLocationsResponse,
4258            crate::Error,
4259        > {
4260            use google_cloud_gax::paginator::Paginator;
4261            self.by_page().items()
4262        }
4263
4264        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4265        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4266            self.0.request.name = v.into();
4267            self
4268        }
4269
4270        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4271        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4272            self.0.request.filter = v.into();
4273            self
4274        }
4275
4276        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4277        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4278            self.0.request.page_size = v.into();
4279            self
4280        }
4281
4282        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4283        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4284            self.0.request.page_token = v.into();
4285            self
4286        }
4287    }
4288
4289    #[doc(hidden)]
4290    impl crate::RequestBuilder for ListLocations {
4291        fn request_options(&mut self) -> &mut crate::RequestOptions {
4292            &mut self.0.options
4293        }
4294    }
4295
4296    /// The request builder for [Conversations::get_location][crate::client::Conversations::get_location] calls.
4297    ///
4298    /// # Example
4299    /// ```
4300    /// # use google_cloud_dialogflow_v2::builder::conversations::GetLocation;
4301    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4302    ///
4303    /// let builder = prepare_request_builder();
4304    /// let response = builder.send().await?;
4305    /// # Ok(()) }
4306    ///
4307    /// fn prepare_request_builder() -> GetLocation {
4308    ///   # panic!();
4309    ///   // ... details omitted ...
4310    /// }
4311    /// ```
4312    #[derive(Clone, Debug)]
4313    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4314
4315    impl GetLocation {
4316        pub(crate) fn new(
4317            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4318        ) -> Self {
4319            Self(RequestBuilder::new(stub))
4320        }
4321
4322        /// Sets the full request, replacing any prior values.
4323        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4324            mut self,
4325            v: V,
4326        ) -> Self {
4327            self.0.request = v.into();
4328            self
4329        }
4330
4331        /// Sets all the options, replacing any prior values.
4332        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4333            self.0.options = v.into();
4334            self
4335        }
4336
4337        /// Sends the request.
4338        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4339            (*self.0.stub)
4340                .get_location(self.0.request, self.0.options)
4341                .await
4342                .map(crate::Response::into_body)
4343        }
4344
4345        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4346        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4347            self.0.request.name = v.into();
4348            self
4349        }
4350    }
4351
4352    #[doc(hidden)]
4353    impl crate::RequestBuilder for GetLocation {
4354        fn request_options(&mut self) -> &mut crate::RequestOptions {
4355            &mut self.0.options
4356        }
4357    }
4358
4359    /// The request builder for [Conversations::list_operations][crate::client::Conversations::list_operations] calls.
4360    ///
4361    /// # Example
4362    /// ```
4363    /// # use google_cloud_dialogflow_v2::builder::conversations::ListOperations;
4364    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4365    /// use google_cloud_gax::paginator::ItemPaginator;
4366    ///
4367    /// let builder = prepare_request_builder();
4368    /// let mut items = builder.by_item();
4369    /// while let Some(result) = items.next().await {
4370    ///   let item = result?;
4371    /// }
4372    /// # Ok(()) }
4373    ///
4374    /// fn prepare_request_builder() -> ListOperations {
4375    ///   # panic!();
4376    ///   // ... details omitted ...
4377    /// }
4378    /// ```
4379    #[derive(Clone, Debug)]
4380    pub struct ListOperations(
4381        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4382    );
4383
4384    impl ListOperations {
4385        pub(crate) fn new(
4386            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4387        ) -> Self {
4388            Self(RequestBuilder::new(stub))
4389        }
4390
4391        /// Sets the full request, replacing any prior values.
4392        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4393            mut self,
4394            v: V,
4395        ) -> Self {
4396            self.0.request = v.into();
4397            self
4398        }
4399
4400        /// Sets all the options, replacing any prior values.
4401        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4402            self.0.options = v.into();
4403            self
4404        }
4405
4406        /// Sends the request.
4407        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4408            (*self.0.stub)
4409                .list_operations(self.0.request, self.0.options)
4410                .await
4411                .map(crate::Response::into_body)
4412        }
4413
4414        /// Streams each page in the collection.
4415        pub fn by_page(
4416            self,
4417        ) -> impl google_cloud_gax::paginator::Paginator<
4418            google_cloud_longrunning::model::ListOperationsResponse,
4419            crate::Error,
4420        > {
4421            use std::clone::Clone;
4422            let token = self.0.request.page_token.clone();
4423            let execute = move |token: String| {
4424                let mut builder = self.clone();
4425                builder.0.request = builder.0.request.set_page_token(token);
4426                builder.send()
4427            };
4428            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4429        }
4430
4431        /// Streams each item in the collection.
4432        pub fn by_item(
4433            self,
4434        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4435            google_cloud_longrunning::model::ListOperationsResponse,
4436            crate::Error,
4437        > {
4438            use google_cloud_gax::paginator::Paginator;
4439            self.by_page().items()
4440        }
4441
4442        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4443        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4444            self.0.request.name = v.into();
4445            self
4446        }
4447
4448        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4449        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4450            self.0.request.filter = v.into();
4451            self
4452        }
4453
4454        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4455        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4456            self.0.request.page_size = v.into();
4457            self
4458        }
4459
4460        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4461        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4462            self.0.request.page_token = v.into();
4463            self
4464        }
4465
4466        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4467        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4468            self.0.request.return_partial_success = v.into();
4469            self
4470        }
4471    }
4472
4473    #[doc(hidden)]
4474    impl crate::RequestBuilder for ListOperations {
4475        fn request_options(&mut self) -> &mut crate::RequestOptions {
4476            &mut self.0.options
4477        }
4478    }
4479
4480    /// The request builder for [Conversations::get_operation][crate::client::Conversations::get_operation] calls.
4481    ///
4482    /// # Example
4483    /// ```
4484    /// # use google_cloud_dialogflow_v2::builder::conversations::GetOperation;
4485    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4486    ///
4487    /// let builder = prepare_request_builder();
4488    /// let response = builder.send().await?;
4489    /// # Ok(()) }
4490    ///
4491    /// fn prepare_request_builder() -> GetOperation {
4492    ///   # panic!();
4493    ///   // ... details omitted ...
4494    /// }
4495    /// ```
4496    #[derive(Clone, Debug)]
4497    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4498
4499    impl GetOperation {
4500        pub(crate) fn new(
4501            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4502        ) -> Self {
4503            Self(RequestBuilder::new(stub))
4504        }
4505
4506        /// Sets the full request, replacing any prior values.
4507        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4508            mut self,
4509            v: V,
4510        ) -> Self {
4511            self.0.request = v.into();
4512            self
4513        }
4514
4515        /// Sets all the options, replacing any prior values.
4516        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4517            self.0.options = v.into();
4518            self
4519        }
4520
4521        /// Sends the request.
4522        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4523            (*self.0.stub)
4524                .get_operation(self.0.request, self.0.options)
4525                .await
4526                .map(crate::Response::into_body)
4527        }
4528
4529        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4530        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4531            self.0.request.name = v.into();
4532            self
4533        }
4534    }
4535
4536    #[doc(hidden)]
4537    impl crate::RequestBuilder for GetOperation {
4538        fn request_options(&mut self) -> &mut crate::RequestOptions {
4539            &mut self.0.options
4540        }
4541    }
4542
4543    /// The request builder for [Conversations::cancel_operation][crate::client::Conversations::cancel_operation] calls.
4544    ///
4545    /// # Example
4546    /// ```
4547    /// # use google_cloud_dialogflow_v2::builder::conversations::CancelOperation;
4548    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4549    ///
4550    /// let builder = prepare_request_builder();
4551    /// let response = builder.send().await?;
4552    /// # Ok(()) }
4553    ///
4554    /// fn prepare_request_builder() -> CancelOperation {
4555    ///   # panic!();
4556    ///   // ... details omitted ...
4557    /// }
4558    /// ```
4559    #[derive(Clone, Debug)]
4560    pub struct CancelOperation(
4561        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4562    );
4563
4564    impl CancelOperation {
4565        pub(crate) fn new(
4566            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4567        ) -> Self {
4568            Self(RequestBuilder::new(stub))
4569        }
4570
4571        /// Sets the full request, replacing any prior values.
4572        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4573            mut self,
4574            v: V,
4575        ) -> Self {
4576            self.0.request = v.into();
4577            self
4578        }
4579
4580        /// Sets all the options, replacing any prior values.
4581        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4582            self.0.options = v.into();
4583            self
4584        }
4585
4586        /// Sends the request.
4587        pub async fn send(self) -> Result<()> {
4588            (*self.0.stub)
4589                .cancel_operation(self.0.request, self.0.options)
4590                .await
4591                .map(crate::Response::into_body)
4592        }
4593
4594        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4595        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4596            self.0.request.name = v.into();
4597            self
4598        }
4599    }
4600
4601    #[doc(hidden)]
4602    impl crate::RequestBuilder for CancelOperation {
4603        fn request_options(&mut self) -> &mut crate::RequestOptions {
4604            &mut self.0.options
4605        }
4606    }
4607}
4608
4609#[cfg(feature = "conversation-datasets")]
4610#[cfg_attr(docsrs, doc(cfg(feature = "conversation-datasets")))]
4611pub mod conversation_datasets {
4612    use crate::Result;
4613
4614    /// A builder for [ConversationDatasets][crate::client::ConversationDatasets].
4615    ///
4616    /// ```
4617    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4618    /// # use google_cloud_dialogflow_v2::*;
4619    /// # use builder::conversation_datasets::ClientBuilder;
4620    /// # use client::ConversationDatasets;
4621    /// let builder : ClientBuilder = ConversationDatasets::builder();
4622    /// let client = builder
4623    ///     .with_endpoint("https://dialogflow.googleapis.com")
4624    ///     .build().await?;
4625    /// # Ok(()) }
4626    /// ```
4627    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4628
4629    pub(crate) mod client {
4630        use super::super::super::client::ConversationDatasets;
4631        pub struct Factory;
4632        impl crate::ClientFactory for Factory {
4633            type Client = ConversationDatasets;
4634            type Credentials = gaxi::options::Credentials;
4635            async fn build(
4636                self,
4637                config: gaxi::options::ClientConfig,
4638            ) -> crate::ClientBuilderResult<Self::Client> {
4639                Self::Client::new(config).await
4640            }
4641        }
4642    }
4643
4644    /// Common implementation for [crate::client::ConversationDatasets] request builders.
4645    #[derive(Clone, Debug)]
4646    pub(crate) struct RequestBuilder<R: std::default::Default> {
4647        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4648        request: R,
4649        options: crate::RequestOptions,
4650    }
4651
4652    impl<R> RequestBuilder<R>
4653    where
4654        R: std::default::Default,
4655    {
4656        pub(crate) fn new(
4657            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4658        ) -> Self {
4659            Self {
4660                stub,
4661                request: R::default(),
4662                options: crate::RequestOptions::default(),
4663            }
4664        }
4665    }
4666
4667    /// The request builder for [ConversationDatasets::create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset] calls.
4668    ///
4669    /// # Example
4670    /// ```
4671    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::CreateConversationDataset;
4672    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4673    /// use google_cloud_lro::Poller;
4674    ///
4675    /// let builder = prepare_request_builder();
4676    /// let response = builder.poller().until_done().await?;
4677    /// # Ok(()) }
4678    ///
4679    /// fn prepare_request_builder() -> CreateConversationDataset {
4680    ///   # panic!();
4681    ///   // ... details omitted ...
4682    /// }
4683    /// ```
4684    #[derive(Clone, Debug)]
4685    pub struct CreateConversationDataset(
4686        RequestBuilder<crate::model::CreateConversationDatasetRequest>,
4687    );
4688
4689    impl CreateConversationDataset {
4690        pub(crate) fn new(
4691            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4692        ) -> Self {
4693            Self(RequestBuilder::new(stub))
4694        }
4695
4696        /// Sets the full request, replacing any prior values.
4697        pub fn with_request<V: Into<crate::model::CreateConversationDatasetRequest>>(
4698            mut self,
4699            v: V,
4700        ) -> Self {
4701            self.0.request = v.into();
4702            self
4703        }
4704
4705        /// Sets all the options, replacing any prior values.
4706        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4707            self.0.options = v.into();
4708            self
4709        }
4710
4711        /// Sends the request.
4712        ///
4713        /// # Long running operations
4714        ///
4715        /// This starts, but does not poll, a longrunning operation. More information
4716        /// on [create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset].
4717        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4718            (*self.0.stub)
4719                .create_conversation_dataset(self.0.request, self.0.options)
4720                .await
4721                .map(crate::Response::into_body)
4722        }
4723
4724        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_dataset`.
4725        pub fn poller(
4726            self,
4727        ) -> impl google_cloud_lro::Poller<
4728            crate::model::ConversationDataset,
4729            crate::model::CreateConversationDatasetOperationMetadata,
4730        > {
4731            type Operation = google_cloud_lro::internal::Operation<
4732                crate::model::ConversationDataset,
4733                crate::model::CreateConversationDatasetOperationMetadata,
4734            >;
4735            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4736            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4737
4738            let stub = self.0.stub.clone();
4739            let mut options = self.0.options.clone();
4740            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4741            let query = move |name| {
4742                let stub = stub.clone();
4743                let options = options.clone();
4744                async {
4745                    let op = GetOperation::new(stub)
4746                        .set_name(name)
4747                        .with_options(options)
4748                        .send()
4749                        .await?;
4750                    Ok(Operation::new(op))
4751                }
4752            };
4753
4754            let start = move || async {
4755                let op = self.send().await?;
4756                Ok(Operation::new(op))
4757            };
4758
4759            google_cloud_lro::internal::new_poller(
4760                polling_error_policy,
4761                polling_backoff_policy,
4762                start,
4763                query,
4764            )
4765        }
4766
4767        /// Sets the value of [parent][crate::model::CreateConversationDatasetRequest::parent].
4768        ///
4769        /// This is a **required** field for requests.
4770        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4771            self.0.request.parent = v.into();
4772            self
4773        }
4774
4775        /// Sets the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4776        ///
4777        /// This is a **required** field for requests.
4778        pub fn set_conversation_dataset<T>(mut self, v: T) -> Self
4779        where
4780            T: std::convert::Into<crate::model::ConversationDataset>,
4781        {
4782            self.0.request.conversation_dataset = std::option::Option::Some(v.into());
4783            self
4784        }
4785
4786        /// Sets or clears the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4787        ///
4788        /// This is a **required** field for requests.
4789        pub fn set_or_clear_conversation_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4790        where
4791            T: std::convert::Into<crate::model::ConversationDataset>,
4792        {
4793            self.0.request.conversation_dataset = v.map(|x| x.into());
4794            self
4795        }
4796    }
4797
4798    #[doc(hidden)]
4799    impl crate::RequestBuilder for CreateConversationDataset {
4800        fn request_options(&mut self) -> &mut crate::RequestOptions {
4801            &mut self.0.options
4802        }
4803    }
4804
4805    /// The request builder for [ConversationDatasets::get_conversation_dataset][crate::client::ConversationDatasets::get_conversation_dataset] calls.
4806    ///
4807    /// # Example
4808    /// ```
4809    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetConversationDataset;
4810    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4811    ///
4812    /// let builder = prepare_request_builder();
4813    /// let response = builder.send().await?;
4814    /// # Ok(()) }
4815    ///
4816    /// fn prepare_request_builder() -> GetConversationDataset {
4817    ///   # panic!();
4818    ///   // ... details omitted ...
4819    /// }
4820    /// ```
4821    #[derive(Clone, Debug)]
4822    pub struct GetConversationDataset(RequestBuilder<crate::model::GetConversationDatasetRequest>);
4823
4824    impl GetConversationDataset {
4825        pub(crate) fn new(
4826            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4827        ) -> Self {
4828            Self(RequestBuilder::new(stub))
4829        }
4830
4831        /// Sets the full request, replacing any prior values.
4832        pub fn with_request<V: Into<crate::model::GetConversationDatasetRequest>>(
4833            mut self,
4834            v: V,
4835        ) -> Self {
4836            self.0.request = v.into();
4837            self
4838        }
4839
4840        /// Sets all the options, replacing any prior values.
4841        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4842            self.0.options = v.into();
4843            self
4844        }
4845
4846        /// Sends the request.
4847        pub async fn send(self) -> Result<crate::model::ConversationDataset> {
4848            (*self.0.stub)
4849                .get_conversation_dataset(self.0.request, self.0.options)
4850                .await
4851                .map(crate::Response::into_body)
4852        }
4853
4854        /// Sets the value of [name][crate::model::GetConversationDatasetRequest::name].
4855        ///
4856        /// This is a **required** field for requests.
4857        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4858            self.0.request.name = v.into();
4859            self
4860        }
4861    }
4862
4863    #[doc(hidden)]
4864    impl crate::RequestBuilder for GetConversationDataset {
4865        fn request_options(&mut self) -> &mut crate::RequestOptions {
4866            &mut self.0.options
4867        }
4868    }
4869
4870    /// The request builder for [ConversationDatasets::list_conversation_datasets][crate::client::ConversationDatasets::list_conversation_datasets] calls.
4871    ///
4872    /// # Example
4873    /// ```
4874    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListConversationDatasets;
4875    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4876    /// use google_cloud_gax::paginator::ItemPaginator;
4877    ///
4878    /// let builder = prepare_request_builder();
4879    /// let mut items = builder.by_item();
4880    /// while let Some(result) = items.next().await {
4881    ///   let item = result?;
4882    /// }
4883    /// # Ok(()) }
4884    ///
4885    /// fn prepare_request_builder() -> ListConversationDatasets {
4886    ///   # panic!();
4887    ///   // ... details omitted ...
4888    /// }
4889    /// ```
4890    #[derive(Clone, Debug)]
4891    pub struct ListConversationDatasets(
4892        RequestBuilder<crate::model::ListConversationDatasetsRequest>,
4893    );
4894
4895    impl ListConversationDatasets {
4896        pub(crate) fn new(
4897            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4898        ) -> Self {
4899            Self(RequestBuilder::new(stub))
4900        }
4901
4902        /// Sets the full request, replacing any prior values.
4903        pub fn with_request<V: Into<crate::model::ListConversationDatasetsRequest>>(
4904            mut self,
4905            v: V,
4906        ) -> Self {
4907            self.0.request = v.into();
4908            self
4909        }
4910
4911        /// Sets all the options, replacing any prior values.
4912        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4913            self.0.options = v.into();
4914            self
4915        }
4916
4917        /// Sends the request.
4918        pub async fn send(self) -> Result<crate::model::ListConversationDatasetsResponse> {
4919            (*self.0.stub)
4920                .list_conversation_datasets(self.0.request, self.0.options)
4921                .await
4922                .map(crate::Response::into_body)
4923        }
4924
4925        /// Streams each page in the collection.
4926        pub fn by_page(
4927            self,
4928        ) -> impl google_cloud_gax::paginator::Paginator<
4929            crate::model::ListConversationDatasetsResponse,
4930            crate::Error,
4931        > {
4932            use std::clone::Clone;
4933            let token = self.0.request.page_token.clone();
4934            let execute = move |token: String| {
4935                let mut builder = self.clone();
4936                builder.0.request = builder.0.request.set_page_token(token);
4937                builder.send()
4938            };
4939            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4940        }
4941
4942        /// Streams each item in the collection.
4943        pub fn by_item(
4944            self,
4945        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4946            crate::model::ListConversationDatasetsResponse,
4947            crate::Error,
4948        > {
4949            use google_cloud_gax::paginator::Paginator;
4950            self.by_page().items()
4951        }
4952
4953        /// Sets the value of [parent][crate::model::ListConversationDatasetsRequest::parent].
4954        ///
4955        /// This is a **required** field for requests.
4956        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4957            self.0.request.parent = v.into();
4958            self
4959        }
4960
4961        /// Sets the value of [page_size][crate::model::ListConversationDatasetsRequest::page_size].
4962        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4963            self.0.request.page_size = v.into();
4964            self
4965        }
4966
4967        /// Sets the value of [page_token][crate::model::ListConversationDatasetsRequest::page_token].
4968        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4969            self.0.request.page_token = v.into();
4970            self
4971        }
4972    }
4973
4974    #[doc(hidden)]
4975    impl crate::RequestBuilder for ListConversationDatasets {
4976        fn request_options(&mut self) -> &mut crate::RequestOptions {
4977            &mut self.0.options
4978        }
4979    }
4980
4981    /// The request builder for [ConversationDatasets::delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset] calls.
4982    ///
4983    /// # Example
4984    /// ```
4985    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::DeleteConversationDataset;
4986    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
4987    /// use google_cloud_lro::Poller;
4988    ///
4989    /// let builder = prepare_request_builder();
4990    /// let response = builder.poller().until_done().await?;
4991    /// # Ok(()) }
4992    ///
4993    /// fn prepare_request_builder() -> DeleteConversationDataset {
4994    ///   # panic!();
4995    ///   // ... details omitted ...
4996    /// }
4997    /// ```
4998    #[derive(Clone, Debug)]
4999    pub struct DeleteConversationDataset(
5000        RequestBuilder<crate::model::DeleteConversationDatasetRequest>,
5001    );
5002
5003    impl DeleteConversationDataset {
5004        pub(crate) fn new(
5005            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5006        ) -> Self {
5007            Self(RequestBuilder::new(stub))
5008        }
5009
5010        /// Sets the full request, replacing any prior values.
5011        pub fn with_request<V: Into<crate::model::DeleteConversationDatasetRequest>>(
5012            mut self,
5013            v: V,
5014        ) -> Self {
5015            self.0.request = v.into();
5016            self
5017        }
5018
5019        /// Sets all the options, replacing any prior values.
5020        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5021            self.0.options = v.into();
5022            self
5023        }
5024
5025        /// Sends the request.
5026        ///
5027        /// # Long running operations
5028        ///
5029        /// This starts, but does not poll, a longrunning operation. More information
5030        /// on [delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset].
5031        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5032            (*self.0.stub)
5033                .delete_conversation_dataset(self.0.request, self.0.options)
5034                .await
5035                .map(crate::Response::into_body)
5036        }
5037
5038        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_conversation_dataset`.
5039        pub fn poller(
5040            self,
5041        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteConversationDatasetOperationMetadata>
5042        {
5043            type Operation = google_cloud_lro::internal::Operation<
5044                wkt::Empty,
5045                crate::model::DeleteConversationDatasetOperationMetadata,
5046            >;
5047            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5048            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5049
5050            let stub = self.0.stub.clone();
5051            let mut options = self.0.options.clone();
5052            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5053            let query = move |name| {
5054                let stub = stub.clone();
5055                let options = options.clone();
5056                async {
5057                    let op = GetOperation::new(stub)
5058                        .set_name(name)
5059                        .with_options(options)
5060                        .send()
5061                        .await?;
5062                    Ok(Operation::new(op))
5063                }
5064            };
5065
5066            let start = move || async {
5067                let op = self.send().await?;
5068                Ok(Operation::new(op))
5069            };
5070
5071            google_cloud_lro::internal::new_unit_response_poller(
5072                polling_error_policy,
5073                polling_backoff_policy,
5074                start,
5075                query,
5076            )
5077        }
5078
5079        /// Sets the value of [name][crate::model::DeleteConversationDatasetRequest::name].
5080        ///
5081        /// This is a **required** field for requests.
5082        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5083            self.0.request.name = v.into();
5084            self
5085        }
5086    }
5087
5088    #[doc(hidden)]
5089    impl crate::RequestBuilder for DeleteConversationDataset {
5090        fn request_options(&mut self) -> &mut crate::RequestOptions {
5091            &mut self.0.options
5092        }
5093    }
5094
5095    /// The request builder for [ConversationDatasets::import_conversation_data][crate::client::ConversationDatasets::import_conversation_data] calls.
5096    ///
5097    /// # Example
5098    /// ```
5099    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ImportConversationData;
5100    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5101    /// use google_cloud_lro::Poller;
5102    ///
5103    /// let builder = prepare_request_builder();
5104    /// let response = builder.poller().until_done().await?;
5105    /// # Ok(()) }
5106    ///
5107    /// fn prepare_request_builder() -> ImportConversationData {
5108    ///   # panic!();
5109    ///   // ... details omitted ...
5110    /// }
5111    /// ```
5112    #[derive(Clone, Debug)]
5113    pub struct ImportConversationData(RequestBuilder<crate::model::ImportConversationDataRequest>);
5114
5115    impl ImportConversationData {
5116        pub(crate) fn new(
5117            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5118        ) -> Self {
5119            Self(RequestBuilder::new(stub))
5120        }
5121
5122        /// Sets the full request, replacing any prior values.
5123        pub fn with_request<V: Into<crate::model::ImportConversationDataRequest>>(
5124            mut self,
5125            v: V,
5126        ) -> Self {
5127            self.0.request = v.into();
5128            self
5129        }
5130
5131        /// Sets all the options, replacing any prior values.
5132        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5133            self.0.options = v.into();
5134            self
5135        }
5136
5137        /// Sends the request.
5138        ///
5139        /// # Long running operations
5140        ///
5141        /// This starts, but does not poll, a longrunning operation. More information
5142        /// on [import_conversation_data][crate::client::ConversationDatasets::import_conversation_data].
5143        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5144            (*self.0.stub)
5145                .import_conversation_data(self.0.request, self.0.options)
5146                .await
5147                .map(crate::Response::into_body)
5148        }
5149
5150        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_conversation_data`.
5151        pub fn poller(
5152            self,
5153        ) -> impl google_cloud_lro::Poller<
5154            crate::model::ImportConversationDataOperationResponse,
5155            crate::model::ImportConversationDataOperationMetadata,
5156        > {
5157            type Operation = google_cloud_lro::internal::Operation<
5158                crate::model::ImportConversationDataOperationResponse,
5159                crate::model::ImportConversationDataOperationMetadata,
5160            >;
5161            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5162            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5163
5164            let stub = self.0.stub.clone();
5165            let mut options = self.0.options.clone();
5166            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5167            let query = move |name| {
5168                let stub = stub.clone();
5169                let options = options.clone();
5170                async {
5171                    let op = GetOperation::new(stub)
5172                        .set_name(name)
5173                        .with_options(options)
5174                        .send()
5175                        .await?;
5176                    Ok(Operation::new(op))
5177                }
5178            };
5179
5180            let start = move || async {
5181                let op = self.send().await?;
5182                Ok(Operation::new(op))
5183            };
5184
5185            google_cloud_lro::internal::new_poller(
5186                polling_error_policy,
5187                polling_backoff_policy,
5188                start,
5189                query,
5190            )
5191        }
5192
5193        /// Sets the value of [name][crate::model::ImportConversationDataRequest::name].
5194        ///
5195        /// This is a **required** field for requests.
5196        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5197            self.0.request.name = v.into();
5198            self
5199        }
5200
5201        /// Sets the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5202        ///
5203        /// This is a **required** field for requests.
5204        pub fn set_input_config<T>(mut self, v: T) -> Self
5205        where
5206            T: std::convert::Into<crate::model::InputConfig>,
5207        {
5208            self.0.request.input_config = std::option::Option::Some(v.into());
5209            self
5210        }
5211
5212        /// Sets or clears the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5213        ///
5214        /// This is a **required** field for requests.
5215        pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5216        where
5217            T: std::convert::Into<crate::model::InputConfig>,
5218        {
5219            self.0.request.input_config = v.map(|x| x.into());
5220            self
5221        }
5222    }
5223
5224    #[doc(hidden)]
5225    impl crate::RequestBuilder for ImportConversationData {
5226        fn request_options(&mut self) -> &mut crate::RequestOptions {
5227            &mut self.0.options
5228        }
5229    }
5230
5231    /// The request builder for [ConversationDatasets::list_locations][crate::client::ConversationDatasets::list_locations] calls.
5232    ///
5233    /// # Example
5234    /// ```
5235    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListLocations;
5236    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5237    /// use google_cloud_gax::paginator::ItemPaginator;
5238    ///
5239    /// let builder = prepare_request_builder();
5240    /// let mut items = builder.by_item();
5241    /// while let Some(result) = items.next().await {
5242    ///   let item = result?;
5243    /// }
5244    /// # Ok(()) }
5245    ///
5246    /// fn prepare_request_builder() -> ListLocations {
5247    ///   # panic!();
5248    ///   // ... details omitted ...
5249    /// }
5250    /// ```
5251    #[derive(Clone, Debug)]
5252    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5253
5254    impl ListLocations {
5255        pub(crate) fn new(
5256            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5257        ) -> Self {
5258            Self(RequestBuilder::new(stub))
5259        }
5260
5261        /// Sets the full request, replacing any prior values.
5262        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5263            mut self,
5264            v: V,
5265        ) -> Self {
5266            self.0.request = v.into();
5267            self
5268        }
5269
5270        /// Sets all the options, replacing any prior values.
5271        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5272            self.0.options = v.into();
5273            self
5274        }
5275
5276        /// Sends the request.
5277        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5278            (*self.0.stub)
5279                .list_locations(self.0.request, self.0.options)
5280                .await
5281                .map(crate::Response::into_body)
5282        }
5283
5284        /// Streams each page in the collection.
5285        pub fn by_page(
5286            self,
5287        ) -> impl google_cloud_gax::paginator::Paginator<
5288            google_cloud_location::model::ListLocationsResponse,
5289            crate::Error,
5290        > {
5291            use std::clone::Clone;
5292            let token = self.0.request.page_token.clone();
5293            let execute = move |token: String| {
5294                let mut builder = self.clone();
5295                builder.0.request = builder.0.request.set_page_token(token);
5296                builder.send()
5297            };
5298            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5299        }
5300
5301        /// Streams each item in the collection.
5302        pub fn by_item(
5303            self,
5304        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5305            google_cloud_location::model::ListLocationsResponse,
5306            crate::Error,
5307        > {
5308            use google_cloud_gax::paginator::Paginator;
5309            self.by_page().items()
5310        }
5311
5312        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
5313        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5314            self.0.request.name = v.into();
5315            self
5316        }
5317
5318        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
5319        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5320            self.0.request.filter = v.into();
5321            self
5322        }
5323
5324        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
5325        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5326            self.0.request.page_size = v.into();
5327            self
5328        }
5329
5330        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
5331        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5332            self.0.request.page_token = v.into();
5333            self
5334        }
5335    }
5336
5337    #[doc(hidden)]
5338    impl crate::RequestBuilder for ListLocations {
5339        fn request_options(&mut self) -> &mut crate::RequestOptions {
5340            &mut self.0.options
5341        }
5342    }
5343
5344    /// The request builder for [ConversationDatasets::get_location][crate::client::ConversationDatasets::get_location] calls.
5345    ///
5346    /// # Example
5347    /// ```
5348    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetLocation;
5349    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5350    ///
5351    /// let builder = prepare_request_builder();
5352    /// let response = builder.send().await?;
5353    /// # Ok(()) }
5354    ///
5355    /// fn prepare_request_builder() -> GetLocation {
5356    ///   # panic!();
5357    ///   // ... details omitted ...
5358    /// }
5359    /// ```
5360    #[derive(Clone, Debug)]
5361    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5362
5363    impl GetLocation {
5364        pub(crate) fn new(
5365            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5366        ) -> Self {
5367            Self(RequestBuilder::new(stub))
5368        }
5369
5370        /// Sets the full request, replacing any prior values.
5371        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5372            mut self,
5373            v: V,
5374        ) -> Self {
5375            self.0.request = v.into();
5376            self
5377        }
5378
5379        /// Sets all the options, replacing any prior values.
5380        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5381            self.0.options = v.into();
5382            self
5383        }
5384
5385        /// Sends the request.
5386        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5387            (*self.0.stub)
5388                .get_location(self.0.request, self.0.options)
5389                .await
5390                .map(crate::Response::into_body)
5391        }
5392
5393        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
5394        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5395            self.0.request.name = v.into();
5396            self
5397        }
5398    }
5399
5400    #[doc(hidden)]
5401    impl crate::RequestBuilder for GetLocation {
5402        fn request_options(&mut self) -> &mut crate::RequestOptions {
5403            &mut self.0.options
5404        }
5405    }
5406
5407    /// The request builder for [ConversationDatasets::list_operations][crate::client::ConversationDatasets::list_operations] calls.
5408    ///
5409    /// # Example
5410    /// ```
5411    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListOperations;
5412    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5413    /// use google_cloud_gax::paginator::ItemPaginator;
5414    ///
5415    /// let builder = prepare_request_builder();
5416    /// let mut items = builder.by_item();
5417    /// while let Some(result) = items.next().await {
5418    ///   let item = result?;
5419    /// }
5420    /// # Ok(()) }
5421    ///
5422    /// fn prepare_request_builder() -> ListOperations {
5423    ///   # panic!();
5424    ///   // ... details omitted ...
5425    /// }
5426    /// ```
5427    #[derive(Clone, Debug)]
5428    pub struct ListOperations(
5429        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5430    );
5431
5432    impl ListOperations {
5433        pub(crate) fn new(
5434            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5435        ) -> Self {
5436            Self(RequestBuilder::new(stub))
5437        }
5438
5439        /// Sets the full request, replacing any prior values.
5440        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5441            mut self,
5442            v: V,
5443        ) -> Self {
5444            self.0.request = v.into();
5445            self
5446        }
5447
5448        /// Sets all the options, replacing any prior values.
5449        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5450            self.0.options = v.into();
5451            self
5452        }
5453
5454        /// Sends the request.
5455        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5456            (*self.0.stub)
5457                .list_operations(self.0.request, self.0.options)
5458                .await
5459                .map(crate::Response::into_body)
5460        }
5461
5462        /// Streams each page in the collection.
5463        pub fn by_page(
5464            self,
5465        ) -> impl google_cloud_gax::paginator::Paginator<
5466            google_cloud_longrunning::model::ListOperationsResponse,
5467            crate::Error,
5468        > {
5469            use std::clone::Clone;
5470            let token = self.0.request.page_token.clone();
5471            let execute = move |token: String| {
5472                let mut builder = self.clone();
5473                builder.0.request = builder.0.request.set_page_token(token);
5474                builder.send()
5475            };
5476            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5477        }
5478
5479        /// Streams each item in the collection.
5480        pub fn by_item(
5481            self,
5482        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5483            google_cloud_longrunning::model::ListOperationsResponse,
5484            crate::Error,
5485        > {
5486            use google_cloud_gax::paginator::Paginator;
5487            self.by_page().items()
5488        }
5489
5490        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5491        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5492            self.0.request.name = v.into();
5493            self
5494        }
5495
5496        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5497        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5498            self.0.request.filter = v.into();
5499            self
5500        }
5501
5502        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5503        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5504            self.0.request.page_size = v.into();
5505            self
5506        }
5507
5508        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5509        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5510            self.0.request.page_token = v.into();
5511            self
5512        }
5513
5514        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5515        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5516            self.0.request.return_partial_success = v.into();
5517            self
5518        }
5519    }
5520
5521    #[doc(hidden)]
5522    impl crate::RequestBuilder for ListOperations {
5523        fn request_options(&mut self) -> &mut crate::RequestOptions {
5524            &mut self.0.options
5525        }
5526    }
5527
5528    /// The request builder for [ConversationDatasets::get_operation][crate::client::ConversationDatasets::get_operation] calls.
5529    ///
5530    /// # Example
5531    /// ```
5532    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetOperation;
5533    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5534    ///
5535    /// let builder = prepare_request_builder();
5536    /// let response = builder.send().await?;
5537    /// # Ok(()) }
5538    ///
5539    /// fn prepare_request_builder() -> GetOperation {
5540    ///   # panic!();
5541    ///   // ... details omitted ...
5542    /// }
5543    /// ```
5544    #[derive(Clone, Debug)]
5545    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5546
5547    impl GetOperation {
5548        pub(crate) fn new(
5549            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5550        ) -> Self {
5551            Self(RequestBuilder::new(stub))
5552        }
5553
5554        /// Sets the full request, replacing any prior values.
5555        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5556            mut self,
5557            v: V,
5558        ) -> Self {
5559            self.0.request = v.into();
5560            self
5561        }
5562
5563        /// Sets all the options, replacing any prior values.
5564        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5565            self.0.options = v.into();
5566            self
5567        }
5568
5569        /// Sends the request.
5570        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5571            (*self.0.stub)
5572                .get_operation(self.0.request, self.0.options)
5573                .await
5574                .map(crate::Response::into_body)
5575        }
5576
5577        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5578        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5579            self.0.request.name = v.into();
5580            self
5581        }
5582    }
5583
5584    #[doc(hidden)]
5585    impl crate::RequestBuilder for GetOperation {
5586        fn request_options(&mut self) -> &mut crate::RequestOptions {
5587            &mut self.0.options
5588        }
5589    }
5590
5591    /// The request builder for [ConversationDatasets::cancel_operation][crate::client::ConversationDatasets::cancel_operation] calls.
5592    ///
5593    /// # Example
5594    /// ```
5595    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::CancelOperation;
5596    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5597    ///
5598    /// let builder = prepare_request_builder();
5599    /// let response = builder.send().await?;
5600    /// # Ok(()) }
5601    ///
5602    /// fn prepare_request_builder() -> CancelOperation {
5603    ///   # panic!();
5604    ///   // ... details omitted ...
5605    /// }
5606    /// ```
5607    #[derive(Clone, Debug)]
5608    pub struct CancelOperation(
5609        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5610    );
5611
5612    impl CancelOperation {
5613        pub(crate) fn new(
5614            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5615        ) -> Self {
5616            Self(RequestBuilder::new(stub))
5617        }
5618
5619        /// Sets the full request, replacing any prior values.
5620        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5621            mut self,
5622            v: V,
5623        ) -> Self {
5624            self.0.request = v.into();
5625            self
5626        }
5627
5628        /// Sets all the options, replacing any prior values.
5629        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5630            self.0.options = v.into();
5631            self
5632        }
5633
5634        /// Sends the request.
5635        pub async fn send(self) -> Result<()> {
5636            (*self.0.stub)
5637                .cancel_operation(self.0.request, self.0.options)
5638                .await
5639                .map(crate::Response::into_body)
5640        }
5641
5642        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5643        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5644            self.0.request.name = v.into();
5645            self
5646        }
5647    }
5648
5649    #[doc(hidden)]
5650    impl crate::RequestBuilder for CancelOperation {
5651        fn request_options(&mut self) -> &mut crate::RequestOptions {
5652            &mut self.0.options
5653        }
5654    }
5655}
5656
5657#[cfg(feature = "conversation-models")]
5658#[cfg_attr(docsrs, doc(cfg(feature = "conversation-models")))]
5659pub mod conversation_models {
5660    use crate::Result;
5661
5662    /// A builder for [ConversationModels][crate::client::ConversationModels].
5663    ///
5664    /// ```
5665    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5666    /// # use google_cloud_dialogflow_v2::*;
5667    /// # use builder::conversation_models::ClientBuilder;
5668    /// # use client::ConversationModels;
5669    /// let builder : ClientBuilder = ConversationModels::builder();
5670    /// let client = builder
5671    ///     .with_endpoint("https://dialogflow.googleapis.com")
5672    ///     .build().await?;
5673    /// # Ok(()) }
5674    /// ```
5675    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5676
5677    pub(crate) mod client {
5678        use super::super::super::client::ConversationModels;
5679        pub struct Factory;
5680        impl crate::ClientFactory for Factory {
5681            type Client = ConversationModels;
5682            type Credentials = gaxi::options::Credentials;
5683            async fn build(
5684                self,
5685                config: gaxi::options::ClientConfig,
5686            ) -> crate::ClientBuilderResult<Self::Client> {
5687                Self::Client::new(config).await
5688            }
5689        }
5690    }
5691
5692    /// Common implementation for [crate::client::ConversationModels] request builders.
5693    #[derive(Clone, Debug)]
5694    pub(crate) struct RequestBuilder<R: std::default::Default> {
5695        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5696        request: R,
5697        options: crate::RequestOptions,
5698    }
5699
5700    impl<R> RequestBuilder<R>
5701    where
5702        R: std::default::Default,
5703    {
5704        pub(crate) fn new(
5705            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5706        ) -> Self {
5707            Self {
5708                stub,
5709                request: R::default(),
5710                options: crate::RequestOptions::default(),
5711            }
5712        }
5713    }
5714
5715    /// The request builder for [ConversationModels::create_conversation_model][crate::client::ConversationModels::create_conversation_model] calls.
5716    ///
5717    /// # Example
5718    /// ```
5719    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CreateConversationModel;
5720    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5721    /// use google_cloud_lro::Poller;
5722    ///
5723    /// let builder = prepare_request_builder();
5724    /// let response = builder.poller().until_done().await?;
5725    /// # Ok(()) }
5726    ///
5727    /// fn prepare_request_builder() -> CreateConversationModel {
5728    ///   # panic!();
5729    ///   // ... details omitted ...
5730    /// }
5731    /// ```
5732    #[derive(Clone, Debug)]
5733    pub struct CreateConversationModel(
5734        RequestBuilder<crate::model::CreateConversationModelRequest>,
5735    );
5736
5737    impl CreateConversationModel {
5738        pub(crate) fn new(
5739            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5740        ) -> Self {
5741            Self(RequestBuilder::new(stub))
5742        }
5743
5744        /// Sets the full request, replacing any prior values.
5745        pub fn with_request<V: Into<crate::model::CreateConversationModelRequest>>(
5746            mut self,
5747            v: V,
5748        ) -> Self {
5749            self.0.request = v.into();
5750            self
5751        }
5752
5753        /// Sets all the options, replacing any prior values.
5754        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5755            self.0.options = v.into();
5756            self
5757        }
5758
5759        /// Sends the request.
5760        ///
5761        /// # Long running operations
5762        ///
5763        /// This starts, but does not poll, a longrunning operation. More information
5764        /// on [create_conversation_model][crate::client::ConversationModels::create_conversation_model].
5765        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5766            (*self.0.stub)
5767                .create_conversation_model(self.0.request, self.0.options)
5768                .await
5769                .map(crate::Response::into_body)
5770        }
5771
5772        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_model`.
5773        pub fn poller(
5774            self,
5775        ) -> impl google_cloud_lro::Poller<
5776            crate::model::ConversationModel,
5777            crate::model::CreateConversationModelOperationMetadata,
5778        > {
5779            type Operation = google_cloud_lro::internal::Operation<
5780                crate::model::ConversationModel,
5781                crate::model::CreateConversationModelOperationMetadata,
5782            >;
5783            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5784            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5785
5786            let stub = self.0.stub.clone();
5787            let mut options = self.0.options.clone();
5788            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5789            let query = move |name| {
5790                let stub = stub.clone();
5791                let options = options.clone();
5792                async {
5793                    let op = GetOperation::new(stub)
5794                        .set_name(name)
5795                        .with_options(options)
5796                        .send()
5797                        .await?;
5798                    Ok(Operation::new(op))
5799                }
5800            };
5801
5802            let start = move || async {
5803                let op = self.send().await?;
5804                Ok(Operation::new(op))
5805            };
5806
5807            google_cloud_lro::internal::new_poller(
5808                polling_error_policy,
5809                polling_backoff_policy,
5810                start,
5811                query,
5812            )
5813        }
5814
5815        /// Sets the value of [parent][crate::model::CreateConversationModelRequest::parent].
5816        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5817            self.0.request.parent = v.into();
5818            self
5819        }
5820
5821        /// Sets the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5822        ///
5823        /// This is a **required** field for requests.
5824        pub fn set_conversation_model<T>(mut self, v: T) -> Self
5825        where
5826            T: std::convert::Into<crate::model::ConversationModel>,
5827        {
5828            self.0.request.conversation_model = std::option::Option::Some(v.into());
5829            self
5830        }
5831
5832        /// Sets or clears the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5833        ///
5834        /// This is a **required** field for requests.
5835        pub fn set_or_clear_conversation_model<T>(mut self, v: std::option::Option<T>) -> Self
5836        where
5837            T: std::convert::Into<crate::model::ConversationModel>,
5838        {
5839            self.0.request.conversation_model = v.map(|x| x.into());
5840            self
5841        }
5842    }
5843
5844    #[doc(hidden)]
5845    impl crate::RequestBuilder for CreateConversationModel {
5846        fn request_options(&mut self) -> &mut crate::RequestOptions {
5847            &mut self.0.options
5848        }
5849    }
5850
5851    /// The request builder for [ConversationModels::get_conversation_model][crate::client::ConversationModels::get_conversation_model] calls.
5852    ///
5853    /// # Example
5854    /// ```
5855    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetConversationModel;
5856    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5857    ///
5858    /// let builder = prepare_request_builder();
5859    /// let response = builder.send().await?;
5860    /// # Ok(()) }
5861    ///
5862    /// fn prepare_request_builder() -> GetConversationModel {
5863    ///   # panic!();
5864    ///   // ... details omitted ...
5865    /// }
5866    /// ```
5867    #[derive(Clone, Debug)]
5868    pub struct GetConversationModel(RequestBuilder<crate::model::GetConversationModelRequest>);
5869
5870    impl GetConversationModel {
5871        pub(crate) fn new(
5872            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5873        ) -> Self {
5874            Self(RequestBuilder::new(stub))
5875        }
5876
5877        /// Sets the full request, replacing any prior values.
5878        pub fn with_request<V: Into<crate::model::GetConversationModelRequest>>(
5879            mut self,
5880            v: V,
5881        ) -> Self {
5882            self.0.request = v.into();
5883            self
5884        }
5885
5886        /// Sets all the options, replacing any prior values.
5887        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5888            self.0.options = v.into();
5889            self
5890        }
5891
5892        /// Sends the request.
5893        pub async fn send(self) -> Result<crate::model::ConversationModel> {
5894            (*self.0.stub)
5895                .get_conversation_model(self.0.request, self.0.options)
5896                .await
5897                .map(crate::Response::into_body)
5898        }
5899
5900        /// Sets the value of [name][crate::model::GetConversationModelRequest::name].
5901        ///
5902        /// This is a **required** field for requests.
5903        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5904            self.0.request.name = v.into();
5905            self
5906        }
5907    }
5908
5909    #[doc(hidden)]
5910    impl crate::RequestBuilder for GetConversationModel {
5911        fn request_options(&mut self) -> &mut crate::RequestOptions {
5912            &mut self.0.options
5913        }
5914    }
5915
5916    /// The request builder for [ConversationModels::list_conversation_models][crate::client::ConversationModels::list_conversation_models] calls.
5917    ///
5918    /// # Example
5919    /// ```
5920    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListConversationModels;
5921    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
5922    /// use google_cloud_gax::paginator::ItemPaginator;
5923    ///
5924    /// let builder = prepare_request_builder();
5925    /// let mut items = builder.by_item();
5926    /// while let Some(result) = items.next().await {
5927    ///   let item = result?;
5928    /// }
5929    /// # Ok(()) }
5930    ///
5931    /// fn prepare_request_builder() -> ListConversationModels {
5932    ///   # panic!();
5933    ///   // ... details omitted ...
5934    /// }
5935    /// ```
5936    #[derive(Clone, Debug)]
5937    pub struct ListConversationModels(RequestBuilder<crate::model::ListConversationModelsRequest>);
5938
5939    impl ListConversationModels {
5940        pub(crate) fn new(
5941            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5942        ) -> Self {
5943            Self(RequestBuilder::new(stub))
5944        }
5945
5946        /// Sets the full request, replacing any prior values.
5947        pub fn with_request<V: Into<crate::model::ListConversationModelsRequest>>(
5948            mut self,
5949            v: V,
5950        ) -> Self {
5951            self.0.request = v.into();
5952            self
5953        }
5954
5955        /// Sets all the options, replacing any prior values.
5956        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5957            self.0.options = v.into();
5958            self
5959        }
5960
5961        /// Sends the request.
5962        pub async fn send(self) -> Result<crate::model::ListConversationModelsResponse> {
5963            (*self.0.stub)
5964                .list_conversation_models(self.0.request, self.0.options)
5965                .await
5966                .map(crate::Response::into_body)
5967        }
5968
5969        /// Streams each page in the collection.
5970        pub fn by_page(
5971            self,
5972        ) -> impl google_cloud_gax::paginator::Paginator<
5973            crate::model::ListConversationModelsResponse,
5974            crate::Error,
5975        > {
5976            use std::clone::Clone;
5977            let token = self.0.request.page_token.clone();
5978            let execute = move |token: String| {
5979                let mut builder = self.clone();
5980                builder.0.request = builder.0.request.set_page_token(token);
5981                builder.send()
5982            };
5983            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5984        }
5985
5986        /// Streams each item in the collection.
5987        pub fn by_item(
5988            self,
5989        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5990            crate::model::ListConversationModelsResponse,
5991            crate::Error,
5992        > {
5993            use google_cloud_gax::paginator::Paginator;
5994            self.by_page().items()
5995        }
5996
5997        /// Sets the value of [parent][crate::model::ListConversationModelsRequest::parent].
5998        ///
5999        /// This is a **required** field for requests.
6000        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6001            self.0.request.parent = v.into();
6002            self
6003        }
6004
6005        /// Sets the value of [page_size][crate::model::ListConversationModelsRequest::page_size].
6006        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6007            self.0.request.page_size = v.into();
6008            self
6009        }
6010
6011        /// Sets the value of [page_token][crate::model::ListConversationModelsRequest::page_token].
6012        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013            self.0.request.page_token = v.into();
6014            self
6015        }
6016    }
6017
6018    #[doc(hidden)]
6019    impl crate::RequestBuilder for ListConversationModels {
6020        fn request_options(&mut self) -> &mut crate::RequestOptions {
6021            &mut self.0.options
6022        }
6023    }
6024
6025    /// The request builder for [ConversationModels::delete_conversation_model][crate::client::ConversationModels::delete_conversation_model] calls.
6026    ///
6027    /// # Example
6028    /// ```
6029    /// # use google_cloud_dialogflow_v2::builder::conversation_models::DeleteConversationModel;
6030    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6031    /// use google_cloud_lro::Poller;
6032    ///
6033    /// let builder = prepare_request_builder();
6034    /// let response = builder.poller().until_done().await?;
6035    /// # Ok(()) }
6036    ///
6037    /// fn prepare_request_builder() -> DeleteConversationModel {
6038    ///   # panic!();
6039    ///   // ... details omitted ...
6040    /// }
6041    /// ```
6042    #[derive(Clone, Debug)]
6043    pub struct DeleteConversationModel(
6044        RequestBuilder<crate::model::DeleteConversationModelRequest>,
6045    );
6046
6047    impl DeleteConversationModel {
6048        pub(crate) fn new(
6049            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6050        ) -> Self {
6051            Self(RequestBuilder::new(stub))
6052        }
6053
6054        /// Sets the full request, replacing any prior values.
6055        pub fn with_request<V: Into<crate::model::DeleteConversationModelRequest>>(
6056            mut self,
6057            v: V,
6058        ) -> Self {
6059            self.0.request = v.into();
6060            self
6061        }
6062
6063        /// Sets all the options, replacing any prior values.
6064        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6065            self.0.options = v.into();
6066            self
6067        }
6068
6069        /// Sends the request.
6070        ///
6071        /// # Long running operations
6072        ///
6073        /// This starts, but does not poll, a longrunning operation. More information
6074        /// on [delete_conversation_model][crate::client::ConversationModels::delete_conversation_model].
6075        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6076            (*self.0.stub)
6077                .delete_conversation_model(self.0.request, self.0.options)
6078                .await
6079                .map(crate::Response::into_body)
6080        }
6081
6082        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_conversation_model`.
6083        pub fn poller(
6084            self,
6085        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteConversationModelOperationMetadata>
6086        {
6087            type Operation = google_cloud_lro::internal::Operation<
6088                wkt::Empty,
6089                crate::model::DeleteConversationModelOperationMetadata,
6090            >;
6091            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6092            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6093
6094            let stub = self.0.stub.clone();
6095            let mut options = self.0.options.clone();
6096            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6097            let query = move |name| {
6098                let stub = stub.clone();
6099                let options = options.clone();
6100                async {
6101                    let op = GetOperation::new(stub)
6102                        .set_name(name)
6103                        .with_options(options)
6104                        .send()
6105                        .await?;
6106                    Ok(Operation::new(op))
6107                }
6108            };
6109
6110            let start = move || async {
6111                let op = self.send().await?;
6112                Ok(Operation::new(op))
6113            };
6114
6115            google_cloud_lro::internal::new_unit_response_poller(
6116                polling_error_policy,
6117                polling_backoff_policy,
6118                start,
6119                query,
6120            )
6121        }
6122
6123        /// Sets the value of [name][crate::model::DeleteConversationModelRequest::name].
6124        ///
6125        /// This is a **required** field for requests.
6126        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6127            self.0.request.name = v.into();
6128            self
6129        }
6130    }
6131
6132    #[doc(hidden)]
6133    impl crate::RequestBuilder for DeleteConversationModel {
6134        fn request_options(&mut self) -> &mut crate::RequestOptions {
6135            &mut self.0.options
6136        }
6137    }
6138
6139    /// The request builder for [ConversationModels::deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model] calls.
6140    ///
6141    /// # Example
6142    /// ```
6143    /// # use google_cloud_dialogflow_v2::builder::conversation_models::DeployConversationModel;
6144    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6145    /// use google_cloud_lro::Poller;
6146    ///
6147    /// let builder = prepare_request_builder();
6148    /// let response = builder.poller().until_done().await?;
6149    /// # Ok(()) }
6150    ///
6151    /// fn prepare_request_builder() -> DeployConversationModel {
6152    ///   # panic!();
6153    ///   // ... details omitted ...
6154    /// }
6155    /// ```
6156    #[derive(Clone, Debug)]
6157    pub struct DeployConversationModel(
6158        RequestBuilder<crate::model::DeployConversationModelRequest>,
6159    );
6160
6161    impl DeployConversationModel {
6162        pub(crate) fn new(
6163            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6164        ) -> Self {
6165            Self(RequestBuilder::new(stub))
6166        }
6167
6168        /// Sets the full request, replacing any prior values.
6169        pub fn with_request<V: Into<crate::model::DeployConversationModelRequest>>(
6170            mut self,
6171            v: V,
6172        ) -> Self {
6173            self.0.request = v.into();
6174            self
6175        }
6176
6177        /// Sets all the options, replacing any prior values.
6178        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6179            self.0.options = v.into();
6180            self
6181        }
6182
6183        /// Sends the request.
6184        ///
6185        /// # Long running operations
6186        ///
6187        /// This starts, but does not poll, a longrunning operation. More information
6188        /// on [deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model].
6189        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6190            (*self.0.stub)
6191                .deploy_conversation_model(self.0.request, self.0.options)
6192                .await
6193                .map(crate::Response::into_body)
6194        }
6195
6196        /// Creates a [Poller][google_cloud_lro::Poller] to work with `deploy_conversation_model`.
6197        pub fn poller(
6198            self,
6199        ) -> impl google_cloud_lro::Poller<(), crate::model::DeployConversationModelOperationMetadata>
6200        {
6201            type Operation = google_cloud_lro::internal::Operation<
6202                wkt::Empty,
6203                crate::model::DeployConversationModelOperationMetadata,
6204            >;
6205            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6206            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6207
6208            let stub = self.0.stub.clone();
6209            let mut options = self.0.options.clone();
6210            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6211            let query = move |name| {
6212                let stub = stub.clone();
6213                let options = options.clone();
6214                async {
6215                    let op = GetOperation::new(stub)
6216                        .set_name(name)
6217                        .with_options(options)
6218                        .send()
6219                        .await?;
6220                    Ok(Operation::new(op))
6221                }
6222            };
6223
6224            let start = move || async {
6225                let op = self.send().await?;
6226                Ok(Operation::new(op))
6227            };
6228
6229            google_cloud_lro::internal::new_unit_response_poller(
6230                polling_error_policy,
6231                polling_backoff_policy,
6232                start,
6233                query,
6234            )
6235        }
6236
6237        /// Sets the value of [name][crate::model::DeployConversationModelRequest::name].
6238        ///
6239        /// This is a **required** field for requests.
6240        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6241            self.0.request.name = v.into();
6242            self
6243        }
6244    }
6245
6246    #[doc(hidden)]
6247    impl crate::RequestBuilder for DeployConversationModel {
6248        fn request_options(&mut self) -> &mut crate::RequestOptions {
6249            &mut self.0.options
6250        }
6251    }
6252
6253    /// The request builder for [ConversationModels::undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model] calls.
6254    ///
6255    /// # Example
6256    /// ```
6257    /// # use google_cloud_dialogflow_v2::builder::conversation_models::UndeployConversationModel;
6258    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6259    /// use google_cloud_lro::Poller;
6260    ///
6261    /// let builder = prepare_request_builder();
6262    /// let response = builder.poller().until_done().await?;
6263    /// # Ok(()) }
6264    ///
6265    /// fn prepare_request_builder() -> UndeployConversationModel {
6266    ///   # panic!();
6267    ///   // ... details omitted ...
6268    /// }
6269    /// ```
6270    #[derive(Clone, Debug)]
6271    pub struct UndeployConversationModel(
6272        RequestBuilder<crate::model::UndeployConversationModelRequest>,
6273    );
6274
6275    impl UndeployConversationModel {
6276        pub(crate) fn new(
6277            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6278        ) -> Self {
6279            Self(RequestBuilder::new(stub))
6280        }
6281
6282        /// Sets the full request, replacing any prior values.
6283        pub fn with_request<V: Into<crate::model::UndeployConversationModelRequest>>(
6284            mut self,
6285            v: V,
6286        ) -> Self {
6287            self.0.request = v.into();
6288            self
6289        }
6290
6291        /// Sets all the options, replacing any prior values.
6292        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6293            self.0.options = v.into();
6294            self
6295        }
6296
6297        /// Sends the request.
6298        ///
6299        /// # Long running operations
6300        ///
6301        /// This starts, but does not poll, a longrunning operation. More information
6302        /// on [undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model].
6303        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6304            (*self.0.stub)
6305                .undeploy_conversation_model(self.0.request, self.0.options)
6306                .await
6307                .map(crate::Response::into_body)
6308        }
6309
6310        /// Creates a [Poller][google_cloud_lro::Poller] to work with `undeploy_conversation_model`.
6311        pub fn poller(
6312            self,
6313        ) -> impl google_cloud_lro::Poller<(), crate::model::UndeployConversationModelOperationMetadata>
6314        {
6315            type Operation = google_cloud_lro::internal::Operation<
6316                wkt::Empty,
6317                crate::model::UndeployConversationModelOperationMetadata,
6318            >;
6319            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6320            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6321
6322            let stub = self.0.stub.clone();
6323            let mut options = self.0.options.clone();
6324            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6325            let query = move |name| {
6326                let stub = stub.clone();
6327                let options = options.clone();
6328                async {
6329                    let op = GetOperation::new(stub)
6330                        .set_name(name)
6331                        .with_options(options)
6332                        .send()
6333                        .await?;
6334                    Ok(Operation::new(op))
6335                }
6336            };
6337
6338            let start = move || async {
6339                let op = self.send().await?;
6340                Ok(Operation::new(op))
6341            };
6342
6343            google_cloud_lro::internal::new_unit_response_poller(
6344                polling_error_policy,
6345                polling_backoff_policy,
6346                start,
6347                query,
6348            )
6349        }
6350
6351        /// Sets the value of [name][crate::model::UndeployConversationModelRequest::name].
6352        ///
6353        /// This is a **required** field for requests.
6354        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6355            self.0.request.name = v.into();
6356            self
6357        }
6358    }
6359
6360    #[doc(hidden)]
6361    impl crate::RequestBuilder for UndeployConversationModel {
6362        fn request_options(&mut self) -> &mut crate::RequestOptions {
6363            &mut self.0.options
6364        }
6365    }
6366
6367    /// The request builder for [ConversationModels::get_conversation_model_evaluation][crate::client::ConversationModels::get_conversation_model_evaluation] calls.
6368    ///
6369    /// # Example
6370    /// ```
6371    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetConversationModelEvaluation;
6372    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6373    ///
6374    /// let builder = prepare_request_builder();
6375    /// let response = builder.send().await?;
6376    /// # Ok(()) }
6377    ///
6378    /// fn prepare_request_builder() -> GetConversationModelEvaluation {
6379    ///   # panic!();
6380    ///   // ... details omitted ...
6381    /// }
6382    /// ```
6383    #[derive(Clone, Debug)]
6384    pub struct GetConversationModelEvaluation(
6385        RequestBuilder<crate::model::GetConversationModelEvaluationRequest>,
6386    );
6387
6388    impl GetConversationModelEvaluation {
6389        pub(crate) fn new(
6390            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6391        ) -> Self {
6392            Self(RequestBuilder::new(stub))
6393        }
6394
6395        /// Sets the full request, replacing any prior values.
6396        pub fn with_request<V: Into<crate::model::GetConversationModelEvaluationRequest>>(
6397            mut self,
6398            v: V,
6399        ) -> Self {
6400            self.0.request = v.into();
6401            self
6402        }
6403
6404        /// Sets all the options, replacing any prior values.
6405        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6406            self.0.options = v.into();
6407            self
6408        }
6409
6410        /// Sends the request.
6411        pub async fn send(self) -> Result<crate::model::ConversationModelEvaluation> {
6412            (*self.0.stub)
6413                .get_conversation_model_evaluation(self.0.request, self.0.options)
6414                .await
6415                .map(crate::Response::into_body)
6416        }
6417
6418        /// Sets the value of [name][crate::model::GetConversationModelEvaluationRequest::name].
6419        ///
6420        /// This is a **required** field for requests.
6421        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6422            self.0.request.name = v.into();
6423            self
6424        }
6425    }
6426
6427    #[doc(hidden)]
6428    impl crate::RequestBuilder for GetConversationModelEvaluation {
6429        fn request_options(&mut self) -> &mut crate::RequestOptions {
6430            &mut self.0.options
6431        }
6432    }
6433
6434    /// The request builder for [ConversationModels::list_conversation_model_evaluations][crate::client::ConversationModels::list_conversation_model_evaluations] calls.
6435    ///
6436    /// # Example
6437    /// ```
6438    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListConversationModelEvaluations;
6439    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6440    /// use google_cloud_gax::paginator::ItemPaginator;
6441    ///
6442    /// let builder = prepare_request_builder();
6443    /// let mut items = builder.by_item();
6444    /// while let Some(result) = items.next().await {
6445    ///   let item = result?;
6446    /// }
6447    /// # Ok(()) }
6448    ///
6449    /// fn prepare_request_builder() -> ListConversationModelEvaluations {
6450    ///   # panic!();
6451    ///   // ... details omitted ...
6452    /// }
6453    /// ```
6454    #[derive(Clone, Debug)]
6455    pub struct ListConversationModelEvaluations(
6456        RequestBuilder<crate::model::ListConversationModelEvaluationsRequest>,
6457    );
6458
6459    impl ListConversationModelEvaluations {
6460        pub(crate) fn new(
6461            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6462        ) -> Self {
6463            Self(RequestBuilder::new(stub))
6464        }
6465
6466        /// Sets the full request, replacing any prior values.
6467        pub fn with_request<V: Into<crate::model::ListConversationModelEvaluationsRequest>>(
6468            mut self,
6469            v: V,
6470        ) -> Self {
6471            self.0.request = v.into();
6472            self
6473        }
6474
6475        /// Sets all the options, replacing any prior values.
6476        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6477            self.0.options = v.into();
6478            self
6479        }
6480
6481        /// Sends the request.
6482        pub async fn send(self) -> Result<crate::model::ListConversationModelEvaluationsResponse> {
6483            (*self.0.stub)
6484                .list_conversation_model_evaluations(self.0.request, self.0.options)
6485                .await
6486                .map(crate::Response::into_body)
6487        }
6488
6489        /// Streams each page in the collection.
6490        pub fn by_page(
6491            self,
6492        ) -> impl google_cloud_gax::paginator::Paginator<
6493            crate::model::ListConversationModelEvaluationsResponse,
6494            crate::Error,
6495        > {
6496            use std::clone::Clone;
6497            let token = self.0.request.page_token.clone();
6498            let execute = move |token: String| {
6499                let mut builder = self.clone();
6500                builder.0.request = builder.0.request.set_page_token(token);
6501                builder.send()
6502            };
6503            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6504        }
6505
6506        /// Streams each item in the collection.
6507        pub fn by_item(
6508            self,
6509        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6510            crate::model::ListConversationModelEvaluationsResponse,
6511            crate::Error,
6512        > {
6513            use google_cloud_gax::paginator::Paginator;
6514            self.by_page().items()
6515        }
6516
6517        /// Sets the value of [parent][crate::model::ListConversationModelEvaluationsRequest::parent].
6518        ///
6519        /// This is a **required** field for requests.
6520        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6521            self.0.request.parent = v.into();
6522            self
6523        }
6524
6525        /// Sets the value of [page_size][crate::model::ListConversationModelEvaluationsRequest::page_size].
6526        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6527            self.0.request.page_size = v.into();
6528            self
6529        }
6530
6531        /// Sets the value of [page_token][crate::model::ListConversationModelEvaluationsRequest::page_token].
6532        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6533            self.0.request.page_token = v.into();
6534            self
6535        }
6536    }
6537
6538    #[doc(hidden)]
6539    impl crate::RequestBuilder for ListConversationModelEvaluations {
6540        fn request_options(&mut self) -> &mut crate::RequestOptions {
6541            &mut self.0.options
6542        }
6543    }
6544
6545    /// The request builder for [ConversationModels::create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation] calls.
6546    ///
6547    /// # Example
6548    /// ```
6549    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CreateConversationModelEvaluation;
6550    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6551    /// use google_cloud_lro::Poller;
6552    ///
6553    /// let builder = prepare_request_builder();
6554    /// let response = builder.poller().until_done().await?;
6555    /// # Ok(()) }
6556    ///
6557    /// fn prepare_request_builder() -> CreateConversationModelEvaluation {
6558    ///   # panic!();
6559    ///   // ... details omitted ...
6560    /// }
6561    /// ```
6562    #[derive(Clone, Debug)]
6563    pub struct CreateConversationModelEvaluation(
6564        RequestBuilder<crate::model::CreateConversationModelEvaluationRequest>,
6565    );
6566
6567    impl CreateConversationModelEvaluation {
6568        pub(crate) fn new(
6569            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6570        ) -> Self {
6571            Self(RequestBuilder::new(stub))
6572        }
6573
6574        /// Sets the full request, replacing any prior values.
6575        pub fn with_request<V: Into<crate::model::CreateConversationModelEvaluationRequest>>(
6576            mut self,
6577            v: V,
6578        ) -> Self {
6579            self.0.request = v.into();
6580            self
6581        }
6582
6583        /// Sets all the options, replacing any prior values.
6584        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6585            self.0.options = v.into();
6586            self
6587        }
6588
6589        /// Sends the request.
6590        ///
6591        /// # Long running operations
6592        ///
6593        /// This starts, but does not poll, a longrunning operation. More information
6594        /// on [create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation].
6595        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6596            (*self.0.stub)
6597                .create_conversation_model_evaluation(self.0.request, self.0.options)
6598                .await
6599                .map(crate::Response::into_body)
6600        }
6601
6602        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_conversation_model_evaluation`.
6603        pub fn poller(
6604            self,
6605        ) -> impl google_cloud_lro::Poller<
6606            crate::model::ConversationModelEvaluation,
6607            crate::model::CreateConversationModelEvaluationOperationMetadata,
6608        > {
6609            type Operation = google_cloud_lro::internal::Operation<
6610                crate::model::ConversationModelEvaluation,
6611                crate::model::CreateConversationModelEvaluationOperationMetadata,
6612            >;
6613            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6614            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6615
6616            let stub = self.0.stub.clone();
6617            let mut options = self.0.options.clone();
6618            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6619            let query = move |name| {
6620                let stub = stub.clone();
6621                let options = options.clone();
6622                async {
6623                    let op = GetOperation::new(stub)
6624                        .set_name(name)
6625                        .with_options(options)
6626                        .send()
6627                        .await?;
6628                    Ok(Operation::new(op))
6629                }
6630            };
6631
6632            let start = move || async {
6633                let op = self.send().await?;
6634                Ok(Operation::new(op))
6635            };
6636
6637            google_cloud_lro::internal::new_poller(
6638                polling_error_policy,
6639                polling_backoff_policy,
6640                start,
6641                query,
6642            )
6643        }
6644
6645        /// Sets the value of [parent][crate::model::CreateConversationModelEvaluationRequest::parent].
6646        ///
6647        /// This is a **required** field for requests.
6648        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6649            self.0.request.parent = v.into();
6650            self
6651        }
6652
6653        /// Sets the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6654        ///
6655        /// This is a **required** field for requests.
6656        pub fn set_conversation_model_evaluation<T>(mut self, v: T) -> Self
6657        where
6658            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6659        {
6660            self.0.request.conversation_model_evaluation = std::option::Option::Some(v.into());
6661            self
6662        }
6663
6664        /// Sets or clears the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6665        ///
6666        /// This is a **required** field for requests.
6667        pub fn set_or_clear_conversation_model_evaluation<T>(
6668            mut self,
6669            v: std::option::Option<T>,
6670        ) -> Self
6671        where
6672            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6673        {
6674            self.0.request.conversation_model_evaluation = v.map(|x| x.into());
6675            self
6676        }
6677    }
6678
6679    #[doc(hidden)]
6680    impl crate::RequestBuilder for CreateConversationModelEvaluation {
6681        fn request_options(&mut self) -> &mut crate::RequestOptions {
6682            &mut self.0.options
6683        }
6684    }
6685
6686    /// The request builder for [ConversationModels::list_locations][crate::client::ConversationModels::list_locations] calls.
6687    ///
6688    /// # Example
6689    /// ```
6690    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListLocations;
6691    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6692    /// use google_cloud_gax::paginator::ItemPaginator;
6693    ///
6694    /// let builder = prepare_request_builder();
6695    /// let mut items = builder.by_item();
6696    /// while let Some(result) = items.next().await {
6697    ///   let item = result?;
6698    /// }
6699    /// # Ok(()) }
6700    ///
6701    /// fn prepare_request_builder() -> ListLocations {
6702    ///   # panic!();
6703    ///   // ... details omitted ...
6704    /// }
6705    /// ```
6706    #[derive(Clone, Debug)]
6707    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6708
6709    impl ListLocations {
6710        pub(crate) fn new(
6711            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6712        ) -> Self {
6713            Self(RequestBuilder::new(stub))
6714        }
6715
6716        /// Sets the full request, replacing any prior values.
6717        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6718            mut self,
6719            v: V,
6720        ) -> Self {
6721            self.0.request = v.into();
6722            self
6723        }
6724
6725        /// Sets all the options, replacing any prior values.
6726        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6727            self.0.options = v.into();
6728            self
6729        }
6730
6731        /// Sends the request.
6732        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6733            (*self.0.stub)
6734                .list_locations(self.0.request, self.0.options)
6735                .await
6736                .map(crate::Response::into_body)
6737        }
6738
6739        /// Streams each page in the collection.
6740        pub fn by_page(
6741            self,
6742        ) -> impl google_cloud_gax::paginator::Paginator<
6743            google_cloud_location::model::ListLocationsResponse,
6744            crate::Error,
6745        > {
6746            use std::clone::Clone;
6747            let token = self.0.request.page_token.clone();
6748            let execute = move |token: String| {
6749                let mut builder = self.clone();
6750                builder.0.request = builder.0.request.set_page_token(token);
6751                builder.send()
6752            };
6753            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6754        }
6755
6756        /// Streams each item in the collection.
6757        pub fn by_item(
6758            self,
6759        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6760            google_cloud_location::model::ListLocationsResponse,
6761            crate::Error,
6762        > {
6763            use google_cloud_gax::paginator::Paginator;
6764            self.by_page().items()
6765        }
6766
6767        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6768        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6769            self.0.request.name = v.into();
6770            self
6771        }
6772
6773        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6774        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6775            self.0.request.filter = v.into();
6776            self
6777        }
6778
6779        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6780        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6781            self.0.request.page_size = v.into();
6782            self
6783        }
6784
6785        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6786        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6787            self.0.request.page_token = v.into();
6788            self
6789        }
6790    }
6791
6792    #[doc(hidden)]
6793    impl crate::RequestBuilder for ListLocations {
6794        fn request_options(&mut self) -> &mut crate::RequestOptions {
6795            &mut self.0.options
6796        }
6797    }
6798
6799    /// The request builder for [ConversationModels::get_location][crate::client::ConversationModels::get_location] calls.
6800    ///
6801    /// # Example
6802    /// ```
6803    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetLocation;
6804    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6805    ///
6806    /// let builder = prepare_request_builder();
6807    /// let response = builder.send().await?;
6808    /// # Ok(()) }
6809    ///
6810    /// fn prepare_request_builder() -> GetLocation {
6811    ///   # panic!();
6812    ///   // ... details omitted ...
6813    /// }
6814    /// ```
6815    #[derive(Clone, Debug)]
6816    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6817
6818    impl GetLocation {
6819        pub(crate) fn new(
6820            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6821        ) -> Self {
6822            Self(RequestBuilder::new(stub))
6823        }
6824
6825        /// Sets the full request, replacing any prior values.
6826        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6827            mut self,
6828            v: V,
6829        ) -> Self {
6830            self.0.request = v.into();
6831            self
6832        }
6833
6834        /// Sets all the options, replacing any prior values.
6835        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6836            self.0.options = v.into();
6837            self
6838        }
6839
6840        /// Sends the request.
6841        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6842            (*self.0.stub)
6843                .get_location(self.0.request, self.0.options)
6844                .await
6845                .map(crate::Response::into_body)
6846        }
6847
6848        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6849        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6850            self.0.request.name = v.into();
6851            self
6852        }
6853    }
6854
6855    #[doc(hidden)]
6856    impl crate::RequestBuilder for GetLocation {
6857        fn request_options(&mut self) -> &mut crate::RequestOptions {
6858            &mut self.0.options
6859        }
6860    }
6861
6862    /// The request builder for [ConversationModels::list_operations][crate::client::ConversationModels::list_operations] calls.
6863    ///
6864    /// # Example
6865    /// ```
6866    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListOperations;
6867    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6868    /// use google_cloud_gax::paginator::ItemPaginator;
6869    ///
6870    /// let builder = prepare_request_builder();
6871    /// let mut items = builder.by_item();
6872    /// while let Some(result) = items.next().await {
6873    ///   let item = result?;
6874    /// }
6875    /// # Ok(()) }
6876    ///
6877    /// fn prepare_request_builder() -> ListOperations {
6878    ///   # panic!();
6879    ///   // ... details omitted ...
6880    /// }
6881    /// ```
6882    #[derive(Clone, Debug)]
6883    pub struct ListOperations(
6884        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6885    );
6886
6887    impl ListOperations {
6888        pub(crate) fn new(
6889            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6890        ) -> Self {
6891            Self(RequestBuilder::new(stub))
6892        }
6893
6894        /// Sets the full request, replacing any prior values.
6895        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6896            mut self,
6897            v: V,
6898        ) -> Self {
6899            self.0.request = v.into();
6900            self
6901        }
6902
6903        /// Sets all the options, replacing any prior values.
6904        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6905            self.0.options = v.into();
6906            self
6907        }
6908
6909        /// Sends the request.
6910        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6911            (*self.0.stub)
6912                .list_operations(self.0.request, self.0.options)
6913                .await
6914                .map(crate::Response::into_body)
6915        }
6916
6917        /// Streams each page in the collection.
6918        pub fn by_page(
6919            self,
6920        ) -> impl google_cloud_gax::paginator::Paginator<
6921            google_cloud_longrunning::model::ListOperationsResponse,
6922            crate::Error,
6923        > {
6924            use std::clone::Clone;
6925            let token = self.0.request.page_token.clone();
6926            let execute = move |token: String| {
6927                let mut builder = self.clone();
6928                builder.0.request = builder.0.request.set_page_token(token);
6929                builder.send()
6930            };
6931            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6932        }
6933
6934        /// Streams each item in the collection.
6935        pub fn by_item(
6936            self,
6937        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6938            google_cloud_longrunning::model::ListOperationsResponse,
6939            crate::Error,
6940        > {
6941            use google_cloud_gax::paginator::Paginator;
6942            self.by_page().items()
6943        }
6944
6945        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6946        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6947            self.0.request.name = v.into();
6948            self
6949        }
6950
6951        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6952        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6953            self.0.request.filter = v.into();
6954            self
6955        }
6956
6957        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6958        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6959            self.0.request.page_size = v.into();
6960            self
6961        }
6962
6963        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6964        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6965            self.0.request.page_token = v.into();
6966            self
6967        }
6968
6969        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6970        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6971            self.0.request.return_partial_success = v.into();
6972            self
6973        }
6974    }
6975
6976    #[doc(hidden)]
6977    impl crate::RequestBuilder for ListOperations {
6978        fn request_options(&mut self) -> &mut crate::RequestOptions {
6979            &mut self.0.options
6980        }
6981    }
6982
6983    /// The request builder for [ConversationModels::get_operation][crate::client::ConversationModels::get_operation] calls.
6984    ///
6985    /// # Example
6986    /// ```
6987    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetOperation;
6988    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
6989    ///
6990    /// let builder = prepare_request_builder();
6991    /// let response = builder.send().await?;
6992    /// # Ok(()) }
6993    ///
6994    /// fn prepare_request_builder() -> GetOperation {
6995    ///   # panic!();
6996    ///   // ... details omitted ...
6997    /// }
6998    /// ```
6999    #[derive(Clone, Debug)]
7000    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7001
7002    impl GetOperation {
7003        pub(crate) fn new(
7004            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7005        ) -> Self {
7006            Self(RequestBuilder::new(stub))
7007        }
7008
7009        /// Sets the full request, replacing any prior values.
7010        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7011            mut self,
7012            v: V,
7013        ) -> Self {
7014            self.0.request = v.into();
7015            self
7016        }
7017
7018        /// Sets all the options, replacing any prior values.
7019        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7020            self.0.options = v.into();
7021            self
7022        }
7023
7024        /// Sends the request.
7025        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7026            (*self.0.stub)
7027                .get_operation(self.0.request, self.0.options)
7028                .await
7029                .map(crate::Response::into_body)
7030        }
7031
7032        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7033        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7034            self.0.request.name = v.into();
7035            self
7036        }
7037    }
7038
7039    #[doc(hidden)]
7040    impl crate::RequestBuilder for GetOperation {
7041        fn request_options(&mut self) -> &mut crate::RequestOptions {
7042            &mut self.0.options
7043        }
7044    }
7045
7046    /// The request builder for [ConversationModels::cancel_operation][crate::client::ConversationModels::cancel_operation] calls.
7047    ///
7048    /// # Example
7049    /// ```
7050    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CancelOperation;
7051    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7052    ///
7053    /// let builder = prepare_request_builder();
7054    /// let response = builder.send().await?;
7055    /// # Ok(()) }
7056    ///
7057    /// fn prepare_request_builder() -> CancelOperation {
7058    ///   # panic!();
7059    ///   // ... details omitted ...
7060    /// }
7061    /// ```
7062    #[derive(Clone, Debug)]
7063    pub struct CancelOperation(
7064        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7065    );
7066
7067    impl CancelOperation {
7068        pub(crate) fn new(
7069            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7070        ) -> Self {
7071            Self(RequestBuilder::new(stub))
7072        }
7073
7074        /// Sets the full request, replacing any prior values.
7075        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7076            mut self,
7077            v: V,
7078        ) -> Self {
7079            self.0.request = v.into();
7080            self
7081        }
7082
7083        /// Sets all the options, replacing any prior values.
7084        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7085            self.0.options = v.into();
7086            self
7087        }
7088
7089        /// Sends the request.
7090        pub async fn send(self) -> Result<()> {
7091            (*self.0.stub)
7092                .cancel_operation(self.0.request, self.0.options)
7093                .await
7094                .map(crate::Response::into_body)
7095        }
7096
7097        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7098        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7099            self.0.request.name = v.into();
7100            self
7101        }
7102    }
7103
7104    #[doc(hidden)]
7105    impl crate::RequestBuilder for CancelOperation {
7106        fn request_options(&mut self) -> &mut crate::RequestOptions {
7107            &mut self.0.options
7108        }
7109    }
7110}
7111
7112#[cfg(feature = "conversation-profiles")]
7113#[cfg_attr(docsrs, doc(cfg(feature = "conversation-profiles")))]
7114pub mod conversation_profiles {
7115    use crate::Result;
7116
7117    /// A builder for [ConversationProfiles][crate::client::ConversationProfiles].
7118    ///
7119    /// ```
7120    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7121    /// # use google_cloud_dialogflow_v2::*;
7122    /// # use builder::conversation_profiles::ClientBuilder;
7123    /// # use client::ConversationProfiles;
7124    /// let builder : ClientBuilder = ConversationProfiles::builder();
7125    /// let client = builder
7126    ///     .with_endpoint("https://dialogflow.googleapis.com")
7127    ///     .build().await?;
7128    /// # Ok(()) }
7129    /// ```
7130    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7131
7132    pub(crate) mod client {
7133        use super::super::super::client::ConversationProfiles;
7134        pub struct Factory;
7135        impl crate::ClientFactory for Factory {
7136            type Client = ConversationProfiles;
7137            type Credentials = gaxi::options::Credentials;
7138            async fn build(
7139                self,
7140                config: gaxi::options::ClientConfig,
7141            ) -> crate::ClientBuilderResult<Self::Client> {
7142                Self::Client::new(config).await
7143            }
7144        }
7145    }
7146
7147    /// Common implementation for [crate::client::ConversationProfiles] request builders.
7148    #[derive(Clone, Debug)]
7149    pub(crate) struct RequestBuilder<R: std::default::Default> {
7150        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7151        request: R,
7152        options: crate::RequestOptions,
7153    }
7154
7155    impl<R> RequestBuilder<R>
7156    where
7157        R: std::default::Default,
7158    {
7159        pub(crate) fn new(
7160            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7161        ) -> Self {
7162            Self {
7163                stub,
7164                request: R::default(),
7165                options: crate::RequestOptions::default(),
7166            }
7167        }
7168    }
7169
7170    /// The request builder for [ConversationProfiles::list_conversation_profiles][crate::client::ConversationProfiles::list_conversation_profiles] calls.
7171    ///
7172    /// # Example
7173    /// ```
7174    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListConversationProfiles;
7175    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7176    /// use google_cloud_gax::paginator::ItemPaginator;
7177    ///
7178    /// let builder = prepare_request_builder();
7179    /// let mut items = builder.by_item();
7180    /// while let Some(result) = items.next().await {
7181    ///   let item = result?;
7182    /// }
7183    /// # Ok(()) }
7184    ///
7185    /// fn prepare_request_builder() -> ListConversationProfiles {
7186    ///   # panic!();
7187    ///   // ... details omitted ...
7188    /// }
7189    /// ```
7190    #[derive(Clone, Debug)]
7191    pub struct ListConversationProfiles(
7192        RequestBuilder<crate::model::ListConversationProfilesRequest>,
7193    );
7194
7195    impl ListConversationProfiles {
7196        pub(crate) fn new(
7197            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7198        ) -> Self {
7199            Self(RequestBuilder::new(stub))
7200        }
7201
7202        /// Sets the full request, replacing any prior values.
7203        pub fn with_request<V: Into<crate::model::ListConversationProfilesRequest>>(
7204            mut self,
7205            v: V,
7206        ) -> Self {
7207            self.0.request = v.into();
7208            self
7209        }
7210
7211        /// Sets all the options, replacing any prior values.
7212        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7213            self.0.options = v.into();
7214            self
7215        }
7216
7217        /// Sends the request.
7218        pub async fn send(self) -> Result<crate::model::ListConversationProfilesResponse> {
7219            (*self.0.stub)
7220                .list_conversation_profiles(self.0.request, self.0.options)
7221                .await
7222                .map(crate::Response::into_body)
7223        }
7224
7225        /// Streams each page in the collection.
7226        pub fn by_page(
7227            self,
7228        ) -> impl google_cloud_gax::paginator::Paginator<
7229            crate::model::ListConversationProfilesResponse,
7230            crate::Error,
7231        > {
7232            use std::clone::Clone;
7233            let token = self.0.request.page_token.clone();
7234            let execute = move |token: String| {
7235                let mut builder = self.clone();
7236                builder.0.request = builder.0.request.set_page_token(token);
7237                builder.send()
7238            };
7239            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7240        }
7241
7242        /// Streams each item in the collection.
7243        pub fn by_item(
7244            self,
7245        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7246            crate::model::ListConversationProfilesResponse,
7247            crate::Error,
7248        > {
7249            use google_cloud_gax::paginator::Paginator;
7250            self.by_page().items()
7251        }
7252
7253        /// Sets the value of [parent][crate::model::ListConversationProfilesRequest::parent].
7254        ///
7255        /// This is a **required** field for requests.
7256        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7257            self.0.request.parent = v.into();
7258            self
7259        }
7260
7261        /// Sets the value of [page_size][crate::model::ListConversationProfilesRequest::page_size].
7262        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7263            self.0.request.page_size = v.into();
7264            self
7265        }
7266
7267        /// Sets the value of [page_token][crate::model::ListConversationProfilesRequest::page_token].
7268        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7269            self.0.request.page_token = v.into();
7270            self
7271        }
7272    }
7273
7274    #[doc(hidden)]
7275    impl crate::RequestBuilder for ListConversationProfiles {
7276        fn request_options(&mut self) -> &mut crate::RequestOptions {
7277            &mut self.0.options
7278        }
7279    }
7280
7281    /// The request builder for [ConversationProfiles::get_conversation_profile][crate::client::ConversationProfiles::get_conversation_profile] calls.
7282    ///
7283    /// # Example
7284    /// ```
7285    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetConversationProfile;
7286    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7287    ///
7288    /// let builder = prepare_request_builder();
7289    /// let response = builder.send().await?;
7290    /// # Ok(()) }
7291    ///
7292    /// fn prepare_request_builder() -> GetConversationProfile {
7293    ///   # panic!();
7294    ///   // ... details omitted ...
7295    /// }
7296    /// ```
7297    #[derive(Clone, Debug)]
7298    pub struct GetConversationProfile(RequestBuilder<crate::model::GetConversationProfileRequest>);
7299
7300    impl GetConversationProfile {
7301        pub(crate) fn new(
7302            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7303        ) -> Self {
7304            Self(RequestBuilder::new(stub))
7305        }
7306
7307        /// Sets the full request, replacing any prior values.
7308        pub fn with_request<V: Into<crate::model::GetConversationProfileRequest>>(
7309            mut self,
7310            v: V,
7311        ) -> Self {
7312            self.0.request = v.into();
7313            self
7314        }
7315
7316        /// Sets all the options, replacing any prior values.
7317        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7318            self.0.options = v.into();
7319            self
7320        }
7321
7322        /// Sends the request.
7323        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7324            (*self.0.stub)
7325                .get_conversation_profile(self.0.request, self.0.options)
7326                .await
7327                .map(crate::Response::into_body)
7328        }
7329
7330        /// Sets the value of [name][crate::model::GetConversationProfileRequest::name].
7331        ///
7332        /// This is a **required** field for requests.
7333        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7334            self.0.request.name = v.into();
7335            self
7336        }
7337    }
7338
7339    #[doc(hidden)]
7340    impl crate::RequestBuilder for GetConversationProfile {
7341        fn request_options(&mut self) -> &mut crate::RequestOptions {
7342            &mut self.0.options
7343        }
7344    }
7345
7346    /// The request builder for [ConversationProfiles::create_conversation_profile][crate::client::ConversationProfiles::create_conversation_profile] calls.
7347    ///
7348    /// # Example
7349    /// ```
7350    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::CreateConversationProfile;
7351    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7352    ///
7353    /// let builder = prepare_request_builder();
7354    /// let response = builder.send().await?;
7355    /// # Ok(()) }
7356    ///
7357    /// fn prepare_request_builder() -> CreateConversationProfile {
7358    ///   # panic!();
7359    ///   // ... details omitted ...
7360    /// }
7361    /// ```
7362    #[derive(Clone, Debug)]
7363    pub struct CreateConversationProfile(
7364        RequestBuilder<crate::model::CreateConversationProfileRequest>,
7365    );
7366
7367    impl CreateConversationProfile {
7368        pub(crate) fn new(
7369            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7370        ) -> Self {
7371            Self(RequestBuilder::new(stub))
7372        }
7373
7374        /// Sets the full request, replacing any prior values.
7375        pub fn with_request<V: Into<crate::model::CreateConversationProfileRequest>>(
7376            mut self,
7377            v: V,
7378        ) -> Self {
7379            self.0.request = v.into();
7380            self
7381        }
7382
7383        /// Sets all the options, replacing any prior values.
7384        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7385            self.0.options = v.into();
7386            self
7387        }
7388
7389        /// Sends the request.
7390        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7391            (*self.0.stub)
7392                .create_conversation_profile(self.0.request, self.0.options)
7393                .await
7394                .map(crate::Response::into_body)
7395        }
7396
7397        /// Sets the value of [parent][crate::model::CreateConversationProfileRequest::parent].
7398        ///
7399        /// This is a **required** field for requests.
7400        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7401            self.0.request.parent = v.into();
7402            self
7403        }
7404
7405        /// Sets the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7406        ///
7407        /// This is a **required** field for requests.
7408        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7409        where
7410            T: std::convert::Into<crate::model::ConversationProfile>,
7411        {
7412            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7413            self
7414        }
7415
7416        /// Sets or clears the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7417        ///
7418        /// This is a **required** field for requests.
7419        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7420        where
7421            T: std::convert::Into<crate::model::ConversationProfile>,
7422        {
7423            self.0.request.conversation_profile = v.map(|x| x.into());
7424            self
7425        }
7426    }
7427
7428    #[doc(hidden)]
7429    impl crate::RequestBuilder for CreateConversationProfile {
7430        fn request_options(&mut self) -> &mut crate::RequestOptions {
7431            &mut self.0.options
7432        }
7433    }
7434
7435    /// The request builder for [ConversationProfiles::update_conversation_profile][crate::client::ConversationProfiles::update_conversation_profile] calls.
7436    ///
7437    /// # Example
7438    /// ```
7439    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::UpdateConversationProfile;
7440    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7441    ///
7442    /// let builder = prepare_request_builder();
7443    /// let response = builder.send().await?;
7444    /// # Ok(()) }
7445    ///
7446    /// fn prepare_request_builder() -> UpdateConversationProfile {
7447    ///   # panic!();
7448    ///   // ... details omitted ...
7449    /// }
7450    /// ```
7451    #[derive(Clone, Debug)]
7452    pub struct UpdateConversationProfile(
7453        RequestBuilder<crate::model::UpdateConversationProfileRequest>,
7454    );
7455
7456    impl UpdateConversationProfile {
7457        pub(crate) fn new(
7458            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7459        ) -> Self {
7460            Self(RequestBuilder::new(stub))
7461        }
7462
7463        /// Sets the full request, replacing any prior values.
7464        pub fn with_request<V: Into<crate::model::UpdateConversationProfileRequest>>(
7465            mut self,
7466            v: V,
7467        ) -> Self {
7468            self.0.request = v.into();
7469            self
7470        }
7471
7472        /// Sets all the options, replacing any prior values.
7473        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7474            self.0.options = v.into();
7475            self
7476        }
7477
7478        /// Sends the request.
7479        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7480            (*self.0.stub)
7481                .update_conversation_profile(self.0.request, self.0.options)
7482                .await
7483                .map(crate::Response::into_body)
7484        }
7485
7486        /// Sets the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7487        ///
7488        /// This is a **required** field for requests.
7489        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7490        where
7491            T: std::convert::Into<crate::model::ConversationProfile>,
7492        {
7493            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7494            self
7495        }
7496
7497        /// Sets or clears the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7498        ///
7499        /// This is a **required** field for requests.
7500        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7501        where
7502            T: std::convert::Into<crate::model::ConversationProfile>,
7503        {
7504            self.0.request.conversation_profile = v.map(|x| x.into());
7505            self
7506        }
7507
7508        /// Sets the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7509        ///
7510        /// This is a **required** field for requests.
7511        pub fn set_update_mask<T>(mut self, v: T) -> Self
7512        where
7513            T: std::convert::Into<wkt::FieldMask>,
7514        {
7515            self.0.request.update_mask = std::option::Option::Some(v.into());
7516            self
7517        }
7518
7519        /// Sets or clears the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7520        ///
7521        /// This is a **required** field for requests.
7522        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7523        where
7524            T: std::convert::Into<wkt::FieldMask>,
7525        {
7526            self.0.request.update_mask = v.map(|x| x.into());
7527            self
7528        }
7529    }
7530
7531    #[doc(hidden)]
7532    impl crate::RequestBuilder for UpdateConversationProfile {
7533        fn request_options(&mut self) -> &mut crate::RequestOptions {
7534            &mut self.0.options
7535        }
7536    }
7537
7538    /// The request builder for [ConversationProfiles::delete_conversation_profile][crate::client::ConversationProfiles::delete_conversation_profile] calls.
7539    ///
7540    /// # Example
7541    /// ```
7542    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::DeleteConversationProfile;
7543    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7544    ///
7545    /// let builder = prepare_request_builder();
7546    /// let response = builder.send().await?;
7547    /// # Ok(()) }
7548    ///
7549    /// fn prepare_request_builder() -> DeleteConversationProfile {
7550    ///   # panic!();
7551    ///   // ... details omitted ...
7552    /// }
7553    /// ```
7554    #[derive(Clone, Debug)]
7555    pub struct DeleteConversationProfile(
7556        RequestBuilder<crate::model::DeleteConversationProfileRequest>,
7557    );
7558
7559    impl DeleteConversationProfile {
7560        pub(crate) fn new(
7561            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7562        ) -> Self {
7563            Self(RequestBuilder::new(stub))
7564        }
7565
7566        /// Sets the full request, replacing any prior values.
7567        pub fn with_request<V: Into<crate::model::DeleteConversationProfileRequest>>(
7568            mut self,
7569            v: V,
7570        ) -> Self {
7571            self.0.request = v.into();
7572            self
7573        }
7574
7575        /// Sets all the options, replacing any prior values.
7576        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7577            self.0.options = v.into();
7578            self
7579        }
7580
7581        /// Sends the request.
7582        pub async fn send(self) -> Result<()> {
7583            (*self.0.stub)
7584                .delete_conversation_profile(self.0.request, self.0.options)
7585                .await
7586                .map(crate::Response::into_body)
7587        }
7588
7589        /// Sets the value of [name][crate::model::DeleteConversationProfileRequest::name].
7590        ///
7591        /// This is a **required** field for requests.
7592        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7593            self.0.request.name = v.into();
7594            self
7595        }
7596    }
7597
7598    #[doc(hidden)]
7599    impl crate::RequestBuilder for DeleteConversationProfile {
7600        fn request_options(&mut self) -> &mut crate::RequestOptions {
7601            &mut self.0.options
7602        }
7603    }
7604
7605    /// The request builder for [ConversationProfiles::set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config] calls.
7606    ///
7607    /// # Example
7608    /// ```
7609    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::SetSuggestionFeatureConfig;
7610    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7611    /// use google_cloud_lro::Poller;
7612    ///
7613    /// let builder = prepare_request_builder();
7614    /// let response = builder.poller().until_done().await?;
7615    /// # Ok(()) }
7616    ///
7617    /// fn prepare_request_builder() -> SetSuggestionFeatureConfig {
7618    ///   # panic!();
7619    ///   // ... details omitted ...
7620    /// }
7621    /// ```
7622    #[derive(Clone, Debug)]
7623    pub struct SetSuggestionFeatureConfig(
7624        RequestBuilder<crate::model::SetSuggestionFeatureConfigRequest>,
7625    );
7626
7627    impl SetSuggestionFeatureConfig {
7628        pub(crate) fn new(
7629            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7630        ) -> Self {
7631            Self(RequestBuilder::new(stub))
7632        }
7633
7634        /// Sets the full request, replacing any prior values.
7635        pub fn with_request<V: Into<crate::model::SetSuggestionFeatureConfigRequest>>(
7636            mut self,
7637            v: V,
7638        ) -> Self {
7639            self.0.request = v.into();
7640            self
7641        }
7642
7643        /// Sets all the options, replacing any prior values.
7644        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7645            self.0.options = v.into();
7646            self
7647        }
7648
7649        /// Sends the request.
7650        ///
7651        /// # Long running operations
7652        ///
7653        /// This starts, but does not poll, a longrunning operation. More information
7654        /// on [set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config].
7655        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7656            (*self.0.stub)
7657                .set_suggestion_feature_config(self.0.request, self.0.options)
7658                .await
7659                .map(crate::Response::into_body)
7660        }
7661
7662        /// Creates a [Poller][google_cloud_lro::Poller] to work with `set_suggestion_feature_config`.
7663        pub fn poller(
7664            self,
7665        ) -> impl google_cloud_lro::Poller<
7666            crate::model::ConversationProfile,
7667            crate::model::SetSuggestionFeatureConfigOperationMetadata,
7668        > {
7669            type Operation = google_cloud_lro::internal::Operation<
7670                crate::model::ConversationProfile,
7671                crate::model::SetSuggestionFeatureConfigOperationMetadata,
7672            >;
7673            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7674            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7675
7676            let stub = self.0.stub.clone();
7677            let mut options = self.0.options.clone();
7678            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7679            let query = move |name| {
7680                let stub = stub.clone();
7681                let options = options.clone();
7682                async {
7683                    let op = GetOperation::new(stub)
7684                        .set_name(name)
7685                        .with_options(options)
7686                        .send()
7687                        .await?;
7688                    Ok(Operation::new(op))
7689                }
7690            };
7691
7692            let start = move || async {
7693                let op = self.send().await?;
7694                Ok(Operation::new(op))
7695            };
7696
7697            google_cloud_lro::internal::new_poller(
7698                polling_error_policy,
7699                polling_backoff_policy,
7700                start,
7701                query,
7702            )
7703        }
7704
7705        /// Sets the value of [conversation_profile][crate::model::SetSuggestionFeatureConfigRequest::conversation_profile].
7706        ///
7707        /// This is a **required** field for requests.
7708        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7709            self.0.request.conversation_profile = v.into();
7710            self
7711        }
7712
7713        /// Sets the value of [participant_role][crate::model::SetSuggestionFeatureConfigRequest::participant_role].
7714        ///
7715        /// This is a **required** field for requests.
7716        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7717            mut self,
7718            v: T,
7719        ) -> Self {
7720            self.0.request.participant_role = v.into();
7721            self
7722        }
7723
7724        /// Sets the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7725        ///
7726        /// This is a **required** field for requests.
7727        pub fn set_suggestion_feature_config<T>(mut self, v: T) -> Self
7728        where
7729            T: std::convert::Into<
7730                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7731                >,
7732        {
7733            self.0.request.suggestion_feature_config = std::option::Option::Some(v.into());
7734            self
7735        }
7736
7737        /// Sets or clears the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7738        ///
7739        /// This is a **required** field for requests.
7740        pub fn set_or_clear_suggestion_feature_config<T>(
7741            mut self,
7742            v: std::option::Option<T>,
7743        ) -> Self
7744        where
7745            T: std::convert::Into<
7746                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7747                >,
7748        {
7749            self.0.request.suggestion_feature_config = v.map(|x| x.into());
7750            self
7751        }
7752    }
7753
7754    #[doc(hidden)]
7755    impl crate::RequestBuilder for SetSuggestionFeatureConfig {
7756        fn request_options(&mut self) -> &mut crate::RequestOptions {
7757            &mut self.0.options
7758        }
7759    }
7760
7761    /// The request builder for [ConversationProfiles::clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config] calls.
7762    ///
7763    /// # Example
7764    /// ```
7765    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ClearSuggestionFeatureConfig;
7766    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7767    /// use google_cloud_lro::Poller;
7768    ///
7769    /// let builder = prepare_request_builder();
7770    /// let response = builder.poller().until_done().await?;
7771    /// # Ok(()) }
7772    ///
7773    /// fn prepare_request_builder() -> ClearSuggestionFeatureConfig {
7774    ///   # panic!();
7775    ///   // ... details omitted ...
7776    /// }
7777    /// ```
7778    #[derive(Clone, Debug)]
7779    pub struct ClearSuggestionFeatureConfig(
7780        RequestBuilder<crate::model::ClearSuggestionFeatureConfigRequest>,
7781    );
7782
7783    impl ClearSuggestionFeatureConfig {
7784        pub(crate) fn new(
7785            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7786        ) -> Self {
7787            Self(RequestBuilder::new(stub))
7788        }
7789
7790        /// Sets the full request, replacing any prior values.
7791        pub fn with_request<V: Into<crate::model::ClearSuggestionFeatureConfigRequest>>(
7792            mut self,
7793            v: V,
7794        ) -> Self {
7795            self.0.request = v.into();
7796            self
7797        }
7798
7799        /// Sets all the options, replacing any prior values.
7800        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7801            self.0.options = v.into();
7802            self
7803        }
7804
7805        /// Sends the request.
7806        ///
7807        /// # Long running operations
7808        ///
7809        /// This starts, but does not poll, a longrunning operation. More information
7810        /// on [clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config].
7811        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7812            (*self.0.stub)
7813                .clear_suggestion_feature_config(self.0.request, self.0.options)
7814                .await
7815                .map(crate::Response::into_body)
7816        }
7817
7818        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clear_suggestion_feature_config`.
7819        pub fn poller(
7820            self,
7821        ) -> impl google_cloud_lro::Poller<
7822            crate::model::ConversationProfile,
7823            crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7824        > {
7825            type Operation = google_cloud_lro::internal::Operation<
7826                crate::model::ConversationProfile,
7827                crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7828            >;
7829            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7830            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7831
7832            let stub = self.0.stub.clone();
7833            let mut options = self.0.options.clone();
7834            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7835            let query = move |name| {
7836                let stub = stub.clone();
7837                let options = options.clone();
7838                async {
7839                    let op = GetOperation::new(stub)
7840                        .set_name(name)
7841                        .with_options(options)
7842                        .send()
7843                        .await?;
7844                    Ok(Operation::new(op))
7845                }
7846            };
7847
7848            let start = move || async {
7849                let op = self.send().await?;
7850                Ok(Operation::new(op))
7851            };
7852
7853            google_cloud_lro::internal::new_poller(
7854                polling_error_policy,
7855                polling_backoff_policy,
7856                start,
7857                query,
7858            )
7859        }
7860
7861        /// Sets the value of [conversation_profile][crate::model::ClearSuggestionFeatureConfigRequest::conversation_profile].
7862        ///
7863        /// This is a **required** field for requests.
7864        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7865            self.0.request.conversation_profile = v.into();
7866            self
7867        }
7868
7869        /// Sets the value of [participant_role][crate::model::ClearSuggestionFeatureConfigRequest::participant_role].
7870        ///
7871        /// This is a **required** field for requests.
7872        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7873            mut self,
7874            v: T,
7875        ) -> Self {
7876            self.0.request.participant_role = v.into();
7877            self
7878        }
7879
7880        /// Sets the value of [suggestion_feature_type][crate::model::ClearSuggestionFeatureConfigRequest::suggestion_feature_type].
7881        ///
7882        /// This is a **required** field for requests.
7883        pub fn set_suggestion_feature_type<T: Into<crate::model::suggestion_feature::Type>>(
7884            mut self,
7885            v: T,
7886        ) -> Self {
7887            self.0.request.suggestion_feature_type = v.into();
7888            self
7889        }
7890    }
7891
7892    #[doc(hidden)]
7893    impl crate::RequestBuilder for ClearSuggestionFeatureConfig {
7894        fn request_options(&mut self) -> &mut crate::RequestOptions {
7895            &mut self.0.options
7896        }
7897    }
7898
7899    /// The request builder for [ConversationProfiles::list_locations][crate::client::ConversationProfiles::list_locations] calls.
7900    ///
7901    /// # Example
7902    /// ```
7903    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListLocations;
7904    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
7905    /// use google_cloud_gax::paginator::ItemPaginator;
7906    ///
7907    /// let builder = prepare_request_builder();
7908    /// let mut items = builder.by_item();
7909    /// while let Some(result) = items.next().await {
7910    ///   let item = result?;
7911    /// }
7912    /// # Ok(()) }
7913    ///
7914    /// fn prepare_request_builder() -> ListLocations {
7915    ///   # panic!();
7916    ///   // ... details omitted ...
7917    /// }
7918    /// ```
7919    #[derive(Clone, Debug)]
7920    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7921
7922    impl ListLocations {
7923        pub(crate) fn new(
7924            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7925        ) -> Self {
7926            Self(RequestBuilder::new(stub))
7927        }
7928
7929        /// Sets the full request, replacing any prior values.
7930        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7931            mut self,
7932            v: V,
7933        ) -> Self {
7934            self.0.request = v.into();
7935            self
7936        }
7937
7938        /// Sets all the options, replacing any prior values.
7939        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7940            self.0.options = v.into();
7941            self
7942        }
7943
7944        /// Sends the request.
7945        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7946            (*self.0.stub)
7947                .list_locations(self.0.request, self.0.options)
7948                .await
7949                .map(crate::Response::into_body)
7950        }
7951
7952        /// Streams each page in the collection.
7953        pub fn by_page(
7954            self,
7955        ) -> impl google_cloud_gax::paginator::Paginator<
7956            google_cloud_location::model::ListLocationsResponse,
7957            crate::Error,
7958        > {
7959            use std::clone::Clone;
7960            let token = self.0.request.page_token.clone();
7961            let execute = move |token: String| {
7962                let mut builder = self.clone();
7963                builder.0.request = builder.0.request.set_page_token(token);
7964                builder.send()
7965            };
7966            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7967        }
7968
7969        /// Streams each item in the collection.
7970        pub fn by_item(
7971            self,
7972        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7973            google_cloud_location::model::ListLocationsResponse,
7974            crate::Error,
7975        > {
7976            use google_cloud_gax::paginator::Paginator;
7977            self.by_page().items()
7978        }
7979
7980        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
7981        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7982            self.0.request.name = v.into();
7983            self
7984        }
7985
7986        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
7987        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7988            self.0.request.filter = v.into();
7989            self
7990        }
7991
7992        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
7993        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7994            self.0.request.page_size = v.into();
7995            self
7996        }
7997
7998        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
7999        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8000            self.0.request.page_token = v.into();
8001            self
8002        }
8003    }
8004
8005    #[doc(hidden)]
8006    impl crate::RequestBuilder for ListLocations {
8007        fn request_options(&mut self) -> &mut crate::RequestOptions {
8008            &mut self.0.options
8009        }
8010    }
8011
8012    /// The request builder for [ConversationProfiles::get_location][crate::client::ConversationProfiles::get_location] calls.
8013    ///
8014    /// # Example
8015    /// ```
8016    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetLocation;
8017    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8018    ///
8019    /// let builder = prepare_request_builder();
8020    /// let response = builder.send().await?;
8021    /// # Ok(()) }
8022    ///
8023    /// fn prepare_request_builder() -> GetLocation {
8024    ///   # panic!();
8025    ///   // ... details omitted ...
8026    /// }
8027    /// ```
8028    #[derive(Clone, Debug)]
8029    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8030
8031    impl GetLocation {
8032        pub(crate) fn new(
8033            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8034        ) -> Self {
8035            Self(RequestBuilder::new(stub))
8036        }
8037
8038        /// Sets the full request, replacing any prior values.
8039        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8040            mut self,
8041            v: V,
8042        ) -> Self {
8043            self.0.request = v.into();
8044            self
8045        }
8046
8047        /// Sets all the options, replacing any prior values.
8048        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8049            self.0.options = v.into();
8050            self
8051        }
8052
8053        /// Sends the request.
8054        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8055            (*self.0.stub)
8056                .get_location(self.0.request, self.0.options)
8057                .await
8058                .map(crate::Response::into_body)
8059        }
8060
8061        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
8062        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8063            self.0.request.name = v.into();
8064            self
8065        }
8066    }
8067
8068    #[doc(hidden)]
8069    impl crate::RequestBuilder for GetLocation {
8070        fn request_options(&mut self) -> &mut crate::RequestOptions {
8071            &mut self.0.options
8072        }
8073    }
8074
8075    /// The request builder for [ConversationProfiles::list_operations][crate::client::ConversationProfiles::list_operations] calls.
8076    ///
8077    /// # Example
8078    /// ```
8079    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListOperations;
8080    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8081    /// use google_cloud_gax::paginator::ItemPaginator;
8082    ///
8083    /// let builder = prepare_request_builder();
8084    /// let mut items = builder.by_item();
8085    /// while let Some(result) = items.next().await {
8086    ///   let item = result?;
8087    /// }
8088    /// # Ok(()) }
8089    ///
8090    /// fn prepare_request_builder() -> ListOperations {
8091    ///   # panic!();
8092    ///   // ... details omitted ...
8093    /// }
8094    /// ```
8095    #[derive(Clone, Debug)]
8096    pub struct ListOperations(
8097        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8098    );
8099
8100    impl ListOperations {
8101        pub(crate) fn new(
8102            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8103        ) -> Self {
8104            Self(RequestBuilder::new(stub))
8105        }
8106
8107        /// Sets the full request, replacing any prior values.
8108        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8109            mut self,
8110            v: V,
8111        ) -> Self {
8112            self.0.request = v.into();
8113            self
8114        }
8115
8116        /// Sets all the options, replacing any prior values.
8117        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8118            self.0.options = v.into();
8119            self
8120        }
8121
8122        /// Sends the request.
8123        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8124            (*self.0.stub)
8125                .list_operations(self.0.request, self.0.options)
8126                .await
8127                .map(crate::Response::into_body)
8128        }
8129
8130        /// Streams each page in the collection.
8131        pub fn by_page(
8132            self,
8133        ) -> impl google_cloud_gax::paginator::Paginator<
8134            google_cloud_longrunning::model::ListOperationsResponse,
8135            crate::Error,
8136        > {
8137            use std::clone::Clone;
8138            let token = self.0.request.page_token.clone();
8139            let execute = move |token: String| {
8140                let mut builder = self.clone();
8141                builder.0.request = builder.0.request.set_page_token(token);
8142                builder.send()
8143            };
8144            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8145        }
8146
8147        /// Streams each item in the collection.
8148        pub fn by_item(
8149            self,
8150        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8151            google_cloud_longrunning::model::ListOperationsResponse,
8152            crate::Error,
8153        > {
8154            use google_cloud_gax::paginator::Paginator;
8155            self.by_page().items()
8156        }
8157
8158        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
8159        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8160            self.0.request.name = v.into();
8161            self
8162        }
8163
8164        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
8165        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8166            self.0.request.filter = v.into();
8167            self
8168        }
8169
8170        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
8171        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8172            self.0.request.page_size = v.into();
8173            self
8174        }
8175
8176        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
8177        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8178            self.0.request.page_token = v.into();
8179            self
8180        }
8181
8182        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
8183        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8184            self.0.request.return_partial_success = v.into();
8185            self
8186        }
8187    }
8188
8189    #[doc(hidden)]
8190    impl crate::RequestBuilder for ListOperations {
8191        fn request_options(&mut self) -> &mut crate::RequestOptions {
8192            &mut self.0.options
8193        }
8194    }
8195
8196    /// The request builder for [ConversationProfiles::get_operation][crate::client::ConversationProfiles::get_operation] calls.
8197    ///
8198    /// # Example
8199    /// ```
8200    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetOperation;
8201    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8202    ///
8203    /// let builder = prepare_request_builder();
8204    /// let response = builder.send().await?;
8205    /// # Ok(()) }
8206    ///
8207    /// fn prepare_request_builder() -> GetOperation {
8208    ///   # panic!();
8209    ///   // ... details omitted ...
8210    /// }
8211    /// ```
8212    #[derive(Clone, Debug)]
8213    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8214
8215    impl GetOperation {
8216        pub(crate) fn new(
8217            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8218        ) -> Self {
8219            Self(RequestBuilder::new(stub))
8220        }
8221
8222        /// Sets the full request, replacing any prior values.
8223        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8224            mut self,
8225            v: V,
8226        ) -> Self {
8227            self.0.request = v.into();
8228            self
8229        }
8230
8231        /// Sets all the options, replacing any prior values.
8232        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8233            self.0.options = v.into();
8234            self
8235        }
8236
8237        /// Sends the request.
8238        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8239            (*self.0.stub)
8240                .get_operation(self.0.request, self.0.options)
8241                .await
8242                .map(crate::Response::into_body)
8243        }
8244
8245        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
8246        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8247            self.0.request.name = v.into();
8248            self
8249        }
8250    }
8251
8252    #[doc(hidden)]
8253    impl crate::RequestBuilder for GetOperation {
8254        fn request_options(&mut self) -> &mut crate::RequestOptions {
8255            &mut self.0.options
8256        }
8257    }
8258
8259    /// The request builder for [ConversationProfiles::cancel_operation][crate::client::ConversationProfiles::cancel_operation] calls.
8260    ///
8261    /// # Example
8262    /// ```
8263    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::CancelOperation;
8264    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8265    ///
8266    /// let builder = prepare_request_builder();
8267    /// let response = builder.send().await?;
8268    /// # Ok(()) }
8269    ///
8270    /// fn prepare_request_builder() -> CancelOperation {
8271    ///   # panic!();
8272    ///   // ... details omitted ...
8273    /// }
8274    /// ```
8275    #[derive(Clone, Debug)]
8276    pub struct CancelOperation(
8277        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8278    );
8279
8280    impl CancelOperation {
8281        pub(crate) fn new(
8282            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8283        ) -> Self {
8284            Self(RequestBuilder::new(stub))
8285        }
8286
8287        /// Sets the full request, replacing any prior values.
8288        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8289            mut self,
8290            v: V,
8291        ) -> Self {
8292            self.0.request = v.into();
8293            self
8294        }
8295
8296        /// Sets all the options, replacing any prior values.
8297        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8298            self.0.options = v.into();
8299            self
8300        }
8301
8302        /// Sends the request.
8303        pub async fn send(self) -> Result<()> {
8304            (*self.0.stub)
8305                .cancel_operation(self.0.request, self.0.options)
8306                .await
8307                .map(crate::Response::into_body)
8308        }
8309
8310        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
8311        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8312            self.0.request.name = v.into();
8313            self
8314        }
8315    }
8316
8317    #[doc(hidden)]
8318    impl crate::RequestBuilder for CancelOperation {
8319        fn request_options(&mut self) -> &mut crate::RequestOptions {
8320            &mut self.0.options
8321        }
8322    }
8323}
8324
8325#[cfg(feature = "documents")]
8326#[cfg_attr(docsrs, doc(cfg(feature = "documents")))]
8327pub mod documents {
8328    use crate::Result;
8329
8330    /// A builder for [Documents][crate::client::Documents].
8331    ///
8332    /// ```
8333    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8334    /// # use google_cloud_dialogflow_v2::*;
8335    /// # use builder::documents::ClientBuilder;
8336    /// # use client::Documents;
8337    /// let builder : ClientBuilder = Documents::builder();
8338    /// let client = builder
8339    ///     .with_endpoint("https://dialogflow.googleapis.com")
8340    ///     .build().await?;
8341    /// # Ok(()) }
8342    /// ```
8343    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8344
8345    pub(crate) mod client {
8346        use super::super::super::client::Documents;
8347        pub struct Factory;
8348        impl crate::ClientFactory for Factory {
8349            type Client = Documents;
8350            type Credentials = gaxi::options::Credentials;
8351            async fn build(
8352                self,
8353                config: gaxi::options::ClientConfig,
8354            ) -> crate::ClientBuilderResult<Self::Client> {
8355                Self::Client::new(config).await
8356            }
8357        }
8358    }
8359
8360    /// Common implementation for [crate::client::Documents] request builders.
8361    #[derive(Clone, Debug)]
8362    pub(crate) struct RequestBuilder<R: std::default::Default> {
8363        stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8364        request: R,
8365        options: crate::RequestOptions,
8366    }
8367
8368    impl<R> RequestBuilder<R>
8369    where
8370        R: std::default::Default,
8371    {
8372        pub(crate) fn new(
8373            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8374        ) -> Self {
8375            Self {
8376                stub,
8377                request: R::default(),
8378                options: crate::RequestOptions::default(),
8379            }
8380        }
8381    }
8382
8383    /// The request builder for [Documents::list_documents][crate::client::Documents::list_documents] calls.
8384    ///
8385    /// # Example
8386    /// ```
8387    /// # use google_cloud_dialogflow_v2::builder::documents::ListDocuments;
8388    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8389    /// use google_cloud_gax::paginator::ItemPaginator;
8390    ///
8391    /// let builder = prepare_request_builder();
8392    /// let mut items = builder.by_item();
8393    /// while let Some(result) = items.next().await {
8394    ///   let item = result?;
8395    /// }
8396    /// # Ok(()) }
8397    ///
8398    /// fn prepare_request_builder() -> ListDocuments {
8399    ///   # panic!();
8400    ///   // ... details omitted ...
8401    /// }
8402    /// ```
8403    #[derive(Clone, Debug)]
8404    pub struct ListDocuments(RequestBuilder<crate::model::ListDocumentsRequest>);
8405
8406    impl ListDocuments {
8407        pub(crate) fn new(
8408            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8409        ) -> Self {
8410            Self(RequestBuilder::new(stub))
8411        }
8412
8413        /// Sets the full request, replacing any prior values.
8414        pub fn with_request<V: Into<crate::model::ListDocumentsRequest>>(mut self, v: V) -> Self {
8415            self.0.request = v.into();
8416            self
8417        }
8418
8419        /// Sets all the options, replacing any prior values.
8420        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8421            self.0.options = v.into();
8422            self
8423        }
8424
8425        /// Sends the request.
8426        pub async fn send(self) -> Result<crate::model::ListDocumentsResponse> {
8427            (*self.0.stub)
8428                .list_documents(self.0.request, self.0.options)
8429                .await
8430                .map(crate::Response::into_body)
8431        }
8432
8433        /// Streams each page in the collection.
8434        pub fn by_page(
8435            self,
8436        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDocumentsResponse, crate::Error>
8437        {
8438            use std::clone::Clone;
8439            let token = self.0.request.page_token.clone();
8440            let execute = move |token: String| {
8441                let mut builder = self.clone();
8442                builder.0.request = builder.0.request.set_page_token(token);
8443                builder.send()
8444            };
8445            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8446        }
8447
8448        /// Streams each item in the collection.
8449        pub fn by_item(
8450            self,
8451        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8452            crate::model::ListDocumentsResponse,
8453            crate::Error,
8454        > {
8455            use google_cloud_gax::paginator::Paginator;
8456            self.by_page().items()
8457        }
8458
8459        /// Sets the value of [parent][crate::model::ListDocumentsRequest::parent].
8460        ///
8461        /// This is a **required** field for requests.
8462        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8463            self.0.request.parent = v.into();
8464            self
8465        }
8466
8467        /// Sets the value of [page_size][crate::model::ListDocumentsRequest::page_size].
8468        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8469            self.0.request.page_size = v.into();
8470            self
8471        }
8472
8473        /// Sets the value of [page_token][crate::model::ListDocumentsRequest::page_token].
8474        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8475            self.0.request.page_token = v.into();
8476            self
8477        }
8478
8479        /// Sets the value of [filter][crate::model::ListDocumentsRequest::filter].
8480        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8481            self.0.request.filter = v.into();
8482            self
8483        }
8484    }
8485
8486    #[doc(hidden)]
8487    impl crate::RequestBuilder for ListDocuments {
8488        fn request_options(&mut self) -> &mut crate::RequestOptions {
8489            &mut self.0.options
8490        }
8491    }
8492
8493    /// The request builder for [Documents::get_document][crate::client::Documents::get_document] calls.
8494    ///
8495    /// # Example
8496    /// ```
8497    /// # use google_cloud_dialogflow_v2::builder::documents::GetDocument;
8498    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8499    ///
8500    /// let builder = prepare_request_builder();
8501    /// let response = builder.send().await?;
8502    /// # Ok(()) }
8503    ///
8504    /// fn prepare_request_builder() -> GetDocument {
8505    ///   # panic!();
8506    ///   // ... details omitted ...
8507    /// }
8508    /// ```
8509    #[derive(Clone, Debug)]
8510    pub struct GetDocument(RequestBuilder<crate::model::GetDocumentRequest>);
8511
8512    impl GetDocument {
8513        pub(crate) fn new(
8514            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8515        ) -> Self {
8516            Self(RequestBuilder::new(stub))
8517        }
8518
8519        /// Sets the full request, replacing any prior values.
8520        pub fn with_request<V: Into<crate::model::GetDocumentRequest>>(mut self, v: V) -> Self {
8521            self.0.request = v.into();
8522            self
8523        }
8524
8525        /// Sets all the options, replacing any prior values.
8526        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8527            self.0.options = v.into();
8528            self
8529        }
8530
8531        /// Sends the request.
8532        pub async fn send(self) -> Result<crate::model::Document> {
8533            (*self.0.stub)
8534                .get_document(self.0.request, self.0.options)
8535                .await
8536                .map(crate::Response::into_body)
8537        }
8538
8539        /// Sets the value of [name][crate::model::GetDocumentRequest::name].
8540        ///
8541        /// This is a **required** field for requests.
8542        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8543            self.0.request.name = v.into();
8544            self
8545        }
8546    }
8547
8548    #[doc(hidden)]
8549    impl crate::RequestBuilder for GetDocument {
8550        fn request_options(&mut self) -> &mut crate::RequestOptions {
8551            &mut self.0.options
8552        }
8553    }
8554
8555    /// The request builder for [Documents::create_document][crate::client::Documents::create_document] calls.
8556    ///
8557    /// # Example
8558    /// ```
8559    /// # use google_cloud_dialogflow_v2::builder::documents::CreateDocument;
8560    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8561    /// use google_cloud_lro::Poller;
8562    ///
8563    /// let builder = prepare_request_builder();
8564    /// let response = builder.poller().until_done().await?;
8565    /// # Ok(()) }
8566    ///
8567    /// fn prepare_request_builder() -> CreateDocument {
8568    ///   # panic!();
8569    ///   // ... details omitted ...
8570    /// }
8571    /// ```
8572    #[derive(Clone, Debug)]
8573    pub struct CreateDocument(RequestBuilder<crate::model::CreateDocumentRequest>);
8574
8575    impl CreateDocument {
8576        pub(crate) fn new(
8577            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8578        ) -> Self {
8579            Self(RequestBuilder::new(stub))
8580        }
8581
8582        /// Sets the full request, replacing any prior values.
8583        pub fn with_request<V: Into<crate::model::CreateDocumentRequest>>(mut self, v: V) -> Self {
8584            self.0.request = v.into();
8585            self
8586        }
8587
8588        /// Sets all the options, replacing any prior values.
8589        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8590            self.0.options = v.into();
8591            self
8592        }
8593
8594        /// Sends the request.
8595        ///
8596        /// # Long running operations
8597        ///
8598        /// This starts, but does not poll, a longrunning operation. More information
8599        /// on [create_document][crate::client::Documents::create_document].
8600        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8601            (*self.0.stub)
8602                .create_document(self.0.request, self.0.options)
8603                .await
8604                .map(crate::Response::into_body)
8605        }
8606
8607        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_document`.
8608        pub fn poller(
8609            self,
8610        ) -> impl google_cloud_lro::Poller<
8611            crate::model::Document,
8612            crate::model::KnowledgeOperationMetadata,
8613        > {
8614            type Operation = google_cloud_lro::internal::Operation<
8615                crate::model::Document,
8616                crate::model::KnowledgeOperationMetadata,
8617            >;
8618            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8619            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8620
8621            let stub = self.0.stub.clone();
8622            let mut options = self.0.options.clone();
8623            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8624            let query = move |name| {
8625                let stub = stub.clone();
8626                let options = options.clone();
8627                async {
8628                    let op = GetOperation::new(stub)
8629                        .set_name(name)
8630                        .with_options(options)
8631                        .send()
8632                        .await?;
8633                    Ok(Operation::new(op))
8634                }
8635            };
8636
8637            let start = move || async {
8638                let op = self.send().await?;
8639                Ok(Operation::new(op))
8640            };
8641
8642            google_cloud_lro::internal::new_poller(
8643                polling_error_policy,
8644                polling_backoff_policy,
8645                start,
8646                query,
8647            )
8648        }
8649
8650        /// Sets the value of [parent][crate::model::CreateDocumentRequest::parent].
8651        ///
8652        /// This is a **required** field for requests.
8653        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8654            self.0.request.parent = v.into();
8655            self
8656        }
8657
8658        /// Sets the value of [document][crate::model::CreateDocumentRequest::document].
8659        ///
8660        /// This is a **required** field for requests.
8661        pub fn set_document<T>(mut self, v: T) -> Self
8662        where
8663            T: std::convert::Into<crate::model::Document>,
8664        {
8665            self.0.request.document = std::option::Option::Some(v.into());
8666            self
8667        }
8668
8669        /// Sets or clears the value of [document][crate::model::CreateDocumentRequest::document].
8670        ///
8671        /// This is a **required** field for requests.
8672        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
8673        where
8674            T: std::convert::Into<crate::model::Document>,
8675        {
8676            self.0.request.document = v.map(|x| x.into());
8677            self
8678        }
8679    }
8680
8681    #[doc(hidden)]
8682    impl crate::RequestBuilder for CreateDocument {
8683        fn request_options(&mut self) -> &mut crate::RequestOptions {
8684            &mut self.0.options
8685        }
8686    }
8687
8688    /// The request builder for [Documents::import_documents][crate::client::Documents::import_documents] calls.
8689    ///
8690    /// # Example
8691    /// ```
8692    /// # use google_cloud_dialogflow_v2::builder::documents::ImportDocuments;
8693    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8694    /// use google_cloud_lro::Poller;
8695    ///
8696    /// let builder = prepare_request_builder();
8697    /// let response = builder.poller().until_done().await?;
8698    /// # Ok(()) }
8699    ///
8700    /// fn prepare_request_builder() -> ImportDocuments {
8701    ///   # panic!();
8702    ///   // ... details omitted ...
8703    /// }
8704    /// ```
8705    #[derive(Clone, Debug)]
8706    pub struct ImportDocuments(RequestBuilder<crate::model::ImportDocumentsRequest>);
8707
8708    impl ImportDocuments {
8709        pub(crate) fn new(
8710            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8711        ) -> Self {
8712            Self(RequestBuilder::new(stub))
8713        }
8714
8715        /// Sets the full request, replacing any prior values.
8716        pub fn with_request<V: Into<crate::model::ImportDocumentsRequest>>(mut self, v: V) -> Self {
8717            self.0.request = v.into();
8718            self
8719        }
8720
8721        /// Sets all the options, replacing any prior values.
8722        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8723            self.0.options = v.into();
8724            self
8725        }
8726
8727        /// Sends the request.
8728        ///
8729        /// # Long running operations
8730        ///
8731        /// This starts, but does not poll, a longrunning operation. More information
8732        /// on [import_documents][crate::client::Documents::import_documents].
8733        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8734            (*self.0.stub)
8735                .import_documents(self.0.request, self.0.options)
8736                .await
8737                .map(crate::Response::into_body)
8738        }
8739
8740        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_documents`.
8741        pub fn poller(
8742            self,
8743        ) -> impl google_cloud_lro::Poller<
8744            crate::model::ImportDocumentsResponse,
8745            crate::model::KnowledgeOperationMetadata,
8746        > {
8747            type Operation = google_cloud_lro::internal::Operation<
8748                crate::model::ImportDocumentsResponse,
8749                crate::model::KnowledgeOperationMetadata,
8750            >;
8751            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8752            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8753
8754            let stub = self.0.stub.clone();
8755            let mut options = self.0.options.clone();
8756            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8757            let query = move |name| {
8758                let stub = stub.clone();
8759                let options = options.clone();
8760                async {
8761                    let op = GetOperation::new(stub)
8762                        .set_name(name)
8763                        .with_options(options)
8764                        .send()
8765                        .await?;
8766                    Ok(Operation::new(op))
8767                }
8768            };
8769
8770            let start = move || async {
8771                let op = self.send().await?;
8772                Ok(Operation::new(op))
8773            };
8774
8775            google_cloud_lro::internal::new_poller(
8776                polling_error_policy,
8777                polling_backoff_policy,
8778                start,
8779                query,
8780            )
8781        }
8782
8783        /// Sets the value of [parent][crate::model::ImportDocumentsRequest::parent].
8784        ///
8785        /// This is a **required** field for requests.
8786        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8787            self.0.request.parent = v.into();
8788            self
8789        }
8790
8791        /// Sets the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8792        ///
8793        /// This is a **required** field for requests.
8794        pub fn set_document_template<T>(mut self, v: T) -> Self
8795        where
8796            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8797        {
8798            self.0.request.document_template = std::option::Option::Some(v.into());
8799            self
8800        }
8801
8802        /// Sets or clears the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8803        ///
8804        /// This is a **required** field for requests.
8805        pub fn set_or_clear_document_template<T>(mut self, v: std::option::Option<T>) -> Self
8806        where
8807            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8808        {
8809            self.0.request.document_template = v.map(|x| x.into());
8810            self
8811        }
8812
8813        /// Sets the value of [import_gcs_custom_metadata][crate::model::ImportDocumentsRequest::import_gcs_custom_metadata].
8814        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
8815            self.0.request.import_gcs_custom_metadata = v.into();
8816            self
8817        }
8818
8819        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source].
8820        ///
8821        /// Note that all the setters affecting `source` are
8822        /// mutually exclusive.
8823        pub fn set_source<T: Into<Option<crate::model::import_documents_request::Source>>>(
8824            mut self,
8825            v: T,
8826        ) -> Self {
8827            self.0.request.source = v.into();
8828            self
8829        }
8830
8831        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source]
8832        /// to hold a `GcsSource`.
8833        ///
8834        /// Note that all the setters affecting `source` are
8835        /// mutually exclusive.
8836        pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSources>>>(
8837            mut self,
8838            v: T,
8839        ) -> Self {
8840            self.0.request = self.0.request.set_gcs_source(v);
8841            self
8842        }
8843    }
8844
8845    #[doc(hidden)]
8846    impl crate::RequestBuilder for ImportDocuments {
8847        fn request_options(&mut self) -> &mut crate::RequestOptions {
8848            &mut self.0.options
8849        }
8850    }
8851
8852    /// The request builder for [Documents::delete_document][crate::client::Documents::delete_document] calls.
8853    ///
8854    /// # Example
8855    /// ```
8856    /// # use google_cloud_dialogflow_v2::builder::documents::DeleteDocument;
8857    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8858    /// use google_cloud_lro::Poller;
8859    ///
8860    /// let builder = prepare_request_builder();
8861    /// let response = builder.poller().until_done().await?;
8862    /// # Ok(()) }
8863    ///
8864    /// fn prepare_request_builder() -> DeleteDocument {
8865    ///   # panic!();
8866    ///   // ... details omitted ...
8867    /// }
8868    /// ```
8869    #[derive(Clone, Debug)]
8870    pub struct DeleteDocument(RequestBuilder<crate::model::DeleteDocumentRequest>);
8871
8872    impl DeleteDocument {
8873        pub(crate) fn new(
8874            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8875        ) -> Self {
8876            Self(RequestBuilder::new(stub))
8877        }
8878
8879        /// Sets the full request, replacing any prior values.
8880        pub fn with_request<V: Into<crate::model::DeleteDocumentRequest>>(mut self, v: V) -> Self {
8881            self.0.request = v.into();
8882            self
8883        }
8884
8885        /// Sets all the options, replacing any prior values.
8886        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8887            self.0.options = v.into();
8888            self
8889        }
8890
8891        /// Sends the request.
8892        ///
8893        /// # Long running operations
8894        ///
8895        /// This starts, but does not poll, a longrunning operation. More information
8896        /// on [delete_document][crate::client::Documents::delete_document].
8897        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8898            (*self.0.stub)
8899                .delete_document(self.0.request, self.0.options)
8900                .await
8901                .map(crate::Response::into_body)
8902        }
8903
8904        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_document`.
8905        pub fn poller(
8906            self,
8907        ) -> impl google_cloud_lro::Poller<(), crate::model::KnowledgeOperationMetadata> {
8908            type Operation = google_cloud_lro::internal::Operation<
8909                wkt::Empty,
8910                crate::model::KnowledgeOperationMetadata,
8911            >;
8912            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8913            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8914
8915            let stub = self.0.stub.clone();
8916            let mut options = self.0.options.clone();
8917            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8918            let query = move |name| {
8919                let stub = stub.clone();
8920                let options = options.clone();
8921                async {
8922                    let op = GetOperation::new(stub)
8923                        .set_name(name)
8924                        .with_options(options)
8925                        .send()
8926                        .await?;
8927                    Ok(Operation::new(op))
8928                }
8929            };
8930
8931            let start = move || async {
8932                let op = self.send().await?;
8933                Ok(Operation::new(op))
8934            };
8935
8936            google_cloud_lro::internal::new_unit_response_poller(
8937                polling_error_policy,
8938                polling_backoff_policy,
8939                start,
8940                query,
8941            )
8942        }
8943
8944        /// Sets the value of [name][crate::model::DeleteDocumentRequest::name].
8945        ///
8946        /// This is a **required** field for requests.
8947        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8948            self.0.request.name = v.into();
8949            self
8950        }
8951    }
8952
8953    #[doc(hidden)]
8954    impl crate::RequestBuilder for DeleteDocument {
8955        fn request_options(&mut self) -> &mut crate::RequestOptions {
8956            &mut self.0.options
8957        }
8958    }
8959
8960    /// The request builder for [Documents::update_document][crate::client::Documents::update_document] calls.
8961    ///
8962    /// # Example
8963    /// ```
8964    /// # use google_cloud_dialogflow_v2::builder::documents::UpdateDocument;
8965    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
8966    /// use google_cloud_lro::Poller;
8967    ///
8968    /// let builder = prepare_request_builder();
8969    /// let response = builder.poller().until_done().await?;
8970    /// # Ok(()) }
8971    ///
8972    /// fn prepare_request_builder() -> UpdateDocument {
8973    ///   # panic!();
8974    ///   // ... details omitted ...
8975    /// }
8976    /// ```
8977    #[derive(Clone, Debug)]
8978    pub struct UpdateDocument(RequestBuilder<crate::model::UpdateDocumentRequest>);
8979
8980    impl UpdateDocument {
8981        pub(crate) fn new(
8982            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8983        ) -> Self {
8984            Self(RequestBuilder::new(stub))
8985        }
8986
8987        /// Sets the full request, replacing any prior values.
8988        pub fn with_request<V: Into<crate::model::UpdateDocumentRequest>>(mut self, v: V) -> Self {
8989            self.0.request = v.into();
8990            self
8991        }
8992
8993        /// Sets all the options, replacing any prior values.
8994        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8995            self.0.options = v.into();
8996            self
8997        }
8998
8999        /// Sends the request.
9000        ///
9001        /// # Long running operations
9002        ///
9003        /// This starts, but does not poll, a longrunning operation. More information
9004        /// on [update_document][crate::client::Documents::update_document].
9005        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9006            (*self.0.stub)
9007                .update_document(self.0.request, self.0.options)
9008                .await
9009                .map(crate::Response::into_body)
9010        }
9011
9012        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_document`.
9013        pub fn poller(
9014            self,
9015        ) -> impl google_cloud_lro::Poller<
9016            crate::model::Document,
9017            crate::model::KnowledgeOperationMetadata,
9018        > {
9019            type Operation = google_cloud_lro::internal::Operation<
9020                crate::model::Document,
9021                crate::model::KnowledgeOperationMetadata,
9022            >;
9023            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9024            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9025
9026            let stub = self.0.stub.clone();
9027            let mut options = self.0.options.clone();
9028            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9029            let query = move |name| {
9030                let stub = stub.clone();
9031                let options = options.clone();
9032                async {
9033                    let op = GetOperation::new(stub)
9034                        .set_name(name)
9035                        .with_options(options)
9036                        .send()
9037                        .await?;
9038                    Ok(Operation::new(op))
9039                }
9040            };
9041
9042            let start = move || async {
9043                let op = self.send().await?;
9044                Ok(Operation::new(op))
9045            };
9046
9047            google_cloud_lro::internal::new_poller(
9048                polling_error_policy,
9049                polling_backoff_policy,
9050                start,
9051                query,
9052            )
9053        }
9054
9055        /// Sets the value of [document][crate::model::UpdateDocumentRequest::document].
9056        ///
9057        /// This is a **required** field for requests.
9058        pub fn set_document<T>(mut self, v: T) -> Self
9059        where
9060            T: std::convert::Into<crate::model::Document>,
9061        {
9062            self.0.request.document = std::option::Option::Some(v.into());
9063            self
9064        }
9065
9066        /// Sets or clears the value of [document][crate::model::UpdateDocumentRequest::document].
9067        ///
9068        /// This is a **required** field for requests.
9069        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
9070        where
9071            T: std::convert::Into<crate::model::Document>,
9072        {
9073            self.0.request.document = v.map(|x| x.into());
9074            self
9075        }
9076
9077        /// Sets the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
9078        pub fn set_update_mask<T>(mut self, v: T) -> Self
9079        where
9080            T: std::convert::Into<wkt::FieldMask>,
9081        {
9082            self.0.request.update_mask = std::option::Option::Some(v.into());
9083            self
9084        }
9085
9086        /// Sets or clears the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
9087        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9088        where
9089            T: std::convert::Into<wkt::FieldMask>,
9090        {
9091            self.0.request.update_mask = v.map(|x| x.into());
9092            self
9093        }
9094    }
9095
9096    #[doc(hidden)]
9097    impl crate::RequestBuilder for UpdateDocument {
9098        fn request_options(&mut self) -> &mut crate::RequestOptions {
9099            &mut self.0.options
9100        }
9101    }
9102
9103    /// The request builder for [Documents::reload_document][crate::client::Documents::reload_document] calls.
9104    ///
9105    /// # Example
9106    /// ```
9107    /// # use google_cloud_dialogflow_v2::builder::documents::ReloadDocument;
9108    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9109    /// use google_cloud_lro::Poller;
9110    ///
9111    /// let builder = prepare_request_builder();
9112    /// let response = builder.poller().until_done().await?;
9113    /// # Ok(()) }
9114    ///
9115    /// fn prepare_request_builder() -> ReloadDocument {
9116    ///   # panic!();
9117    ///   // ... details omitted ...
9118    /// }
9119    /// ```
9120    #[derive(Clone, Debug)]
9121    pub struct ReloadDocument(RequestBuilder<crate::model::ReloadDocumentRequest>);
9122
9123    impl ReloadDocument {
9124        pub(crate) fn new(
9125            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9126        ) -> Self {
9127            Self(RequestBuilder::new(stub))
9128        }
9129
9130        /// Sets the full request, replacing any prior values.
9131        pub fn with_request<V: Into<crate::model::ReloadDocumentRequest>>(mut self, v: V) -> Self {
9132            self.0.request = v.into();
9133            self
9134        }
9135
9136        /// Sets all the options, replacing any prior values.
9137        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9138            self.0.options = v.into();
9139            self
9140        }
9141
9142        /// Sends the request.
9143        ///
9144        /// # Long running operations
9145        ///
9146        /// This starts, but does not poll, a longrunning operation. More information
9147        /// on [reload_document][crate::client::Documents::reload_document].
9148        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9149            (*self.0.stub)
9150                .reload_document(self.0.request, self.0.options)
9151                .await
9152                .map(crate::Response::into_body)
9153        }
9154
9155        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reload_document`.
9156        pub fn poller(
9157            self,
9158        ) -> impl google_cloud_lro::Poller<
9159            crate::model::Document,
9160            crate::model::KnowledgeOperationMetadata,
9161        > {
9162            type Operation = google_cloud_lro::internal::Operation<
9163                crate::model::Document,
9164                crate::model::KnowledgeOperationMetadata,
9165            >;
9166            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9167            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9168
9169            let stub = self.0.stub.clone();
9170            let mut options = self.0.options.clone();
9171            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9172            let query = move |name| {
9173                let stub = stub.clone();
9174                let options = options.clone();
9175                async {
9176                    let op = GetOperation::new(stub)
9177                        .set_name(name)
9178                        .with_options(options)
9179                        .send()
9180                        .await?;
9181                    Ok(Operation::new(op))
9182                }
9183            };
9184
9185            let start = move || async {
9186                let op = self.send().await?;
9187                Ok(Operation::new(op))
9188            };
9189
9190            google_cloud_lro::internal::new_poller(
9191                polling_error_policy,
9192                polling_backoff_policy,
9193                start,
9194                query,
9195            )
9196        }
9197
9198        /// Sets the value of [name][crate::model::ReloadDocumentRequest::name].
9199        ///
9200        /// This is a **required** field for requests.
9201        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9202            self.0.request.name = v.into();
9203            self
9204        }
9205
9206        /// Sets the value of [import_gcs_custom_metadata][crate::model::ReloadDocumentRequest::import_gcs_custom_metadata].
9207        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
9208            self.0.request.import_gcs_custom_metadata = v.into();
9209            self
9210        }
9211
9212        /// Sets the value of [smart_messaging_partial_update][crate::model::ReloadDocumentRequest::smart_messaging_partial_update].
9213        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9214            self.0.request.smart_messaging_partial_update = v.into();
9215            self
9216        }
9217
9218        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source].
9219        ///
9220        /// Note that all the setters affecting `source` are
9221        /// mutually exclusive.
9222        pub fn set_source<T: Into<Option<crate::model::reload_document_request::Source>>>(
9223            mut self,
9224            v: T,
9225        ) -> Self {
9226            self.0.request.source = v.into();
9227            self
9228        }
9229
9230        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source]
9231        /// to hold a `ContentUri`.
9232        ///
9233        /// Note that all the setters affecting `source` are
9234        /// mutually exclusive.
9235        pub fn set_content_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9236            self.0.request = self.0.request.set_content_uri(v);
9237            self
9238        }
9239    }
9240
9241    #[doc(hidden)]
9242    impl crate::RequestBuilder for ReloadDocument {
9243        fn request_options(&mut self) -> &mut crate::RequestOptions {
9244            &mut self.0.options
9245        }
9246    }
9247
9248    /// The request builder for [Documents::export_document][crate::client::Documents::export_document] calls.
9249    ///
9250    /// # Example
9251    /// ```
9252    /// # use google_cloud_dialogflow_v2::builder::documents::ExportDocument;
9253    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9254    /// use google_cloud_lro::Poller;
9255    ///
9256    /// let builder = prepare_request_builder();
9257    /// let response = builder.poller().until_done().await?;
9258    /// # Ok(()) }
9259    ///
9260    /// fn prepare_request_builder() -> ExportDocument {
9261    ///   # panic!();
9262    ///   // ... details omitted ...
9263    /// }
9264    /// ```
9265    #[derive(Clone, Debug)]
9266    pub struct ExportDocument(RequestBuilder<crate::model::ExportDocumentRequest>);
9267
9268    impl ExportDocument {
9269        pub(crate) fn new(
9270            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9271        ) -> Self {
9272            Self(RequestBuilder::new(stub))
9273        }
9274
9275        /// Sets the full request, replacing any prior values.
9276        pub fn with_request<V: Into<crate::model::ExportDocumentRequest>>(mut self, v: V) -> Self {
9277            self.0.request = v.into();
9278            self
9279        }
9280
9281        /// Sets all the options, replacing any prior values.
9282        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9283            self.0.options = v.into();
9284            self
9285        }
9286
9287        /// Sends the request.
9288        ///
9289        /// # Long running operations
9290        ///
9291        /// This starts, but does not poll, a longrunning operation. More information
9292        /// on [export_document][crate::client::Documents::export_document].
9293        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9294            (*self.0.stub)
9295                .export_document(self.0.request, self.0.options)
9296                .await
9297                .map(crate::Response::into_body)
9298        }
9299
9300        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_document`.
9301        pub fn poller(
9302            self,
9303        ) -> impl google_cloud_lro::Poller<
9304            crate::model::Document,
9305            crate::model::KnowledgeOperationMetadata,
9306        > {
9307            type Operation = google_cloud_lro::internal::Operation<
9308                crate::model::Document,
9309                crate::model::KnowledgeOperationMetadata,
9310            >;
9311            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9312            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9313
9314            let stub = self.0.stub.clone();
9315            let mut options = self.0.options.clone();
9316            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9317            let query = move |name| {
9318                let stub = stub.clone();
9319                let options = options.clone();
9320                async {
9321                    let op = GetOperation::new(stub)
9322                        .set_name(name)
9323                        .with_options(options)
9324                        .send()
9325                        .await?;
9326                    Ok(Operation::new(op))
9327                }
9328            };
9329
9330            let start = move || async {
9331                let op = self.send().await?;
9332                Ok(Operation::new(op))
9333            };
9334
9335            google_cloud_lro::internal::new_poller(
9336                polling_error_policy,
9337                polling_backoff_policy,
9338                start,
9339                query,
9340            )
9341        }
9342
9343        /// Sets the value of [name][crate::model::ExportDocumentRequest::name].
9344        ///
9345        /// This is a **required** field for requests.
9346        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9347            self.0.request.name = v.into();
9348            self
9349        }
9350
9351        /// Sets the value of [export_full_content][crate::model::ExportDocumentRequest::export_full_content].
9352        pub fn set_export_full_content<T: Into<bool>>(mut self, v: T) -> Self {
9353            self.0.request.export_full_content = v.into();
9354            self
9355        }
9356
9357        /// Sets the value of [smart_messaging_partial_update][crate::model::ExportDocumentRequest::smart_messaging_partial_update].
9358        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9359            self.0.request.smart_messaging_partial_update = v.into();
9360            self
9361        }
9362
9363        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination].
9364        ///
9365        /// Note that all the setters affecting `destination` are
9366        /// mutually exclusive.
9367        pub fn set_destination<
9368            T: Into<Option<crate::model::export_document_request::Destination>>,
9369        >(
9370            mut self,
9371            v: T,
9372        ) -> Self {
9373            self.0.request.destination = v.into();
9374            self
9375        }
9376
9377        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination]
9378        /// to hold a `GcsDestination`.
9379        ///
9380        /// Note that all the setters affecting `destination` are
9381        /// mutually exclusive.
9382        pub fn set_gcs_destination<
9383            T: std::convert::Into<std::boxed::Box<crate::model::GcsDestination>>,
9384        >(
9385            mut self,
9386            v: T,
9387        ) -> Self {
9388            self.0.request = self.0.request.set_gcs_destination(v);
9389            self
9390        }
9391    }
9392
9393    #[doc(hidden)]
9394    impl crate::RequestBuilder for ExportDocument {
9395        fn request_options(&mut self) -> &mut crate::RequestOptions {
9396            &mut self.0.options
9397        }
9398    }
9399
9400    /// The request builder for [Documents::list_locations][crate::client::Documents::list_locations] calls.
9401    ///
9402    /// # Example
9403    /// ```
9404    /// # use google_cloud_dialogflow_v2::builder::documents::ListLocations;
9405    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9406    /// use google_cloud_gax::paginator::ItemPaginator;
9407    ///
9408    /// let builder = prepare_request_builder();
9409    /// let mut items = builder.by_item();
9410    /// while let Some(result) = items.next().await {
9411    ///   let item = result?;
9412    /// }
9413    /// # Ok(()) }
9414    ///
9415    /// fn prepare_request_builder() -> ListLocations {
9416    ///   # panic!();
9417    ///   // ... details omitted ...
9418    /// }
9419    /// ```
9420    #[derive(Clone, Debug)]
9421    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9422
9423    impl ListLocations {
9424        pub(crate) fn new(
9425            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9426        ) -> Self {
9427            Self(RequestBuilder::new(stub))
9428        }
9429
9430        /// Sets the full request, replacing any prior values.
9431        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9432            mut self,
9433            v: V,
9434        ) -> Self {
9435            self.0.request = v.into();
9436            self
9437        }
9438
9439        /// Sets all the options, replacing any prior values.
9440        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9441            self.0.options = v.into();
9442            self
9443        }
9444
9445        /// Sends the request.
9446        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9447            (*self.0.stub)
9448                .list_locations(self.0.request, self.0.options)
9449                .await
9450                .map(crate::Response::into_body)
9451        }
9452
9453        /// Streams each page in the collection.
9454        pub fn by_page(
9455            self,
9456        ) -> impl google_cloud_gax::paginator::Paginator<
9457            google_cloud_location::model::ListLocationsResponse,
9458            crate::Error,
9459        > {
9460            use std::clone::Clone;
9461            let token = self.0.request.page_token.clone();
9462            let execute = move |token: String| {
9463                let mut builder = self.clone();
9464                builder.0.request = builder.0.request.set_page_token(token);
9465                builder.send()
9466            };
9467            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9468        }
9469
9470        /// Streams each item in the collection.
9471        pub fn by_item(
9472            self,
9473        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9474            google_cloud_location::model::ListLocationsResponse,
9475            crate::Error,
9476        > {
9477            use google_cloud_gax::paginator::Paginator;
9478            self.by_page().items()
9479        }
9480
9481        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9482        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9483            self.0.request.name = v.into();
9484            self
9485        }
9486
9487        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9488        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9489            self.0.request.filter = v.into();
9490            self
9491        }
9492
9493        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9494        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9495            self.0.request.page_size = v.into();
9496            self
9497        }
9498
9499        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9500        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9501            self.0.request.page_token = v.into();
9502            self
9503        }
9504    }
9505
9506    #[doc(hidden)]
9507    impl crate::RequestBuilder for ListLocations {
9508        fn request_options(&mut self) -> &mut crate::RequestOptions {
9509            &mut self.0.options
9510        }
9511    }
9512
9513    /// The request builder for [Documents::get_location][crate::client::Documents::get_location] calls.
9514    ///
9515    /// # Example
9516    /// ```
9517    /// # use google_cloud_dialogflow_v2::builder::documents::GetLocation;
9518    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9519    ///
9520    /// let builder = prepare_request_builder();
9521    /// let response = builder.send().await?;
9522    /// # Ok(()) }
9523    ///
9524    /// fn prepare_request_builder() -> GetLocation {
9525    ///   # panic!();
9526    ///   // ... details omitted ...
9527    /// }
9528    /// ```
9529    #[derive(Clone, Debug)]
9530    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9531
9532    impl GetLocation {
9533        pub(crate) fn new(
9534            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9535        ) -> Self {
9536            Self(RequestBuilder::new(stub))
9537        }
9538
9539        /// Sets the full request, replacing any prior values.
9540        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9541            mut self,
9542            v: V,
9543        ) -> Self {
9544            self.0.request = v.into();
9545            self
9546        }
9547
9548        /// Sets all the options, replacing any prior values.
9549        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9550            self.0.options = v.into();
9551            self
9552        }
9553
9554        /// Sends the request.
9555        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9556            (*self.0.stub)
9557                .get_location(self.0.request, self.0.options)
9558                .await
9559                .map(crate::Response::into_body)
9560        }
9561
9562        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9563        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9564            self.0.request.name = v.into();
9565            self
9566        }
9567    }
9568
9569    #[doc(hidden)]
9570    impl crate::RequestBuilder for GetLocation {
9571        fn request_options(&mut self) -> &mut crate::RequestOptions {
9572            &mut self.0.options
9573        }
9574    }
9575
9576    /// The request builder for [Documents::list_operations][crate::client::Documents::list_operations] calls.
9577    ///
9578    /// # Example
9579    /// ```
9580    /// # use google_cloud_dialogflow_v2::builder::documents::ListOperations;
9581    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9582    /// use google_cloud_gax::paginator::ItemPaginator;
9583    ///
9584    /// let builder = prepare_request_builder();
9585    /// let mut items = builder.by_item();
9586    /// while let Some(result) = items.next().await {
9587    ///   let item = result?;
9588    /// }
9589    /// # Ok(()) }
9590    ///
9591    /// fn prepare_request_builder() -> ListOperations {
9592    ///   # panic!();
9593    ///   // ... details omitted ...
9594    /// }
9595    /// ```
9596    #[derive(Clone, Debug)]
9597    pub struct ListOperations(
9598        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9599    );
9600
9601    impl ListOperations {
9602        pub(crate) fn new(
9603            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9604        ) -> Self {
9605            Self(RequestBuilder::new(stub))
9606        }
9607
9608        /// Sets the full request, replacing any prior values.
9609        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9610            mut self,
9611            v: V,
9612        ) -> Self {
9613            self.0.request = v.into();
9614            self
9615        }
9616
9617        /// Sets all the options, replacing any prior values.
9618        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9619            self.0.options = v.into();
9620            self
9621        }
9622
9623        /// Sends the request.
9624        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9625            (*self.0.stub)
9626                .list_operations(self.0.request, self.0.options)
9627                .await
9628                .map(crate::Response::into_body)
9629        }
9630
9631        /// Streams each page in the collection.
9632        pub fn by_page(
9633            self,
9634        ) -> impl google_cloud_gax::paginator::Paginator<
9635            google_cloud_longrunning::model::ListOperationsResponse,
9636            crate::Error,
9637        > {
9638            use std::clone::Clone;
9639            let token = self.0.request.page_token.clone();
9640            let execute = move |token: String| {
9641                let mut builder = self.clone();
9642                builder.0.request = builder.0.request.set_page_token(token);
9643                builder.send()
9644            };
9645            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9646        }
9647
9648        /// Streams each item in the collection.
9649        pub fn by_item(
9650            self,
9651        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9652            google_cloud_longrunning::model::ListOperationsResponse,
9653            crate::Error,
9654        > {
9655            use google_cloud_gax::paginator::Paginator;
9656            self.by_page().items()
9657        }
9658
9659        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
9660        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9661            self.0.request.name = v.into();
9662            self
9663        }
9664
9665        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
9666        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9667            self.0.request.filter = v.into();
9668            self
9669        }
9670
9671        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
9672        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9673            self.0.request.page_size = v.into();
9674            self
9675        }
9676
9677        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
9678        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9679            self.0.request.page_token = v.into();
9680            self
9681        }
9682
9683        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
9684        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9685            self.0.request.return_partial_success = v.into();
9686            self
9687        }
9688    }
9689
9690    #[doc(hidden)]
9691    impl crate::RequestBuilder for ListOperations {
9692        fn request_options(&mut self) -> &mut crate::RequestOptions {
9693            &mut self.0.options
9694        }
9695    }
9696
9697    /// The request builder for [Documents::get_operation][crate::client::Documents::get_operation] calls.
9698    ///
9699    /// # Example
9700    /// ```
9701    /// # use google_cloud_dialogflow_v2::builder::documents::GetOperation;
9702    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9703    ///
9704    /// let builder = prepare_request_builder();
9705    /// let response = builder.send().await?;
9706    /// # Ok(()) }
9707    ///
9708    /// fn prepare_request_builder() -> GetOperation {
9709    ///   # panic!();
9710    ///   // ... details omitted ...
9711    /// }
9712    /// ```
9713    #[derive(Clone, Debug)]
9714    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9715
9716    impl GetOperation {
9717        pub(crate) fn new(
9718            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9719        ) -> Self {
9720            Self(RequestBuilder::new(stub))
9721        }
9722
9723        /// Sets the full request, replacing any prior values.
9724        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9725            mut self,
9726            v: V,
9727        ) -> Self {
9728            self.0.request = v.into();
9729            self
9730        }
9731
9732        /// Sets all the options, replacing any prior values.
9733        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9734            self.0.options = v.into();
9735            self
9736        }
9737
9738        /// Sends the request.
9739        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9740            (*self.0.stub)
9741                .get_operation(self.0.request, self.0.options)
9742                .await
9743                .map(crate::Response::into_body)
9744        }
9745
9746        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
9747        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9748            self.0.request.name = v.into();
9749            self
9750        }
9751    }
9752
9753    #[doc(hidden)]
9754    impl crate::RequestBuilder for GetOperation {
9755        fn request_options(&mut self) -> &mut crate::RequestOptions {
9756            &mut self.0.options
9757        }
9758    }
9759
9760    /// The request builder for [Documents::cancel_operation][crate::client::Documents::cancel_operation] calls.
9761    ///
9762    /// # Example
9763    /// ```
9764    /// # use google_cloud_dialogflow_v2::builder::documents::CancelOperation;
9765    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9766    ///
9767    /// let builder = prepare_request_builder();
9768    /// let response = builder.send().await?;
9769    /// # Ok(()) }
9770    ///
9771    /// fn prepare_request_builder() -> CancelOperation {
9772    ///   # panic!();
9773    ///   // ... details omitted ...
9774    /// }
9775    /// ```
9776    #[derive(Clone, Debug)]
9777    pub struct CancelOperation(
9778        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9779    );
9780
9781    impl CancelOperation {
9782        pub(crate) fn new(
9783            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9784        ) -> Self {
9785            Self(RequestBuilder::new(stub))
9786        }
9787
9788        /// Sets the full request, replacing any prior values.
9789        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9790            mut self,
9791            v: V,
9792        ) -> Self {
9793            self.0.request = v.into();
9794            self
9795        }
9796
9797        /// Sets all the options, replacing any prior values.
9798        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9799            self.0.options = v.into();
9800            self
9801        }
9802
9803        /// Sends the request.
9804        pub async fn send(self) -> Result<()> {
9805            (*self.0.stub)
9806                .cancel_operation(self.0.request, self.0.options)
9807                .await
9808                .map(crate::Response::into_body)
9809        }
9810
9811        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
9812        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9813            self.0.request.name = v.into();
9814            self
9815        }
9816    }
9817
9818    #[doc(hidden)]
9819    impl crate::RequestBuilder for CancelOperation {
9820        fn request_options(&mut self) -> &mut crate::RequestOptions {
9821            &mut self.0.options
9822        }
9823    }
9824}
9825
9826#[cfg(feature = "encryption-spec-service")]
9827#[cfg_attr(docsrs, doc(cfg(feature = "encryption-spec-service")))]
9828pub mod encryption_spec_service {
9829    use crate::Result;
9830
9831    /// A builder for [EncryptionSpecService][crate::client::EncryptionSpecService].
9832    ///
9833    /// ```
9834    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9835    /// # use google_cloud_dialogflow_v2::*;
9836    /// # use builder::encryption_spec_service::ClientBuilder;
9837    /// # use client::EncryptionSpecService;
9838    /// let builder : ClientBuilder = EncryptionSpecService::builder();
9839    /// let client = builder
9840    ///     .with_endpoint("https://dialogflow.googleapis.com")
9841    ///     .build().await?;
9842    /// # Ok(()) }
9843    /// ```
9844    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9845
9846    pub(crate) mod client {
9847        use super::super::super::client::EncryptionSpecService;
9848        pub struct Factory;
9849        impl crate::ClientFactory for Factory {
9850            type Client = EncryptionSpecService;
9851            type Credentials = gaxi::options::Credentials;
9852            async fn build(
9853                self,
9854                config: gaxi::options::ClientConfig,
9855            ) -> crate::ClientBuilderResult<Self::Client> {
9856                Self::Client::new(config).await
9857            }
9858        }
9859    }
9860
9861    /// Common implementation for [crate::client::EncryptionSpecService] request builders.
9862    #[derive(Clone, Debug)]
9863    pub(crate) struct RequestBuilder<R: std::default::Default> {
9864        stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9865        request: R,
9866        options: crate::RequestOptions,
9867    }
9868
9869    impl<R> RequestBuilder<R>
9870    where
9871        R: std::default::Default,
9872    {
9873        pub(crate) fn new(
9874            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9875        ) -> Self {
9876            Self {
9877                stub,
9878                request: R::default(),
9879                options: crate::RequestOptions::default(),
9880            }
9881        }
9882    }
9883
9884    /// The request builder for [EncryptionSpecService::get_encryption_spec][crate::client::EncryptionSpecService::get_encryption_spec] calls.
9885    ///
9886    /// # Example
9887    /// ```
9888    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetEncryptionSpec;
9889    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9890    ///
9891    /// let builder = prepare_request_builder();
9892    /// let response = builder.send().await?;
9893    /// # Ok(()) }
9894    ///
9895    /// fn prepare_request_builder() -> GetEncryptionSpec {
9896    ///   # panic!();
9897    ///   // ... details omitted ...
9898    /// }
9899    /// ```
9900    #[derive(Clone, Debug)]
9901    pub struct GetEncryptionSpec(RequestBuilder<crate::model::GetEncryptionSpecRequest>);
9902
9903    impl GetEncryptionSpec {
9904        pub(crate) fn new(
9905            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9906        ) -> Self {
9907            Self(RequestBuilder::new(stub))
9908        }
9909
9910        /// Sets the full request, replacing any prior values.
9911        pub fn with_request<V: Into<crate::model::GetEncryptionSpecRequest>>(
9912            mut self,
9913            v: V,
9914        ) -> Self {
9915            self.0.request = v.into();
9916            self
9917        }
9918
9919        /// Sets all the options, replacing any prior values.
9920        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9921            self.0.options = v.into();
9922            self
9923        }
9924
9925        /// Sends the request.
9926        pub async fn send(self) -> Result<crate::model::EncryptionSpec> {
9927            (*self.0.stub)
9928                .get_encryption_spec(self.0.request, self.0.options)
9929                .await
9930                .map(crate::Response::into_body)
9931        }
9932
9933        /// Sets the value of [name][crate::model::GetEncryptionSpecRequest::name].
9934        ///
9935        /// This is a **required** field for requests.
9936        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9937            self.0.request.name = v.into();
9938            self
9939        }
9940    }
9941
9942    #[doc(hidden)]
9943    impl crate::RequestBuilder for GetEncryptionSpec {
9944        fn request_options(&mut self) -> &mut crate::RequestOptions {
9945            &mut self.0.options
9946        }
9947    }
9948
9949    /// The request builder for [EncryptionSpecService::initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec] calls.
9950    ///
9951    /// # Example
9952    /// ```
9953    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::InitializeEncryptionSpec;
9954    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
9955    /// use google_cloud_lro::Poller;
9956    ///
9957    /// let builder = prepare_request_builder();
9958    /// let response = builder.poller().until_done().await?;
9959    /// # Ok(()) }
9960    ///
9961    /// fn prepare_request_builder() -> InitializeEncryptionSpec {
9962    ///   # panic!();
9963    ///   // ... details omitted ...
9964    /// }
9965    /// ```
9966    #[derive(Clone, Debug)]
9967    pub struct InitializeEncryptionSpec(
9968        RequestBuilder<crate::model::InitializeEncryptionSpecRequest>,
9969    );
9970
9971    impl InitializeEncryptionSpec {
9972        pub(crate) fn new(
9973            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9974        ) -> Self {
9975            Self(RequestBuilder::new(stub))
9976        }
9977
9978        /// Sets the full request, replacing any prior values.
9979        pub fn with_request<V: Into<crate::model::InitializeEncryptionSpecRequest>>(
9980            mut self,
9981            v: V,
9982        ) -> Self {
9983            self.0.request = v.into();
9984            self
9985        }
9986
9987        /// Sets all the options, replacing any prior values.
9988        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9989            self.0.options = v.into();
9990            self
9991        }
9992
9993        /// Sends the request.
9994        ///
9995        /// # Long running operations
9996        ///
9997        /// This starts, but does not poll, a longrunning operation. More information
9998        /// on [initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec].
9999        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10000            (*self.0.stub)
10001                .initialize_encryption_spec(self.0.request, self.0.options)
10002                .await
10003                .map(crate::Response::into_body)
10004        }
10005
10006        /// Creates a [Poller][google_cloud_lro::Poller] to work with `initialize_encryption_spec`.
10007        pub fn poller(
10008            self,
10009        ) -> impl google_cloud_lro::Poller<
10010            crate::model::InitializeEncryptionSpecResponse,
10011            crate::model::InitializeEncryptionSpecMetadata,
10012        > {
10013            type Operation = google_cloud_lro::internal::Operation<
10014                crate::model::InitializeEncryptionSpecResponse,
10015                crate::model::InitializeEncryptionSpecMetadata,
10016            >;
10017            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10018            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10019
10020            let stub = self.0.stub.clone();
10021            let mut options = self.0.options.clone();
10022            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10023            let query = move |name| {
10024                let stub = stub.clone();
10025                let options = options.clone();
10026                async {
10027                    let op = GetOperation::new(stub)
10028                        .set_name(name)
10029                        .with_options(options)
10030                        .send()
10031                        .await?;
10032                    Ok(Operation::new(op))
10033                }
10034            };
10035
10036            let start = move || async {
10037                let op = self.send().await?;
10038                Ok(Operation::new(op))
10039            };
10040
10041            google_cloud_lro::internal::new_poller(
10042                polling_error_policy,
10043                polling_backoff_policy,
10044                start,
10045                query,
10046            )
10047        }
10048
10049        /// Sets the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
10050        ///
10051        /// This is a **required** field for requests.
10052        pub fn set_encryption_spec<T>(mut self, v: T) -> Self
10053        where
10054            T: std::convert::Into<crate::model::EncryptionSpec>,
10055        {
10056            self.0.request.encryption_spec = std::option::Option::Some(v.into());
10057            self
10058        }
10059
10060        /// Sets or clears the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
10061        ///
10062        /// This is a **required** field for requests.
10063        pub fn set_or_clear_encryption_spec<T>(mut self, v: std::option::Option<T>) -> Self
10064        where
10065            T: std::convert::Into<crate::model::EncryptionSpec>,
10066        {
10067            self.0.request.encryption_spec = v.map(|x| x.into());
10068            self
10069        }
10070    }
10071
10072    #[doc(hidden)]
10073    impl crate::RequestBuilder for InitializeEncryptionSpec {
10074        fn request_options(&mut self) -> &mut crate::RequestOptions {
10075            &mut self.0.options
10076        }
10077    }
10078
10079    /// The request builder for [EncryptionSpecService::list_locations][crate::client::EncryptionSpecService::list_locations] calls.
10080    ///
10081    /// # Example
10082    /// ```
10083    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::ListLocations;
10084    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10085    /// use google_cloud_gax::paginator::ItemPaginator;
10086    ///
10087    /// let builder = prepare_request_builder();
10088    /// let mut items = builder.by_item();
10089    /// while let Some(result) = items.next().await {
10090    ///   let item = result?;
10091    /// }
10092    /// # Ok(()) }
10093    ///
10094    /// fn prepare_request_builder() -> ListLocations {
10095    ///   # panic!();
10096    ///   // ... details omitted ...
10097    /// }
10098    /// ```
10099    #[derive(Clone, Debug)]
10100    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10101
10102    impl ListLocations {
10103        pub(crate) fn new(
10104            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10105        ) -> Self {
10106            Self(RequestBuilder::new(stub))
10107        }
10108
10109        /// Sets the full request, replacing any prior values.
10110        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10111            mut self,
10112            v: V,
10113        ) -> Self {
10114            self.0.request = v.into();
10115            self
10116        }
10117
10118        /// Sets all the options, replacing any prior values.
10119        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10120            self.0.options = v.into();
10121            self
10122        }
10123
10124        /// Sends the request.
10125        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10126            (*self.0.stub)
10127                .list_locations(self.0.request, self.0.options)
10128                .await
10129                .map(crate::Response::into_body)
10130        }
10131
10132        /// Streams each page in the collection.
10133        pub fn by_page(
10134            self,
10135        ) -> impl google_cloud_gax::paginator::Paginator<
10136            google_cloud_location::model::ListLocationsResponse,
10137            crate::Error,
10138        > {
10139            use std::clone::Clone;
10140            let token = self.0.request.page_token.clone();
10141            let execute = move |token: String| {
10142                let mut builder = self.clone();
10143                builder.0.request = builder.0.request.set_page_token(token);
10144                builder.send()
10145            };
10146            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10147        }
10148
10149        /// Streams each item in the collection.
10150        pub fn by_item(
10151            self,
10152        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10153            google_cloud_location::model::ListLocationsResponse,
10154            crate::Error,
10155        > {
10156            use google_cloud_gax::paginator::Paginator;
10157            self.by_page().items()
10158        }
10159
10160        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10161        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10162            self.0.request.name = v.into();
10163            self
10164        }
10165
10166        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10167        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10168            self.0.request.filter = v.into();
10169            self
10170        }
10171
10172        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10173        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10174            self.0.request.page_size = v.into();
10175            self
10176        }
10177
10178        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10179        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10180            self.0.request.page_token = v.into();
10181            self
10182        }
10183    }
10184
10185    #[doc(hidden)]
10186    impl crate::RequestBuilder for ListLocations {
10187        fn request_options(&mut self) -> &mut crate::RequestOptions {
10188            &mut self.0.options
10189        }
10190    }
10191
10192    /// The request builder for [EncryptionSpecService::get_location][crate::client::EncryptionSpecService::get_location] calls.
10193    ///
10194    /// # Example
10195    /// ```
10196    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetLocation;
10197    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10198    ///
10199    /// let builder = prepare_request_builder();
10200    /// let response = builder.send().await?;
10201    /// # Ok(()) }
10202    ///
10203    /// fn prepare_request_builder() -> GetLocation {
10204    ///   # panic!();
10205    ///   // ... details omitted ...
10206    /// }
10207    /// ```
10208    #[derive(Clone, Debug)]
10209    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10210
10211    impl GetLocation {
10212        pub(crate) fn new(
10213            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10214        ) -> Self {
10215            Self(RequestBuilder::new(stub))
10216        }
10217
10218        /// Sets the full request, replacing any prior values.
10219        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10220            mut self,
10221            v: V,
10222        ) -> Self {
10223            self.0.request = v.into();
10224            self
10225        }
10226
10227        /// Sets all the options, replacing any prior values.
10228        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10229            self.0.options = v.into();
10230            self
10231        }
10232
10233        /// Sends the request.
10234        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10235            (*self.0.stub)
10236                .get_location(self.0.request, self.0.options)
10237                .await
10238                .map(crate::Response::into_body)
10239        }
10240
10241        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
10242        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10243            self.0.request.name = v.into();
10244            self
10245        }
10246    }
10247
10248    #[doc(hidden)]
10249    impl crate::RequestBuilder for GetLocation {
10250        fn request_options(&mut self) -> &mut crate::RequestOptions {
10251            &mut self.0.options
10252        }
10253    }
10254
10255    /// The request builder for [EncryptionSpecService::list_operations][crate::client::EncryptionSpecService::list_operations] calls.
10256    ///
10257    /// # Example
10258    /// ```
10259    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::ListOperations;
10260    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10261    /// use google_cloud_gax::paginator::ItemPaginator;
10262    ///
10263    /// let builder = prepare_request_builder();
10264    /// let mut items = builder.by_item();
10265    /// while let Some(result) = items.next().await {
10266    ///   let item = result?;
10267    /// }
10268    /// # Ok(()) }
10269    ///
10270    /// fn prepare_request_builder() -> ListOperations {
10271    ///   # panic!();
10272    ///   // ... details omitted ...
10273    /// }
10274    /// ```
10275    #[derive(Clone, Debug)]
10276    pub struct ListOperations(
10277        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10278    );
10279
10280    impl ListOperations {
10281        pub(crate) fn new(
10282            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10283        ) -> Self {
10284            Self(RequestBuilder::new(stub))
10285        }
10286
10287        /// Sets the full request, replacing any prior values.
10288        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10289            mut self,
10290            v: V,
10291        ) -> Self {
10292            self.0.request = v.into();
10293            self
10294        }
10295
10296        /// Sets all the options, replacing any prior values.
10297        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10298            self.0.options = v.into();
10299            self
10300        }
10301
10302        /// Sends the request.
10303        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10304            (*self.0.stub)
10305                .list_operations(self.0.request, self.0.options)
10306                .await
10307                .map(crate::Response::into_body)
10308        }
10309
10310        /// Streams each page in the collection.
10311        pub fn by_page(
10312            self,
10313        ) -> impl google_cloud_gax::paginator::Paginator<
10314            google_cloud_longrunning::model::ListOperationsResponse,
10315            crate::Error,
10316        > {
10317            use std::clone::Clone;
10318            let token = self.0.request.page_token.clone();
10319            let execute = move |token: String| {
10320                let mut builder = self.clone();
10321                builder.0.request = builder.0.request.set_page_token(token);
10322                builder.send()
10323            };
10324            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10325        }
10326
10327        /// Streams each item in the collection.
10328        pub fn by_item(
10329            self,
10330        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10331            google_cloud_longrunning::model::ListOperationsResponse,
10332            crate::Error,
10333        > {
10334            use google_cloud_gax::paginator::Paginator;
10335            self.by_page().items()
10336        }
10337
10338        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
10339        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10340            self.0.request.name = v.into();
10341            self
10342        }
10343
10344        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
10345        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10346            self.0.request.filter = v.into();
10347            self
10348        }
10349
10350        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
10351        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10352            self.0.request.page_size = v.into();
10353            self
10354        }
10355
10356        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
10357        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10358            self.0.request.page_token = v.into();
10359            self
10360        }
10361
10362        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
10363        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10364            self.0.request.return_partial_success = v.into();
10365            self
10366        }
10367    }
10368
10369    #[doc(hidden)]
10370    impl crate::RequestBuilder for ListOperations {
10371        fn request_options(&mut self) -> &mut crate::RequestOptions {
10372            &mut self.0.options
10373        }
10374    }
10375
10376    /// The request builder for [EncryptionSpecService::get_operation][crate::client::EncryptionSpecService::get_operation] calls.
10377    ///
10378    /// # Example
10379    /// ```
10380    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetOperation;
10381    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10382    ///
10383    /// let builder = prepare_request_builder();
10384    /// let response = builder.send().await?;
10385    /// # Ok(()) }
10386    ///
10387    /// fn prepare_request_builder() -> GetOperation {
10388    ///   # panic!();
10389    ///   // ... details omitted ...
10390    /// }
10391    /// ```
10392    #[derive(Clone, Debug)]
10393    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10394
10395    impl GetOperation {
10396        pub(crate) fn new(
10397            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10398        ) -> Self {
10399            Self(RequestBuilder::new(stub))
10400        }
10401
10402        /// Sets the full request, replacing any prior values.
10403        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10404            mut self,
10405            v: V,
10406        ) -> Self {
10407            self.0.request = v.into();
10408            self
10409        }
10410
10411        /// Sets all the options, replacing any prior values.
10412        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10413            self.0.options = v.into();
10414            self
10415        }
10416
10417        /// Sends the request.
10418        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10419            (*self.0.stub)
10420                .get_operation(self.0.request, self.0.options)
10421                .await
10422                .map(crate::Response::into_body)
10423        }
10424
10425        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
10426        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10427            self.0.request.name = v.into();
10428            self
10429        }
10430    }
10431
10432    #[doc(hidden)]
10433    impl crate::RequestBuilder for GetOperation {
10434        fn request_options(&mut self) -> &mut crate::RequestOptions {
10435            &mut self.0.options
10436        }
10437    }
10438
10439    /// The request builder for [EncryptionSpecService::cancel_operation][crate::client::EncryptionSpecService::cancel_operation] calls.
10440    ///
10441    /// # Example
10442    /// ```
10443    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::CancelOperation;
10444    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10445    ///
10446    /// let builder = prepare_request_builder();
10447    /// let response = builder.send().await?;
10448    /// # Ok(()) }
10449    ///
10450    /// fn prepare_request_builder() -> CancelOperation {
10451    ///   # panic!();
10452    ///   // ... details omitted ...
10453    /// }
10454    /// ```
10455    #[derive(Clone, Debug)]
10456    pub struct CancelOperation(
10457        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10458    );
10459
10460    impl CancelOperation {
10461        pub(crate) fn new(
10462            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10463        ) -> Self {
10464            Self(RequestBuilder::new(stub))
10465        }
10466
10467        /// Sets the full request, replacing any prior values.
10468        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10469            mut self,
10470            v: V,
10471        ) -> Self {
10472            self.0.request = v.into();
10473            self
10474        }
10475
10476        /// Sets all the options, replacing any prior values.
10477        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10478            self.0.options = v.into();
10479            self
10480        }
10481
10482        /// Sends the request.
10483        pub async fn send(self) -> Result<()> {
10484            (*self.0.stub)
10485                .cancel_operation(self.0.request, self.0.options)
10486                .await
10487                .map(crate::Response::into_body)
10488        }
10489
10490        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
10491        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10492            self.0.request.name = v.into();
10493            self
10494        }
10495    }
10496
10497    #[doc(hidden)]
10498    impl crate::RequestBuilder for CancelOperation {
10499        fn request_options(&mut self) -> &mut crate::RequestOptions {
10500            &mut self.0.options
10501        }
10502    }
10503}
10504
10505#[cfg(feature = "entity-types")]
10506#[cfg_attr(docsrs, doc(cfg(feature = "entity-types")))]
10507pub mod entity_types {
10508    use crate::Result;
10509
10510    /// A builder for [EntityTypes][crate::client::EntityTypes].
10511    ///
10512    /// ```
10513    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10514    /// # use google_cloud_dialogflow_v2::*;
10515    /// # use builder::entity_types::ClientBuilder;
10516    /// # use client::EntityTypes;
10517    /// let builder : ClientBuilder = EntityTypes::builder();
10518    /// let client = builder
10519    ///     .with_endpoint("https://dialogflow.googleapis.com")
10520    ///     .build().await?;
10521    /// # Ok(()) }
10522    /// ```
10523    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10524
10525    pub(crate) mod client {
10526        use super::super::super::client::EntityTypes;
10527        pub struct Factory;
10528        impl crate::ClientFactory for Factory {
10529            type Client = EntityTypes;
10530            type Credentials = gaxi::options::Credentials;
10531            async fn build(
10532                self,
10533                config: gaxi::options::ClientConfig,
10534            ) -> crate::ClientBuilderResult<Self::Client> {
10535                Self::Client::new(config).await
10536            }
10537        }
10538    }
10539
10540    /// Common implementation for [crate::client::EntityTypes] request builders.
10541    #[derive(Clone, Debug)]
10542    pub(crate) struct RequestBuilder<R: std::default::Default> {
10543        stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10544        request: R,
10545        options: crate::RequestOptions,
10546    }
10547
10548    impl<R> RequestBuilder<R>
10549    where
10550        R: std::default::Default,
10551    {
10552        pub(crate) fn new(
10553            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10554        ) -> Self {
10555            Self {
10556                stub,
10557                request: R::default(),
10558                options: crate::RequestOptions::default(),
10559            }
10560        }
10561    }
10562
10563    /// The request builder for [EntityTypes::list_entity_types][crate::client::EntityTypes::list_entity_types] calls.
10564    ///
10565    /// # Example
10566    /// ```
10567    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListEntityTypes;
10568    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10569    /// use google_cloud_gax::paginator::ItemPaginator;
10570    ///
10571    /// let builder = prepare_request_builder();
10572    /// let mut items = builder.by_item();
10573    /// while let Some(result) = items.next().await {
10574    ///   let item = result?;
10575    /// }
10576    /// # Ok(()) }
10577    ///
10578    /// fn prepare_request_builder() -> ListEntityTypes {
10579    ///   # panic!();
10580    ///   // ... details omitted ...
10581    /// }
10582    /// ```
10583    #[derive(Clone, Debug)]
10584    pub struct ListEntityTypes(RequestBuilder<crate::model::ListEntityTypesRequest>);
10585
10586    impl ListEntityTypes {
10587        pub(crate) fn new(
10588            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10589        ) -> Self {
10590            Self(RequestBuilder::new(stub))
10591        }
10592
10593        /// Sets the full request, replacing any prior values.
10594        pub fn with_request<V: Into<crate::model::ListEntityTypesRequest>>(mut self, v: V) -> Self {
10595            self.0.request = v.into();
10596            self
10597        }
10598
10599        /// Sets all the options, replacing any prior values.
10600        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10601            self.0.options = v.into();
10602            self
10603        }
10604
10605        /// Sends the request.
10606        pub async fn send(self) -> Result<crate::model::ListEntityTypesResponse> {
10607            (*self.0.stub)
10608                .list_entity_types(self.0.request, self.0.options)
10609                .await
10610                .map(crate::Response::into_body)
10611        }
10612
10613        /// Streams each page in the collection.
10614        pub fn by_page(
10615            self,
10616        ) -> impl google_cloud_gax::paginator::Paginator<
10617            crate::model::ListEntityTypesResponse,
10618            crate::Error,
10619        > {
10620            use std::clone::Clone;
10621            let token = self.0.request.page_token.clone();
10622            let execute = move |token: String| {
10623                let mut builder = self.clone();
10624                builder.0.request = builder.0.request.set_page_token(token);
10625                builder.send()
10626            };
10627            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10628        }
10629
10630        /// Streams each item in the collection.
10631        pub fn by_item(
10632            self,
10633        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10634            crate::model::ListEntityTypesResponse,
10635            crate::Error,
10636        > {
10637            use google_cloud_gax::paginator::Paginator;
10638            self.by_page().items()
10639        }
10640
10641        /// Sets the value of [parent][crate::model::ListEntityTypesRequest::parent].
10642        ///
10643        /// This is a **required** field for requests.
10644        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10645            self.0.request.parent = v.into();
10646            self
10647        }
10648
10649        /// Sets the value of [language_code][crate::model::ListEntityTypesRequest::language_code].
10650        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10651            self.0.request.language_code = v.into();
10652            self
10653        }
10654
10655        /// Sets the value of [page_size][crate::model::ListEntityTypesRequest::page_size].
10656        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10657            self.0.request.page_size = v.into();
10658            self
10659        }
10660
10661        /// Sets the value of [page_token][crate::model::ListEntityTypesRequest::page_token].
10662        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10663            self.0.request.page_token = v.into();
10664            self
10665        }
10666    }
10667
10668    #[doc(hidden)]
10669    impl crate::RequestBuilder for ListEntityTypes {
10670        fn request_options(&mut self) -> &mut crate::RequestOptions {
10671            &mut self.0.options
10672        }
10673    }
10674
10675    /// The request builder for [EntityTypes::get_entity_type][crate::client::EntityTypes::get_entity_type] calls.
10676    ///
10677    /// # Example
10678    /// ```
10679    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetEntityType;
10680    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10681    ///
10682    /// let builder = prepare_request_builder();
10683    /// let response = builder.send().await?;
10684    /// # Ok(()) }
10685    ///
10686    /// fn prepare_request_builder() -> GetEntityType {
10687    ///   # panic!();
10688    ///   // ... details omitted ...
10689    /// }
10690    /// ```
10691    #[derive(Clone, Debug)]
10692    pub struct GetEntityType(RequestBuilder<crate::model::GetEntityTypeRequest>);
10693
10694    impl GetEntityType {
10695        pub(crate) fn new(
10696            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10697        ) -> Self {
10698            Self(RequestBuilder::new(stub))
10699        }
10700
10701        /// Sets the full request, replacing any prior values.
10702        pub fn with_request<V: Into<crate::model::GetEntityTypeRequest>>(mut self, v: V) -> Self {
10703            self.0.request = v.into();
10704            self
10705        }
10706
10707        /// Sets all the options, replacing any prior values.
10708        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10709            self.0.options = v.into();
10710            self
10711        }
10712
10713        /// Sends the request.
10714        pub async fn send(self) -> Result<crate::model::EntityType> {
10715            (*self.0.stub)
10716                .get_entity_type(self.0.request, self.0.options)
10717                .await
10718                .map(crate::Response::into_body)
10719        }
10720
10721        /// Sets the value of [name][crate::model::GetEntityTypeRequest::name].
10722        ///
10723        /// This is a **required** field for requests.
10724        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10725            self.0.request.name = v.into();
10726            self
10727        }
10728
10729        /// Sets the value of [language_code][crate::model::GetEntityTypeRequest::language_code].
10730        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10731            self.0.request.language_code = v.into();
10732            self
10733        }
10734    }
10735
10736    #[doc(hidden)]
10737    impl crate::RequestBuilder for GetEntityType {
10738        fn request_options(&mut self) -> &mut crate::RequestOptions {
10739            &mut self.0.options
10740        }
10741    }
10742
10743    /// The request builder for [EntityTypes::create_entity_type][crate::client::EntityTypes::create_entity_type] calls.
10744    ///
10745    /// # Example
10746    /// ```
10747    /// # use google_cloud_dialogflow_v2::builder::entity_types::CreateEntityType;
10748    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10749    ///
10750    /// let builder = prepare_request_builder();
10751    /// let response = builder.send().await?;
10752    /// # Ok(()) }
10753    ///
10754    /// fn prepare_request_builder() -> CreateEntityType {
10755    ///   # panic!();
10756    ///   // ... details omitted ...
10757    /// }
10758    /// ```
10759    #[derive(Clone, Debug)]
10760    pub struct CreateEntityType(RequestBuilder<crate::model::CreateEntityTypeRequest>);
10761
10762    impl CreateEntityType {
10763        pub(crate) fn new(
10764            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10765        ) -> Self {
10766            Self(RequestBuilder::new(stub))
10767        }
10768
10769        /// Sets the full request, replacing any prior values.
10770        pub fn with_request<V: Into<crate::model::CreateEntityTypeRequest>>(
10771            mut self,
10772            v: V,
10773        ) -> Self {
10774            self.0.request = v.into();
10775            self
10776        }
10777
10778        /// Sets all the options, replacing any prior values.
10779        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10780            self.0.options = v.into();
10781            self
10782        }
10783
10784        /// Sends the request.
10785        pub async fn send(self) -> Result<crate::model::EntityType> {
10786            (*self.0.stub)
10787                .create_entity_type(self.0.request, self.0.options)
10788                .await
10789                .map(crate::Response::into_body)
10790        }
10791
10792        /// Sets the value of [parent][crate::model::CreateEntityTypeRequest::parent].
10793        ///
10794        /// This is a **required** field for requests.
10795        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10796            self.0.request.parent = v.into();
10797            self
10798        }
10799
10800        /// Sets the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10801        ///
10802        /// This is a **required** field for requests.
10803        pub fn set_entity_type<T>(mut self, v: T) -> Self
10804        where
10805            T: std::convert::Into<crate::model::EntityType>,
10806        {
10807            self.0.request.entity_type = std::option::Option::Some(v.into());
10808            self
10809        }
10810
10811        /// Sets or clears the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10812        ///
10813        /// This is a **required** field for requests.
10814        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
10815        where
10816            T: std::convert::Into<crate::model::EntityType>,
10817        {
10818            self.0.request.entity_type = v.map(|x| x.into());
10819            self
10820        }
10821
10822        /// Sets the value of [language_code][crate::model::CreateEntityTypeRequest::language_code].
10823        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10824            self.0.request.language_code = v.into();
10825            self
10826        }
10827    }
10828
10829    #[doc(hidden)]
10830    impl crate::RequestBuilder for CreateEntityType {
10831        fn request_options(&mut self) -> &mut crate::RequestOptions {
10832            &mut self.0.options
10833        }
10834    }
10835
10836    /// The request builder for [EntityTypes::update_entity_type][crate::client::EntityTypes::update_entity_type] calls.
10837    ///
10838    /// # Example
10839    /// ```
10840    /// # use google_cloud_dialogflow_v2::builder::entity_types::UpdateEntityType;
10841    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10842    ///
10843    /// let builder = prepare_request_builder();
10844    /// let response = builder.send().await?;
10845    /// # Ok(()) }
10846    ///
10847    /// fn prepare_request_builder() -> UpdateEntityType {
10848    ///   # panic!();
10849    ///   // ... details omitted ...
10850    /// }
10851    /// ```
10852    #[derive(Clone, Debug)]
10853    pub struct UpdateEntityType(RequestBuilder<crate::model::UpdateEntityTypeRequest>);
10854
10855    impl UpdateEntityType {
10856        pub(crate) fn new(
10857            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10858        ) -> Self {
10859            Self(RequestBuilder::new(stub))
10860        }
10861
10862        /// Sets the full request, replacing any prior values.
10863        pub fn with_request<V: Into<crate::model::UpdateEntityTypeRequest>>(
10864            mut self,
10865            v: V,
10866        ) -> Self {
10867            self.0.request = v.into();
10868            self
10869        }
10870
10871        /// Sets all the options, replacing any prior values.
10872        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10873            self.0.options = v.into();
10874            self
10875        }
10876
10877        /// Sends the request.
10878        pub async fn send(self) -> Result<crate::model::EntityType> {
10879            (*self.0.stub)
10880                .update_entity_type(self.0.request, self.0.options)
10881                .await
10882                .map(crate::Response::into_body)
10883        }
10884
10885        /// Sets the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
10886        ///
10887        /// This is a **required** field for requests.
10888        pub fn set_entity_type<T>(mut self, v: T) -> Self
10889        where
10890            T: std::convert::Into<crate::model::EntityType>,
10891        {
10892            self.0.request.entity_type = std::option::Option::Some(v.into());
10893            self
10894        }
10895
10896        /// Sets or clears the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
10897        ///
10898        /// This is a **required** field for requests.
10899        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
10900        where
10901            T: std::convert::Into<crate::model::EntityType>,
10902        {
10903            self.0.request.entity_type = v.map(|x| x.into());
10904            self
10905        }
10906
10907        /// Sets the value of [language_code][crate::model::UpdateEntityTypeRequest::language_code].
10908        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10909            self.0.request.language_code = v.into();
10910            self
10911        }
10912
10913        /// Sets the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
10914        pub fn set_update_mask<T>(mut self, v: T) -> Self
10915        where
10916            T: std::convert::Into<wkt::FieldMask>,
10917        {
10918            self.0.request.update_mask = std::option::Option::Some(v.into());
10919            self
10920        }
10921
10922        /// Sets or clears the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
10923        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10924        where
10925            T: std::convert::Into<wkt::FieldMask>,
10926        {
10927            self.0.request.update_mask = v.map(|x| x.into());
10928            self
10929        }
10930    }
10931
10932    #[doc(hidden)]
10933    impl crate::RequestBuilder for UpdateEntityType {
10934        fn request_options(&mut self) -> &mut crate::RequestOptions {
10935            &mut self.0.options
10936        }
10937    }
10938
10939    /// The request builder for [EntityTypes::delete_entity_type][crate::client::EntityTypes::delete_entity_type] calls.
10940    ///
10941    /// # Example
10942    /// ```
10943    /// # use google_cloud_dialogflow_v2::builder::entity_types::DeleteEntityType;
10944    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
10945    ///
10946    /// let builder = prepare_request_builder();
10947    /// let response = builder.send().await?;
10948    /// # Ok(()) }
10949    ///
10950    /// fn prepare_request_builder() -> DeleteEntityType {
10951    ///   # panic!();
10952    ///   // ... details omitted ...
10953    /// }
10954    /// ```
10955    #[derive(Clone, Debug)]
10956    pub struct DeleteEntityType(RequestBuilder<crate::model::DeleteEntityTypeRequest>);
10957
10958    impl DeleteEntityType {
10959        pub(crate) fn new(
10960            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10961        ) -> Self {
10962            Self(RequestBuilder::new(stub))
10963        }
10964
10965        /// Sets the full request, replacing any prior values.
10966        pub fn with_request<V: Into<crate::model::DeleteEntityTypeRequest>>(
10967            mut self,
10968            v: V,
10969        ) -> Self {
10970            self.0.request = v.into();
10971            self
10972        }
10973
10974        /// Sets all the options, replacing any prior values.
10975        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10976            self.0.options = v.into();
10977            self
10978        }
10979
10980        /// Sends the request.
10981        pub async fn send(self) -> Result<()> {
10982            (*self.0.stub)
10983                .delete_entity_type(self.0.request, self.0.options)
10984                .await
10985                .map(crate::Response::into_body)
10986        }
10987
10988        /// Sets the value of [name][crate::model::DeleteEntityTypeRequest::name].
10989        ///
10990        /// This is a **required** field for requests.
10991        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10992            self.0.request.name = v.into();
10993            self
10994        }
10995    }
10996
10997    #[doc(hidden)]
10998    impl crate::RequestBuilder for DeleteEntityType {
10999        fn request_options(&mut self) -> &mut crate::RequestOptions {
11000            &mut self.0.options
11001        }
11002    }
11003
11004    /// The request builder for [EntityTypes::batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types] calls.
11005    ///
11006    /// # Example
11007    /// ```
11008    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchUpdateEntityTypes;
11009    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11010    /// use google_cloud_lro::Poller;
11011    ///
11012    /// let builder = prepare_request_builder();
11013    /// let response = builder.poller().until_done().await?;
11014    /// # Ok(()) }
11015    ///
11016    /// fn prepare_request_builder() -> BatchUpdateEntityTypes {
11017    ///   # panic!();
11018    ///   // ... details omitted ...
11019    /// }
11020    /// ```
11021    #[derive(Clone, Debug)]
11022    pub struct BatchUpdateEntityTypes(RequestBuilder<crate::model::BatchUpdateEntityTypesRequest>);
11023
11024    impl BatchUpdateEntityTypes {
11025        pub(crate) fn new(
11026            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11027        ) -> Self {
11028            Self(RequestBuilder::new(stub))
11029        }
11030
11031        /// Sets the full request, replacing any prior values.
11032        pub fn with_request<V: Into<crate::model::BatchUpdateEntityTypesRequest>>(
11033            mut self,
11034            v: V,
11035        ) -> Self {
11036            self.0.request = v.into();
11037            self
11038        }
11039
11040        /// Sets all the options, replacing any prior values.
11041        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11042            self.0.options = v.into();
11043            self
11044        }
11045
11046        /// Sends the request.
11047        ///
11048        /// # Long running operations
11049        ///
11050        /// This starts, but does not poll, a longrunning operation. More information
11051        /// on [batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types].
11052        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11053            (*self.0.stub)
11054                .batch_update_entity_types(self.0.request, self.0.options)
11055                .await
11056                .map(crate::Response::into_body)
11057        }
11058
11059        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_entity_types`.
11060        pub fn poller(
11061            self,
11062        ) -> impl google_cloud_lro::Poller<crate::model::BatchUpdateEntityTypesResponse, wkt::Struct>
11063        {
11064            type Operation = google_cloud_lro::internal::Operation<
11065                crate::model::BatchUpdateEntityTypesResponse,
11066                wkt::Struct,
11067            >;
11068            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11069            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11070
11071            let stub = self.0.stub.clone();
11072            let mut options = self.0.options.clone();
11073            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11074            let query = move |name| {
11075                let stub = stub.clone();
11076                let options = options.clone();
11077                async {
11078                    let op = GetOperation::new(stub)
11079                        .set_name(name)
11080                        .with_options(options)
11081                        .send()
11082                        .await?;
11083                    Ok(Operation::new(op))
11084                }
11085            };
11086
11087            let start = move || async {
11088                let op = self.send().await?;
11089                Ok(Operation::new(op))
11090            };
11091
11092            google_cloud_lro::internal::new_poller(
11093                polling_error_policy,
11094                polling_backoff_policy,
11095                start,
11096                query,
11097            )
11098        }
11099
11100        /// Sets the value of [parent][crate::model::BatchUpdateEntityTypesRequest::parent].
11101        ///
11102        /// This is a **required** field for requests.
11103        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11104            self.0.request.parent = v.into();
11105            self
11106        }
11107
11108        /// Sets the value of [language_code][crate::model::BatchUpdateEntityTypesRequest::language_code].
11109        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11110            self.0.request.language_code = v.into();
11111            self
11112        }
11113
11114        /// Sets the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
11115        pub fn set_update_mask<T>(mut self, v: T) -> Self
11116        where
11117            T: std::convert::Into<wkt::FieldMask>,
11118        {
11119            self.0.request.update_mask = std::option::Option::Some(v.into());
11120            self
11121        }
11122
11123        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
11124        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11125        where
11126            T: std::convert::Into<wkt::FieldMask>,
11127        {
11128            self.0.request.update_mask = v.map(|x| x.into());
11129            self
11130        }
11131
11132        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch].
11133        ///
11134        /// Note that all the setters affecting `entity_type_batch` are
11135        /// mutually exclusive.
11136        pub fn set_entity_type_batch<
11137            T: Into<Option<crate::model::batch_update_entity_types_request::EntityTypeBatch>>,
11138        >(
11139            mut self,
11140            v: T,
11141        ) -> Self {
11142            self.0.request.entity_type_batch = v.into();
11143            self
11144        }
11145
11146        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
11147        /// to hold a `EntityTypeBatchUri`.
11148        ///
11149        /// Note that all the setters affecting `entity_type_batch` are
11150        /// mutually exclusive.
11151        pub fn set_entity_type_batch_uri<T: std::convert::Into<std::string::String>>(
11152            mut self,
11153            v: T,
11154        ) -> Self {
11155            self.0.request = self.0.request.set_entity_type_batch_uri(v);
11156            self
11157        }
11158
11159        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
11160        /// to hold a `EntityTypeBatchInline`.
11161        ///
11162        /// Note that all the setters affecting `entity_type_batch` are
11163        /// mutually exclusive.
11164        pub fn set_entity_type_batch_inline<
11165            T: std::convert::Into<std::boxed::Box<crate::model::EntityTypeBatch>>,
11166        >(
11167            mut self,
11168            v: T,
11169        ) -> Self {
11170            self.0.request = self.0.request.set_entity_type_batch_inline(v);
11171            self
11172        }
11173    }
11174
11175    #[doc(hidden)]
11176    impl crate::RequestBuilder for BatchUpdateEntityTypes {
11177        fn request_options(&mut self) -> &mut crate::RequestOptions {
11178            &mut self.0.options
11179        }
11180    }
11181
11182    /// The request builder for [EntityTypes::batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types] calls.
11183    ///
11184    /// # Example
11185    /// ```
11186    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchDeleteEntityTypes;
11187    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11188    /// use google_cloud_lro::Poller;
11189    ///
11190    /// let builder = prepare_request_builder();
11191    /// let response = builder.poller().until_done().await?;
11192    /// # Ok(()) }
11193    ///
11194    /// fn prepare_request_builder() -> BatchDeleteEntityTypes {
11195    ///   # panic!();
11196    ///   // ... details omitted ...
11197    /// }
11198    /// ```
11199    #[derive(Clone, Debug)]
11200    pub struct BatchDeleteEntityTypes(RequestBuilder<crate::model::BatchDeleteEntityTypesRequest>);
11201
11202    impl BatchDeleteEntityTypes {
11203        pub(crate) fn new(
11204            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11205        ) -> Self {
11206            Self(RequestBuilder::new(stub))
11207        }
11208
11209        /// Sets the full request, replacing any prior values.
11210        pub fn with_request<V: Into<crate::model::BatchDeleteEntityTypesRequest>>(
11211            mut self,
11212            v: V,
11213        ) -> Self {
11214            self.0.request = v.into();
11215            self
11216        }
11217
11218        /// Sets all the options, replacing any prior values.
11219        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11220            self.0.options = v.into();
11221            self
11222        }
11223
11224        /// Sends the request.
11225        ///
11226        /// # Long running operations
11227        ///
11228        /// This starts, but does not poll, a longrunning operation. More information
11229        /// on [batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types].
11230        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11231            (*self.0.stub)
11232                .batch_delete_entity_types(self.0.request, self.0.options)
11233                .await
11234                .map(crate::Response::into_body)
11235        }
11236
11237        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_entity_types`.
11238        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11239            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11240            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11241            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11242
11243            let stub = self.0.stub.clone();
11244            let mut options = self.0.options.clone();
11245            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11246            let query = move |name| {
11247                let stub = stub.clone();
11248                let options = options.clone();
11249                async {
11250                    let op = GetOperation::new(stub)
11251                        .set_name(name)
11252                        .with_options(options)
11253                        .send()
11254                        .await?;
11255                    Ok(Operation::new(op))
11256                }
11257            };
11258
11259            let start = move || async {
11260                let op = self.send().await?;
11261                Ok(Operation::new(op))
11262            };
11263
11264            google_cloud_lro::internal::new_unit_response_poller(
11265                polling_error_policy,
11266                polling_backoff_policy,
11267                start,
11268                query,
11269            )
11270        }
11271
11272        /// Sets the value of [parent][crate::model::BatchDeleteEntityTypesRequest::parent].
11273        ///
11274        /// This is a **required** field for requests.
11275        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11276            self.0.request.parent = v.into();
11277            self
11278        }
11279
11280        /// Sets the value of [entity_type_names][crate::model::BatchDeleteEntityTypesRequest::entity_type_names].
11281        ///
11282        /// This is a **required** field for requests.
11283        pub fn set_entity_type_names<T, V>(mut self, v: T) -> Self
11284        where
11285            T: std::iter::IntoIterator<Item = V>,
11286            V: std::convert::Into<std::string::String>,
11287        {
11288            use std::iter::Iterator;
11289            self.0.request.entity_type_names = v.into_iter().map(|i| i.into()).collect();
11290            self
11291        }
11292    }
11293
11294    #[doc(hidden)]
11295    impl crate::RequestBuilder for BatchDeleteEntityTypes {
11296        fn request_options(&mut self) -> &mut crate::RequestOptions {
11297            &mut self.0.options
11298        }
11299    }
11300
11301    /// The request builder for [EntityTypes::batch_create_entities][crate::client::EntityTypes::batch_create_entities] calls.
11302    ///
11303    /// # Example
11304    /// ```
11305    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchCreateEntities;
11306    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11307    /// use google_cloud_lro::Poller;
11308    ///
11309    /// let builder = prepare_request_builder();
11310    /// let response = builder.poller().until_done().await?;
11311    /// # Ok(()) }
11312    ///
11313    /// fn prepare_request_builder() -> BatchCreateEntities {
11314    ///   # panic!();
11315    ///   // ... details omitted ...
11316    /// }
11317    /// ```
11318    #[derive(Clone, Debug)]
11319    pub struct BatchCreateEntities(RequestBuilder<crate::model::BatchCreateEntitiesRequest>);
11320
11321    impl BatchCreateEntities {
11322        pub(crate) fn new(
11323            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11324        ) -> Self {
11325            Self(RequestBuilder::new(stub))
11326        }
11327
11328        /// Sets the full request, replacing any prior values.
11329        pub fn with_request<V: Into<crate::model::BatchCreateEntitiesRequest>>(
11330            mut self,
11331            v: V,
11332        ) -> Self {
11333            self.0.request = v.into();
11334            self
11335        }
11336
11337        /// Sets all the options, replacing any prior values.
11338        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11339            self.0.options = v.into();
11340            self
11341        }
11342
11343        /// Sends the request.
11344        ///
11345        /// # Long running operations
11346        ///
11347        /// This starts, but does not poll, a longrunning operation. More information
11348        /// on [batch_create_entities][crate::client::EntityTypes::batch_create_entities].
11349        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11350            (*self.0.stub)
11351                .batch_create_entities(self.0.request, self.0.options)
11352                .await
11353                .map(crate::Response::into_body)
11354        }
11355
11356        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_create_entities`.
11357        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11358            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11359            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11360            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11361
11362            let stub = self.0.stub.clone();
11363            let mut options = self.0.options.clone();
11364            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11365            let query = move |name| {
11366                let stub = stub.clone();
11367                let options = options.clone();
11368                async {
11369                    let op = GetOperation::new(stub)
11370                        .set_name(name)
11371                        .with_options(options)
11372                        .send()
11373                        .await?;
11374                    Ok(Operation::new(op))
11375                }
11376            };
11377
11378            let start = move || async {
11379                let op = self.send().await?;
11380                Ok(Operation::new(op))
11381            };
11382
11383            google_cloud_lro::internal::new_unit_response_poller(
11384                polling_error_policy,
11385                polling_backoff_policy,
11386                start,
11387                query,
11388            )
11389        }
11390
11391        /// Sets the value of [parent][crate::model::BatchCreateEntitiesRequest::parent].
11392        ///
11393        /// This is a **required** field for requests.
11394        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11395            self.0.request.parent = v.into();
11396            self
11397        }
11398
11399        /// Sets the value of [entities][crate::model::BatchCreateEntitiesRequest::entities].
11400        ///
11401        /// This is a **required** field for requests.
11402        pub fn set_entities<T, V>(mut self, v: T) -> Self
11403        where
11404            T: std::iter::IntoIterator<Item = V>,
11405            V: std::convert::Into<crate::model::entity_type::Entity>,
11406        {
11407            use std::iter::Iterator;
11408            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11409            self
11410        }
11411
11412        /// Sets the value of [language_code][crate::model::BatchCreateEntitiesRequest::language_code].
11413        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11414            self.0.request.language_code = v.into();
11415            self
11416        }
11417    }
11418
11419    #[doc(hidden)]
11420    impl crate::RequestBuilder for BatchCreateEntities {
11421        fn request_options(&mut self) -> &mut crate::RequestOptions {
11422            &mut self.0.options
11423        }
11424    }
11425
11426    /// The request builder for [EntityTypes::batch_update_entities][crate::client::EntityTypes::batch_update_entities] calls.
11427    ///
11428    /// # Example
11429    /// ```
11430    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchUpdateEntities;
11431    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11432    /// use google_cloud_lro::Poller;
11433    ///
11434    /// let builder = prepare_request_builder();
11435    /// let response = builder.poller().until_done().await?;
11436    /// # Ok(()) }
11437    ///
11438    /// fn prepare_request_builder() -> BatchUpdateEntities {
11439    ///   # panic!();
11440    ///   // ... details omitted ...
11441    /// }
11442    /// ```
11443    #[derive(Clone, Debug)]
11444    pub struct BatchUpdateEntities(RequestBuilder<crate::model::BatchUpdateEntitiesRequest>);
11445
11446    impl BatchUpdateEntities {
11447        pub(crate) fn new(
11448            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11449        ) -> Self {
11450            Self(RequestBuilder::new(stub))
11451        }
11452
11453        /// Sets the full request, replacing any prior values.
11454        pub fn with_request<V: Into<crate::model::BatchUpdateEntitiesRequest>>(
11455            mut self,
11456            v: V,
11457        ) -> Self {
11458            self.0.request = v.into();
11459            self
11460        }
11461
11462        /// Sets all the options, replacing any prior values.
11463        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11464            self.0.options = v.into();
11465            self
11466        }
11467
11468        /// Sends the request.
11469        ///
11470        /// # Long running operations
11471        ///
11472        /// This starts, but does not poll, a longrunning operation. More information
11473        /// on [batch_update_entities][crate::client::EntityTypes::batch_update_entities].
11474        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11475            (*self.0.stub)
11476                .batch_update_entities(self.0.request, self.0.options)
11477                .await
11478                .map(crate::Response::into_body)
11479        }
11480
11481        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_entities`.
11482        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11483            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11484            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11485            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11486
11487            let stub = self.0.stub.clone();
11488            let mut options = self.0.options.clone();
11489            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11490            let query = move |name| {
11491                let stub = stub.clone();
11492                let options = options.clone();
11493                async {
11494                    let op = GetOperation::new(stub)
11495                        .set_name(name)
11496                        .with_options(options)
11497                        .send()
11498                        .await?;
11499                    Ok(Operation::new(op))
11500                }
11501            };
11502
11503            let start = move || async {
11504                let op = self.send().await?;
11505                Ok(Operation::new(op))
11506            };
11507
11508            google_cloud_lro::internal::new_unit_response_poller(
11509                polling_error_policy,
11510                polling_backoff_policy,
11511                start,
11512                query,
11513            )
11514        }
11515
11516        /// Sets the value of [parent][crate::model::BatchUpdateEntitiesRequest::parent].
11517        ///
11518        /// This is a **required** field for requests.
11519        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11520            self.0.request.parent = v.into();
11521            self
11522        }
11523
11524        /// Sets the value of [entities][crate::model::BatchUpdateEntitiesRequest::entities].
11525        ///
11526        /// This is a **required** field for requests.
11527        pub fn set_entities<T, V>(mut self, v: T) -> Self
11528        where
11529            T: std::iter::IntoIterator<Item = V>,
11530            V: std::convert::Into<crate::model::entity_type::Entity>,
11531        {
11532            use std::iter::Iterator;
11533            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11534            self
11535        }
11536
11537        /// Sets the value of [language_code][crate::model::BatchUpdateEntitiesRequest::language_code].
11538        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11539            self.0.request.language_code = v.into();
11540            self
11541        }
11542
11543        /// Sets the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11544        pub fn set_update_mask<T>(mut self, v: T) -> Self
11545        where
11546            T: std::convert::Into<wkt::FieldMask>,
11547        {
11548            self.0.request.update_mask = std::option::Option::Some(v.into());
11549            self
11550        }
11551
11552        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11553        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11554        where
11555            T: std::convert::Into<wkt::FieldMask>,
11556        {
11557            self.0.request.update_mask = v.map(|x| x.into());
11558            self
11559        }
11560    }
11561
11562    #[doc(hidden)]
11563    impl crate::RequestBuilder for BatchUpdateEntities {
11564        fn request_options(&mut self) -> &mut crate::RequestOptions {
11565            &mut self.0.options
11566        }
11567    }
11568
11569    /// The request builder for [EntityTypes::batch_delete_entities][crate::client::EntityTypes::batch_delete_entities] calls.
11570    ///
11571    /// # Example
11572    /// ```
11573    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchDeleteEntities;
11574    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11575    /// use google_cloud_lro::Poller;
11576    ///
11577    /// let builder = prepare_request_builder();
11578    /// let response = builder.poller().until_done().await?;
11579    /// # Ok(()) }
11580    ///
11581    /// fn prepare_request_builder() -> BatchDeleteEntities {
11582    ///   # panic!();
11583    ///   // ... details omitted ...
11584    /// }
11585    /// ```
11586    #[derive(Clone, Debug)]
11587    pub struct BatchDeleteEntities(RequestBuilder<crate::model::BatchDeleteEntitiesRequest>);
11588
11589    impl BatchDeleteEntities {
11590        pub(crate) fn new(
11591            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11592        ) -> Self {
11593            Self(RequestBuilder::new(stub))
11594        }
11595
11596        /// Sets the full request, replacing any prior values.
11597        pub fn with_request<V: Into<crate::model::BatchDeleteEntitiesRequest>>(
11598            mut self,
11599            v: V,
11600        ) -> Self {
11601            self.0.request = v.into();
11602            self
11603        }
11604
11605        /// Sets all the options, replacing any prior values.
11606        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11607            self.0.options = v.into();
11608            self
11609        }
11610
11611        /// Sends the request.
11612        ///
11613        /// # Long running operations
11614        ///
11615        /// This starts, but does not poll, a longrunning operation. More information
11616        /// on [batch_delete_entities][crate::client::EntityTypes::batch_delete_entities].
11617        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11618            (*self.0.stub)
11619                .batch_delete_entities(self.0.request, self.0.options)
11620                .await
11621                .map(crate::Response::into_body)
11622        }
11623
11624        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_entities`.
11625        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11626            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11627            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11628            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11629
11630            let stub = self.0.stub.clone();
11631            let mut options = self.0.options.clone();
11632            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11633            let query = move |name| {
11634                let stub = stub.clone();
11635                let options = options.clone();
11636                async {
11637                    let op = GetOperation::new(stub)
11638                        .set_name(name)
11639                        .with_options(options)
11640                        .send()
11641                        .await?;
11642                    Ok(Operation::new(op))
11643                }
11644            };
11645
11646            let start = move || async {
11647                let op = self.send().await?;
11648                Ok(Operation::new(op))
11649            };
11650
11651            google_cloud_lro::internal::new_unit_response_poller(
11652                polling_error_policy,
11653                polling_backoff_policy,
11654                start,
11655                query,
11656            )
11657        }
11658
11659        /// Sets the value of [parent][crate::model::BatchDeleteEntitiesRequest::parent].
11660        ///
11661        /// This is a **required** field for requests.
11662        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11663            self.0.request.parent = v.into();
11664            self
11665        }
11666
11667        /// Sets the value of [entity_values][crate::model::BatchDeleteEntitiesRequest::entity_values].
11668        ///
11669        /// This is a **required** field for requests.
11670        pub fn set_entity_values<T, V>(mut self, v: T) -> Self
11671        where
11672            T: std::iter::IntoIterator<Item = V>,
11673            V: std::convert::Into<std::string::String>,
11674        {
11675            use std::iter::Iterator;
11676            self.0.request.entity_values = v.into_iter().map(|i| i.into()).collect();
11677            self
11678        }
11679
11680        /// Sets the value of [language_code][crate::model::BatchDeleteEntitiesRequest::language_code].
11681        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11682            self.0.request.language_code = v.into();
11683            self
11684        }
11685    }
11686
11687    #[doc(hidden)]
11688    impl crate::RequestBuilder for BatchDeleteEntities {
11689        fn request_options(&mut self) -> &mut crate::RequestOptions {
11690            &mut self.0.options
11691        }
11692    }
11693
11694    /// The request builder for [EntityTypes::list_locations][crate::client::EntityTypes::list_locations] calls.
11695    ///
11696    /// # Example
11697    /// ```
11698    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListLocations;
11699    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11700    /// use google_cloud_gax::paginator::ItemPaginator;
11701    ///
11702    /// let builder = prepare_request_builder();
11703    /// let mut items = builder.by_item();
11704    /// while let Some(result) = items.next().await {
11705    ///   let item = result?;
11706    /// }
11707    /// # Ok(()) }
11708    ///
11709    /// fn prepare_request_builder() -> ListLocations {
11710    ///   # panic!();
11711    ///   // ... details omitted ...
11712    /// }
11713    /// ```
11714    #[derive(Clone, Debug)]
11715    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
11716
11717    impl ListLocations {
11718        pub(crate) fn new(
11719            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11720        ) -> Self {
11721            Self(RequestBuilder::new(stub))
11722        }
11723
11724        /// Sets the full request, replacing any prior values.
11725        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
11726            mut self,
11727            v: V,
11728        ) -> Self {
11729            self.0.request = v.into();
11730            self
11731        }
11732
11733        /// Sets all the options, replacing any prior values.
11734        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11735            self.0.options = v.into();
11736            self
11737        }
11738
11739        /// Sends the request.
11740        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
11741            (*self.0.stub)
11742                .list_locations(self.0.request, self.0.options)
11743                .await
11744                .map(crate::Response::into_body)
11745        }
11746
11747        /// Streams each page in the collection.
11748        pub fn by_page(
11749            self,
11750        ) -> impl google_cloud_gax::paginator::Paginator<
11751            google_cloud_location::model::ListLocationsResponse,
11752            crate::Error,
11753        > {
11754            use std::clone::Clone;
11755            let token = self.0.request.page_token.clone();
11756            let execute = move |token: String| {
11757                let mut builder = self.clone();
11758                builder.0.request = builder.0.request.set_page_token(token);
11759                builder.send()
11760            };
11761            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11762        }
11763
11764        /// Streams each item in the collection.
11765        pub fn by_item(
11766            self,
11767        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11768            google_cloud_location::model::ListLocationsResponse,
11769            crate::Error,
11770        > {
11771            use google_cloud_gax::paginator::Paginator;
11772            self.by_page().items()
11773        }
11774
11775        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
11776        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11777            self.0.request.name = v.into();
11778            self
11779        }
11780
11781        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
11782        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11783            self.0.request.filter = v.into();
11784            self
11785        }
11786
11787        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
11788        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11789            self.0.request.page_size = v.into();
11790            self
11791        }
11792
11793        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
11794        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11795            self.0.request.page_token = v.into();
11796            self
11797        }
11798    }
11799
11800    #[doc(hidden)]
11801    impl crate::RequestBuilder for ListLocations {
11802        fn request_options(&mut self) -> &mut crate::RequestOptions {
11803            &mut self.0.options
11804        }
11805    }
11806
11807    /// The request builder for [EntityTypes::get_location][crate::client::EntityTypes::get_location] calls.
11808    ///
11809    /// # Example
11810    /// ```
11811    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetLocation;
11812    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11813    ///
11814    /// let builder = prepare_request_builder();
11815    /// let response = builder.send().await?;
11816    /// # Ok(()) }
11817    ///
11818    /// fn prepare_request_builder() -> GetLocation {
11819    ///   # panic!();
11820    ///   // ... details omitted ...
11821    /// }
11822    /// ```
11823    #[derive(Clone, Debug)]
11824    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
11825
11826    impl GetLocation {
11827        pub(crate) fn new(
11828            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11829        ) -> Self {
11830            Self(RequestBuilder::new(stub))
11831        }
11832
11833        /// Sets the full request, replacing any prior values.
11834        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
11835            mut self,
11836            v: V,
11837        ) -> Self {
11838            self.0.request = v.into();
11839            self
11840        }
11841
11842        /// Sets all the options, replacing any prior values.
11843        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11844            self.0.options = v.into();
11845            self
11846        }
11847
11848        /// Sends the request.
11849        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
11850            (*self.0.stub)
11851                .get_location(self.0.request, self.0.options)
11852                .await
11853                .map(crate::Response::into_body)
11854        }
11855
11856        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
11857        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11858            self.0.request.name = v.into();
11859            self
11860        }
11861    }
11862
11863    #[doc(hidden)]
11864    impl crate::RequestBuilder for GetLocation {
11865        fn request_options(&mut self) -> &mut crate::RequestOptions {
11866            &mut self.0.options
11867        }
11868    }
11869
11870    /// The request builder for [EntityTypes::list_operations][crate::client::EntityTypes::list_operations] calls.
11871    ///
11872    /// # Example
11873    /// ```
11874    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListOperations;
11875    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11876    /// use google_cloud_gax::paginator::ItemPaginator;
11877    ///
11878    /// let builder = prepare_request_builder();
11879    /// let mut items = builder.by_item();
11880    /// while let Some(result) = items.next().await {
11881    ///   let item = result?;
11882    /// }
11883    /// # Ok(()) }
11884    ///
11885    /// fn prepare_request_builder() -> ListOperations {
11886    ///   # panic!();
11887    ///   // ... details omitted ...
11888    /// }
11889    /// ```
11890    #[derive(Clone, Debug)]
11891    pub struct ListOperations(
11892        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11893    );
11894
11895    impl ListOperations {
11896        pub(crate) fn new(
11897            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11898        ) -> Self {
11899            Self(RequestBuilder::new(stub))
11900        }
11901
11902        /// Sets the full request, replacing any prior values.
11903        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11904            mut self,
11905            v: V,
11906        ) -> Self {
11907            self.0.request = v.into();
11908            self
11909        }
11910
11911        /// Sets all the options, replacing any prior values.
11912        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11913            self.0.options = v.into();
11914            self
11915        }
11916
11917        /// Sends the request.
11918        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11919            (*self.0.stub)
11920                .list_operations(self.0.request, self.0.options)
11921                .await
11922                .map(crate::Response::into_body)
11923        }
11924
11925        /// Streams each page in the collection.
11926        pub fn by_page(
11927            self,
11928        ) -> impl google_cloud_gax::paginator::Paginator<
11929            google_cloud_longrunning::model::ListOperationsResponse,
11930            crate::Error,
11931        > {
11932            use std::clone::Clone;
11933            let token = self.0.request.page_token.clone();
11934            let execute = move |token: String| {
11935                let mut builder = self.clone();
11936                builder.0.request = builder.0.request.set_page_token(token);
11937                builder.send()
11938            };
11939            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11940        }
11941
11942        /// Streams each item in the collection.
11943        pub fn by_item(
11944            self,
11945        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11946            google_cloud_longrunning::model::ListOperationsResponse,
11947            crate::Error,
11948        > {
11949            use google_cloud_gax::paginator::Paginator;
11950            self.by_page().items()
11951        }
11952
11953        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
11954        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11955            self.0.request.name = v.into();
11956            self
11957        }
11958
11959        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
11960        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11961            self.0.request.filter = v.into();
11962            self
11963        }
11964
11965        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
11966        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11967            self.0.request.page_size = v.into();
11968            self
11969        }
11970
11971        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
11972        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11973            self.0.request.page_token = v.into();
11974            self
11975        }
11976
11977        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
11978        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11979            self.0.request.return_partial_success = v.into();
11980            self
11981        }
11982    }
11983
11984    #[doc(hidden)]
11985    impl crate::RequestBuilder for ListOperations {
11986        fn request_options(&mut self) -> &mut crate::RequestOptions {
11987            &mut self.0.options
11988        }
11989    }
11990
11991    /// The request builder for [EntityTypes::get_operation][crate::client::EntityTypes::get_operation] calls.
11992    ///
11993    /// # Example
11994    /// ```
11995    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetOperation;
11996    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
11997    ///
11998    /// let builder = prepare_request_builder();
11999    /// let response = builder.send().await?;
12000    /// # Ok(()) }
12001    ///
12002    /// fn prepare_request_builder() -> GetOperation {
12003    ///   # panic!();
12004    ///   // ... details omitted ...
12005    /// }
12006    /// ```
12007    #[derive(Clone, Debug)]
12008    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
12009
12010    impl GetOperation {
12011        pub(crate) fn new(
12012            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12013        ) -> Self {
12014            Self(RequestBuilder::new(stub))
12015        }
12016
12017        /// Sets the full request, replacing any prior values.
12018        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
12019            mut self,
12020            v: V,
12021        ) -> Self {
12022            self.0.request = v.into();
12023            self
12024        }
12025
12026        /// Sets all the options, replacing any prior values.
12027        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12028            self.0.options = v.into();
12029            self
12030        }
12031
12032        /// Sends the request.
12033        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12034            (*self.0.stub)
12035                .get_operation(self.0.request, self.0.options)
12036                .await
12037                .map(crate::Response::into_body)
12038        }
12039
12040        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
12041        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12042            self.0.request.name = v.into();
12043            self
12044        }
12045    }
12046
12047    #[doc(hidden)]
12048    impl crate::RequestBuilder for GetOperation {
12049        fn request_options(&mut self) -> &mut crate::RequestOptions {
12050            &mut self.0.options
12051        }
12052    }
12053
12054    /// The request builder for [EntityTypes::cancel_operation][crate::client::EntityTypes::cancel_operation] calls.
12055    ///
12056    /// # Example
12057    /// ```
12058    /// # use google_cloud_dialogflow_v2::builder::entity_types::CancelOperation;
12059    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12060    ///
12061    /// let builder = prepare_request_builder();
12062    /// let response = builder.send().await?;
12063    /// # Ok(()) }
12064    ///
12065    /// fn prepare_request_builder() -> CancelOperation {
12066    ///   # panic!();
12067    ///   // ... details omitted ...
12068    /// }
12069    /// ```
12070    #[derive(Clone, Debug)]
12071    pub struct CancelOperation(
12072        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
12073    );
12074
12075    impl CancelOperation {
12076        pub(crate) fn new(
12077            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12078        ) -> Self {
12079            Self(RequestBuilder::new(stub))
12080        }
12081
12082        /// Sets the full request, replacing any prior values.
12083        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
12084            mut self,
12085            v: V,
12086        ) -> Self {
12087            self.0.request = v.into();
12088            self
12089        }
12090
12091        /// Sets all the options, replacing any prior values.
12092        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12093            self.0.options = v.into();
12094            self
12095        }
12096
12097        /// Sends the request.
12098        pub async fn send(self) -> Result<()> {
12099            (*self.0.stub)
12100                .cancel_operation(self.0.request, self.0.options)
12101                .await
12102                .map(crate::Response::into_body)
12103        }
12104
12105        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
12106        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12107            self.0.request.name = v.into();
12108            self
12109        }
12110    }
12111
12112    #[doc(hidden)]
12113    impl crate::RequestBuilder for CancelOperation {
12114        fn request_options(&mut self) -> &mut crate::RequestOptions {
12115            &mut self.0.options
12116        }
12117    }
12118}
12119
12120#[cfg(feature = "environments")]
12121#[cfg_attr(docsrs, doc(cfg(feature = "environments")))]
12122pub mod environments {
12123    use crate::Result;
12124
12125    /// A builder for [Environments][crate::client::Environments].
12126    ///
12127    /// ```
12128    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12129    /// # use google_cloud_dialogflow_v2::*;
12130    /// # use builder::environments::ClientBuilder;
12131    /// # use client::Environments;
12132    /// let builder : ClientBuilder = Environments::builder();
12133    /// let client = builder
12134    ///     .with_endpoint("https://dialogflow.googleapis.com")
12135    ///     .build().await?;
12136    /// # Ok(()) }
12137    /// ```
12138    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12139
12140    pub(crate) mod client {
12141        use super::super::super::client::Environments;
12142        pub struct Factory;
12143        impl crate::ClientFactory for Factory {
12144            type Client = Environments;
12145            type Credentials = gaxi::options::Credentials;
12146            async fn build(
12147                self,
12148                config: gaxi::options::ClientConfig,
12149            ) -> crate::ClientBuilderResult<Self::Client> {
12150                Self::Client::new(config).await
12151            }
12152        }
12153    }
12154
12155    /// Common implementation for [crate::client::Environments] request builders.
12156    #[derive(Clone, Debug)]
12157    pub(crate) struct RequestBuilder<R: std::default::Default> {
12158        stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12159        request: R,
12160        options: crate::RequestOptions,
12161    }
12162
12163    impl<R> RequestBuilder<R>
12164    where
12165        R: std::default::Default,
12166    {
12167        pub(crate) fn new(
12168            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12169        ) -> Self {
12170            Self {
12171                stub,
12172                request: R::default(),
12173                options: crate::RequestOptions::default(),
12174            }
12175        }
12176    }
12177
12178    /// The request builder for [Environments::list_environments][crate::client::Environments::list_environments] calls.
12179    ///
12180    /// # Example
12181    /// ```
12182    /// # use google_cloud_dialogflow_v2::builder::environments::ListEnvironments;
12183    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12184    /// use google_cloud_gax::paginator::ItemPaginator;
12185    ///
12186    /// let builder = prepare_request_builder();
12187    /// let mut items = builder.by_item();
12188    /// while let Some(result) = items.next().await {
12189    ///   let item = result?;
12190    /// }
12191    /// # Ok(()) }
12192    ///
12193    /// fn prepare_request_builder() -> ListEnvironments {
12194    ///   # panic!();
12195    ///   // ... details omitted ...
12196    /// }
12197    /// ```
12198    #[derive(Clone, Debug)]
12199    pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
12200
12201    impl ListEnvironments {
12202        pub(crate) fn new(
12203            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12204        ) -> Self {
12205            Self(RequestBuilder::new(stub))
12206        }
12207
12208        /// Sets the full request, replacing any prior values.
12209        pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
12210            mut self,
12211            v: V,
12212        ) -> Self {
12213            self.0.request = v.into();
12214            self
12215        }
12216
12217        /// Sets all the options, replacing any prior values.
12218        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12219            self.0.options = v.into();
12220            self
12221        }
12222
12223        /// Sends the request.
12224        pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
12225            (*self.0.stub)
12226                .list_environments(self.0.request, self.0.options)
12227                .await
12228                .map(crate::Response::into_body)
12229        }
12230
12231        /// Streams each page in the collection.
12232        pub fn by_page(
12233            self,
12234        ) -> impl google_cloud_gax::paginator::Paginator<
12235            crate::model::ListEnvironmentsResponse,
12236            crate::Error,
12237        > {
12238            use std::clone::Clone;
12239            let token = self.0.request.page_token.clone();
12240            let execute = move |token: String| {
12241                let mut builder = self.clone();
12242                builder.0.request = builder.0.request.set_page_token(token);
12243                builder.send()
12244            };
12245            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12246        }
12247
12248        /// Streams each item in the collection.
12249        pub fn by_item(
12250            self,
12251        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12252            crate::model::ListEnvironmentsResponse,
12253            crate::Error,
12254        > {
12255            use google_cloud_gax::paginator::Paginator;
12256            self.by_page().items()
12257        }
12258
12259        /// Sets the value of [parent][crate::model::ListEnvironmentsRequest::parent].
12260        ///
12261        /// This is a **required** field for requests.
12262        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12263            self.0.request.parent = v.into();
12264            self
12265        }
12266
12267        /// Sets the value of [page_size][crate::model::ListEnvironmentsRequest::page_size].
12268        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12269            self.0.request.page_size = v.into();
12270            self
12271        }
12272
12273        /// Sets the value of [page_token][crate::model::ListEnvironmentsRequest::page_token].
12274        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12275            self.0.request.page_token = v.into();
12276            self
12277        }
12278    }
12279
12280    #[doc(hidden)]
12281    impl crate::RequestBuilder for ListEnvironments {
12282        fn request_options(&mut self) -> &mut crate::RequestOptions {
12283            &mut self.0.options
12284        }
12285    }
12286
12287    /// The request builder for [Environments::get_environment][crate::client::Environments::get_environment] calls.
12288    ///
12289    /// # Example
12290    /// ```
12291    /// # use google_cloud_dialogflow_v2::builder::environments::GetEnvironment;
12292    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12293    ///
12294    /// let builder = prepare_request_builder();
12295    /// let response = builder.send().await?;
12296    /// # Ok(()) }
12297    ///
12298    /// fn prepare_request_builder() -> GetEnvironment {
12299    ///   # panic!();
12300    ///   // ... details omitted ...
12301    /// }
12302    /// ```
12303    #[derive(Clone, Debug)]
12304    pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
12305
12306    impl GetEnvironment {
12307        pub(crate) fn new(
12308            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12309        ) -> Self {
12310            Self(RequestBuilder::new(stub))
12311        }
12312
12313        /// Sets the full request, replacing any prior values.
12314        pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
12315            self.0.request = v.into();
12316            self
12317        }
12318
12319        /// Sets all the options, replacing any prior values.
12320        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12321            self.0.options = v.into();
12322            self
12323        }
12324
12325        /// Sends the request.
12326        pub async fn send(self) -> Result<crate::model::Environment> {
12327            (*self.0.stub)
12328                .get_environment(self.0.request, self.0.options)
12329                .await
12330                .map(crate::Response::into_body)
12331        }
12332
12333        /// Sets the value of [name][crate::model::GetEnvironmentRequest::name].
12334        ///
12335        /// This is a **required** field for requests.
12336        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12337            self.0.request.name = v.into();
12338            self
12339        }
12340    }
12341
12342    #[doc(hidden)]
12343    impl crate::RequestBuilder for GetEnvironment {
12344        fn request_options(&mut self) -> &mut crate::RequestOptions {
12345            &mut self.0.options
12346        }
12347    }
12348
12349    /// The request builder for [Environments::create_environment][crate::client::Environments::create_environment] calls.
12350    ///
12351    /// # Example
12352    /// ```
12353    /// # use google_cloud_dialogflow_v2::builder::environments::CreateEnvironment;
12354    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12355    ///
12356    /// let builder = prepare_request_builder();
12357    /// let response = builder.send().await?;
12358    /// # Ok(()) }
12359    ///
12360    /// fn prepare_request_builder() -> CreateEnvironment {
12361    ///   # panic!();
12362    ///   // ... details omitted ...
12363    /// }
12364    /// ```
12365    #[derive(Clone, Debug)]
12366    pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
12367
12368    impl CreateEnvironment {
12369        pub(crate) fn new(
12370            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12371        ) -> Self {
12372            Self(RequestBuilder::new(stub))
12373        }
12374
12375        /// Sets the full request, replacing any prior values.
12376        pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
12377            mut self,
12378            v: V,
12379        ) -> Self {
12380            self.0.request = v.into();
12381            self
12382        }
12383
12384        /// Sets all the options, replacing any prior values.
12385        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12386            self.0.options = v.into();
12387            self
12388        }
12389
12390        /// Sends the request.
12391        pub async fn send(self) -> Result<crate::model::Environment> {
12392            (*self.0.stub)
12393                .create_environment(self.0.request, self.0.options)
12394                .await
12395                .map(crate::Response::into_body)
12396        }
12397
12398        /// Sets the value of [parent][crate::model::CreateEnvironmentRequest::parent].
12399        ///
12400        /// This is a **required** field for requests.
12401        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12402            self.0.request.parent = v.into();
12403            self
12404        }
12405
12406        /// Sets the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12407        ///
12408        /// This is a **required** field for requests.
12409        pub fn set_environment<T>(mut self, v: T) -> Self
12410        where
12411            T: std::convert::Into<crate::model::Environment>,
12412        {
12413            self.0.request.environment = std::option::Option::Some(v.into());
12414            self
12415        }
12416
12417        /// Sets or clears the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12418        ///
12419        /// This is a **required** field for requests.
12420        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12421        where
12422            T: std::convert::Into<crate::model::Environment>,
12423        {
12424            self.0.request.environment = v.map(|x| x.into());
12425            self
12426        }
12427
12428        /// Sets the value of [environment_id][crate::model::CreateEnvironmentRequest::environment_id].
12429        ///
12430        /// This is a **required** field for requests.
12431        pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12432            self.0.request.environment_id = v.into();
12433            self
12434        }
12435    }
12436
12437    #[doc(hidden)]
12438    impl crate::RequestBuilder for CreateEnvironment {
12439        fn request_options(&mut self) -> &mut crate::RequestOptions {
12440            &mut self.0.options
12441        }
12442    }
12443
12444    /// The request builder for [Environments::update_environment][crate::client::Environments::update_environment] calls.
12445    ///
12446    /// # Example
12447    /// ```
12448    /// # use google_cloud_dialogflow_v2::builder::environments::UpdateEnvironment;
12449    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12450    ///
12451    /// let builder = prepare_request_builder();
12452    /// let response = builder.send().await?;
12453    /// # Ok(()) }
12454    ///
12455    /// fn prepare_request_builder() -> UpdateEnvironment {
12456    ///   # panic!();
12457    ///   // ... details omitted ...
12458    /// }
12459    /// ```
12460    #[derive(Clone, Debug)]
12461    pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
12462
12463    impl UpdateEnvironment {
12464        pub(crate) fn new(
12465            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12466        ) -> Self {
12467            Self(RequestBuilder::new(stub))
12468        }
12469
12470        /// Sets the full request, replacing any prior values.
12471        pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
12472            mut self,
12473            v: V,
12474        ) -> Self {
12475            self.0.request = v.into();
12476            self
12477        }
12478
12479        /// Sets all the options, replacing any prior values.
12480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12481            self.0.options = v.into();
12482            self
12483        }
12484
12485        /// Sends the request.
12486        pub async fn send(self) -> Result<crate::model::Environment> {
12487            (*self.0.stub)
12488                .update_environment(self.0.request, self.0.options)
12489                .await
12490                .map(crate::Response::into_body)
12491        }
12492
12493        /// Sets the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12494        ///
12495        /// This is a **required** field for requests.
12496        pub fn set_environment<T>(mut self, v: T) -> Self
12497        where
12498            T: std::convert::Into<crate::model::Environment>,
12499        {
12500            self.0.request.environment = std::option::Option::Some(v.into());
12501            self
12502        }
12503
12504        /// Sets or clears the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12505        ///
12506        /// This is a **required** field for requests.
12507        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12508        where
12509            T: std::convert::Into<crate::model::Environment>,
12510        {
12511            self.0.request.environment = v.map(|x| x.into());
12512            self
12513        }
12514
12515        /// Sets the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12516        ///
12517        /// This is a **required** field for requests.
12518        pub fn set_update_mask<T>(mut self, v: T) -> Self
12519        where
12520            T: std::convert::Into<wkt::FieldMask>,
12521        {
12522            self.0.request.update_mask = std::option::Option::Some(v.into());
12523            self
12524        }
12525
12526        /// Sets or clears the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12527        ///
12528        /// This is a **required** field for requests.
12529        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12530        where
12531            T: std::convert::Into<wkt::FieldMask>,
12532        {
12533            self.0.request.update_mask = v.map(|x| x.into());
12534            self
12535        }
12536
12537        /// Sets the value of [allow_load_to_draft_and_discard_changes][crate::model::UpdateEnvironmentRequest::allow_load_to_draft_and_discard_changes].
12538        pub fn set_allow_load_to_draft_and_discard_changes<T: Into<bool>>(mut self, v: T) -> Self {
12539            self.0.request.allow_load_to_draft_and_discard_changes = v.into();
12540            self
12541        }
12542    }
12543
12544    #[doc(hidden)]
12545    impl crate::RequestBuilder for UpdateEnvironment {
12546        fn request_options(&mut self) -> &mut crate::RequestOptions {
12547            &mut self.0.options
12548        }
12549    }
12550
12551    /// The request builder for [Environments::delete_environment][crate::client::Environments::delete_environment] calls.
12552    ///
12553    /// # Example
12554    /// ```
12555    /// # use google_cloud_dialogflow_v2::builder::environments::DeleteEnvironment;
12556    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12557    ///
12558    /// let builder = prepare_request_builder();
12559    /// let response = builder.send().await?;
12560    /// # Ok(()) }
12561    ///
12562    /// fn prepare_request_builder() -> DeleteEnvironment {
12563    ///   # panic!();
12564    ///   // ... details omitted ...
12565    /// }
12566    /// ```
12567    #[derive(Clone, Debug)]
12568    pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
12569
12570    impl DeleteEnvironment {
12571        pub(crate) fn new(
12572            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12573        ) -> Self {
12574            Self(RequestBuilder::new(stub))
12575        }
12576
12577        /// Sets the full request, replacing any prior values.
12578        pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
12579            mut self,
12580            v: V,
12581        ) -> Self {
12582            self.0.request = v.into();
12583            self
12584        }
12585
12586        /// Sets all the options, replacing any prior values.
12587        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12588            self.0.options = v.into();
12589            self
12590        }
12591
12592        /// Sends the request.
12593        pub async fn send(self) -> Result<()> {
12594            (*self.0.stub)
12595                .delete_environment(self.0.request, self.0.options)
12596                .await
12597                .map(crate::Response::into_body)
12598        }
12599
12600        /// Sets the value of [name][crate::model::DeleteEnvironmentRequest::name].
12601        ///
12602        /// This is a **required** field for requests.
12603        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12604            self.0.request.name = v.into();
12605            self
12606        }
12607    }
12608
12609    #[doc(hidden)]
12610    impl crate::RequestBuilder for DeleteEnvironment {
12611        fn request_options(&mut self) -> &mut crate::RequestOptions {
12612            &mut self.0.options
12613        }
12614    }
12615
12616    /// The request builder for [Environments::get_environment_history][crate::client::Environments::get_environment_history] calls.
12617    ///
12618    /// # Example
12619    /// ```
12620    /// # use google_cloud_dialogflow_v2::builder::environments::GetEnvironmentHistory;
12621    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12622    /// use google_cloud_gax::paginator::ItemPaginator;
12623    ///
12624    /// let builder = prepare_request_builder();
12625    /// let mut items = builder.by_item();
12626    /// while let Some(result) = items.next().await {
12627    ///   let item = result?;
12628    /// }
12629    /// # Ok(()) }
12630    ///
12631    /// fn prepare_request_builder() -> GetEnvironmentHistory {
12632    ///   # panic!();
12633    ///   // ... details omitted ...
12634    /// }
12635    /// ```
12636    #[derive(Clone, Debug)]
12637    pub struct GetEnvironmentHistory(RequestBuilder<crate::model::GetEnvironmentHistoryRequest>);
12638
12639    impl GetEnvironmentHistory {
12640        pub(crate) fn new(
12641            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12642        ) -> Self {
12643            Self(RequestBuilder::new(stub))
12644        }
12645
12646        /// Sets the full request, replacing any prior values.
12647        pub fn with_request<V: Into<crate::model::GetEnvironmentHistoryRequest>>(
12648            mut self,
12649            v: V,
12650        ) -> Self {
12651            self.0.request = v.into();
12652            self
12653        }
12654
12655        /// Sets all the options, replacing any prior values.
12656        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12657            self.0.options = v.into();
12658            self
12659        }
12660
12661        /// Sends the request.
12662        pub async fn send(self) -> Result<crate::model::EnvironmentHistory> {
12663            (*self.0.stub)
12664                .get_environment_history(self.0.request, self.0.options)
12665                .await
12666                .map(crate::Response::into_body)
12667        }
12668
12669        /// Streams each page in the collection.
12670        pub fn by_page(
12671            self,
12672        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::EnvironmentHistory, crate::Error>
12673        {
12674            use std::clone::Clone;
12675            let token = self.0.request.page_token.clone();
12676            let execute = move |token: String| {
12677                let mut builder = self.clone();
12678                builder.0.request = builder.0.request.set_page_token(token);
12679                builder.send()
12680            };
12681            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12682        }
12683
12684        /// Streams each item in the collection.
12685        pub fn by_item(
12686            self,
12687        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12688            crate::model::EnvironmentHistory,
12689            crate::Error,
12690        > {
12691            use google_cloud_gax::paginator::Paginator;
12692            self.by_page().items()
12693        }
12694
12695        /// Sets the value of [parent][crate::model::GetEnvironmentHistoryRequest::parent].
12696        ///
12697        /// This is a **required** field for requests.
12698        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12699            self.0.request.parent = v.into();
12700            self
12701        }
12702
12703        /// Sets the value of [page_size][crate::model::GetEnvironmentHistoryRequest::page_size].
12704        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12705            self.0.request.page_size = v.into();
12706            self
12707        }
12708
12709        /// Sets the value of [page_token][crate::model::GetEnvironmentHistoryRequest::page_token].
12710        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12711            self.0.request.page_token = v.into();
12712            self
12713        }
12714    }
12715
12716    #[doc(hidden)]
12717    impl crate::RequestBuilder for GetEnvironmentHistory {
12718        fn request_options(&mut self) -> &mut crate::RequestOptions {
12719            &mut self.0.options
12720        }
12721    }
12722
12723    /// The request builder for [Environments::list_locations][crate::client::Environments::list_locations] calls.
12724    ///
12725    /// # Example
12726    /// ```
12727    /// # use google_cloud_dialogflow_v2::builder::environments::ListLocations;
12728    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12729    /// use google_cloud_gax::paginator::ItemPaginator;
12730    ///
12731    /// let builder = prepare_request_builder();
12732    /// let mut items = builder.by_item();
12733    /// while let Some(result) = items.next().await {
12734    ///   let item = result?;
12735    /// }
12736    /// # Ok(()) }
12737    ///
12738    /// fn prepare_request_builder() -> ListLocations {
12739    ///   # panic!();
12740    ///   // ... details omitted ...
12741    /// }
12742    /// ```
12743    #[derive(Clone, Debug)]
12744    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12745
12746    impl ListLocations {
12747        pub(crate) fn new(
12748            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12749        ) -> Self {
12750            Self(RequestBuilder::new(stub))
12751        }
12752
12753        /// Sets the full request, replacing any prior values.
12754        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12755            mut self,
12756            v: V,
12757        ) -> Self {
12758            self.0.request = v.into();
12759            self
12760        }
12761
12762        /// Sets all the options, replacing any prior values.
12763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12764            self.0.options = v.into();
12765            self
12766        }
12767
12768        /// Sends the request.
12769        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12770            (*self.0.stub)
12771                .list_locations(self.0.request, self.0.options)
12772                .await
12773                .map(crate::Response::into_body)
12774        }
12775
12776        /// Streams each page in the collection.
12777        pub fn by_page(
12778            self,
12779        ) -> impl google_cloud_gax::paginator::Paginator<
12780            google_cloud_location::model::ListLocationsResponse,
12781            crate::Error,
12782        > {
12783            use std::clone::Clone;
12784            let token = self.0.request.page_token.clone();
12785            let execute = move |token: String| {
12786                let mut builder = self.clone();
12787                builder.0.request = builder.0.request.set_page_token(token);
12788                builder.send()
12789            };
12790            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12791        }
12792
12793        /// Streams each item in the collection.
12794        pub fn by_item(
12795            self,
12796        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12797            google_cloud_location::model::ListLocationsResponse,
12798            crate::Error,
12799        > {
12800            use google_cloud_gax::paginator::Paginator;
12801            self.by_page().items()
12802        }
12803
12804        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
12805        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12806            self.0.request.name = v.into();
12807            self
12808        }
12809
12810        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
12811        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12812            self.0.request.filter = v.into();
12813            self
12814        }
12815
12816        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
12817        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12818            self.0.request.page_size = v.into();
12819            self
12820        }
12821
12822        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
12823        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12824            self.0.request.page_token = v.into();
12825            self
12826        }
12827    }
12828
12829    #[doc(hidden)]
12830    impl crate::RequestBuilder for ListLocations {
12831        fn request_options(&mut self) -> &mut crate::RequestOptions {
12832            &mut self.0.options
12833        }
12834    }
12835
12836    /// The request builder for [Environments::get_location][crate::client::Environments::get_location] calls.
12837    ///
12838    /// # Example
12839    /// ```
12840    /// # use google_cloud_dialogflow_v2::builder::environments::GetLocation;
12841    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12842    ///
12843    /// let builder = prepare_request_builder();
12844    /// let response = builder.send().await?;
12845    /// # Ok(()) }
12846    ///
12847    /// fn prepare_request_builder() -> GetLocation {
12848    ///   # panic!();
12849    ///   // ... details omitted ...
12850    /// }
12851    /// ```
12852    #[derive(Clone, Debug)]
12853    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
12854
12855    impl GetLocation {
12856        pub(crate) fn new(
12857            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12858        ) -> Self {
12859            Self(RequestBuilder::new(stub))
12860        }
12861
12862        /// Sets the full request, replacing any prior values.
12863        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
12864            mut self,
12865            v: V,
12866        ) -> Self {
12867            self.0.request = v.into();
12868            self
12869        }
12870
12871        /// Sets all the options, replacing any prior values.
12872        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12873            self.0.options = v.into();
12874            self
12875        }
12876
12877        /// Sends the request.
12878        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
12879            (*self.0.stub)
12880                .get_location(self.0.request, self.0.options)
12881                .await
12882                .map(crate::Response::into_body)
12883        }
12884
12885        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
12886        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12887            self.0.request.name = v.into();
12888            self
12889        }
12890    }
12891
12892    #[doc(hidden)]
12893    impl crate::RequestBuilder for GetLocation {
12894        fn request_options(&mut self) -> &mut crate::RequestOptions {
12895            &mut self.0.options
12896        }
12897    }
12898
12899    /// The request builder for [Environments::list_operations][crate::client::Environments::list_operations] calls.
12900    ///
12901    /// # Example
12902    /// ```
12903    /// # use google_cloud_dialogflow_v2::builder::environments::ListOperations;
12904    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
12905    /// use google_cloud_gax::paginator::ItemPaginator;
12906    ///
12907    /// let builder = prepare_request_builder();
12908    /// let mut items = builder.by_item();
12909    /// while let Some(result) = items.next().await {
12910    ///   let item = result?;
12911    /// }
12912    /// # Ok(()) }
12913    ///
12914    /// fn prepare_request_builder() -> ListOperations {
12915    ///   # panic!();
12916    ///   // ... details omitted ...
12917    /// }
12918    /// ```
12919    #[derive(Clone, Debug)]
12920    pub struct ListOperations(
12921        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
12922    );
12923
12924    impl ListOperations {
12925        pub(crate) fn new(
12926            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12927        ) -> Self {
12928            Self(RequestBuilder::new(stub))
12929        }
12930
12931        /// Sets the full request, replacing any prior values.
12932        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
12933            mut self,
12934            v: V,
12935        ) -> Self {
12936            self.0.request = v.into();
12937            self
12938        }
12939
12940        /// Sets all the options, replacing any prior values.
12941        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12942            self.0.options = v.into();
12943            self
12944        }
12945
12946        /// Sends the request.
12947        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
12948            (*self.0.stub)
12949                .list_operations(self.0.request, self.0.options)
12950                .await
12951                .map(crate::Response::into_body)
12952        }
12953
12954        /// Streams each page in the collection.
12955        pub fn by_page(
12956            self,
12957        ) -> impl google_cloud_gax::paginator::Paginator<
12958            google_cloud_longrunning::model::ListOperationsResponse,
12959            crate::Error,
12960        > {
12961            use std::clone::Clone;
12962            let token = self.0.request.page_token.clone();
12963            let execute = move |token: String| {
12964                let mut builder = self.clone();
12965                builder.0.request = builder.0.request.set_page_token(token);
12966                builder.send()
12967            };
12968            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12969        }
12970
12971        /// Streams each item in the collection.
12972        pub fn by_item(
12973            self,
12974        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12975            google_cloud_longrunning::model::ListOperationsResponse,
12976            crate::Error,
12977        > {
12978            use google_cloud_gax::paginator::Paginator;
12979            self.by_page().items()
12980        }
12981
12982        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
12983        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12984            self.0.request.name = v.into();
12985            self
12986        }
12987
12988        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
12989        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12990            self.0.request.filter = v.into();
12991            self
12992        }
12993
12994        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
12995        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12996            self.0.request.page_size = v.into();
12997            self
12998        }
12999
13000        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13001        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13002            self.0.request.page_token = v.into();
13003            self
13004        }
13005
13006        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13007        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13008            self.0.request.return_partial_success = v.into();
13009            self
13010        }
13011    }
13012
13013    #[doc(hidden)]
13014    impl crate::RequestBuilder for ListOperations {
13015        fn request_options(&mut self) -> &mut crate::RequestOptions {
13016            &mut self.0.options
13017        }
13018    }
13019
13020    /// The request builder for [Environments::get_operation][crate::client::Environments::get_operation] calls.
13021    ///
13022    /// # Example
13023    /// ```
13024    /// # use google_cloud_dialogflow_v2::builder::environments::GetOperation;
13025    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13026    ///
13027    /// let builder = prepare_request_builder();
13028    /// let response = builder.send().await?;
13029    /// # Ok(()) }
13030    ///
13031    /// fn prepare_request_builder() -> GetOperation {
13032    ///   # panic!();
13033    ///   // ... details omitted ...
13034    /// }
13035    /// ```
13036    #[derive(Clone, Debug)]
13037    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13038
13039    impl GetOperation {
13040        pub(crate) fn new(
13041            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13042        ) -> Self {
13043            Self(RequestBuilder::new(stub))
13044        }
13045
13046        /// Sets the full request, replacing any prior values.
13047        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13048            mut self,
13049            v: V,
13050        ) -> Self {
13051            self.0.request = v.into();
13052            self
13053        }
13054
13055        /// Sets all the options, replacing any prior values.
13056        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13057            self.0.options = v.into();
13058            self
13059        }
13060
13061        /// Sends the request.
13062        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13063            (*self.0.stub)
13064                .get_operation(self.0.request, self.0.options)
13065                .await
13066                .map(crate::Response::into_body)
13067        }
13068
13069        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13070        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13071            self.0.request.name = v.into();
13072            self
13073        }
13074    }
13075
13076    #[doc(hidden)]
13077    impl crate::RequestBuilder for GetOperation {
13078        fn request_options(&mut self) -> &mut crate::RequestOptions {
13079            &mut self.0.options
13080        }
13081    }
13082
13083    /// The request builder for [Environments::cancel_operation][crate::client::Environments::cancel_operation] calls.
13084    ///
13085    /// # Example
13086    /// ```
13087    /// # use google_cloud_dialogflow_v2::builder::environments::CancelOperation;
13088    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13089    ///
13090    /// let builder = prepare_request_builder();
13091    /// let response = builder.send().await?;
13092    /// # Ok(()) }
13093    ///
13094    /// fn prepare_request_builder() -> CancelOperation {
13095    ///   # panic!();
13096    ///   // ... details omitted ...
13097    /// }
13098    /// ```
13099    #[derive(Clone, Debug)]
13100    pub struct CancelOperation(
13101        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13102    );
13103
13104    impl CancelOperation {
13105        pub(crate) fn new(
13106            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13107        ) -> Self {
13108            Self(RequestBuilder::new(stub))
13109        }
13110
13111        /// Sets the full request, replacing any prior values.
13112        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13113            mut self,
13114            v: V,
13115        ) -> Self {
13116            self.0.request = v.into();
13117            self
13118        }
13119
13120        /// Sets all the options, replacing any prior values.
13121        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13122            self.0.options = v.into();
13123            self
13124        }
13125
13126        /// Sends the request.
13127        pub async fn send(self) -> Result<()> {
13128            (*self.0.stub)
13129                .cancel_operation(self.0.request, self.0.options)
13130                .await
13131                .map(crate::Response::into_body)
13132        }
13133
13134        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
13135        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13136            self.0.request.name = v.into();
13137            self
13138        }
13139    }
13140
13141    #[doc(hidden)]
13142    impl crate::RequestBuilder for CancelOperation {
13143        fn request_options(&mut self) -> &mut crate::RequestOptions {
13144            &mut self.0.options
13145        }
13146    }
13147}
13148
13149#[cfg(feature = "fulfillments")]
13150#[cfg_attr(docsrs, doc(cfg(feature = "fulfillments")))]
13151pub mod fulfillments {
13152    use crate::Result;
13153
13154    /// A builder for [Fulfillments][crate::client::Fulfillments].
13155    ///
13156    /// ```
13157    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13158    /// # use google_cloud_dialogflow_v2::*;
13159    /// # use builder::fulfillments::ClientBuilder;
13160    /// # use client::Fulfillments;
13161    /// let builder : ClientBuilder = Fulfillments::builder();
13162    /// let client = builder
13163    ///     .with_endpoint("https://dialogflow.googleapis.com")
13164    ///     .build().await?;
13165    /// # Ok(()) }
13166    /// ```
13167    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13168
13169    pub(crate) mod client {
13170        use super::super::super::client::Fulfillments;
13171        pub struct Factory;
13172        impl crate::ClientFactory for Factory {
13173            type Client = Fulfillments;
13174            type Credentials = gaxi::options::Credentials;
13175            async fn build(
13176                self,
13177                config: gaxi::options::ClientConfig,
13178            ) -> crate::ClientBuilderResult<Self::Client> {
13179                Self::Client::new(config).await
13180            }
13181        }
13182    }
13183
13184    /// Common implementation for [crate::client::Fulfillments] request builders.
13185    #[derive(Clone, Debug)]
13186    pub(crate) struct RequestBuilder<R: std::default::Default> {
13187        stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13188        request: R,
13189        options: crate::RequestOptions,
13190    }
13191
13192    impl<R> RequestBuilder<R>
13193    where
13194        R: std::default::Default,
13195    {
13196        pub(crate) fn new(
13197            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13198        ) -> Self {
13199            Self {
13200                stub,
13201                request: R::default(),
13202                options: crate::RequestOptions::default(),
13203            }
13204        }
13205    }
13206
13207    /// The request builder for [Fulfillments::get_fulfillment][crate::client::Fulfillments::get_fulfillment] calls.
13208    ///
13209    /// # Example
13210    /// ```
13211    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetFulfillment;
13212    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13213    ///
13214    /// let builder = prepare_request_builder();
13215    /// let response = builder.send().await?;
13216    /// # Ok(()) }
13217    ///
13218    /// fn prepare_request_builder() -> GetFulfillment {
13219    ///   # panic!();
13220    ///   // ... details omitted ...
13221    /// }
13222    /// ```
13223    #[derive(Clone, Debug)]
13224    pub struct GetFulfillment(RequestBuilder<crate::model::GetFulfillmentRequest>);
13225
13226    impl GetFulfillment {
13227        pub(crate) fn new(
13228            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13229        ) -> Self {
13230            Self(RequestBuilder::new(stub))
13231        }
13232
13233        /// Sets the full request, replacing any prior values.
13234        pub fn with_request<V: Into<crate::model::GetFulfillmentRequest>>(mut self, v: V) -> Self {
13235            self.0.request = v.into();
13236            self
13237        }
13238
13239        /// Sets all the options, replacing any prior values.
13240        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13241            self.0.options = v.into();
13242            self
13243        }
13244
13245        /// Sends the request.
13246        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13247            (*self.0.stub)
13248                .get_fulfillment(self.0.request, self.0.options)
13249                .await
13250                .map(crate::Response::into_body)
13251        }
13252
13253        /// Sets the value of [name][crate::model::GetFulfillmentRequest::name].
13254        ///
13255        /// This is a **required** field for requests.
13256        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13257            self.0.request.name = v.into();
13258            self
13259        }
13260    }
13261
13262    #[doc(hidden)]
13263    impl crate::RequestBuilder for GetFulfillment {
13264        fn request_options(&mut self) -> &mut crate::RequestOptions {
13265            &mut self.0.options
13266        }
13267    }
13268
13269    /// The request builder for [Fulfillments::update_fulfillment][crate::client::Fulfillments::update_fulfillment] calls.
13270    ///
13271    /// # Example
13272    /// ```
13273    /// # use google_cloud_dialogflow_v2::builder::fulfillments::UpdateFulfillment;
13274    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13275    ///
13276    /// let builder = prepare_request_builder();
13277    /// let response = builder.send().await?;
13278    /// # Ok(()) }
13279    ///
13280    /// fn prepare_request_builder() -> UpdateFulfillment {
13281    ///   # panic!();
13282    ///   // ... details omitted ...
13283    /// }
13284    /// ```
13285    #[derive(Clone, Debug)]
13286    pub struct UpdateFulfillment(RequestBuilder<crate::model::UpdateFulfillmentRequest>);
13287
13288    impl UpdateFulfillment {
13289        pub(crate) fn new(
13290            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13291        ) -> Self {
13292            Self(RequestBuilder::new(stub))
13293        }
13294
13295        /// Sets the full request, replacing any prior values.
13296        pub fn with_request<V: Into<crate::model::UpdateFulfillmentRequest>>(
13297            mut self,
13298            v: V,
13299        ) -> Self {
13300            self.0.request = v.into();
13301            self
13302        }
13303
13304        /// Sets all the options, replacing any prior values.
13305        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13306            self.0.options = v.into();
13307            self
13308        }
13309
13310        /// Sends the request.
13311        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13312            (*self.0.stub)
13313                .update_fulfillment(self.0.request, self.0.options)
13314                .await
13315                .map(crate::Response::into_body)
13316        }
13317
13318        /// Sets the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13319        ///
13320        /// This is a **required** field for requests.
13321        pub fn set_fulfillment<T>(mut self, v: T) -> Self
13322        where
13323            T: std::convert::Into<crate::model::Fulfillment>,
13324        {
13325            self.0.request.fulfillment = std::option::Option::Some(v.into());
13326            self
13327        }
13328
13329        /// Sets or clears the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13330        ///
13331        /// This is a **required** field for requests.
13332        pub fn set_or_clear_fulfillment<T>(mut self, v: std::option::Option<T>) -> Self
13333        where
13334            T: std::convert::Into<crate::model::Fulfillment>,
13335        {
13336            self.0.request.fulfillment = v.map(|x| x.into());
13337            self
13338        }
13339
13340        /// Sets the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13341        ///
13342        /// This is a **required** field for requests.
13343        pub fn set_update_mask<T>(mut self, v: T) -> Self
13344        where
13345            T: std::convert::Into<wkt::FieldMask>,
13346        {
13347            self.0.request.update_mask = std::option::Option::Some(v.into());
13348            self
13349        }
13350
13351        /// Sets or clears the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13352        ///
13353        /// This is a **required** field for requests.
13354        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13355        where
13356            T: std::convert::Into<wkt::FieldMask>,
13357        {
13358            self.0.request.update_mask = v.map(|x| x.into());
13359            self
13360        }
13361    }
13362
13363    #[doc(hidden)]
13364    impl crate::RequestBuilder for UpdateFulfillment {
13365        fn request_options(&mut self) -> &mut crate::RequestOptions {
13366            &mut self.0.options
13367        }
13368    }
13369
13370    /// The request builder for [Fulfillments::list_locations][crate::client::Fulfillments::list_locations] calls.
13371    ///
13372    /// # Example
13373    /// ```
13374    /// # use google_cloud_dialogflow_v2::builder::fulfillments::ListLocations;
13375    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13376    /// use google_cloud_gax::paginator::ItemPaginator;
13377    ///
13378    /// let builder = prepare_request_builder();
13379    /// let mut items = builder.by_item();
13380    /// while let Some(result) = items.next().await {
13381    ///   let item = result?;
13382    /// }
13383    /// # Ok(()) }
13384    ///
13385    /// fn prepare_request_builder() -> ListLocations {
13386    ///   # panic!();
13387    ///   // ... details omitted ...
13388    /// }
13389    /// ```
13390    #[derive(Clone, Debug)]
13391    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13392
13393    impl ListLocations {
13394        pub(crate) fn new(
13395            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13396        ) -> Self {
13397            Self(RequestBuilder::new(stub))
13398        }
13399
13400        /// Sets the full request, replacing any prior values.
13401        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13402            mut self,
13403            v: V,
13404        ) -> Self {
13405            self.0.request = v.into();
13406            self
13407        }
13408
13409        /// Sets all the options, replacing any prior values.
13410        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13411            self.0.options = v.into();
13412            self
13413        }
13414
13415        /// Sends the request.
13416        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13417            (*self.0.stub)
13418                .list_locations(self.0.request, self.0.options)
13419                .await
13420                .map(crate::Response::into_body)
13421        }
13422
13423        /// Streams each page in the collection.
13424        pub fn by_page(
13425            self,
13426        ) -> impl google_cloud_gax::paginator::Paginator<
13427            google_cloud_location::model::ListLocationsResponse,
13428            crate::Error,
13429        > {
13430            use std::clone::Clone;
13431            let token = self.0.request.page_token.clone();
13432            let execute = move |token: String| {
13433                let mut builder = self.clone();
13434                builder.0.request = builder.0.request.set_page_token(token);
13435                builder.send()
13436            };
13437            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13438        }
13439
13440        /// Streams each item in the collection.
13441        pub fn by_item(
13442            self,
13443        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13444            google_cloud_location::model::ListLocationsResponse,
13445            crate::Error,
13446        > {
13447            use google_cloud_gax::paginator::Paginator;
13448            self.by_page().items()
13449        }
13450
13451        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13452        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13453            self.0.request.name = v.into();
13454            self
13455        }
13456
13457        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13458        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13459            self.0.request.filter = v.into();
13460            self
13461        }
13462
13463        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13464        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13465            self.0.request.page_size = v.into();
13466            self
13467        }
13468
13469        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
13470        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13471            self.0.request.page_token = v.into();
13472            self
13473        }
13474    }
13475
13476    #[doc(hidden)]
13477    impl crate::RequestBuilder for ListLocations {
13478        fn request_options(&mut self) -> &mut crate::RequestOptions {
13479            &mut self.0.options
13480        }
13481    }
13482
13483    /// The request builder for [Fulfillments::get_location][crate::client::Fulfillments::get_location] calls.
13484    ///
13485    /// # Example
13486    /// ```
13487    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetLocation;
13488    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13489    ///
13490    /// let builder = prepare_request_builder();
13491    /// let response = builder.send().await?;
13492    /// # Ok(()) }
13493    ///
13494    /// fn prepare_request_builder() -> GetLocation {
13495    ///   # panic!();
13496    ///   // ... details omitted ...
13497    /// }
13498    /// ```
13499    #[derive(Clone, Debug)]
13500    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13501
13502    impl GetLocation {
13503        pub(crate) fn new(
13504            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13505        ) -> Self {
13506            Self(RequestBuilder::new(stub))
13507        }
13508
13509        /// Sets the full request, replacing any prior values.
13510        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13511            mut self,
13512            v: V,
13513        ) -> Self {
13514            self.0.request = v.into();
13515            self
13516        }
13517
13518        /// Sets all the options, replacing any prior values.
13519        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13520            self.0.options = v.into();
13521            self
13522        }
13523
13524        /// Sends the request.
13525        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13526            (*self.0.stub)
13527                .get_location(self.0.request, self.0.options)
13528                .await
13529                .map(crate::Response::into_body)
13530        }
13531
13532        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
13533        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13534            self.0.request.name = v.into();
13535            self
13536        }
13537    }
13538
13539    #[doc(hidden)]
13540    impl crate::RequestBuilder for GetLocation {
13541        fn request_options(&mut self) -> &mut crate::RequestOptions {
13542            &mut self.0.options
13543        }
13544    }
13545
13546    /// The request builder for [Fulfillments::list_operations][crate::client::Fulfillments::list_operations] calls.
13547    ///
13548    /// # Example
13549    /// ```
13550    /// # use google_cloud_dialogflow_v2::builder::fulfillments::ListOperations;
13551    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13552    /// use google_cloud_gax::paginator::ItemPaginator;
13553    ///
13554    /// let builder = prepare_request_builder();
13555    /// let mut items = builder.by_item();
13556    /// while let Some(result) = items.next().await {
13557    ///   let item = result?;
13558    /// }
13559    /// # Ok(()) }
13560    ///
13561    /// fn prepare_request_builder() -> ListOperations {
13562    ///   # panic!();
13563    ///   // ... details omitted ...
13564    /// }
13565    /// ```
13566    #[derive(Clone, Debug)]
13567    pub struct ListOperations(
13568        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13569    );
13570
13571    impl ListOperations {
13572        pub(crate) fn new(
13573            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13574        ) -> Self {
13575            Self(RequestBuilder::new(stub))
13576        }
13577
13578        /// Sets the full request, replacing any prior values.
13579        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13580            mut self,
13581            v: V,
13582        ) -> Self {
13583            self.0.request = v.into();
13584            self
13585        }
13586
13587        /// Sets all the options, replacing any prior values.
13588        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13589            self.0.options = v.into();
13590            self
13591        }
13592
13593        /// Sends the request.
13594        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13595            (*self.0.stub)
13596                .list_operations(self.0.request, self.0.options)
13597                .await
13598                .map(crate::Response::into_body)
13599        }
13600
13601        /// Streams each page in the collection.
13602        pub fn by_page(
13603            self,
13604        ) -> impl google_cloud_gax::paginator::Paginator<
13605            google_cloud_longrunning::model::ListOperationsResponse,
13606            crate::Error,
13607        > {
13608            use std::clone::Clone;
13609            let token = self.0.request.page_token.clone();
13610            let execute = move |token: String| {
13611                let mut builder = self.clone();
13612                builder.0.request = builder.0.request.set_page_token(token);
13613                builder.send()
13614            };
13615            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13616        }
13617
13618        /// Streams each item in the collection.
13619        pub fn by_item(
13620            self,
13621        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13622            google_cloud_longrunning::model::ListOperationsResponse,
13623            crate::Error,
13624        > {
13625            use google_cloud_gax::paginator::Paginator;
13626            self.by_page().items()
13627        }
13628
13629        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
13630        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13631            self.0.request.name = v.into();
13632            self
13633        }
13634
13635        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
13636        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13637            self.0.request.filter = v.into();
13638            self
13639        }
13640
13641        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
13642        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13643            self.0.request.page_size = v.into();
13644            self
13645        }
13646
13647        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13648        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13649            self.0.request.page_token = v.into();
13650            self
13651        }
13652
13653        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13654        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13655            self.0.request.return_partial_success = v.into();
13656            self
13657        }
13658    }
13659
13660    #[doc(hidden)]
13661    impl crate::RequestBuilder for ListOperations {
13662        fn request_options(&mut self) -> &mut crate::RequestOptions {
13663            &mut self.0.options
13664        }
13665    }
13666
13667    /// The request builder for [Fulfillments::get_operation][crate::client::Fulfillments::get_operation] calls.
13668    ///
13669    /// # Example
13670    /// ```
13671    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetOperation;
13672    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13673    ///
13674    /// let builder = prepare_request_builder();
13675    /// let response = builder.send().await?;
13676    /// # Ok(()) }
13677    ///
13678    /// fn prepare_request_builder() -> GetOperation {
13679    ///   # panic!();
13680    ///   // ... details omitted ...
13681    /// }
13682    /// ```
13683    #[derive(Clone, Debug)]
13684    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13685
13686    impl GetOperation {
13687        pub(crate) fn new(
13688            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13689        ) -> Self {
13690            Self(RequestBuilder::new(stub))
13691        }
13692
13693        /// Sets the full request, replacing any prior values.
13694        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13695            mut self,
13696            v: V,
13697        ) -> Self {
13698            self.0.request = v.into();
13699            self
13700        }
13701
13702        /// Sets all the options, replacing any prior values.
13703        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13704            self.0.options = v.into();
13705            self
13706        }
13707
13708        /// Sends the request.
13709        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13710            (*self.0.stub)
13711                .get_operation(self.0.request, self.0.options)
13712                .await
13713                .map(crate::Response::into_body)
13714        }
13715
13716        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13717        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13718            self.0.request.name = v.into();
13719            self
13720        }
13721    }
13722
13723    #[doc(hidden)]
13724    impl crate::RequestBuilder for GetOperation {
13725        fn request_options(&mut self) -> &mut crate::RequestOptions {
13726            &mut self.0.options
13727        }
13728    }
13729
13730    /// The request builder for [Fulfillments::cancel_operation][crate::client::Fulfillments::cancel_operation] calls.
13731    ///
13732    /// # Example
13733    /// ```
13734    /// # use google_cloud_dialogflow_v2::builder::fulfillments::CancelOperation;
13735    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13736    ///
13737    /// let builder = prepare_request_builder();
13738    /// let response = builder.send().await?;
13739    /// # Ok(()) }
13740    ///
13741    /// fn prepare_request_builder() -> CancelOperation {
13742    ///   # panic!();
13743    ///   // ... details omitted ...
13744    /// }
13745    /// ```
13746    #[derive(Clone, Debug)]
13747    pub struct CancelOperation(
13748        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13749    );
13750
13751    impl CancelOperation {
13752        pub(crate) fn new(
13753            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13754        ) -> Self {
13755            Self(RequestBuilder::new(stub))
13756        }
13757
13758        /// Sets the full request, replacing any prior values.
13759        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13760            mut self,
13761            v: V,
13762        ) -> Self {
13763            self.0.request = v.into();
13764            self
13765        }
13766
13767        /// Sets all the options, replacing any prior values.
13768        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13769            self.0.options = v.into();
13770            self
13771        }
13772
13773        /// Sends the request.
13774        pub async fn send(self) -> Result<()> {
13775            (*self.0.stub)
13776                .cancel_operation(self.0.request, self.0.options)
13777                .await
13778                .map(crate::Response::into_body)
13779        }
13780
13781        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
13782        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13783            self.0.request.name = v.into();
13784            self
13785        }
13786    }
13787
13788    #[doc(hidden)]
13789    impl crate::RequestBuilder for CancelOperation {
13790        fn request_options(&mut self) -> &mut crate::RequestOptions {
13791            &mut self.0.options
13792        }
13793    }
13794}
13795
13796#[cfg(feature = "generators")]
13797#[cfg_attr(docsrs, doc(cfg(feature = "generators")))]
13798pub mod generators {
13799    use crate::Result;
13800
13801    /// A builder for [Generators][crate::client::Generators].
13802    ///
13803    /// ```
13804    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13805    /// # use google_cloud_dialogflow_v2::*;
13806    /// # use builder::generators::ClientBuilder;
13807    /// # use client::Generators;
13808    /// let builder : ClientBuilder = Generators::builder();
13809    /// let client = builder
13810    ///     .with_endpoint("https://dialogflow.googleapis.com")
13811    ///     .build().await?;
13812    /// # Ok(()) }
13813    /// ```
13814    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13815
13816    pub(crate) mod client {
13817        use super::super::super::client::Generators;
13818        pub struct Factory;
13819        impl crate::ClientFactory for Factory {
13820            type Client = Generators;
13821            type Credentials = gaxi::options::Credentials;
13822            async fn build(
13823                self,
13824                config: gaxi::options::ClientConfig,
13825            ) -> crate::ClientBuilderResult<Self::Client> {
13826                Self::Client::new(config).await
13827            }
13828        }
13829    }
13830
13831    /// Common implementation for [crate::client::Generators] request builders.
13832    #[derive(Clone, Debug)]
13833    pub(crate) struct RequestBuilder<R: std::default::Default> {
13834        stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13835        request: R,
13836        options: crate::RequestOptions,
13837    }
13838
13839    impl<R> RequestBuilder<R>
13840    where
13841        R: std::default::Default,
13842    {
13843        pub(crate) fn new(
13844            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13845        ) -> Self {
13846            Self {
13847                stub,
13848                request: R::default(),
13849                options: crate::RequestOptions::default(),
13850            }
13851        }
13852    }
13853
13854    /// The request builder for [Generators::create_generator][crate::client::Generators::create_generator] calls.
13855    ///
13856    /// # Example
13857    /// ```
13858    /// # use google_cloud_dialogflow_v2::builder::generators::CreateGenerator;
13859    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13860    ///
13861    /// let builder = prepare_request_builder();
13862    /// let response = builder.send().await?;
13863    /// # Ok(()) }
13864    ///
13865    /// fn prepare_request_builder() -> CreateGenerator {
13866    ///   # panic!();
13867    ///   // ... details omitted ...
13868    /// }
13869    /// ```
13870    #[derive(Clone, Debug)]
13871    pub struct CreateGenerator(RequestBuilder<crate::model::CreateGeneratorRequest>);
13872
13873    impl CreateGenerator {
13874        pub(crate) fn new(
13875            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13876        ) -> Self {
13877            Self(RequestBuilder::new(stub))
13878        }
13879
13880        /// Sets the full request, replacing any prior values.
13881        pub fn with_request<V: Into<crate::model::CreateGeneratorRequest>>(mut self, v: V) -> Self {
13882            self.0.request = v.into();
13883            self
13884        }
13885
13886        /// Sets all the options, replacing any prior values.
13887        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13888            self.0.options = v.into();
13889            self
13890        }
13891
13892        /// Sends the request.
13893        pub async fn send(self) -> Result<crate::model::Generator> {
13894            (*self.0.stub)
13895                .create_generator(self.0.request, self.0.options)
13896                .await
13897                .map(crate::Response::into_body)
13898        }
13899
13900        /// Sets the value of [parent][crate::model::CreateGeneratorRequest::parent].
13901        ///
13902        /// This is a **required** field for requests.
13903        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13904            self.0.request.parent = v.into();
13905            self
13906        }
13907
13908        /// Sets the value of [generator][crate::model::CreateGeneratorRequest::generator].
13909        ///
13910        /// This is a **required** field for requests.
13911        pub fn set_generator<T>(mut self, v: T) -> Self
13912        where
13913            T: std::convert::Into<crate::model::Generator>,
13914        {
13915            self.0.request.generator = std::option::Option::Some(v.into());
13916            self
13917        }
13918
13919        /// Sets or clears the value of [generator][crate::model::CreateGeneratorRequest::generator].
13920        ///
13921        /// This is a **required** field for requests.
13922        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
13923        where
13924            T: std::convert::Into<crate::model::Generator>,
13925        {
13926            self.0.request.generator = v.map(|x| x.into());
13927            self
13928        }
13929
13930        /// Sets the value of [generator_id][crate::model::CreateGeneratorRequest::generator_id].
13931        pub fn set_generator_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13932            self.0.request.generator_id = v.into();
13933            self
13934        }
13935    }
13936
13937    #[doc(hidden)]
13938    impl crate::RequestBuilder for CreateGenerator {
13939        fn request_options(&mut self) -> &mut crate::RequestOptions {
13940            &mut self.0.options
13941        }
13942    }
13943
13944    /// The request builder for [Generators::get_generator][crate::client::Generators::get_generator] calls.
13945    ///
13946    /// # Example
13947    /// ```
13948    /// # use google_cloud_dialogflow_v2::builder::generators::GetGenerator;
13949    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
13950    ///
13951    /// let builder = prepare_request_builder();
13952    /// let response = builder.send().await?;
13953    /// # Ok(()) }
13954    ///
13955    /// fn prepare_request_builder() -> GetGenerator {
13956    ///   # panic!();
13957    ///   // ... details omitted ...
13958    /// }
13959    /// ```
13960    #[derive(Clone, Debug)]
13961    pub struct GetGenerator(RequestBuilder<crate::model::GetGeneratorRequest>);
13962
13963    impl GetGenerator {
13964        pub(crate) fn new(
13965            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13966        ) -> Self {
13967            Self(RequestBuilder::new(stub))
13968        }
13969
13970        /// Sets the full request, replacing any prior values.
13971        pub fn with_request<V: Into<crate::model::GetGeneratorRequest>>(mut self, v: V) -> Self {
13972            self.0.request = v.into();
13973            self
13974        }
13975
13976        /// Sets all the options, replacing any prior values.
13977        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13978            self.0.options = v.into();
13979            self
13980        }
13981
13982        /// Sends the request.
13983        pub async fn send(self) -> Result<crate::model::Generator> {
13984            (*self.0.stub)
13985                .get_generator(self.0.request, self.0.options)
13986                .await
13987                .map(crate::Response::into_body)
13988        }
13989
13990        /// Sets the value of [name][crate::model::GetGeneratorRequest::name].
13991        ///
13992        /// This is a **required** field for requests.
13993        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13994            self.0.request.name = v.into();
13995            self
13996        }
13997    }
13998
13999    #[doc(hidden)]
14000    impl crate::RequestBuilder for GetGenerator {
14001        fn request_options(&mut self) -> &mut crate::RequestOptions {
14002            &mut self.0.options
14003        }
14004    }
14005
14006    /// The request builder for [Generators::list_generators][crate::client::Generators::list_generators] calls.
14007    ///
14008    /// # Example
14009    /// ```
14010    /// # use google_cloud_dialogflow_v2::builder::generators::ListGenerators;
14011    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14012    /// use google_cloud_gax::paginator::ItemPaginator;
14013    ///
14014    /// let builder = prepare_request_builder();
14015    /// let mut items = builder.by_item();
14016    /// while let Some(result) = items.next().await {
14017    ///   let item = result?;
14018    /// }
14019    /// # Ok(()) }
14020    ///
14021    /// fn prepare_request_builder() -> ListGenerators {
14022    ///   # panic!();
14023    ///   // ... details omitted ...
14024    /// }
14025    /// ```
14026    #[derive(Clone, Debug)]
14027    pub struct ListGenerators(RequestBuilder<crate::model::ListGeneratorsRequest>);
14028
14029    impl ListGenerators {
14030        pub(crate) fn new(
14031            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14032        ) -> Self {
14033            Self(RequestBuilder::new(stub))
14034        }
14035
14036        /// Sets the full request, replacing any prior values.
14037        pub fn with_request<V: Into<crate::model::ListGeneratorsRequest>>(mut self, v: V) -> Self {
14038            self.0.request = v.into();
14039            self
14040        }
14041
14042        /// Sets all the options, replacing any prior values.
14043        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14044            self.0.options = v.into();
14045            self
14046        }
14047
14048        /// Sends the request.
14049        pub async fn send(self) -> Result<crate::model::ListGeneratorsResponse> {
14050            (*self.0.stub)
14051                .list_generators(self.0.request, self.0.options)
14052                .await
14053                .map(crate::Response::into_body)
14054        }
14055
14056        /// Streams each page in the collection.
14057        pub fn by_page(
14058            self,
14059        ) -> impl google_cloud_gax::paginator::Paginator<
14060            crate::model::ListGeneratorsResponse,
14061            crate::Error,
14062        > {
14063            use std::clone::Clone;
14064            let token = self.0.request.page_token.clone();
14065            let execute = move |token: String| {
14066                let mut builder = self.clone();
14067                builder.0.request = builder.0.request.set_page_token(token);
14068                builder.send()
14069            };
14070            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14071        }
14072
14073        /// Streams each item in the collection.
14074        pub fn by_item(
14075            self,
14076        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14077            crate::model::ListGeneratorsResponse,
14078            crate::Error,
14079        > {
14080            use google_cloud_gax::paginator::Paginator;
14081            self.by_page().items()
14082        }
14083
14084        /// Sets the value of [parent][crate::model::ListGeneratorsRequest::parent].
14085        ///
14086        /// This is a **required** field for requests.
14087        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14088            self.0.request.parent = v.into();
14089            self
14090        }
14091
14092        /// Sets the value of [page_size][crate::model::ListGeneratorsRequest::page_size].
14093        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14094            self.0.request.page_size = v.into();
14095            self
14096        }
14097
14098        /// Sets the value of [page_token][crate::model::ListGeneratorsRequest::page_token].
14099        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14100            self.0.request.page_token = v.into();
14101            self
14102        }
14103    }
14104
14105    #[doc(hidden)]
14106    impl crate::RequestBuilder for ListGenerators {
14107        fn request_options(&mut self) -> &mut crate::RequestOptions {
14108            &mut self.0.options
14109        }
14110    }
14111
14112    /// The request builder for [Generators::delete_generator][crate::client::Generators::delete_generator] calls.
14113    ///
14114    /// # Example
14115    /// ```
14116    /// # use google_cloud_dialogflow_v2::builder::generators::DeleteGenerator;
14117    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14118    ///
14119    /// let builder = prepare_request_builder();
14120    /// let response = builder.send().await?;
14121    /// # Ok(()) }
14122    ///
14123    /// fn prepare_request_builder() -> DeleteGenerator {
14124    ///   # panic!();
14125    ///   // ... details omitted ...
14126    /// }
14127    /// ```
14128    #[derive(Clone, Debug)]
14129    pub struct DeleteGenerator(RequestBuilder<crate::model::DeleteGeneratorRequest>);
14130
14131    impl DeleteGenerator {
14132        pub(crate) fn new(
14133            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14134        ) -> Self {
14135            Self(RequestBuilder::new(stub))
14136        }
14137
14138        /// Sets the full request, replacing any prior values.
14139        pub fn with_request<V: Into<crate::model::DeleteGeneratorRequest>>(mut self, v: V) -> Self {
14140            self.0.request = v.into();
14141            self
14142        }
14143
14144        /// Sets all the options, replacing any prior values.
14145        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14146            self.0.options = v.into();
14147            self
14148        }
14149
14150        /// Sends the request.
14151        pub async fn send(self) -> Result<()> {
14152            (*self.0.stub)
14153                .delete_generator(self.0.request, self.0.options)
14154                .await
14155                .map(crate::Response::into_body)
14156        }
14157
14158        /// Sets the value of [name][crate::model::DeleteGeneratorRequest::name].
14159        ///
14160        /// This is a **required** field for requests.
14161        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14162            self.0.request.name = v.into();
14163            self
14164        }
14165    }
14166
14167    #[doc(hidden)]
14168    impl crate::RequestBuilder for DeleteGenerator {
14169        fn request_options(&mut self) -> &mut crate::RequestOptions {
14170            &mut self.0.options
14171        }
14172    }
14173
14174    /// The request builder for [Generators::update_generator][crate::client::Generators::update_generator] calls.
14175    ///
14176    /// # Example
14177    /// ```
14178    /// # use google_cloud_dialogflow_v2::builder::generators::UpdateGenerator;
14179    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14180    ///
14181    /// let builder = prepare_request_builder();
14182    /// let response = builder.send().await?;
14183    /// # Ok(()) }
14184    ///
14185    /// fn prepare_request_builder() -> UpdateGenerator {
14186    ///   # panic!();
14187    ///   // ... details omitted ...
14188    /// }
14189    /// ```
14190    #[derive(Clone, Debug)]
14191    pub struct UpdateGenerator(RequestBuilder<crate::model::UpdateGeneratorRequest>);
14192
14193    impl UpdateGenerator {
14194        pub(crate) fn new(
14195            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14196        ) -> Self {
14197            Self(RequestBuilder::new(stub))
14198        }
14199
14200        /// Sets the full request, replacing any prior values.
14201        pub fn with_request<V: Into<crate::model::UpdateGeneratorRequest>>(mut self, v: V) -> Self {
14202            self.0.request = v.into();
14203            self
14204        }
14205
14206        /// Sets all the options, replacing any prior values.
14207        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14208            self.0.options = v.into();
14209            self
14210        }
14211
14212        /// Sends the request.
14213        pub async fn send(self) -> Result<crate::model::Generator> {
14214            (*self.0.stub)
14215                .update_generator(self.0.request, self.0.options)
14216                .await
14217                .map(crate::Response::into_body)
14218        }
14219
14220        /// Sets the value of [generator][crate::model::UpdateGeneratorRequest::generator].
14221        ///
14222        /// This is a **required** field for requests.
14223        pub fn set_generator<T>(mut self, v: T) -> Self
14224        where
14225            T: std::convert::Into<crate::model::Generator>,
14226        {
14227            self.0.request.generator = std::option::Option::Some(v.into());
14228            self
14229        }
14230
14231        /// Sets or clears the value of [generator][crate::model::UpdateGeneratorRequest::generator].
14232        ///
14233        /// This is a **required** field for requests.
14234        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
14235        where
14236            T: std::convert::Into<crate::model::Generator>,
14237        {
14238            self.0.request.generator = v.map(|x| x.into());
14239            self
14240        }
14241
14242        /// Sets the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
14243        pub fn set_update_mask<T>(mut self, v: T) -> Self
14244        where
14245            T: std::convert::Into<wkt::FieldMask>,
14246        {
14247            self.0.request.update_mask = std::option::Option::Some(v.into());
14248            self
14249        }
14250
14251        /// Sets or clears the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
14252        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14253        where
14254            T: std::convert::Into<wkt::FieldMask>,
14255        {
14256            self.0.request.update_mask = v.map(|x| x.into());
14257            self
14258        }
14259    }
14260
14261    #[doc(hidden)]
14262    impl crate::RequestBuilder for UpdateGenerator {
14263        fn request_options(&mut self) -> &mut crate::RequestOptions {
14264            &mut self.0.options
14265        }
14266    }
14267
14268    /// The request builder for [Generators::list_locations][crate::client::Generators::list_locations] calls.
14269    ///
14270    /// # Example
14271    /// ```
14272    /// # use google_cloud_dialogflow_v2::builder::generators::ListLocations;
14273    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14274    /// use google_cloud_gax::paginator::ItemPaginator;
14275    ///
14276    /// let builder = prepare_request_builder();
14277    /// let mut items = builder.by_item();
14278    /// while let Some(result) = items.next().await {
14279    ///   let item = result?;
14280    /// }
14281    /// # Ok(()) }
14282    ///
14283    /// fn prepare_request_builder() -> ListLocations {
14284    ///   # panic!();
14285    ///   // ... details omitted ...
14286    /// }
14287    /// ```
14288    #[derive(Clone, Debug)]
14289    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14290
14291    impl ListLocations {
14292        pub(crate) fn new(
14293            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14294        ) -> Self {
14295            Self(RequestBuilder::new(stub))
14296        }
14297
14298        /// Sets the full request, replacing any prior values.
14299        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14300            mut self,
14301            v: V,
14302        ) -> Self {
14303            self.0.request = v.into();
14304            self
14305        }
14306
14307        /// Sets all the options, replacing any prior values.
14308        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14309            self.0.options = v.into();
14310            self
14311        }
14312
14313        /// Sends the request.
14314        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14315            (*self.0.stub)
14316                .list_locations(self.0.request, self.0.options)
14317                .await
14318                .map(crate::Response::into_body)
14319        }
14320
14321        /// Streams each page in the collection.
14322        pub fn by_page(
14323            self,
14324        ) -> impl google_cloud_gax::paginator::Paginator<
14325            google_cloud_location::model::ListLocationsResponse,
14326            crate::Error,
14327        > {
14328            use std::clone::Clone;
14329            let token = self.0.request.page_token.clone();
14330            let execute = move |token: String| {
14331                let mut builder = self.clone();
14332                builder.0.request = builder.0.request.set_page_token(token);
14333                builder.send()
14334            };
14335            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14336        }
14337
14338        /// Streams each item in the collection.
14339        pub fn by_item(
14340            self,
14341        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14342            google_cloud_location::model::ListLocationsResponse,
14343            crate::Error,
14344        > {
14345            use google_cloud_gax::paginator::Paginator;
14346            self.by_page().items()
14347        }
14348
14349        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
14350        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14351            self.0.request.name = v.into();
14352            self
14353        }
14354
14355        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
14356        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14357            self.0.request.filter = v.into();
14358            self
14359        }
14360
14361        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
14362        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14363            self.0.request.page_size = v.into();
14364            self
14365        }
14366
14367        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
14368        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14369            self.0.request.page_token = v.into();
14370            self
14371        }
14372    }
14373
14374    #[doc(hidden)]
14375    impl crate::RequestBuilder for ListLocations {
14376        fn request_options(&mut self) -> &mut crate::RequestOptions {
14377            &mut self.0.options
14378        }
14379    }
14380
14381    /// The request builder for [Generators::get_location][crate::client::Generators::get_location] calls.
14382    ///
14383    /// # Example
14384    /// ```
14385    /// # use google_cloud_dialogflow_v2::builder::generators::GetLocation;
14386    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14387    ///
14388    /// let builder = prepare_request_builder();
14389    /// let response = builder.send().await?;
14390    /// # Ok(()) }
14391    ///
14392    /// fn prepare_request_builder() -> GetLocation {
14393    ///   # panic!();
14394    ///   // ... details omitted ...
14395    /// }
14396    /// ```
14397    #[derive(Clone, Debug)]
14398    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14399
14400    impl GetLocation {
14401        pub(crate) fn new(
14402            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14403        ) -> Self {
14404            Self(RequestBuilder::new(stub))
14405        }
14406
14407        /// Sets the full request, replacing any prior values.
14408        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14409            mut self,
14410            v: V,
14411        ) -> Self {
14412            self.0.request = v.into();
14413            self
14414        }
14415
14416        /// Sets all the options, replacing any prior values.
14417        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14418            self.0.options = v.into();
14419            self
14420        }
14421
14422        /// Sends the request.
14423        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14424            (*self.0.stub)
14425                .get_location(self.0.request, self.0.options)
14426                .await
14427                .map(crate::Response::into_body)
14428        }
14429
14430        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
14431        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14432            self.0.request.name = v.into();
14433            self
14434        }
14435    }
14436
14437    #[doc(hidden)]
14438    impl crate::RequestBuilder for GetLocation {
14439        fn request_options(&mut self) -> &mut crate::RequestOptions {
14440            &mut self.0.options
14441        }
14442    }
14443
14444    /// The request builder for [Generators::list_operations][crate::client::Generators::list_operations] calls.
14445    ///
14446    /// # Example
14447    /// ```
14448    /// # use google_cloud_dialogflow_v2::builder::generators::ListOperations;
14449    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14450    /// use google_cloud_gax::paginator::ItemPaginator;
14451    ///
14452    /// let builder = prepare_request_builder();
14453    /// let mut items = builder.by_item();
14454    /// while let Some(result) = items.next().await {
14455    ///   let item = result?;
14456    /// }
14457    /// # Ok(()) }
14458    ///
14459    /// fn prepare_request_builder() -> ListOperations {
14460    ///   # panic!();
14461    ///   // ... details omitted ...
14462    /// }
14463    /// ```
14464    #[derive(Clone, Debug)]
14465    pub struct ListOperations(
14466        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14467    );
14468
14469    impl ListOperations {
14470        pub(crate) fn new(
14471            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14472        ) -> Self {
14473            Self(RequestBuilder::new(stub))
14474        }
14475
14476        /// Sets the full request, replacing any prior values.
14477        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14478            mut self,
14479            v: V,
14480        ) -> Self {
14481            self.0.request = v.into();
14482            self
14483        }
14484
14485        /// Sets all the options, replacing any prior values.
14486        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14487            self.0.options = v.into();
14488            self
14489        }
14490
14491        /// Sends the request.
14492        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14493            (*self.0.stub)
14494                .list_operations(self.0.request, self.0.options)
14495                .await
14496                .map(crate::Response::into_body)
14497        }
14498
14499        /// Streams each page in the collection.
14500        pub fn by_page(
14501            self,
14502        ) -> impl google_cloud_gax::paginator::Paginator<
14503            google_cloud_longrunning::model::ListOperationsResponse,
14504            crate::Error,
14505        > {
14506            use std::clone::Clone;
14507            let token = self.0.request.page_token.clone();
14508            let execute = move |token: String| {
14509                let mut builder = self.clone();
14510                builder.0.request = builder.0.request.set_page_token(token);
14511                builder.send()
14512            };
14513            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14514        }
14515
14516        /// Streams each item in the collection.
14517        pub fn by_item(
14518            self,
14519        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14520            google_cloud_longrunning::model::ListOperationsResponse,
14521            crate::Error,
14522        > {
14523            use google_cloud_gax::paginator::Paginator;
14524            self.by_page().items()
14525        }
14526
14527        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
14528        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14529            self.0.request.name = v.into();
14530            self
14531        }
14532
14533        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
14534        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14535            self.0.request.filter = v.into();
14536            self
14537        }
14538
14539        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
14540        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14541            self.0.request.page_size = v.into();
14542            self
14543        }
14544
14545        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
14546        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14547            self.0.request.page_token = v.into();
14548            self
14549        }
14550
14551        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
14552        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14553            self.0.request.return_partial_success = v.into();
14554            self
14555        }
14556    }
14557
14558    #[doc(hidden)]
14559    impl crate::RequestBuilder for ListOperations {
14560        fn request_options(&mut self) -> &mut crate::RequestOptions {
14561            &mut self.0.options
14562        }
14563    }
14564
14565    /// The request builder for [Generators::get_operation][crate::client::Generators::get_operation] calls.
14566    ///
14567    /// # Example
14568    /// ```
14569    /// # use google_cloud_dialogflow_v2::builder::generators::GetOperation;
14570    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14571    ///
14572    /// let builder = prepare_request_builder();
14573    /// let response = builder.send().await?;
14574    /// # Ok(()) }
14575    ///
14576    /// fn prepare_request_builder() -> GetOperation {
14577    ///   # panic!();
14578    ///   // ... details omitted ...
14579    /// }
14580    /// ```
14581    #[derive(Clone, Debug)]
14582    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14583
14584    impl GetOperation {
14585        pub(crate) fn new(
14586            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14587        ) -> Self {
14588            Self(RequestBuilder::new(stub))
14589        }
14590
14591        /// Sets the full request, replacing any prior values.
14592        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14593            mut self,
14594            v: V,
14595        ) -> Self {
14596            self.0.request = v.into();
14597            self
14598        }
14599
14600        /// Sets all the options, replacing any prior values.
14601        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14602            self.0.options = v.into();
14603            self
14604        }
14605
14606        /// Sends the request.
14607        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14608            (*self.0.stub)
14609                .get_operation(self.0.request, self.0.options)
14610                .await
14611                .map(crate::Response::into_body)
14612        }
14613
14614        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
14615        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14616            self.0.request.name = v.into();
14617            self
14618        }
14619    }
14620
14621    #[doc(hidden)]
14622    impl crate::RequestBuilder for GetOperation {
14623        fn request_options(&mut self) -> &mut crate::RequestOptions {
14624            &mut self.0.options
14625        }
14626    }
14627
14628    /// The request builder for [Generators::cancel_operation][crate::client::Generators::cancel_operation] calls.
14629    ///
14630    /// # Example
14631    /// ```
14632    /// # use google_cloud_dialogflow_v2::builder::generators::CancelOperation;
14633    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14634    ///
14635    /// let builder = prepare_request_builder();
14636    /// let response = builder.send().await?;
14637    /// # Ok(()) }
14638    ///
14639    /// fn prepare_request_builder() -> CancelOperation {
14640    ///   # panic!();
14641    ///   // ... details omitted ...
14642    /// }
14643    /// ```
14644    #[derive(Clone, Debug)]
14645    pub struct CancelOperation(
14646        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14647    );
14648
14649    impl CancelOperation {
14650        pub(crate) fn new(
14651            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14652        ) -> Self {
14653            Self(RequestBuilder::new(stub))
14654        }
14655
14656        /// Sets the full request, replacing any prior values.
14657        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14658            mut self,
14659            v: V,
14660        ) -> Self {
14661            self.0.request = v.into();
14662            self
14663        }
14664
14665        /// Sets all the options, replacing any prior values.
14666        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14667            self.0.options = v.into();
14668            self
14669        }
14670
14671        /// Sends the request.
14672        pub async fn send(self) -> Result<()> {
14673            (*self.0.stub)
14674                .cancel_operation(self.0.request, self.0.options)
14675                .await
14676                .map(crate::Response::into_body)
14677        }
14678
14679        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
14680        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14681            self.0.request.name = v.into();
14682            self
14683        }
14684    }
14685
14686    #[doc(hidden)]
14687    impl crate::RequestBuilder for CancelOperation {
14688        fn request_options(&mut self) -> &mut crate::RequestOptions {
14689            &mut self.0.options
14690        }
14691    }
14692}
14693
14694#[cfg(feature = "generator-evaluations")]
14695#[cfg_attr(docsrs, doc(cfg(feature = "generator-evaluations")))]
14696pub mod generator_evaluations {
14697    use crate::Result;
14698
14699    /// A builder for [GeneratorEvaluations][crate::client::GeneratorEvaluations].
14700    ///
14701    /// ```
14702    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14703    /// # use google_cloud_dialogflow_v2::*;
14704    /// # use builder::generator_evaluations::ClientBuilder;
14705    /// # use client::GeneratorEvaluations;
14706    /// let builder : ClientBuilder = GeneratorEvaluations::builder();
14707    /// let client = builder
14708    ///     .with_endpoint("https://dialogflow.googleapis.com")
14709    ///     .build().await?;
14710    /// # Ok(()) }
14711    /// ```
14712    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14713
14714    pub(crate) mod client {
14715        use super::super::super::client::GeneratorEvaluations;
14716        pub struct Factory;
14717        impl crate::ClientFactory for Factory {
14718            type Client = GeneratorEvaluations;
14719            type Credentials = gaxi::options::Credentials;
14720            async fn build(
14721                self,
14722                config: gaxi::options::ClientConfig,
14723            ) -> crate::ClientBuilderResult<Self::Client> {
14724                Self::Client::new(config).await
14725            }
14726        }
14727    }
14728
14729    /// Common implementation for [crate::client::GeneratorEvaluations] request builders.
14730    #[derive(Clone, Debug)]
14731    pub(crate) struct RequestBuilder<R: std::default::Default> {
14732        stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14733        request: R,
14734        options: crate::RequestOptions,
14735    }
14736
14737    impl<R> RequestBuilder<R>
14738    where
14739        R: std::default::Default,
14740    {
14741        pub(crate) fn new(
14742            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14743        ) -> Self {
14744            Self {
14745                stub,
14746                request: R::default(),
14747                options: crate::RequestOptions::default(),
14748            }
14749        }
14750    }
14751
14752    /// The request builder for [GeneratorEvaluations::create_generator_evaluation][crate::client::GeneratorEvaluations::create_generator_evaluation] calls.
14753    ///
14754    /// # Example
14755    /// ```
14756    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::CreateGeneratorEvaluation;
14757    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14758    /// use google_cloud_lro::Poller;
14759    ///
14760    /// let builder = prepare_request_builder();
14761    /// let response = builder.poller().until_done().await?;
14762    /// # Ok(()) }
14763    ///
14764    /// fn prepare_request_builder() -> CreateGeneratorEvaluation {
14765    ///   # panic!();
14766    ///   // ... details omitted ...
14767    /// }
14768    /// ```
14769    #[derive(Clone, Debug)]
14770    pub struct CreateGeneratorEvaluation(
14771        RequestBuilder<crate::model::CreateGeneratorEvaluationRequest>,
14772    );
14773
14774    impl CreateGeneratorEvaluation {
14775        pub(crate) fn new(
14776            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14777        ) -> Self {
14778            Self(RequestBuilder::new(stub))
14779        }
14780
14781        /// Sets the full request, replacing any prior values.
14782        pub fn with_request<V: Into<crate::model::CreateGeneratorEvaluationRequest>>(
14783            mut self,
14784            v: V,
14785        ) -> Self {
14786            self.0.request = v.into();
14787            self
14788        }
14789
14790        /// Sets all the options, replacing any prior values.
14791        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14792            self.0.options = v.into();
14793            self
14794        }
14795
14796        /// Sends the request.
14797        ///
14798        /// # Long running operations
14799        ///
14800        /// This starts, but does not poll, a longrunning operation. More information
14801        /// on [create_generator_evaluation][crate::client::GeneratorEvaluations::create_generator_evaluation].
14802        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14803            (*self.0.stub)
14804                .create_generator_evaluation(self.0.request, self.0.options)
14805                .await
14806                .map(crate::Response::into_body)
14807        }
14808
14809        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_generator_evaluation`.
14810        pub fn poller(
14811            self,
14812        ) -> impl google_cloud_lro::Poller<
14813            crate::model::GeneratorEvaluation,
14814            crate::model::GeneratorEvaluationOperationMetadata,
14815        > {
14816            type Operation = google_cloud_lro::internal::Operation<
14817                crate::model::GeneratorEvaluation,
14818                crate::model::GeneratorEvaluationOperationMetadata,
14819            >;
14820            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14821            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14822
14823            let stub = self.0.stub.clone();
14824            let mut options = self.0.options.clone();
14825            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14826            let query = move |name| {
14827                let stub = stub.clone();
14828                let options = options.clone();
14829                async {
14830                    let op = GetOperation::new(stub)
14831                        .set_name(name)
14832                        .with_options(options)
14833                        .send()
14834                        .await?;
14835                    Ok(Operation::new(op))
14836                }
14837            };
14838
14839            let start = move || async {
14840                let op = self.send().await?;
14841                Ok(Operation::new(op))
14842            };
14843
14844            google_cloud_lro::internal::new_poller(
14845                polling_error_policy,
14846                polling_backoff_policy,
14847                start,
14848                query,
14849            )
14850        }
14851
14852        /// Sets the value of [parent][crate::model::CreateGeneratorEvaluationRequest::parent].
14853        ///
14854        /// This is a **required** field for requests.
14855        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14856            self.0.request.parent = v.into();
14857            self
14858        }
14859
14860        /// Sets the value of [generator_evaluation][crate::model::CreateGeneratorEvaluationRequest::generator_evaluation].
14861        ///
14862        /// This is a **required** field for requests.
14863        pub fn set_generator_evaluation<T>(mut self, v: T) -> Self
14864        where
14865            T: std::convert::Into<crate::model::GeneratorEvaluation>,
14866        {
14867            self.0.request.generator_evaluation = std::option::Option::Some(v.into());
14868            self
14869        }
14870
14871        /// Sets or clears the value of [generator_evaluation][crate::model::CreateGeneratorEvaluationRequest::generator_evaluation].
14872        ///
14873        /// This is a **required** field for requests.
14874        pub fn set_or_clear_generator_evaluation<T>(mut self, v: std::option::Option<T>) -> Self
14875        where
14876            T: std::convert::Into<crate::model::GeneratorEvaluation>,
14877        {
14878            self.0.request.generator_evaluation = v.map(|x| x.into());
14879            self
14880        }
14881    }
14882
14883    #[doc(hidden)]
14884    impl crate::RequestBuilder for CreateGeneratorEvaluation {
14885        fn request_options(&mut self) -> &mut crate::RequestOptions {
14886            &mut self.0.options
14887        }
14888    }
14889
14890    /// The request builder for [GeneratorEvaluations::get_generator_evaluation][crate::client::GeneratorEvaluations::get_generator_evaluation] calls.
14891    ///
14892    /// # Example
14893    /// ```
14894    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetGeneratorEvaluation;
14895    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14896    ///
14897    /// let builder = prepare_request_builder();
14898    /// let response = builder.send().await?;
14899    /// # Ok(()) }
14900    ///
14901    /// fn prepare_request_builder() -> GetGeneratorEvaluation {
14902    ///   # panic!();
14903    ///   // ... details omitted ...
14904    /// }
14905    /// ```
14906    #[derive(Clone, Debug)]
14907    pub struct GetGeneratorEvaluation(RequestBuilder<crate::model::GetGeneratorEvaluationRequest>);
14908
14909    impl GetGeneratorEvaluation {
14910        pub(crate) fn new(
14911            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14912        ) -> Self {
14913            Self(RequestBuilder::new(stub))
14914        }
14915
14916        /// Sets the full request, replacing any prior values.
14917        pub fn with_request<V: Into<crate::model::GetGeneratorEvaluationRequest>>(
14918            mut self,
14919            v: V,
14920        ) -> Self {
14921            self.0.request = v.into();
14922            self
14923        }
14924
14925        /// Sets all the options, replacing any prior values.
14926        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14927            self.0.options = v.into();
14928            self
14929        }
14930
14931        /// Sends the request.
14932        pub async fn send(self) -> Result<crate::model::GeneratorEvaluation> {
14933            (*self.0.stub)
14934                .get_generator_evaluation(self.0.request, self.0.options)
14935                .await
14936                .map(crate::Response::into_body)
14937        }
14938
14939        /// Sets the value of [name][crate::model::GetGeneratorEvaluationRequest::name].
14940        ///
14941        /// This is a **required** field for requests.
14942        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14943            self.0.request.name = v.into();
14944            self
14945        }
14946    }
14947
14948    #[doc(hidden)]
14949    impl crate::RequestBuilder for GetGeneratorEvaluation {
14950        fn request_options(&mut self) -> &mut crate::RequestOptions {
14951            &mut self.0.options
14952        }
14953    }
14954
14955    /// The request builder for [GeneratorEvaluations::list_generator_evaluations][crate::client::GeneratorEvaluations::list_generator_evaluations] calls.
14956    ///
14957    /// # Example
14958    /// ```
14959    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListGeneratorEvaluations;
14960    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
14961    /// use google_cloud_gax::paginator::ItemPaginator;
14962    ///
14963    /// let builder = prepare_request_builder();
14964    /// let mut items = builder.by_item();
14965    /// while let Some(result) = items.next().await {
14966    ///   let item = result?;
14967    /// }
14968    /// # Ok(()) }
14969    ///
14970    /// fn prepare_request_builder() -> ListGeneratorEvaluations {
14971    ///   # panic!();
14972    ///   // ... details omitted ...
14973    /// }
14974    /// ```
14975    #[derive(Clone, Debug)]
14976    pub struct ListGeneratorEvaluations(
14977        RequestBuilder<crate::model::ListGeneratorEvaluationsRequest>,
14978    );
14979
14980    impl ListGeneratorEvaluations {
14981        pub(crate) fn new(
14982            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14983        ) -> Self {
14984            Self(RequestBuilder::new(stub))
14985        }
14986
14987        /// Sets the full request, replacing any prior values.
14988        pub fn with_request<V: Into<crate::model::ListGeneratorEvaluationsRequest>>(
14989            mut self,
14990            v: V,
14991        ) -> Self {
14992            self.0.request = v.into();
14993            self
14994        }
14995
14996        /// Sets all the options, replacing any prior values.
14997        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14998            self.0.options = v.into();
14999            self
15000        }
15001
15002        /// Sends the request.
15003        pub async fn send(self) -> Result<crate::model::ListGeneratorEvaluationsResponse> {
15004            (*self.0.stub)
15005                .list_generator_evaluations(self.0.request, self.0.options)
15006                .await
15007                .map(crate::Response::into_body)
15008        }
15009
15010        /// Streams each page in the collection.
15011        pub fn by_page(
15012            self,
15013        ) -> impl google_cloud_gax::paginator::Paginator<
15014            crate::model::ListGeneratorEvaluationsResponse,
15015            crate::Error,
15016        > {
15017            use std::clone::Clone;
15018            let token = self.0.request.page_token.clone();
15019            let execute = move |token: String| {
15020                let mut builder = self.clone();
15021                builder.0.request = builder.0.request.set_page_token(token);
15022                builder.send()
15023            };
15024            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15025        }
15026
15027        /// Streams each item in the collection.
15028        pub fn by_item(
15029            self,
15030        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15031            crate::model::ListGeneratorEvaluationsResponse,
15032            crate::Error,
15033        > {
15034            use google_cloud_gax::paginator::Paginator;
15035            self.by_page().items()
15036        }
15037
15038        /// Sets the value of [parent][crate::model::ListGeneratorEvaluationsRequest::parent].
15039        ///
15040        /// This is a **required** field for requests.
15041        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15042            self.0.request.parent = v.into();
15043            self
15044        }
15045
15046        /// Sets the value of [page_size][crate::model::ListGeneratorEvaluationsRequest::page_size].
15047        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15048            self.0.request.page_size = v.into();
15049            self
15050        }
15051
15052        /// Sets the value of [page_token][crate::model::ListGeneratorEvaluationsRequest::page_token].
15053        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15054            self.0.request.page_token = v.into();
15055            self
15056        }
15057    }
15058
15059    #[doc(hidden)]
15060    impl crate::RequestBuilder for ListGeneratorEvaluations {
15061        fn request_options(&mut self) -> &mut crate::RequestOptions {
15062            &mut self.0.options
15063        }
15064    }
15065
15066    /// The request builder for [GeneratorEvaluations::delete_generator_evaluation][crate::client::GeneratorEvaluations::delete_generator_evaluation] calls.
15067    ///
15068    /// # Example
15069    /// ```
15070    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::DeleteGeneratorEvaluation;
15071    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15072    ///
15073    /// let builder = prepare_request_builder();
15074    /// let response = builder.send().await?;
15075    /// # Ok(()) }
15076    ///
15077    /// fn prepare_request_builder() -> DeleteGeneratorEvaluation {
15078    ///   # panic!();
15079    ///   // ... details omitted ...
15080    /// }
15081    /// ```
15082    #[derive(Clone, Debug)]
15083    pub struct DeleteGeneratorEvaluation(
15084        RequestBuilder<crate::model::DeleteGeneratorEvaluationRequest>,
15085    );
15086
15087    impl DeleteGeneratorEvaluation {
15088        pub(crate) fn new(
15089            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15090        ) -> Self {
15091            Self(RequestBuilder::new(stub))
15092        }
15093
15094        /// Sets the full request, replacing any prior values.
15095        pub fn with_request<V: Into<crate::model::DeleteGeneratorEvaluationRequest>>(
15096            mut self,
15097            v: V,
15098        ) -> Self {
15099            self.0.request = v.into();
15100            self
15101        }
15102
15103        /// Sets all the options, replacing any prior values.
15104        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15105            self.0.options = v.into();
15106            self
15107        }
15108
15109        /// Sends the request.
15110        pub async fn send(self) -> Result<()> {
15111            (*self.0.stub)
15112                .delete_generator_evaluation(self.0.request, self.0.options)
15113                .await
15114                .map(crate::Response::into_body)
15115        }
15116
15117        /// Sets the value of [name][crate::model::DeleteGeneratorEvaluationRequest::name].
15118        ///
15119        /// This is a **required** field for requests.
15120        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15121            self.0.request.name = v.into();
15122            self
15123        }
15124    }
15125
15126    #[doc(hidden)]
15127    impl crate::RequestBuilder for DeleteGeneratorEvaluation {
15128        fn request_options(&mut self) -> &mut crate::RequestOptions {
15129            &mut self.0.options
15130        }
15131    }
15132
15133    /// The request builder for [GeneratorEvaluations::list_locations][crate::client::GeneratorEvaluations::list_locations] calls.
15134    ///
15135    /// # Example
15136    /// ```
15137    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListLocations;
15138    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15139    /// use google_cloud_gax::paginator::ItemPaginator;
15140    ///
15141    /// let builder = prepare_request_builder();
15142    /// let mut items = builder.by_item();
15143    /// while let Some(result) = items.next().await {
15144    ///   let item = result?;
15145    /// }
15146    /// # Ok(()) }
15147    ///
15148    /// fn prepare_request_builder() -> ListLocations {
15149    ///   # panic!();
15150    ///   // ... details omitted ...
15151    /// }
15152    /// ```
15153    #[derive(Clone, Debug)]
15154    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
15155
15156    impl ListLocations {
15157        pub(crate) fn new(
15158            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15159        ) -> Self {
15160            Self(RequestBuilder::new(stub))
15161        }
15162
15163        /// Sets the full request, replacing any prior values.
15164        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
15165            mut self,
15166            v: V,
15167        ) -> Self {
15168            self.0.request = v.into();
15169            self
15170        }
15171
15172        /// Sets all the options, replacing any prior values.
15173        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15174            self.0.options = v.into();
15175            self
15176        }
15177
15178        /// Sends the request.
15179        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
15180            (*self.0.stub)
15181                .list_locations(self.0.request, self.0.options)
15182                .await
15183                .map(crate::Response::into_body)
15184        }
15185
15186        /// Streams each page in the collection.
15187        pub fn by_page(
15188            self,
15189        ) -> impl google_cloud_gax::paginator::Paginator<
15190            google_cloud_location::model::ListLocationsResponse,
15191            crate::Error,
15192        > {
15193            use std::clone::Clone;
15194            let token = self.0.request.page_token.clone();
15195            let execute = move |token: String| {
15196                let mut builder = self.clone();
15197                builder.0.request = builder.0.request.set_page_token(token);
15198                builder.send()
15199            };
15200            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15201        }
15202
15203        /// Streams each item in the collection.
15204        pub fn by_item(
15205            self,
15206        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15207            google_cloud_location::model::ListLocationsResponse,
15208            crate::Error,
15209        > {
15210            use google_cloud_gax::paginator::Paginator;
15211            self.by_page().items()
15212        }
15213
15214        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
15215        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15216            self.0.request.name = v.into();
15217            self
15218        }
15219
15220        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
15221        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15222            self.0.request.filter = v.into();
15223            self
15224        }
15225
15226        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
15227        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15228            self.0.request.page_size = v.into();
15229            self
15230        }
15231
15232        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
15233        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15234            self.0.request.page_token = v.into();
15235            self
15236        }
15237    }
15238
15239    #[doc(hidden)]
15240    impl crate::RequestBuilder for ListLocations {
15241        fn request_options(&mut self) -> &mut crate::RequestOptions {
15242            &mut self.0.options
15243        }
15244    }
15245
15246    /// The request builder for [GeneratorEvaluations::get_location][crate::client::GeneratorEvaluations::get_location] calls.
15247    ///
15248    /// # Example
15249    /// ```
15250    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetLocation;
15251    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15252    ///
15253    /// let builder = prepare_request_builder();
15254    /// let response = builder.send().await?;
15255    /// # Ok(()) }
15256    ///
15257    /// fn prepare_request_builder() -> GetLocation {
15258    ///   # panic!();
15259    ///   // ... details omitted ...
15260    /// }
15261    /// ```
15262    #[derive(Clone, Debug)]
15263    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15264
15265    impl GetLocation {
15266        pub(crate) fn new(
15267            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15268        ) -> Self {
15269            Self(RequestBuilder::new(stub))
15270        }
15271
15272        /// Sets the full request, replacing any prior values.
15273        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15274            mut self,
15275            v: V,
15276        ) -> Self {
15277            self.0.request = v.into();
15278            self
15279        }
15280
15281        /// Sets all the options, replacing any prior values.
15282        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15283            self.0.options = v.into();
15284            self
15285        }
15286
15287        /// Sends the request.
15288        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15289            (*self.0.stub)
15290                .get_location(self.0.request, self.0.options)
15291                .await
15292                .map(crate::Response::into_body)
15293        }
15294
15295        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
15296        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15297            self.0.request.name = v.into();
15298            self
15299        }
15300    }
15301
15302    #[doc(hidden)]
15303    impl crate::RequestBuilder for GetLocation {
15304        fn request_options(&mut self) -> &mut crate::RequestOptions {
15305            &mut self.0.options
15306        }
15307    }
15308
15309    /// The request builder for [GeneratorEvaluations::list_operations][crate::client::GeneratorEvaluations::list_operations] calls.
15310    ///
15311    /// # Example
15312    /// ```
15313    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListOperations;
15314    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15315    /// use google_cloud_gax::paginator::ItemPaginator;
15316    ///
15317    /// let builder = prepare_request_builder();
15318    /// let mut items = builder.by_item();
15319    /// while let Some(result) = items.next().await {
15320    ///   let item = result?;
15321    /// }
15322    /// # Ok(()) }
15323    ///
15324    /// fn prepare_request_builder() -> ListOperations {
15325    ///   # panic!();
15326    ///   // ... details omitted ...
15327    /// }
15328    /// ```
15329    #[derive(Clone, Debug)]
15330    pub struct ListOperations(
15331        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15332    );
15333
15334    impl ListOperations {
15335        pub(crate) fn new(
15336            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15337        ) -> Self {
15338            Self(RequestBuilder::new(stub))
15339        }
15340
15341        /// Sets the full request, replacing any prior values.
15342        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15343            mut self,
15344            v: V,
15345        ) -> Self {
15346            self.0.request = v.into();
15347            self
15348        }
15349
15350        /// Sets all the options, replacing any prior values.
15351        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15352            self.0.options = v.into();
15353            self
15354        }
15355
15356        /// Sends the request.
15357        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15358            (*self.0.stub)
15359                .list_operations(self.0.request, self.0.options)
15360                .await
15361                .map(crate::Response::into_body)
15362        }
15363
15364        /// Streams each page in the collection.
15365        pub fn by_page(
15366            self,
15367        ) -> impl google_cloud_gax::paginator::Paginator<
15368            google_cloud_longrunning::model::ListOperationsResponse,
15369            crate::Error,
15370        > {
15371            use std::clone::Clone;
15372            let token = self.0.request.page_token.clone();
15373            let execute = move |token: String| {
15374                let mut builder = self.clone();
15375                builder.0.request = builder.0.request.set_page_token(token);
15376                builder.send()
15377            };
15378            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15379        }
15380
15381        /// Streams each item in the collection.
15382        pub fn by_item(
15383            self,
15384        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15385            google_cloud_longrunning::model::ListOperationsResponse,
15386            crate::Error,
15387        > {
15388            use google_cloud_gax::paginator::Paginator;
15389            self.by_page().items()
15390        }
15391
15392        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
15393        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15394            self.0.request.name = v.into();
15395            self
15396        }
15397
15398        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
15399        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15400            self.0.request.filter = v.into();
15401            self
15402        }
15403
15404        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
15405        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15406            self.0.request.page_size = v.into();
15407            self
15408        }
15409
15410        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
15411        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15412            self.0.request.page_token = v.into();
15413            self
15414        }
15415
15416        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
15417        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15418            self.0.request.return_partial_success = v.into();
15419            self
15420        }
15421    }
15422
15423    #[doc(hidden)]
15424    impl crate::RequestBuilder for ListOperations {
15425        fn request_options(&mut self) -> &mut crate::RequestOptions {
15426            &mut self.0.options
15427        }
15428    }
15429
15430    /// The request builder for [GeneratorEvaluations::get_operation][crate::client::GeneratorEvaluations::get_operation] calls.
15431    ///
15432    /// # Example
15433    /// ```
15434    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetOperation;
15435    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15436    ///
15437    /// let builder = prepare_request_builder();
15438    /// let response = builder.send().await?;
15439    /// # Ok(()) }
15440    ///
15441    /// fn prepare_request_builder() -> GetOperation {
15442    ///   # panic!();
15443    ///   // ... details omitted ...
15444    /// }
15445    /// ```
15446    #[derive(Clone, Debug)]
15447    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15448
15449    impl GetOperation {
15450        pub(crate) fn new(
15451            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15452        ) -> Self {
15453            Self(RequestBuilder::new(stub))
15454        }
15455
15456        /// Sets the full request, replacing any prior values.
15457        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15458            mut self,
15459            v: V,
15460        ) -> Self {
15461            self.0.request = v.into();
15462            self
15463        }
15464
15465        /// Sets all the options, replacing any prior values.
15466        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15467            self.0.options = v.into();
15468            self
15469        }
15470
15471        /// Sends the request.
15472        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15473            (*self.0.stub)
15474                .get_operation(self.0.request, self.0.options)
15475                .await
15476                .map(crate::Response::into_body)
15477        }
15478
15479        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
15480        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15481            self.0.request.name = v.into();
15482            self
15483        }
15484    }
15485
15486    #[doc(hidden)]
15487    impl crate::RequestBuilder for GetOperation {
15488        fn request_options(&mut self) -> &mut crate::RequestOptions {
15489            &mut self.0.options
15490        }
15491    }
15492
15493    /// The request builder for [GeneratorEvaluations::cancel_operation][crate::client::GeneratorEvaluations::cancel_operation] calls.
15494    ///
15495    /// # Example
15496    /// ```
15497    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::CancelOperation;
15498    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15499    ///
15500    /// let builder = prepare_request_builder();
15501    /// let response = builder.send().await?;
15502    /// # Ok(()) }
15503    ///
15504    /// fn prepare_request_builder() -> CancelOperation {
15505    ///   # panic!();
15506    ///   // ... details omitted ...
15507    /// }
15508    /// ```
15509    #[derive(Clone, Debug)]
15510    pub struct CancelOperation(
15511        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15512    );
15513
15514    impl CancelOperation {
15515        pub(crate) fn new(
15516            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15517        ) -> Self {
15518            Self(RequestBuilder::new(stub))
15519        }
15520
15521        /// Sets the full request, replacing any prior values.
15522        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15523            mut self,
15524            v: V,
15525        ) -> Self {
15526            self.0.request = v.into();
15527            self
15528        }
15529
15530        /// Sets all the options, replacing any prior values.
15531        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15532            self.0.options = v.into();
15533            self
15534        }
15535
15536        /// Sends the request.
15537        pub async fn send(self) -> Result<()> {
15538            (*self.0.stub)
15539                .cancel_operation(self.0.request, self.0.options)
15540                .await
15541                .map(crate::Response::into_body)
15542        }
15543
15544        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
15545        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15546            self.0.request.name = v.into();
15547            self
15548        }
15549    }
15550
15551    #[doc(hidden)]
15552    impl crate::RequestBuilder for CancelOperation {
15553        fn request_options(&mut self) -> &mut crate::RequestOptions {
15554            &mut self.0.options
15555        }
15556    }
15557}
15558
15559#[cfg(feature = "intents")]
15560#[cfg_attr(docsrs, doc(cfg(feature = "intents")))]
15561pub mod intents {
15562    use crate::Result;
15563
15564    /// A builder for [Intents][crate::client::Intents].
15565    ///
15566    /// ```
15567    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15568    /// # use google_cloud_dialogflow_v2::*;
15569    /// # use builder::intents::ClientBuilder;
15570    /// # use client::Intents;
15571    /// let builder : ClientBuilder = Intents::builder();
15572    /// let client = builder
15573    ///     .with_endpoint("https://dialogflow.googleapis.com")
15574    ///     .build().await?;
15575    /// # Ok(()) }
15576    /// ```
15577    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15578
15579    pub(crate) mod client {
15580        use super::super::super::client::Intents;
15581        pub struct Factory;
15582        impl crate::ClientFactory for Factory {
15583            type Client = Intents;
15584            type Credentials = gaxi::options::Credentials;
15585            async fn build(
15586                self,
15587                config: gaxi::options::ClientConfig,
15588            ) -> crate::ClientBuilderResult<Self::Client> {
15589                Self::Client::new(config).await
15590            }
15591        }
15592    }
15593
15594    /// Common implementation for [crate::client::Intents] request builders.
15595    #[derive(Clone, Debug)]
15596    pub(crate) struct RequestBuilder<R: std::default::Default> {
15597        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>,
15598        request: R,
15599        options: crate::RequestOptions,
15600    }
15601
15602    impl<R> RequestBuilder<R>
15603    where
15604        R: std::default::Default,
15605    {
15606        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15607            Self {
15608                stub,
15609                request: R::default(),
15610                options: crate::RequestOptions::default(),
15611            }
15612        }
15613    }
15614
15615    /// The request builder for [Intents::list_intents][crate::client::Intents::list_intents] calls.
15616    ///
15617    /// # Example
15618    /// ```
15619    /// # use google_cloud_dialogflow_v2::builder::intents::ListIntents;
15620    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15621    /// use google_cloud_gax::paginator::ItemPaginator;
15622    ///
15623    /// let builder = prepare_request_builder();
15624    /// let mut items = builder.by_item();
15625    /// while let Some(result) = items.next().await {
15626    ///   let item = result?;
15627    /// }
15628    /// # Ok(()) }
15629    ///
15630    /// fn prepare_request_builder() -> ListIntents {
15631    ///   # panic!();
15632    ///   // ... details omitted ...
15633    /// }
15634    /// ```
15635    #[derive(Clone, Debug)]
15636    pub struct ListIntents(RequestBuilder<crate::model::ListIntentsRequest>);
15637
15638    impl ListIntents {
15639        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15640            Self(RequestBuilder::new(stub))
15641        }
15642
15643        /// Sets the full request, replacing any prior values.
15644        pub fn with_request<V: Into<crate::model::ListIntentsRequest>>(mut self, v: V) -> Self {
15645            self.0.request = v.into();
15646            self
15647        }
15648
15649        /// Sets all the options, replacing any prior values.
15650        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15651            self.0.options = v.into();
15652            self
15653        }
15654
15655        /// Sends the request.
15656        pub async fn send(self) -> Result<crate::model::ListIntentsResponse> {
15657            (*self.0.stub)
15658                .list_intents(self.0.request, self.0.options)
15659                .await
15660                .map(crate::Response::into_body)
15661        }
15662
15663        /// Streams each page in the collection.
15664        pub fn by_page(
15665            self,
15666        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIntentsResponse, crate::Error>
15667        {
15668            use std::clone::Clone;
15669            let token = self.0.request.page_token.clone();
15670            let execute = move |token: String| {
15671                let mut builder = self.clone();
15672                builder.0.request = builder.0.request.set_page_token(token);
15673                builder.send()
15674            };
15675            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15676        }
15677
15678        /// Streams each item in the collection.
15679        pub fn by_item(
15680            self,
15681        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15682            crate::model::ListIntentsResponse,
15683            crate::Error,
15684        > {
15685            use google_cloud_gax::paginator::Paginator;
15686            self.by_page().items()
15687        }
15688
15689        /// Sets the value of [parent][crate::model::ListIntentsRequest::parent].
15690        ///
15691        /// This is a **required** field for requests.
15692        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15693            self.0.request.parent = v.into();
15694            self
15695        }
15696
15697        /// Sets the value of [language_code][crate::model::ListIntentsRequest::language_code].
15698        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15699            self.0.request.language_code = v.into();
15700            self
15701        }
15702
15703        /// Sets the value of [intent_view][crate::model::ListIntentsRequest::intent_view].
15704        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15705            self.0.request.intent_view = v.into();
15706            self
15707        }
15708
15709        /// Sets the value of [page_size][crate::model::ListIntentsRequest::page_size].
15710        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15711            self.0.request.page_size = v.into();
15712            self
15713        }
15714
15715        /// Sets the value of [page_token][crate::model::ListIntentsRequest::page_token].
15716        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15717            self.0.request.page_token = v.into();
15718            self
15719        }
15720    }
15721
15722    #[doc(hidden)]
15723    impl crate::RequestBuilder for ListIntents {
15724        fn request_options(&mut self) -> &mut crate::RequestOptions {
15725            &mut self.0.options
15726        }
15727    }
15728
15729    /// The request builder for [Intents::get_intent][crate::client::Intents::get_intent] calls.
15730    ///
15731    /// # Example
15732    /// ```
15733    /// # use google_cloud_dialogflow_v2::builder::intents::GetIntent;
15734    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15735    ///
15736    /// let builder = prepare_request_builder();
15737    /// let response = builder.send().await?;
15738    /// # Ok(()) }
15739    ///
15740    /// fn prepare_request_builder() -> GetIntent {
15741    ///   # panic!();
15742    ///   // ... details omitted ...
15743    /// }
15744    /// ```
15745    #[derive(Clone, Debug)]
15746    pub struct GetIntent(RequestBuilder<crate::model::GetIntentRequest>);
15747
15748    impl GetIntent {
15749        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15750            Self(RequestBuilder::new(stub))
15751        }
15752
15753        /// Sets the full request, replacing any prior values.
15754        pub fn with_request<V: Into<crate::model::GetIntentRequest>>(mut self, v: V) -> Self {
15755            self.0.request = v.into();
15756            self
15757        }
15758
15759        /// Sets all the options, replacing any prior values.
15760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15761            self.0.options = v.into();
15762            self
15763        }
15764
15765        /// Sends the request.
15766        pub async fn send(self) -> Result<crate::model::Intent> {
15767            (*self.0.stub)
15768                .get_intent(self.0.request, self.0.options)
15769                .await
15770                .map(crate::Response::into_body)
15771        }
15772
15773        /// Sets the value of [name][crate::model::GetIntentRequest::name].
15774        ///
15775        /// This is a **required** field for requests.
15776        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15777            self.0.request.name = v.into();
15778            self
15779        }
15780
15781        /// Sets the value of [language_code][crate::model::GetIntentRequest::language_code].
15782        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15783            self.0.request.language_code = v.into();
15784            self
15785        }
15786
15787        /// Sets the value of [intent_view][crate::model::GetIntentRequest::intent_view].
15788        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15789            self.0.request.intent_view = v.into();
15790            self
15791        }
15792    }
15793
15794    #[doc(hidden)]
15795    impl crate::RequestBuilder for GetIntent {
15796        fn request_options(&mut self) -> &mut crate::RequestOptions {
15797            &mut self.0.options
15798        }
15799    }
15800
15801    /// The request builder for [Intents::create_intent][crate::client::Intents::create_intent] calls.
15802    ///
15803    /// # Example
15804    /// ```
15805    /// # use google_cloud_dialogflow_v2::builder::intents::CreateIntent;
15806    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15807    ///
15808    /// let builder = prepare_request_builder();
15809    /// let response = builder.send().await?;
15810    /// # Ok(()) }
15811    ///
15812    /// fn prepare_request_builder() -> CreateIntent {
15813    ///   # panic!();
15814    ///   // ... details omitted ...
15815    /// }
15816    /// ```
15817    #[derive(Clone, Debug)]
15818    pub struct CreateIntent(RequestBuilder<crate::model::CreateIntentRequest>);
15819
15820    impl CreateIntent {
15821        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15822            Self(RequestBuilder::new(stub))
15823        }
15824
15825        /// Sets the full request, replacing any prior values.
15826        pub fn with_request<V: Into<crate::model::CreateIntentRequest>>(mut self, v: V) -> Self {
15827            self.0.request = v.into();
15828            self
15829        }
15830
15831        /// Sets all the options, replacing any prior values.
15832        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15833            self.0.options = v.into();
15834            self
15835        }
15836
15837        /// Sends the request.
15838        pub async fn send(self) -> Result<crate::model::Intent> {
15839            (*self.0.stub)
15840                .create_intent(self.0.request, self.0.options)
15841                .await
15842                .map(crate::Response::into_body)
15843        }
15844
15845        /// Sets the value of [parent][crate::model::CreateIntentRequest::parent].
15846        ///
15847        /// This is a **required** field for requests.
15848        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15849            self.0.request.parent = v.into();
15850            self
15851        }
15852
15853        /// Sets the value of [intent][crate::model::CreateIntentRequest::intent].
15854        ///
15855        /// This is a **required** field for requests.
15856        pub fn set_intent<T>(mut self, v: T) -> Self
15857        where
15858            T: std::convert::Into<crate::model::Intent>,
15859        {
15860            self.0.request.intent = std::option::Option::Some(v.into());
15861            self
15862        }
15863
15864        /// Sets or clears the value of [intent][crate::model::CreateIntentRequest::intent].
15865        ///
15866        /// This is a **required** field for requests.
15867        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
15868        where
15869            T: std::convert::Into<crate::model::Intent>,
15870        {
15871            self.0.request.intent = v.map(|x| x.into());
15872            self
15873        }
15874
15875        /// Sets the value of [language_code][crate::model::CreateIntentRequest::language_code].
15876        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15877            self.0.request.language_code = v.into();
15878            self
15879        }
15880
15881        /// Sets the value of [intent_view][crate::model::CreateIntentRequest::intent_view].
15882        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15883            self.0.request.intent_view = v.into();
15884            self
15885        }
15886    }
15887
15888    #[doc(hidden)]
15889    impl crate::RequestBuilder for CreateIntent {
15890        fn request_options(&mut self) -> &mut crate::RequestOptions {
15891            &mut self.0.options
15892        }
15893    }
15894
15895    /// The request builder for [Intents::update_intent][crate::client::Intents::update_intent] calls.
15896    ///
15897    /// # Example
15898    /// ```
15899    /// # use google_cloud_dialogflow_v2::builder::intents::UpdateIntent;
15900    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
15901    ///
15902    /// let builder = prepare_request_builder();
15903    /// let response = builder.send().await?;
15904    /// # Ok(()) }
15905    ///
15906    /// fn prepare_request_builder() -> UpdateIntent {
15907    ///   # panic!();
15908    ///   // ... details omitted ...
15909    /// }
15910    /// ```
15911    #[derive(Clone, Debug)]
15912    pub struct UpdateIntent(RequestBuilder<crate::model::UpdateIntentRequest>);
15913
15914    impl UpdateIntent {
15915        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15916            Self(RequestBuilder::new(stub))
15917        }
15918
15919        /// Sets the full request, replacing any prior values.
15920        pub fn with_request<V: Into<crate::model::UpdateIntentRequest>>(mut self, v: V) -> Self {
15921            self.0.request = v.into();
15922            self
15923        }
15924
15925        /// Sets all the options, replacing any prior values.
15926        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15927            self.0.options = v.into();
15928            self
15929        }
15930
15931        /// Sends the request.
15932        pub async fn send(self) -> Result<crate::model::Intent> {
15933            (*self.0.stub)
15934                .update_intent(self.0.request, self.0.options)
15935                .await
15936                .map(crate::Response::into_body)
15937        }
15938
15939        /// Sets the value of [intent][crate::model::UpdateIntentRequest::intent].
15940        ///
15941        /// This is a **required** field for requests.
15942        pub fn set_intent<T>(mut self, v: T) -> Self
15943        where
15944            T: std::convert::Into<crate::model::Intent>,
15945        {
15946            self.0.request.intent = std::option::Option::Some(v.into());
15947            self
15948        }
15949
15950        /// Sets or clears the value of [intent][crate::model::UpdateIntentRequest::intent].
15951        ///
15952        /// This is a **required** field for requests.
15953        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
15954        where
15955            T: std::convert::Into<crate::model::Intent>,
15956        {
15957            self.0.request.intent = v.map(|x| x.into());
15958            self
15959        }
15960
15961        /// Sets the value of [language_code][crate::model::UpdateIntentRequest::language_code].
15962        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15963            self.0.request.language_code = v.into();
15964            self
15965        }
15966
15967        /// Sets the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
15968        pub fn set_update_mask<T>(mut self, v: T) -> Self
15969        where
15970            T: std::convert::Into<wkt::FieldMask>,
15971        {
15972            self.0.request.update_mask = std::option::Option::Some(v.into());
15973            self
15974        }
15975
15976        /// Sets or clears the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
15977        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15978        where
15979            T: std::convert::Into<wkt::FieldMask>,
15980        {
15981            self.0.request.update_mask = v.map(|x| x.into());
15982            self
15983        }
15984
15985        /// Sets the value of [intent_view][crate::model::UpdateIntentRequest::intent_view].
15986        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15987            self.0.request.intent_view = v.into();
15988            self
15989        }
15990    }
15991
15992    #[doc(hidden)]
15993    impl crate::RequestBuilder for UpdateIntent {
15994        fn request_options(&mut self) -> &mut crate::RequestOptions {
15995            &mut self.0.options
15996        }
15997    }
15998
15999    /// The request builder for [Intents::delete_intent][crate::client::Intents::delete_intent] calls.
16000    ///
16001    /// # Example
16002    /// ```
16003    /// # use google_cloud_dialogflow_v2::builder::intents::DeleteIntent;
16004    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16005    ///
16006    /// let builder = prepare_request_builder();
16007    /// let response = builder.send().await?;
16008    /// # Ok(()) }
16009    ///
16010    /// fn prepare_request_builder() -> DeleteIntent {
16011    ///   # panic!();
16012    ///   // ... details omitted ...
16013    /// }
16014    /// ```
16015    #[derive(Clone, Debug)]
16016    pub struct DeleteIntent(RequestBuilder<crate::model::DeleteIntentRequest>);
16017
16018    impl DeleteIntent {
16019        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16020            Self(RequestBuilder::new(stub))
16021        }
16022
16023        /// Sets the full request, replacing any prior values.
16024        pub fn with_request<V: Into<crate::model::DeleteIntentRequest>>(mut self, v: V) -> Self {
16025            self.0.request = v.into();
16026            self
16027        }
16028
16029        /// Sets all the options, replacing any prior values.
16030        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16031            self.0.options = v.into();
16032            self
16033        }
16034
16035        /// Sends the request.
16036        pub async fn send(self) -> Result<()> {
16037            (*self.0.stub)
16038                .delete_intent(self.0.request, self.0.options)
16039                .await
16040                .map(crate::Response::into_body)
16041        }
16042
16043        /// Sets the value of [name][crate::model::DeleteIntentRequest::name].
16044        ///
16045        /// This is a **required** field for requests.
16046        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16047            self.0.request.name = v.into();
16048            self
16049        }
16050    }
16051
16052    #[doc(hidden)]
16053    impl crate::RequestBuilder for DeleteIntent {
16054        fn request_options(&mut self) -> &mut crate::RequestOptions {
16055            &mut self.0.options
16056        }
16057    }
16058
16059    /// The request builder for [Intents::batch_update_intents][crate::client::Intents::batch_update_intents] calls.
16060    ///
16061    /// # Example
16062    /// ```
16063    /// # use google_cloud_dialogflow_v2::builder::intents::BatchUpdateIntents;
16064    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16065    /// use google_cloud_lro::Poller;
16066    ///
16067    /// let builder = prepare_request_builder();
16068    /// let response = builder.poller().until_done().await?;
16069    /// # Ok(()) }
16070    ///
16071    /// fn prepare_request_builder() -> BatchUpdateIntents {
16072    ///   # panic!();
16073    ///   // ... details omitted ...
16074    /// }
16075    /// ```
16076    #[derive(Clone, Debug)]
16077    pub struct BatchUpdateIntents(RequestBuilder<crate::model::BatchUpdateIntentsRequest>);
16078
16079    impl BatchUpdateIntents {
16080        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16081            Self(RequestBuilder::new(stub))
16082        }
16083
16084        /// Sets the full request, replacing any prior values.
16085        pub fn with_request<V: Into<crate::model::BatchUpdateIntentsRequest>>(
16086            mut self,
16087            v: V,
16088        ) -> Self {
16089            self.0.request = v.into();
16090            self
16091        }
16092
16093        /// Sets all the options, replacing any prior values.
16094        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16095            self.0.options = v.into();
16096            self
16097        }
16098
16099        /// Sends the request.
16100        ///
16101        /// # Long running operations
16102        ///
16103        /// This starts, but does not poll, a longrunning operation. More information
16104        /// on [batch_update_intents][crate::client::Intents::batch_update_intents].
16105        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16106            (*self.0.stub)
16107                .batch_update_intents(self.0.request, self.0.options)
16108                .await
16109                .map(crate::Response::into_body)
16110        }
16111
16112        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_update_intents`.
16113        pub fn poller(
16114            self,
16115        ) -> impl google_cloud_lro::Poller<crate::model::BatchUpdateIntentsResponse, wkt::Struct>
16116        {
16117            type Operation = google_cloud_lro::internal::Operation<
16118                crate::model::BatchUpdateIntentsResponse,
16119                wkt::Struct,
16120            >;
16121            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16122            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16123
16124            let stub = self.0.stub.clone();
16125            let mut options = self.0.options.clone();
16126            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16127            let query = move |name| {
16128                let stub = stub.clone();
16129                let options = options.clone();
16130                async {
16131                    let op = GetOperation::new(stub)
16132                        .set_name(name)
16133                        .with_options(options)
16134                        .send()
16135                        .await?;
16136                    Ok(Operation::new(op))
16137                }
16138            };
16139
16140            let start = move || async {
16141                let op = self.send().await?;
16142                Ok(Operation::new(op))
16143            };
16144
16145            google_cloud_lro::internal::new_poller(
16146                polling_error_policy,
16147                polling_backoff_policy,
16148                start,
16149                query,
16150            )
16151        }
16152
16153        /// Sets the value of [parent][crate::model::BatchUpdateIntentsRequest::parent].
16154        ///
16155        /// This is a **required** field for requests.
16156        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16157            self.0.request.parent = v.into();
16158            self
16159        }
16160
16161        /// Sets the value of [language_code][crate::model::BatchUpdateIntentsRequest::language_code].
16162        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16163            self.0.request.language_code = v.into();
16164            self
16165        }
16166
16167        /// Sets the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
16168        pub fn set_update_mask<T>(mut self, v: T) -> Self
16169        where
16170            T: std::convert::Into<wkt::FieldMask>,
16171        {
16172            self.0.request.update_mask = std::option::Option::Some(v.into());
16173            self
16174        }
16175
16176        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
16177        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16178        where
16179            T: std::convert::Into<wkt::FieldMask>,
16180        {
16181            self.0.request.update_mask = v.map(|x| x.into());
16182            self
16183        }
16184
16185        /// Sets the value of [intent_view][crate::model::BatchUpdateIntentsRequest::intent_view].
16186        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16187            self.0.request.intent_view = v.into();
16188            self
16189        }
16190
16191        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch].
16192        ///
16193        /// Note that all the setters affecting `intent_batch` are
16194        /// mutually exclusive.
16195        pub fn set_intent_batch<
16196            T: Into<Option<crate::model::batch_update_intents_request::IntentBatch>>,
16197        >(
16198            mut self,
16199            v: T,
16200        ) -> Self {
16201            self.0.request.intent_batch = v.into();
16202            self
16203        }
16204
16205        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
16206        /// to hold a `IntentBatchUri`.
16207        ///
16208        /// Note that all the setters affecting `intent_batch` are
16209        /// mutually exclusive.
16210        pub fn set_intent_batch_uri<T: std::convert::Into<std::string::String>>(
16211            mut self,
16212            v: T,
16213        ) -> Self {
16214            self.0.request = self.0.request.set_intent_batch_uri(v);
16215            self
16216        }
16217
16218        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
16219        /// to hold a `IntentBatchInline`.
16220        ///
16221        /// Note that all the setters affecting `intent_batch` are
16222        /// mutually exclusive.
16223        pub fn set_intent_batch_inline<
16224            T: std::convert::Into<std::boxed::Box<crate::model::IntentBatch>>,
16225        >(
16226            mut self,
16227            v: T,
16228        ) -> Self {
16229            self.0.request = self.0.request.set_intent_batch_inline(v);
16230            self
16231        }
16232    }
16233
16234    #[doc(hidden)]
16235    impl crate::RequestBuilder for BatchUpdateIntents {
16236        fn request_options(&mut self) -> &mut crate::RequestOptions {
16237            &mut self.0.options
16238        }
16239    }
16240
16241    /// The request builder for [Intents::batch_delete_intents][crate::client::Intents::batch_delete_intents] calls.
16242    ///
16243    /// # Example
16244    /// ```
16245    /// # use google_cloud_dialogflow_v2::builder::intents::BatchDeleteIntents;
16246    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16247    /// use google_cloud_lro::Poller;
16248    ///
16249    /// let builder = prepare_request_builder();
16250    /// let response = builder.poller().until_done().await?;
16251    /// # Ok(()) }
16252    ///
16253    /// fn prepare_request_builder() -> BatchDeleteIntents {
16254    ///   # panic!();
16255    ///   // ... details omitted ...
16256    /// }
16257    /// ```
16258    #[derive(Clone, Debug)]
16259    pub struct BatchDeleteIntents(RequestBuilder<crate::model::BatchDeleteIntentsRequest>);
16260
16261    impl BatchDeleteIntents {
16262        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16263            Self(RequestBuilder::new(stub))
16264        }
16265
16266        /// Sets the full request, replacing any prior values.
16267        pub fn with_request<V: Into<crate::model::BatchDeleteIntentsRequest>>(
16268            mut self,
16269            v: V,
16270        ) -> Self {
16271            self.0.request = v.into();
16272            self
16273        }
16274
16275        /// Sets all the options, replacing any prior values.
16276        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16277            self.0.options = v.into();
16278            self
16279        }
16280
16281        /// Sends the request.
16282        ///
16283        /// # Long running operations
16284        ///
16285        /// This starts, but does not poll, a longrunning operation. More information
16286        /// on [batch_delete_intents][crate::client::Intents::batch_delete_intents].
16287        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16288            (*self.0.stub)
16289                .batch_delete_intents(self.0.request, self.0.options)
16290                .await
16291                .map(crate::Response::into_body)
16292        }
16293
16294        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_delete_intents`.
16295        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
16296            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
16297            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16298            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16299
16300            let stub = self.0.stub.clone();
16301            let mut options = self.0.options.clone();
16302            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16303            let query = move |name| {
16304                let stub = stub.clone();
16305                let options = options.clone();
16306                async {
16307                    let op = GetOperation::new(stub)
16308                        .set_name(name)
16309                        .with_options(options)
16310                        .send()
16311                        .await?;
16312                    Ok(Operation::new(op))
16313                }
16314            };
16315
16316            let start = move || async {
16317                let op = self.send().await?;
16318                Ok(Operation::new(op))
16319            };
16320
16321            google_cloud_lro::internal::new_unit_response_poller(
16322                polling_error_policy,
16323                polling_backoff_policy,
16324                start,
16325                query,
16326            )
16327        }
16328
16329        /// Sets the value of [parent][crate::model::BatchDeleteIntentsRequest::parent].
16330        ///
16331        /// This is a **required** field for requests.
16332        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16333            self.0.request.parent = v.into();
16334            self
16335        }
16336
16337        /// Sets the value of [intents][crate::model::BatchDeleteIntentsRequest::intents].
16338        ///
16339        /// This is a **required** field for requests.
16340        pub fn set_intents<T, V>(mut self, v: T) -> Self
16341        where
16342            T: std::iter::IntoIterator<Item = V>,
16343            V: std::convert::Into<crate::model::Intent>,
16344        {
16345            use std::iter::Iterator;
16346            self.0.request.intents = v.into_iter().map(|i| i.into()).collect();
16347            self
16348        }
16349    }
16350
16351    #[doc(hidden)]
16352    impl crate::RequestBuilder for BatchDeleteIntents {
16353        fn request_options(&mut self) -> &mut crate::RequestOptions {
16354            &mut self.0.options
16355        }
16356    }
16357
16358    /// The request builder for [Intents::list_locations][crate::client::Intents::list_locations] calls.
16359    ///
16360    /// # Example
16361    /// ```
16362    /// # use google_cloud_dialogflow_v2::builder::intents::ListLocations;
16363    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16364    /// use google_cloud_gax::paginator::ItemPaginator;
16365    ///
16366    /// let builder = prepare_request_builder();
16367    /// let mut items = builder.by_item();
16368    /// while let Some(result) = items.next().await {
16369    ///   let item = result?;
16370    /// }
16371    /// # Ok(()) }
16372    ///
16373    /// fn prepare_request_builder() -> ListLocations {
16374    ///   # panic!();
16375    ///   // ... details omitted ...
16376    /// }
16377    /// ```
16378    #[derive(Clone, Debug)]
16379    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
16380
16381    impl ListLocations {
16382        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16383            Self(RequestBuilder::new(stub))
16384        }
16385
16386        /// Sets the full request, replacing any prior values.
16387        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
16388            mut self,
16389            v: V,
16390        ) -> Self {
16391            self.0.request = v.into();
16392            self
16393        }
16394
16395        /// Sets all the options, replacing any prior values.
16396        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16397            self.0.options = v.into();
16398            self
16399        }
16400
16401        /// Sends the request.
16402        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
16403            (*self.0.stub)
16404                .list_locations(self.0.request, self.0.options)
16405                .await
16406                .map(crate::Response::into_body)
16407        }
16408
16409        /// Streams each page in the collection.
16410        pub fn by_page(
16411            self,
16412        ) -> impl google_cloud_gax::paginator::Paginator<
16413            google_cloud_location::model::ListLocationsResponse,
16414            crate::Error,
16415        > {
16416            use std::clone::Clone;
16417            let token = self.0.request.page_token.clone();
16418            let execute = move |token: String| {
16419                let mut builder = self.clone();
16420                builder.0.request = builder.0.request.set_page_token(token);
16421                builder.send()
16422            };
16423            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16424        }
16425
16426        /// Streams each item in the collection.
16427        pub fn by_item(
16428            self,
16429        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16430            google_cloud_location::model::ListLocationsResponse,
16431            crate::Error,
16432        > {
16433            use google_cloud_gax::paginator::Paginator;
16434            self.by_page().items()
16435        }
16436
16437        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
16438        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16439            self.0.request.name = v.into();
16440            self
16441        }
16442
16443        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
16444        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16445            self.0.request.filter = v.into();
16446            self
16447        }
16448
16449        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
16450        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16451            self.0.request.page_size = v.into();
16452            self
16453        }
16454
16455        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
16456        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16457            self.0.request.page_token = v.into();
16458            self
16459        }
16460    }
16461
16462    #[doc(hidden)]
16463    impl crate::RequestBuilder for ListLocations {
16464        fn request_options(&mut self) -> &mut crate::RequestOptions {
16465            &mut self.0.options
16466        }
16467    }
16468
16469    /// The request builder for [Intents::get_location][crate::client::Intents::get_location] calls.
16470    ///
16471    /// # Example
16472    /// ```
16473    /// # use google_cloud_dialogflow_v2::builder::intents::GetLocation;
16474    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16475    ///
16476    /// let builder = prepare_request_builder();
16477    /// let response = builder.send().await?;
16478    /// # Ok(()) }
16479    ///
16480    /// fn prepare_request_builder() -> GetLocation {
16481    ///   # panic!();
16482    ///   // ... details omitted ...
16483    /// }
16484    /// ```
16485    #[derive(Clone, Debug)]
16486    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
16487
16488    impl GetLocation {
16489        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16490            Self(RequestBuilder::new(stub))
16491        }
16492
16493        /// Sets the full request, replacing any prior values.
16494        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
16495            mut self,
16496            v: V,
16497        ) -> Self {
16498            self.0.request = v.into();
16499            self
16500        }
16501
16502        /// Sets all the options, replacing any prior values.
16503        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16504            self.0.options = v.into();
16505            self
16506        }
16507
16508        /// Sends the request.
16509        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
16510            (*self.0.stub)
16511                .get_location(self.0.request, self.0.options)
16512                .await
16513                .map(crate::Response::into_body)
16514        }
16515
16516        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
16517        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16518            self.0.request.name = v.into();
16519            self
16520        }
16521    }
16522
16523    #[doc(hidden)]
16524    impl crate::RequestBuilder for GetLocation {
16525        fn request_options(&mut self) -> &mut crate::RequestOptions {
16526            &mut self.0.options
16527        }
16528    }
16529
16530    /// The request builder for [Intents::list_operations][crate::client::Intents::list_operations] calls.
16531    ///
16532    /// # Example
16533    /// ```
16534    /// # use google_cloud_dialogflow_v2::builder::intents::ListOperations;
16535    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16536    /// use google_cloud_gax::paginator::ItemPaginator;
16537    ///
16538    /// let builder = prepare_request_builder();
16539    /// let mut items = builder.by_item();
16540    /// while let Some(result) = items.next().await {
16541    ///   let item = result?;
16542    /// }
16543    /// # Ok(()) }
16544    ///
16545    /// fn prepare_request_builder() -> ListOperations {
16546    ///   # panic!();
16547    ///   // ... details omitted ...
16548    /// }
16549    /// ```
16550    #[derive(Clone, Debug)]
16551    pub struct ListOperations(
16552        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
16553    );
16554
16555    impl ListOperations {
16556        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16557            Self(RequestBuilder::new(stub))
16558        }
16559
16560        /// Sets the full request, replacing any prior values.
16561        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
16562            mut self,
16563            v: V,
16564        ) -> Self {
16565            self.0.request = v.into();
16566            self
16567        }
16568
16569        /// Sets all the options, replacing any prior values.
16570        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16571            self.0.options = v.into();
16572            self
16573        }
16574
16575        /// Sends the request.
16576        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
16577            (*self.0.stub)
16578                .list_operations(self.0.request, self.0.options)
16579                .await
16580                .map(crate::Response::into_body)
16581        }
16582
16583        /// Streams each page in the collection.
16584        pub fn by_page(
16585            self,
16586        ) -> impl google_cloud_gax::paginator::Paginator<
16587            google_cloud_longrunning::model::ListOperationsResponse,
16588            crate::Error,
16589        > {
16590            use std::clone::Clone;
16591            let token = self.0.request.page_token.clone();
16592            let execute = move |token: String| {
16593                let mut builder = self.clone();
16594                builder.0.request = builder.0.request.set_page_token(token);
16595                builder.send()
16596            };
16597            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16598        }
16599
16600        /// Streams each item in the collection.
16601        pub fn by_item(
16602            self,
16603        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16604            google_cloud_longrunning::model::ListOperationsResponse,
16605            crate::Error,
16606        > {
16607            use google_cloud_gax::paginator::Paginator;
16608            self.by_page().items()
16609        }
16610
16611        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
16612        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16613            self.0.request.name = v.into();
16614            self
16615        }
16616
16617        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
16618        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16619            self.0.request.filter = v.into();
16620            self
16621        }
16622
16623        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
16624        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16625            self.0.request.page_size = v.into();
16626            self
16627        }
16628
16629        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
16630        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16631            self.0.request.page_token = v.into();
16632            self
16633        }
16634
16635        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
16636        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16637            self.0.request.return_partial_success = v.into();
16638            self
16639        }
16640    }
16641
16642    #[doc(hidden)]
16643    impl crate::RequestBuilder for ListOperations {
16644        fn request_options(&mut self) -> &mut crate::RequestOptions {
16645            &mut self.0.options
16646        }
16647    }
16648
16649    /// The request builder for [Intents::get_operation][crate::client::Intents::get_operation] calls.
16650    ///
16651    /// # Example
16652    /// ```
16653    /// # use google_cloud_dialogflow_v2::builder::intents::GetOperation;
16654    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16655    ///
16656    /// let builder = prepare_request_builder();
16657    /// let response = builder.send().await?;
16658    /// # Ok(()) }
16659    ///
16660    /// fn prepare_request_builder() -> GetOperation {
16661    ///   # panic!();
16662    ///   // ... details omitted ...
16663    /// }
16664    /// ```
16665    #[derive(Clone, Debug)]
16666    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
16667
16668    impl GetOperation {
16669        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16670            Self(RequestBuilder::new(stub))
16671        }
16672
16673        /// Sets the full request, replacing any prior values.
16674        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
16675            mut self,
16676            v: V,
16677        ) -> Self {
16678            self.0.request = v.into();
16679            self
16680        }
16681
16682        /// Sets all the options, replacing any prior values.
16683        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16684            self.0.options = v.into();
16685            self
16686        }
16687
16688        /// Sends the request.
16689        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16690            (*self.0.stub)
16691                .get_operation(self.0.request, self.0.options)
16692                .await
16693                .map(crate::Response::into_body)
16694        }
16695
16696        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
16697        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16698            self.0.request.name = v.into();
16699            self
16700        }
16701    }
16702
16703    #[doc(hidden)]
16704    impl crate::RequestBuilder for GetOperation {
16705        fn request_options(&mut self) -> &mut crate::RequestOptions {
16706            &mut self.0.options
16707        }
16708    }
16709
16710    /// The request builder for [Intents::cancel_operation][crate::client::Intents::cancel_operation] calls.
16711    ///
16712    /// # Example
16713    /// ```
16714    /// # use google_cloud_dialogflow_v2::builder::intents::CancelOperation;
16715    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16716    ///
16717    /// let builder = prepare_request_builder();
16718    /// let response = builder.send().await?;
16719    /// # Ok(()) }
16720    ///
16721    /// fn prepare_request_builder() -> CancelOperation {
16722    ///   # panic!();
16723    ///   // ... details omitted ...
16724    /// }
16725    /// ```
16726    #[derive(Clone, Debug)]
16727    pub struct CancelOperation(
16728        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
16729    );
16730
16731    impl CancelOperation {
16732        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16733            Self(RequestBuilder::new(stub))
16734        }
16735
16736        /// Sets the full request, replacing any prior values.
16737        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
16738            mut self,
16739            v: V,
16740        ) -> Self {
16741            self.0.request = v.into();
16742            self
16743        }
16744
16745        /// Sets all the options, replacing any prior values.
16746        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16747            self.0.options = v.into();
16748            self
16749        }
16750
16751        /// Sends the request.
16752        pub async fn send(self) -> Result<()> {
16753            (*self.0.stub)
16754                .cancel_operation(self.0.request, self.0.options)
16755                .await
16756                .map(crate::Response::into_body)
16757        }
16758
16759        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
16760        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16761            self.0.request.name = v.into();
16762            self
16763        }
16764    }
16765
16766    #[doc(hidden)]
16767    impl crate::RequestBuilder for CancelOperation {
16768        fn request_options(&mut self) -> &mut crate::RequestOptions {
16769            &mut self.0.options
16770        }
16771    }
16772}
16773
16774#[cfg(feature = "knowledge-bases")]
16775#[cfg_attr(docsrs, doc(cfg(feature = "knowledge-bases")))]
16776pub mod knowledge_bases {
16777    use crate::Result;
16778
16779    /// A builder for [KnowledgeBases][crate::client::KnowledgeBases].
16780    ///
16781    /// ```
16782    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16783    /// # use google_cloud_dialogflow_v2::*;
16784    /// # use builder::knowledge_bases::ClientBuilder;
16785    /// # use client::KnowledgeBases;
16786    /// let builder : ClientBuilder = KnowledgeBases::builder();
16787    /// let client = builder
16788    ///     .with_endpoint("https://dialogflow.googleapis.com")
16789    ///     .build().await?;
16790    /// # Ok(()) }
16791    /// ```
16792    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16793
16794    pub(crate) mod client {
16795        use super::super::super::client::KnowledgeBases;
16796        pub struct Factory;
16797        impl crate::ClientFactory for Factory {
16798            type Client = KnowledgeBases;
16799            type Credentials = gaxi::options::Credentials;
16800            async fn build(
16801                self,
16802                config: gaxi::options::ClientConfig,
16803            ) -> crate::ClientBuilderResult<Self::Client> {
16804                Self::Client::new(config).await
16805            }
16806        }
16807    }
16808
16809    /// Common implementation for [crate::client::KnowledgeBases] request builders.
16810    #[derive(Clone, Debug)]
16811    pub(crate) struct RequestBuilder<R: std::default::Default> {
16812        stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16813        request: R,
16814        options: crate::RequestOptions,
16815    }
16816
16817    impl<R> RequestBuilder<R>
16818    where
16819        R: std::default::Default,
16820    {
16821        pub(crate) fn new(
16822            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16823        ) -> Self {
16824            Self {
16825                stub,
16826                request: R::default(),
16827                options: crate::RequestOptions::default(),
16828            }
16829        }
16830    }
16831
16832    /// The request builder for [KnowledgeBases::list_knowledge_bases][crate::client::KnowledgeBases::list_knowledge_bases] calls.
16833    ///
16834    /// # Example
16835    /// ```
16836    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListKnowledgeBases;
16837    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16838    /// use google_cloud_gax::paginator::ItemPaginator;
16839    ///
16840    /// let builder = prepare_request_builder();
16841    /// let mut items = builder.by_item();
16842    /// while let Some(result) = items.next().await {
16843    ///   let item = result?;
16844    /// }
16845    /// # Ok(()) }
16846    ///
16847    /// fn prepare_request_builder() -> ListKnowledgeBases {
16848    ///   # panic!();
16849    ///   // ... details omitted ...
16850    /// }
16851    /// ```
16852    #[derive(Clone, Debug)]
16853    pub struct ListKnowledgeBases(RequestBuilder<crate::model::ListKnowledgeBasesRequest>);
16854
16855    impl ListKnowledgeBases {
16856        pub(crate) fn new(
16857            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16858        ) -> Self {
16859            Self(RequestBuilder::new(stub))
16860        }
16861
16862        /// Sets the full request, replacing any prior values.
16863        pub fn with_request<V: Into<crate::model::ListKnowledgeBasesRequest>>(
16864            mut self,
16865            v: V,
16866        ) -> Self {
16867            self.0.request = v.into();
16868            self
16869        }
16870
16871        /// Sets all the options, replacing any prior values.
16872        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16873            self.0.options = v.into();
16874            self
16875        }
16876
16877        /// Sends the request.
16878        pub async fn send(self) -> Result<crate::model::ListKnowledgeBasesResponse> {
16879            (*self.0.stub)
16880                .list_knowledge_bases(self.0.request, self.0.options)
16881                .await
16882                .map(crate::Response::into_body)
16883        }
16884
16885        /// Streams each page in the collection.
16886        pub fn by_page(
16887            self,
16888        ) -> impl google_cloud_gax::paginator::Paginator<
16889            crate::model::ListKnowledgeBasesResponse,
16890            crate::Error,
16891        > {
16892            use std::clone::Clone;
16893            let token = self.0.request.page_token.clone();
16894            let execute = move |token: String| {
16895                let mut builder = self.clone();
16896                builder.0.request = builder.0.request.set_page_token(token);
16897                builder.send()
16898            };
16899            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16900        }
16901
16902        /// Streams each item in the collection.
16903        pub fn by_item(
16904            self,
16905        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16906            crate::model::ListKnowledgeBasesResponse,
16907            crate::Error,
16908        > {
16909            use google_cloud_gax::paginator::Paginator;
16910            self.by_page().items()
16911        }
16912
16913        /// Sets the value of [parent][crate::model::ListKnowledgeBasesRequest::parent].
16914        ///
16915        /// This is a **required** field for requests.
16916        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16917            self.0.request.parent = v.into();
16918            self
16919        }
16920
16921        /// Sets the value of [page_size][crate::model::ListKnowledgeBasesRequest::page_size].
16922        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16923            self.0.request.page_size = v.into();
16924            self
16925        }
16926
16927        /// Sets the value of [page_token][crate::model::ListKnowledgeBasesRequest::page_token].
16928        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16929            self.0.request.page_token = v.into();
16930            self
16931        }
16932
16933        /// Sets the value of [filter][crate::model::ListKnowledgeBasesRequest::filter].
16934        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16935            self.0.request.filter = v.into();
16936            self
16937        }
16938    }
16939
16940    #[doc(hidden)]
16941    impl crate::RequestBuilder for ListKnowledgeBases {
16942        fn request_options(&mut self) -> &mut crate::RequestOptions {
16943            &mut self.0.options
16944        }
16945    }
16946
16947    /// The request builder for [KnowledgeBases::get_knowledge_base][crate::client::KnowledgeBases::get_knowledge_base] calls.
16948    ///
16949    /// # Example
16950    /// ```
16951    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetKnowledgeBase;
16952    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
16953    ///
16954    /// let builder = prepare_request_builder();
16955    /// let response = builder.send().await?;
16956    /// # Ok(()) }
16957    ///
16958    /// fn prepare_request_builder() -> GetKnowledgeBase {
16959    ///   # panic!();
16960    ///   // ... details omitted ...
16961    /// }
16962    /// ```
16963    #[derive(Clone, Debug)]
16964    pub struct GetKnowledgeBase(RequestBuilder<crate::model::GetKnowledgeBaseRequest>);
16965
16966    impl GetKnowledgeBase {
16967        pub(crate) fn new(
16968            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16969        ) -> Self {
16970            Self(RequestBuilder::new(stub))
16971        }
16972
16973        /// Sets the full request, replacing any prior values.
16974        pub fn with_request<V: Into<crate::model::GetKnowledgeBaseRequest>>(
16975            mut self,
16976            v: V,
16977        ) -> Self {
16978            self.0.request = v.into();
16979            self
16980        }
16981
16982        /// Sets all the options, replacing any prior values.
16983        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16984            self.0.options = v.into();
16985            self
16986        }
16987
16988        /// Sends the request.
16989        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
16990            (*self.0.stub)
16991                .get_knowledge_base(self.0.request, self.0.options)
16992                .await
16993                .map(crate::Response::into_body)
16994        }
16995
16996        /// Sets the value of [name][crate::model::GetKnowledgeBaseRequest::name].
16997        ///
16998        /// This is a **required** field for requests.
16999        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17000            self.0.request.name = v.into();
17001            self
17002        }
17003    }
17004
17005    #[doc(hidden)]
17006    impl crate::RequestBuilder for GetKnowledgeBase {
17007        fn request_options(&mut self) -> &mut crate::RequestOptions {
17008            &mut self.0.options
17009        }
17010    }
17011
17012    /// The request builder for [KnowledgeBases::create_knowledge_base][crate::client::KnowledgeBases::create_knowledge_base] calls.
17013    ///
17014    /// # Example
17015    /// ```
17016    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::CreateKnowledgeBase;
17017    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17018    ///
17019    /// let builder = prepare_request_builder();
17020    /// let response = builder.send().await?;
17021    /// # Ok(()) }
17022    ///
17023    /// fn prepare_request_builder() -> CreateKnowledgeBase {
17024    ///   # panic!();
17025    ///   // ... details omitted ...
17026    /// }
17027    /// ```
17028    #[derive(Clone, Debug)]
17029    pub struct CreateKnowledgeBase(RequestBuilder<crate::model::CreateKnowledgeBaseRequest>);
17030
17031    impl CreateKnowledgeBase {
17032        pub(crate) fn new(
17033            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17034        ) -> Self {
17035            Self(RequestBuilder::new(stub))
17036        }
17037
17038        /// Sets the full request, replacing any prior values.
17039        pub fn with_request<V: Into<crate::model::CreateKnowledgeBaseRequest>>(
17040            mut self,
17041            v: V,
17042        ) -> Self {
17043            self.0.request = v.into();
17044            self
17045        }
17046
17047        /// Sets all the options, replacing any prior values.
17048        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17049            self.0.options = v.into();
17050            self
17051        }
17052
17053        /// Sends the request.
17054        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17055            (*self.0.stub)
17056                .create_knowledge_base(self.0.request, self.0.options)
17057                .await
17058                .map(crate::Response::into_body)
17059        }
17060
17061        /// Sets the value of [parent][crate::model::CreateKnowledgeBaseRequest::parent].
17062        ///
17063        /// This is a **required** field for requests.
17064        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17065            self.0.request.parent = v.into();
17066            self
17067        }
17068
17069        /// Sets the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
17070        ///
17071        /// This is a **required** field for requests.
17072        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
17073        where
17074            T: std::convert::Into<crate::model::KnowledgeBase>,
17075        {
17076            self.0.request.knowledge_base = std::option::Option::Some(v.into());
17077            self
17078        }
17079
17080        /// Sets or clears the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
17081        ///
17082        /// This is a **required** field for requests.
17083        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
17084        where
17085            T: std::convert::Into<crate::model::KnowledgeBase>,
17086        {
17087            self.0.request.knowledge_base = v.map(|x| x.into());
17088            self
17089        }
17090    }
17091
17092    #[doc(hidden)]
17093    impl crate::RequestBuilder for CreateKnowledgeBase {
17094        fn request_options(&mut self) -> &mut crate::RequestOptions {
17095            &mut self.0.options
17096        }
17097    }
17098
17099    /// The request builder for [KnowledgeBases::delete_knowledge_base][crate::client::KnowledgeBases::delete_knowledge_base] calls.
17100    ///
17101    /// # Example
17102    /// ```
17103    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::DeleteKnowledgeBase;
17104    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17105    ///
17106    /// let builder = prepare_request_builder();
17107    /// let response = builder.send().await?;
17108    /// # Ok(()) }
17109    ///
17110    /// fn prepare_request_builder() -> DeleteKnowledgeBase {
17111    ///   # panic!();
17112    ///   // ... details omitted ...
17113    /// }
17114    /// ```
17115    #[derive(Clone, Debug)]
17116    pub struct DeleteKnowledgeBase(RequestBuilder<crate::model::DeleteKnowledgeBaseRequest>);
17117
17118    impl DeleteKnowledgeBase {
17119        pub(crate) fn new(
17120            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17121        ) -> Self {
17122            Self(RequestBuilder::new(stub))
17123        }
17124
17125        /// Sets the full request, replacing any prior values.
17126        pub fn with_request<V: Into<crate::model::DeleteKnowledgeBaseRequest>>(
17127            mut self,
17128            v: V,
17129        ) -> Self {
17130            self.0.request = v.into();
17131            self
17132        }
17133
17134        /// Sets all the options, replacing any prior values.
17135        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17136            self.0.options = v.into();
17137            self
17138        }
17139
17140        /// Sends the request.
17141        pub async fn send(self) -> Result<()> {
17142            (*self.0.stub)
17143                .delete_knowledge_base(self.0.request, self.0.options)
17144                .await
17145                .map(crate::Response::into_body)
17146        }
17147
17148        /// Sets the value of [name][crate::model::DeleteKnowledgeBaseRequest::name].
17149        ///
17150        /// This is a **required** field for requests.
17151        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17152            self.0.request.name = v.into();
17153            self
17154        }
17155
17156        /// Sets the value of [force][crate::model::DeleteKnowledgeBaseRequest::force].
17157        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
17158            self.0.request.force = v.into();
17159            self
17160        }
17161    }
17162
17163    #[doc(hidden)]
17164    impl crate::RequestBuilder for DeleteKnowledgeBase {
17165        fn request_options(&mut self) -> &mut crate::RequestOptions {
17166            &mut self.0.options
17167        }
17168    }
17169
17170    /// The request builder for [KnowledgeBases::update_knowledge_base][crate::client::KnowledgeBases::update_knowledge_base] calls.
17171    ///
17172    /// # Example
17173    /// ```
17174    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::UpdateKnowledgeBase;
17175    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17176    ///
17177    /// let builder = prepare_request_builder();
17178    /// let response = builder.send().await?;
17179    /// # Ok(()) }
17180    ///
17181    /// fn prepare_request_builder() -> UpdateKnowledgeBase {
17182    ///   # panic!();
17183    ///   // ... details omitted ...
17184    /// }
17185    /// ```
17186    #[derive(Clone, Debug)]
17187    pub struct UpdateKnowledgeBase(RequestBuilder<crate::model::UpdateKnowledgeBaseRequest>);
17188
17189    impl UpdateKnowledgeBase {
17190        pub(crate) fn new(
17191            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17192        ) -> Self {
17193            Self(RequestBuilder::new(stub))
17194        }
17195
17196        /// Sets the full request, replacing any prior values.
17197        pub fn with_request<V: Into<crate::model::UpdateKnowledgeBaseRequest>>(
17198            mut self,
17199            v: V,
17200        ) -> Self {
17201            self.0.request = v.into();
17202            self
17203        }
17204
17205        /// Sets all the options, replacing any prior values.
17206        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17207            self.0.options = v.into();
17208            self
17209        }
17210
17211        /// Sends the request.
17212        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17213            (*self.0.stub)
17214                .update_knowledge_base(self.0.request, self.0.options)
17215                .await
17216                .map(crate::Response::into_body)
17217        }
17218
17219        /// Sets the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
17220        ///
17221        /// This is a **required** field for requests.
17222        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
17223        where
17224            T: std::convert::Into<crate::model::KnowledgeBase>,
17225        {
17226            self.0.request.knowledge_base = std::option::Option::Some(v.into());
17227            self
17228        }
17229
17230        /// Sets or clears the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
17231        ///
17232        /// This is a **required** field for requests.
17233        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
17234        where
17235            T: std::convert::Into<crate::model::KnowledgeBase>,
17236        {
17237            self.0.request.knowledge_base = v.map(|x| x.into());
17238            self
17239        }
17240
17241        /// Sets the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
17242        pub fn set_update_mask<T>(mut self, v: T) -> Self
17243        where
17244            T: std::convert::Into<wkt::FieldMask>,
17245        {
17246            self.0.request.update_mask = std::option::Option::Some(v.into());
17247            self
17248        }
17249
17250        /// Sets or clears the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
17251        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17252        where
17253            T: std::convert::Into<wkt::FieldMask>,
17254        {
17255            self.0.request.update_mask = v.map(|x| x.into());
17256            self
17257        }
17258    }
17259
17260    #[doc(hidden)]
17261    impl crate::RequestBuilder for UpdateKnowledgeBase {
17262        fn request_options(&mut self) -> &mut crate::RequestOptions {
17263            &mut self.0.options
17264        }
17265    }
17266
17267    /// The request builder for [KnowledgeBases::list_locations][crate::client::KnowledgeBases::list_locations] calls.
17268    ///
17269    /// # Example
17270    /// ```
17271    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListLocations;
17272    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17273    /// use google_cloud_gax::paginator::ItemPaginator;
17274    ///
17275    /// let builder = prepare_request_builder();
17276    /// let mut items = builder.by_item();
17277    /// while let Some(result) = items.next().await {
17278    ///   let item = result?;
17279    /// }
17280    /// # Ok(()) }
17281    ///
17282    /// fn prepare_request_builder() -> ListLocations {
17283    ///   # panic!();
17284    ///   // ... details omitted ...
17285    /// }
17286    /// ```
17287    #[derive(Clone, Debug)]
17288    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
17289
17290    impl ListLocations {
17291        pub(crate) fn new(
17292            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17293        ) -> Self {
17294            Self(RequestBuilder::new(stub))
17295        }
17296
17297        /// Sets the full request, replacing any prior values.
17298        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
17299            mut self,
17300            v: V,
17301        ) -> Self {
17302            self.0.request = v.into();
17303            self
17304        }
17305
17306        /// Sets all the options, replacing any prior values.
17307        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17308            self.0.options = v.into();
17309            self
17310        }
17311
17312        /// Sends the request.
17313        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
17314            (*self.0.stub)
17315                .list_locations(self.0.request, self.0.options)
17316                .await
17317                .map(crate::Response::into_body)
17318        }
17319
17320        /// Streams each page in the collection.
17321        pub fn by_page(
17322            self,
17323        ) -> impl google_cloud_gax::paginator::Paginator<
17324            google_cloud_location::model::ListLocationsResponse,
17325            crate::Error,
17326        > {
17327            use std::clone::Clone;
17328            let token = self.0.request.page_token.clone();
17329            let execute = move |token: String| {
17330                let mut builder = self.clone();
17331                builder.0.request = builder.0.request.set_page_token(token);
17332                builder.send()
17333            };
17334            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17335        }
17336
17337        /// Streams each item in the collection.
17338        pub fn by_item(
17339            self,
17340        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17341            google_cloud_location::model::ListLocationsResponse,
17342            crate::Error,
17343        > {
17344            use google_cloud_gax::paginator::Paginator;
17345            self.by_page().items()
17346        }
17347
17348        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
17349        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17350            self.0.request.name = v.into();
17351            self
17352        }
17353
17354        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
17355        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17356            self.0.request.filter = v.into();
17357            self
17358        }
17359
17360        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
17361        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17362            self.0.request.page_size = v.into();
17363            self
17364        }
17365
17366        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
17367        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17368            self.0.request.page_token = v.into();
17369            self
17370        }
17371    }
17372
17373    #[doc(hidden)]
17374    impl crate::RequestBuilder for ListLocations {
17375        fn request_options(&mut self) -> &mut crate::RequestOptions {
17376            &mut self.0.options
17377        }
17378    }
17379
17380    /// The request builder for [KnowledgeBases::get_location][crate::client::KnowledgeBases::get_location] calls.
17381    ///
17382    /// # Example
17383    /// ```
17384    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetLocation;
17385    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17386    ///
17387    /// let builder = prepare_request_builder();
17388    /// let response = builder.send().await?;
17389    /// # Ok(()) }
17390    ///
17391    /// fn prepare_request_builder() -> GetLocation {
17392    ///   # panic!();
17393    ///   // ... details omitted ...
17394    /// }
17395    /// ```
17396    #[derive(Clone, Debug)]
17397    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
17398
17399    impl GetLocation {
17400        pub(crate) fn new(
17401            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17402        ) -> Self {
17403            Self(RequestBuilder::new(stub))
17404        }
17405
17406        /// Sets the full request, replacing any prior values.
17407        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
17408            mut self,
17409            v: V,
17410        ) -> Self {
17411            self.0.request = v.into();
17412            self
17413        }
17414
17415        /// Sets all the options, replacing any prior values.
17416        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17417            self.0.options = v.into();
17418            self
17419        }
17420
17421        /// Sends the request.
17422        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
17423            (*self.0.stub)
17424                .get_location(self.0.request, self.0.options)
17425                .await
17426                .map(crate::Response::into_body)
17427        }
17428
17429        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
17430        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17431            self.0.request.name = v.into();
17432            self
17433        }
17434    }
17435
17436    #[doc(hidden)]
17437    impl crate::RequestBuilder for GetLocation {
17438        fn request_options(&mut self) -> &mut crate::RequestOptions {
17439            &mut self.0.options
17440        }
17441    }
17442
17443    /// The request builder for [KnowledgeBases::list_operations][crate::client::KnowledgeBases::list_operations] calls.
17444    ///
17445    /// # Example
17446    /// ```
17447    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListOperations;
17448    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17449    /// use google_cloud_gax::paginator::ItemPaginator;
17450    ///
17451    /// let builder = prepare_request_builder();
17452    /// let mut items = builder.by_item();
17453    /// while let Some(result) = items.next().await {
17454    ///   let item = result?;
17455    /// }
17456    /// # Ok(()) }
17457    ///
17458    /// fn prepare_request_builder() -> ListOperations {
17459    ///   # panic!();
17460    ///   // ... details omitted ...
17461    /// }
17462    /// ```
17463    #[derive(Clone, Debug)]
17464    pub struct ListOperations(
17465        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
17466    );
17467
17468    impl ListOperations {
17469        pub(crate) fn new(
17470            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17471        ) -> Self {
17472            Self(RequestBuilder::new(stub))
17473        }
17474
17475        /// Sets the full request, replacing any prior values.
17476        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
17477            mut self,
17478            v: V,
17479        ) -> Self {
17480            self.0.request = v.into();
17481            self
17482        }
17483
17484        /// Sets all the options, replacing any prior values.
17485        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17486            self.0.options = v.into();
17487            self
17488        }
17489
17490        /// Sends the request.
17491        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
17492            (*self.0.stub)
17493                .list_operations(self.0.request, self.0.options)
17494                .await
17495                .map(crate::Response::into_body)
17496        }
17497
17498        /// Streams each page in the collection.
17499        pub fn by_page(
17500            self,
17501        ) -> impl google_cloud_gax::paginator::Paginator<
17502            google_cloud_longrunning::model::ListOperationsResponse,
17503            crate::Error,
17504        > {
17505            use std::clone::Clone;
17506            let token = self.0.request.page_token.clone();
17507            let execute = move |token: String| {
17508                let mut builder = self.clone();
17509                builder.0.request = builder.0.request.set_page_token(token);
17510                builder.send()
17511            };
17512            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17513        }
17514
17515        /// Streams each item in the collection.
17516        pub fn by_item(
17517            self,
17518        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17519            google_cloud_longrunning::model::ListOperationsResponse,
17520            crate::Error,
17521        > {
17522            use google_cloud_gax::paginator::Paginator;
17523            self.by_page().items()
17524        }
17525
17526        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
17527        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17528            self.0.request.name = v.into();
17529            self
17530        }
17531
17532        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
17533        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17534            self.0.request.filter = v.into();
17535            self
17536        }
17537
17538        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
17539        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17540            self.0.request.page_size = v.into();
17541            self
17542        }
17543
17544        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
17545        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17546            self.0.request.page_token = v.into();
17547            self
17548        }
17549
17550        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
17551        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17552            self.0.request.return_partial_success = v.into();
17553            self
17554        }
17555    }
17556
17557    #[doc(hidden)]
17558    impl crate::RequestBuilder for ListOperations {
17559        fn request_options(&mut self) -> &mut crate::RequestOptions {
17560            &mut self.0.options
17561        }
17562    }
17563
17564    /// The request builder for [KnowledgeBases::get_operation][crate::client::KnowledgeBases::get_operation] calls.
17565    ///
17566    /// # Example
17567    /// ```
17568    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetOperation;
17569    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17570    ///
17571    /// let builder = prepare_request_builder();
17572    /// let response = builder.send().await?;
17573    /// # Ok(()) }
17574    ///
17575    /// fn prepare_request_builder() -> GetOperation {
17576    ///   # panic!();
17577    ///   // ... details omitted ...
17578    /// }
17579    /// ```
17580    #[derive(Clone, Debug)]
17581    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17582
17583    impl GetOperation {
17584        pub(crate) fn new(
17585            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17586        ) -> Self {
17587            Self(RequestBuilder::new(stub))
17588        }
17589
17590        /// Sets the full request, replacing any prior values.
17591        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17592            mut self,
17593            v: V,
17594        ) -> Self {
17595            self.0.request = v.into();
17596            self
17597        }
17598
17599        /// Sets all the options, replacing any prior values.
17600        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17601            self.0.options = v.into();
17602            self
17603        }
17604
17605        /// Sends the request.
17606        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17607            (*self.0.stub)
17608                .get_operation(self.0.request, self.0.options)
17609                .await
17610                .map(crate::Response::into_body)
17611        }
17612
17613        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
17614        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17615            self.0.request.name = v.into();
17616            self
17617        }
17618    }
17619
17620    #[doc(hidden)]
17621    impl crate::RequestBuilder for GetOperation {
17622        fn request_options(&mut self) -> &mut crate::RequestOptions {
17623            &mut self.0.options
17624        }
17625    }
17626
17627    /// The request builder for [KnowledgeBases::cancel_operation][crate::client::KnowledgeBases::cancel_operation] calls.
17628    ///
17629    /// # Example
17630    /// ```
17631    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::CancelOperation;
17632    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17633    ///
17634    /// let builder = prepare_request_builder();
17635    /// let response = builder.send().await?;
17636    /// # Ok(()) }
17637    ///
17638    /// fn prepare_request_builder() -> CancelOperation {
17639    ///   # panic!();
17640    ///   // ... details omitted ...
17641    /// }
17642    /// ```
17643    #[derive(Clone, Debug)]
17644    pub struct CancelOperation(
17645        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17646    );
17647
17648    impl CancelOperation {
17649        pub(crate) fn new(
17650            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17651        ) -> Self {
17652            Self(RequestBuilder::new(stub))
17653        }
17654
17655        /// Sets the full request, replacing any prior values.
17656        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17657            mut self,
17658            v: V,
17659        ) -> Self {
17660            self.0.request = v.into();
17661            self
17662        }
17663
17664        /// Sets all the options, replacing any prior values.
17665        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17666            self.0.options = v.into();
17667            self
17668        }
17669
17670        /// Sends the request.
17671        pub async fn send(self) -> Result<()> {
17672            (*self.0.stub)
17673                .cancel_operation(self.0.request, self.0.options)
17674                .await
17675                .map(crate::Response::into_body)
17676        }
17677
17678        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
17679        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17680            self.0.request.name = v.into();
17681            self
17682        }
17683    }
17684
17685    #[doc(hidden)]
17686    impl crate::RequestBuilder for CancelOperation {
17687        fn request_options(&mut self) -> &mut crate::RequestOptions {
17688            &mut self.0.options
17689        }
17690    }
17691}
17692
17693#[cfg(feature = "participants")]
17694#[cfg_attr(docsrs, doc(cfg(feature = "participants")))]
17695pub mod participants {
17696    use crate::Result;
17697
17698    /// A builder for [Participants][crate::client::Participants].
17699    ///
17700    /// ```
17701    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17702    /// # use google_cloud_dialogflow_v2::*;
17703    /// # use builder::participants::ClientBuilder;
17704    /// # use client::Participants;
17705    /// let builder : ClientBuilder = Participants::builder();
17706    /// let client = builder
17707    ///     .with_endpoint("https://dialogflow.googleapis.com")
17708    ///     .build().await?;
17709    /// # Ok(()) }
17710    /// ```
17711    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17712
17713    pub(crate) mod client {
17714        use super::super::super::client::Participants;
17715        pub struct Factory;
17716        impl crate::ClientFactory for Factory {
17717            type Client = Participants;
17718            type Credentials = gaxi::options::Credentials;
17719            async fn build(
17720                self,
17721                config: gaxi::options::ClientConfig,
17722            ) -> crate::ClientBuilderResult<Self::Client> {
17723                Self::Client::new(config).await
17724            }
17725        }
17726    }
17727
17728    /// Common implementation for [crate::client::Participants] request builders.
17729    #[derive(Clone, Debug)]
17730    pub(crate) struct RequestBuilder<R: std::default::Default> {
17731        stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17732        request: R,
17733        options: crate::RequestOptions,
17734    }
17735
17736    impl<R> RequestBuilder<R>
17737    where
17738        R: std::default::Default,
17739    {
17740        pub(crate) fn new(
17741            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17742        ) -> Self {
17743            Self {
17744                stub,
17745                request: R::default(),
17746                options: crate::RequestOptions::default(),
17747            }
17748        }
17749    }
17750
17751    /// The request builder for [Participants::create_participant][crate::client::Participants::create_participant] calls.
17752    ///
17753    /// # Example
17754    /// ```
17755    /// # use google_cloud_dialogflow_v2::builder::participants::CreateParticipant;
17756    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17757    ///
17758    /// let builder = prepare_request_builder();
17759    /// let response = builder.send().await?;
17760    /// # Ok(()) }
17761    ///
17762    /// fn prepare_request_builder() -> CreateParticipant {
17763    ///   # panic!();
17764    ///   // ... details omitted ...
17765    /// }
17766    /// ```
17767    #[derive(Clone, Debug)]
17768    pub struct CreateParticipant(RequestBuilder<crate::model::CreateParticipantRequest>);
17769
17770    impl CreateParticipant {
17771        pub(crate) fn new(
17772            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17773        ) -> Self {
17774            Self(RequestBuilder::new(stub))
17775        }
17776
17777        /// Sets the full request, replacing any prior values.
17778        pub fn with_request<V: Into<crate::model::CreateParticipantRequest>>(
17779            mut self,
17780            v: V,
17781        ) -> Self {
17782            self.0.request = v.into();
17783            self
17784        }
17785
17786        /// Sets all the options, replacing any prior values.
17787        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17788            self.0.options = v.into();
17789            self
17790        }
17791
17792        /// Sends the request.
17793        pub async fn send(self) -> Result<crate::model::Participant> {
17794            (*self.0.stub)
17795                .create_participant(self.0.request, self.0.options)
17796                .await
17797                .map(crate::Response::into_body)
17798        }
17799
17800        /// Sets the value of [parent][crate::model::CreateParticipantRequest::parent].
17801        ///
17802        /// This is a **required** field for requests.
17803        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17804            self.0.request.parent = v.into();
17805            self
17806        }
17807
17808        /// Sets the value of [participant][crate::model::CreateParticipantRequest::participant].
17809        ///
17810        /// This is a **required** field for requests.
17811        pub fn set_participant<T>(mut self, v: T) -> Self
17812        where
17813            T: std::convert::Into<crate::model::Participant>,
17814        {
17815            self.0.request.participant = std::option::Option::Some(v.into());
17816            self
17817        }
17818
17819        /// Sets or clears the value of [participant][crate::model::CreateParticipantRequest::participant].
17820        ///
17821        /// This is a **required** field for requests.
17822        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
17823        where
17824            T: std::convert::Into<crate::model::Participant>,
17825        {
17826            self.0.request.participant = v.map(|x| x.into());
17827            self
17828        }
17829    }
17830
17831    #[doc(hidden)]
17832    impl crate::RequestBuilder for CreateParticipant {
17833        fn request_options(&mut self) -> &mut crate::RequestOptions {
17834            &mut self.0.options
17835        }
17836    }
17837
17838    /// The request builder for [Participants::get_participant][crate::client::Participants::get_participant] calls.
17839    ///
17840    /// # Example
17841    /// ```
17842    /// # use google_cloud_dialogflow_v2::builder::participants::GetParticipant;
17843    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17844    ///
17845    /// let builder = prepare_request_builder();
17846    /// let response = builder.send().await?;
17847    /// # Ok(()) }
17848    ///
17849    /// fn prepare_request_builder() -> GetParticipant {
17850    ///   # panic!();
17851    ///   // ... details omitted ...
17852    /// }
17853    /// ```
17854    #[derive(Clone, Debug)]
17855    pub struct GetParticipant(RequestBuilder<crate::model::GetParticipantRequest>);
17856
17857    impl GetParticipant {
17858        pub(crate) fn new(
17859            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17860        ) -> Self {
17861            Self(RequestBuilder::new(stub))
17862        }
17863
17864        /// Sets the full request, replacing any prior values.
17865        pub fn with_request<V: Into<crate::model::GetParticipantRequest>>(mut self, v: V) -> Self {
17866            self.0.request = v.into();
17867            self
17868        }
17869
17870        /// Sets all the options, replacing any prior values.
17871        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17872            self.0.options = v.into();
17873            self
17874        }
17875
17876        /// Sends the request.
17877        pub async fn send(self) -> Result<crate::model::Participant> {
17878            (*self.0.stub)
17879                .get_participant(self.0.request, self.0.options)
17880                .await
17881                .map(crate::Response::into_body)
17882        }
17883
17884        /// Sets the value of [name][crate::model::GetParticipantRequest::name].
17885        ///
17886        /// This is a **required** field for requests.
17887        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17888            self.0.request.name = v.into();
17889            self
17890        }
17891    }
17892
17893    #[doc(hidden)]
17894    impl crate::RequestBuilder for GetParticipant {
17895        fn request_options(&mut self) -> &mut crate::RequestOptions {
17896            &mut self.0.options
17897        }
17898    }
17899
17900    /// The request builder for [Participants::list_participants][crate::client::Participants::list_participants] calls.
17901    ///
17902    /// # Example
17903    /// ```
17904    /// # use google_cloud_dialogflow_v2::builder::participants::ListParticipants;
17905    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
17906    /// use google_cloud_gax::paginator::ItemPaginator;
17907    ///
17908    /// let builder = prepare_request_builder();
17909    /// let mut items = builder.by_item();
17910    /// while let Some(result) = items.next().await {
17911    ///   let item = result?;
17912    /// }
17913    /// # Ok(()) }
17914    ///
17915    /// fn prepare_request_builder() -> ListParticipants {
17916    ///   # panic!();
17917    ///   // ... details omitted ...
17918    /// }
17919    /// ```
17920    #[derive(Clone, Debug)]
17921    pub struct ListParticipants(RequestBuilder<crate::model::ListParticipantsRequest>);
17922
17923    impl ListParticipants {
17924        pub(crate) fn new(
17925            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17926        ) -> Self {
17927            Self(RequestBuilder::new(stub))
17928        }
17929
17930        /// Sets the full request, replacing any prior values.
17931        pub fn with_request<V: Into<crate::model::ListParticipantsRequest>>(
17932            mut self,
17933            v: V,
17934        ) -> Self {
17935            self.0.request = v.into();
17936            self
17937        }
17938
17939        /// Sets all the options, replacing any prior values.
17940        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17941            self.0.options = v.into();
17942            self
17943        }
17944
17945        /// Sends the request.
17946        pub async fn send(self) -> Result<crate::model::ListParticipantsResponse> {
17947            (*self.0.stub)
17948                .list_participants(self.0.request, self.0.options)
17949                .await
17950                .map(crate::Response::into_body)
17951        }
17952
17953        /// Streams each page in the collection.
17954        pub fn by_page(
17955            self,
17956        ) -> impl google_cloud_gax::paginator::Paginator<
17957            crate::model::ListParticipantsResponse,
17958            crate::Error,
17959        > {
17960            use std::clone::Clone;
17961            let token = self.0.request.page_token.clone();
17962            let execute = move |token: String| {
17963                let mut builder = self.clone();
17964                builder.0.request = builder.0.request.set_page_token(token);
17965                builder.send()
17966            };
17967            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17968        }
17969
17970        /// Streams each item in the collection.
17971        pub fn by_item(
17972            self,
17973        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17974            crate::model::ListParticipantsResponse,
17975            crate::Error,
17976        > {
17977            use google_cloud_gax::paginator::Paginator;
17978            self.by_page().items()
17979        }
17980
17981        /// Sets the value of [parent][crate::model::ListParticipantsRequest::parent].
17982        ///
17983        /// This is a **required** field for requests.
17984        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17985            self.0.request.parent = v.into();
17986            self
17987        }
17988
17989        /// Sets the value of [page_size][crate::model::ListParticipantsRequest::page_size].
17990        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17991            self.0.request.page_size = v.into();
17992            self
17993        }
17994
17995        /// Sets the value of [page_token][crate::model::ListParticipantsRequest::page_token].
17996        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17997            self.0.request.page_token = v.into();
17998            self
17999        }
18000    }
18001
18002    #[doc(hidden)]
18003    impl crate::RequestBuilder for ListParticipants {
18004        fn request_options(&mut self) -> &mut crate::RequestOptions {
18005            &mut self.0.options
18006        }
18007    }
18008
18009    /// The request builder for [Participants::update_participant][crate::client::Participants::update_participant] calls.
18010    ///
18011    /// # Example
18012    /// ```
18013    /// # use google_cloud_dialogflow_v2::builder::participants::UpdateParticipant;
18014    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18015    ///
18016    /// let builder = prepare_request_builder();
18017    /// let response = builder.send().await?;
18018    /// # Ok(()) }
18019    ///
18020    /// fn prepare_request_builder() -> UpdateParticipant {
18021    ///   # panic!();
18022    ///   // ... details omitted ...
18023    /// }
18024    /// ```
18025    #[derive(Clone, Debug)]
18026    pub struct UpdateParticipant(RequestBuilder<crate::model::UpdateParticipantRequest>);
18027
18028    impl UpdateParticipant {
18029        pub(crate) fn new(
18030            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18031        ) -> Self {
18032            Self(RequestBuilder::new(stub))
18033        }
18034
18035        /// Sets the full request, replacing any prior values.
18036        pub fn with_request<V: Into<crate::model::UpdateParticipantRequest>>(
18037            mut self,
18038            v: V,
18039        ) -> Self {
18040            self.0.request = v.into();
18041            self
18042        }
18043
18044        /// Sets all the options, replacing any prior values.
18045        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18046            self.0.options = v.into();
18047            self
18048        }
18049
18050        /// Sends the request.
18051        pub async fn send(self) -> Result<crate::model::Participant> {
18052            (*self.0.stub)
18053                .update_participant(self.0.request, self.0.options)
18054                .await
18055                .map(crate::Response::into_body)
18056        }
18057
18058        /// Sets the value of [participant][crate::model::UpdateParticipantRequest::participant].
18059        ///
18060        /// This is a **required** field for requests.
18061        pub fn set_participant<T>(mut self, v: T) -> Self
18062        where
18063            T: std::convert::Into<crate::model::Participant>,
18064        {
18065            self.0.request.participant = std::option::Option::Some(v.into());
18066            self
18067        }
18068
18069        /// Sets or clears the value of [participant][crate::model::UpdateParticipantRequest::participant].
18070        ///
18071        /// This is a **required** field for requests.
18072        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
18073        where
18074            T: std::convert::Into<crate::model::Participant>,
18075        {
18076            self.0.request.participant = v.map(|x| x.into());
18077            self
18078        }
18079
18080        /// Sets the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
18081        ///
18082        /// This is a **required** field for requests.
18083        pub fn set_update_mask<T>(mut self, v: T) -> Self
18084        where
18085            T: std::convert::Into<wkt::FieldMask>,
18086        {
18087            self.0.request.update_mask = std::option::Option::Some(v.into());
18088            self
18089        }
18090
18091        /// Sets or clears the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
18092        ///
18093        /// This is a **required** field for requests.
18094        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18095        where
18096            T: std::convert::Into<wkt::FieldMask>,
18097        {
18098            self.0.request.update_mask = v.map(|x| x.into());
18099            self
18100        }
18101    }
18102
18103    #[doc(hidden)]
18104    impl crate::RequestBuilder for UpdateParticipant {
18105        fn request_options(&mut self) -> &mut crate::RequestOptions {
18106            &mut self.0.options
18107        }
18108    }
18109
18110    /// The request builder for [Participants::analyze_content][crate::client::Participants::analyze_content] calls.
18111    ///
18112    /// # Example
18113    /// ```
18114    /// # use google_cloud_dialogflow_v2::builder::participants::AnalyzeContent;
18115    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18116    ///
18117    /// let builder = prepare_request_builder();
18118    /// let response = builder.send().await?;
18119    /// # Ok(()) }
18120    ///
18121    /// fn prepare_request_builder() -> AnalyzeContent {
18122    ///   # panic!();
18123    ///   // ... details omitted ...
18124    /// }
18125    /// ```
18126    #[derive(Clone, Debug)]
18127    pub struct AnalyzeContent(RequestBuilder<crate::model::AnalyzeContentRequest>);
18128
18129    impl AnalyzeContent {
18130        pub(crate) fn new(
18131            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18132        ) -> Self {
18133            Self(RequestBuilder::new(stub))
18134        }
18135
18136        /// Sets the full request, replacing any prior values.
18137        pub fn with_request<V: Into<crate::model::AnalyzeContentRequest>>(mut self, v: V) -> Self {
18138            self.0.request = v.into();
18139            self
18140        }
18141
18142        /// Sets all the options, replacing any prior values.
18143        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18144            self.0.options = v.into();
18145            self
18146        }
18147
18148        /// Sends the request.
18149        pub async fn send(self) -> Result<crate::model::AnalyzeContentResponse> {
18150            (*self.0.stub)
18151                .analyze_content(self.0.request, self.0.options)
18152                .await
18153                .map(crate::Response::into_body)
18154        }
18155
18156        /// Sets the value of [participant][crate::model::AnalyzeContentRequest::participant].
18157        ///
18158        /// This is a **required** field for requests.
18159        pub fn set_participant<T: Into<std::string::String>>(mut self, v: T) -> Self {
18160            self.0.request.participant = v.into();
18161            self
18162        }
18163
18164        /// Sets the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
18165        pub fn set_reply_audio_config<T>(mut self, v: T) -> Self
18166        where
18167            T: std::convert::Into<crate::model::OutputAudioConfig>,
18168        {
18169            self.0.request.reply_audio_config = std::option::Option::Some(v.into());
18170            self
18171        }
18172
18173        /// Sets or clears the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
18174        pub fn set_or_clear_reply_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
18175        where
18176            T: std::convert::Into<crate::model::OutputAudioConfig>,
18177        {
18178            self.0.request.reply_audio_config = v.map(|x| x.into());
18179            self
18180        }
18181
18182        /// Sets the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
18183        pub fn set_query_params<T>(mut self, v: T) -> Self
18184        where
18185            T: std::convert::Into<crate::model::QueryParameters>,
18186        {
18187            self.0.request.query_params = std::option::Option::Some(v.into());
18188            self
18189        }
18190
18191        /// Sets or clears the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
18192        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18193        where
18194            T: std::convert::Into<crate::model::QueryParameters>,
18195        {
18196            self.0.request.query_params = v.map(|x| x.into());
18197            self
18198        }
18199
18200        /// Sets the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
18201        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18202        where
18203            T: std::convert::Into<crate::model::AssistQueryParameters>,
18204        {
18205            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18206            self
18207        }
18208
18209        /// Sets or clears the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
18210        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18211        where
18212            T: std::convert::Into<crate::model::AssistQueryParameters>,
18213        {
18214            self.0.request.assist_query_params = v.map(|x| x.into());
18215            self
18216        }
18217
18218        /// Sets the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
18219        pub fn set_cx_parameters<T>(mut self, v: T) -> Self
18220        where
18221            T: std::convert::Into<wkt::Struct>,
18222        {
18223            self.0.request.cx_parameters = std::option::Option::Some(v.into());
18224            self
18225        }
18226
18227        /// Sets or clears the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
18228        pub fn set_or_clear_cx_parameters<T>(mut self, v: std::option::Option<T>) -> Self
18229        where
18230            T: std::convert::Into<wkt::Struct>,
18231        {
18232            self.0.request.cx_parameters = v.map(|x| x.into());
18233            self
18234        }
18235
18236        /// Sets the value of [request_id][crate::model::AnalyzeContentRequest::request_id].
18237        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18238            self.0.request.request_id = v.into();
18239            self
18240        }
18241
18242        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input].
18243        ///
18244        /// Note that all the setters affecting `input` are
18245        /// mutually exclusive.
18246        pub fn set_input<T: Into<Option<crate::model::analyze_content_request::Input>>>(
18247            mut self,
18248            v: T,
18249        ) -> Self {
18250            self.0.request.input = v.into();
18251            self
18252        }
18253
18254        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18255        /// to hold a `TextInput`.
18256        ///
18257        /// Note that all the setters affecting `input` are
18258        /// mutually exclusive.
18259        pub fn set_text_input<T: std::convert::Into<std::boxed::Box<crate::model::TextInput>>>(
18260            mut self,
18261            v: T,
18262        ) -> Self {
18263            self.0.request = self.0.request.set_text_input(v);
18264            self
18265        }
18266
18267        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18268        /// to hold a `AudioInput`.
18269        ///
18270        /// Note that all the setters affecting `input` are
18271        /// mutually exclusive.
18272        pub fn set_audio_input<T: std::convert::Into<std::boxed::Box<crate::model::AudioInput>>>(
18273            mut self,
18274            v: T,
18275        ) -> Self {
18276            self.0.request = self.0.request.set_audio_input(v);
18277            self
18278        }
18279
18280        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18281        /// to hold a `EventInput`.
18282        ///
18283        /// Note that all the setters affecting `input` are
18284        /// mutually exclusive.
18285        pub fn set_event_input<T: std::convert::Into<std::boxed::Box<crate::model::EventInput>>>(
18286            mut self,
18287            v: T,
18288        ) -> Self {
18289            self.0.request = self.0.request.set_event_input(v);
18290            self
18291        }
18292
18293        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
18294        /// to hold a `SuggestionInput`.
18295        ///
18296        /// Note that all the setters affecting `input` are
18297        /// mutually exclusive.
18298        pub fn set_suggestion_input<
18299            T: std::convert::Into<std::boxed::Box<crate::model::SuggestionInput>>,
18300        >(
18301            mut self,
18302            v: T,
18303        ) -> Self {
18304            self.0.request = self.0.request.set_suggestion_input(v);
18305            self
18306        }
18307    }
18308
18309    #[doc(hidden)]
18310    impl crate::RequestBuilder for AnalyzeContent {
18311        fn request_options(&mut self) -> &mut crate::RequestOptions {
18312            &mut self.0.options
18313        }
18314    }
18315
18316    /// The request builder for [Participants::suggest_articles][crate::client::Participants::suggest_articles] calls.
18317    ///
18318    /// # Example
18319    /// ```
18320    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestArticles;
18321    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18322    ///
18323    /// let builder = prepare_request_builder();
18324    /// let response = builder.send().await?;
18325    /// # Ok(()) }
18326    ///
18327    /// fn prepare_request_builder() -> SuggestArticles {
18328    ///   # panic!();
18329    ///   // ... details omitted ...
18330    /// }
18331    /// ```
18332    #[derive(Clone, Debug)]
18333    pub struct SuggestArticles(RequestBuilder<crate::model::SuggestArticlesRequest>);
18334
18335    impl SuggestArticles {
18336        pub(crate) fn new(
18337            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18338        ) -> Self {
18339            Self(RequestBuilder::new(stub))
18340        }
18341
18342        /// Sets the full request, replacing any prior values.
18343        pub fn with_request<V: Into<crate::model::SuggestArticlesRequest>>(mut self, v: V) -> Self {
18344            self.0.request = v.into();
18345            self
18346        }
18347
18348        /// Sets all the options, replacing any prior values.
18349        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18350            self.0.options = v.into();
18351            self
18352        }
18353
18354        /// Sends the request.
18355        pub async fn send(self) -> Result<crate::model::SuggestArticlesResponse> {
18356            (*self.0.stub)
18357                .suggest_articles(self.0.request, self.0.options)
18358                .await
18359                .map(crate::Response::into_body)
18360        }
18361
18362        /// Sets the value of [parent][crate::model::SuggestArticlesRequest::parent].
18363        ///
18364        /// This is a **required** field for requests.
18365        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18366            self.0.request.parent = v.into();
18367            self
18368        }
18369
18370        /// Sets the value of [latest_message][crate::model::SuggestArticlesRequest::latest_message].
18371        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18372            self.0.request.latest_message = v.into();
18373            self
18374        }
18375
18376        /// Sets the value of [context_size][crate::model::SuggestArticlesRequest::context_size].
18377        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18378            self.0.request.context_size = v.into();
18379            self
18380        }
18381
18382        /// Sets the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
18383        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18384        where
18385            T: std::convert::Into<crate::model::AssistQueryParameters>,
18386        {
18387            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18388            self
18389        }
18390
18391        /// Sets or clears the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
18392        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18393        where
18394            T: std::convert::Into<crate::model::AssistQueryParameters>,
18395        {
18396            self.0.request.assist_query_params = v.map(|x| x.into());
18397            self
18398        }
18399    }
18400
18401    #[doc(hidden)]
18402    impl crate::RequestBuilder for SuggestArticles {
18403        fn request_options(&mut self) -> &mut crate::RequestOptions {
18404            &mut self.0.options
18405        }
18406    }
18407
18408    /// The request builder for [Participants::suggest_faq_answers][crate::client::Participants::suggest_faq_answers] calls.
18409    ///
18410    /// # Example
18411    /// ```
18412    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestFaqAnswers;
18413    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18414    ///
18415    /// let builder = prepare_request_builder();
18416    /// let response = builder.send().await?;
18417    /// # Ok(()) }
18418    ///
18419    /// fn prepare_request_builder() -> SuggestFaqAnswers {
18420    ///   # panic!();
18421    ///   // ... details omitted ...
18422    /// }
18423    /// ```
18424    #[derive(Clone, Debug)]
18425    pub struct SuggestFaqAnswers(RequestBuilder<crate::model::SuggestFaqAnswersRequest>);
18426
18427    impl SuggestFaqAnswers {
18428        pub(crate) fn new(
18429            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18430        ) -> Self {
18431            Self(RequestBuilder::new(stub))
18432        }
18433
18434        /// Sets the full request, replacing any prior values.
18435        pub fn with_request<V: Into<crate::model::SuggestFaqAnswersRequest>>(
18436            mut self,
18437            v: V,
18438        ) -> Self {
18439            self.0.request = v.into();
18440            self
18441        }
18442
18443        /// Sets all the options, replacing any prior values.
18444        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18445            self.0.options = v.into();
18446            self
18447        }
18448
18449        /// Sends the request.
18450        pub async fn send(self) -> Result<crate::model::SuggestFaqAnswersResponse> {
18451            (*self.0.stub)
18452                .suggest_faq_answers(self.0.request, self.0.options)
18453                .await
18454                .map(crate::Response::into_body)
18455        }
18456
18457        /// Sets the value of [parent][crate::model::SuggestFaqAnswersRequest::parent].
18458        ///
18459        /// This is a **required** field for requests.
18460        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18461            self.0.request.parent = v.into();
18462            self
18463        }
18464
18465        /// Sets the value of [latest_message][crate::model::SuggestFaqAnswersRequest::latest_message].
18466        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18467            self.0.request.latest_message = v.into();
18468            self
18469        }
18470
18471        /// Sets the value of [context_size][crate::model::SuggestFaqAnswersRequest::context_size].
18472        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18473            self.0.request.context_size = v.into();
18474            self
18475        }
18476
18477        /// Sets the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
18478        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18479        where
18480            T: std::convert::Into<crate::model::AssistQueryParameters>,
18481        {
18482            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18483            self
18484        }
18485
18486        /// Sets or clears the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
18487        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18488        where
18489            T: std::convert::Into<crate::model::AssistQueryParameters>,
18490        {
18491            self.0.request.assist_query_params = v.map(|x| x.into());
18492            self
18493        }
18494    }
18495
18496    #[doc(hidden)]
18497    impl crate::RequestBuilder for SuggestFaqAnswers {
18498        fn request_options(&mut self) -> &mut crate::RequestOptions {
18499            &mut self.0.options
18500        }
18501    }
18502
18503    /// The request builder for [Participants::suggest_smart_replies][crate::client::Participants::suggest_smart_replies] calls.
18504    ///
18505    /// # Example
18506    /// ```
18507    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestSmartReplies;
18508    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18509    ///
18510    /// let builder = prepare_request_builder();
18511    /// let response = builder.send().await?;
18512    /// # Ok(()) }
18513    ///
18514    /// fn prepare_request_builder() -> SuggestSmartReplies {
18515    ///   # panic!();
18516    ///   // ... details omitted ...
18517    /// }
18518    /// ```
18519    #[derive(Clone, Debug)]
18520    pub struct SuggestSmartReplies(RequestBuilder<crate::model::SuggestSmartRepliesRequest>);
18521
18522    impl SuggestSmartReplies {
18523        pub(crate) fn new(
18524            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18525        ) -> Self {
18526            Self(RequestBuilder::new(stub))
18527        }
18528
18529        /// Sets the full request, replacing any prior values.
18530        pub fn with_request<V: Into<crate::model::SuggestSmartRepliesRequest>>(
18531            mut self,
18532            v: V,
18533        ) -> Self {
18534            self.0.request = v.into();
18535            self
18536        }
18537
18538        /// Sets all the options, replacing any prior values.
18539        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18540            self.0.options = v.into();
18541            self
18542        }
18543
18544        /// Sends the request.
18545        pub async fn send(self) -> Result<crate::model::SuggestSmartRepliesResponse> {
18546            (*self.0.stub)
18547                .suggest_smart_replies(self.0.request, self.0.options)
18548                .await
18549                .map(crate::Response::into_body)
18550        }
18551
18552        /// Sets the value of [parent][crate::model::SuggestSmartRepliesRequest::parent].
18553        ///
18554        /// This is a **required** field for requests.
18555        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18556            self.0.request.parent = v.into();
18557            self
18558        }
18559
18560        /// Sets the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
18561        pub fn set_current_text_input<T>(mut self, v: T) -> Self
18562        where
18563            T: std::convert::Into<crate::model::TextInput>,
18564        {
18565            self.0.request.current_text_input = std::option::Option::Some(v.into());
18566            self
18567        }
18568
18569        /// Sets or clears the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
18570        pub fn set_or_clear_current_text_input<T>(mut self, v: std::option::Option<T>) -> Self
18571        where
18572            T: std::convert::Into<crate::model::TextInput>,
18573        {
18574            self.0.request.current_text_input = v.map(|x| x.into());
18575            self
18576        }
18577
18578        /// Sets the value of [latest_message][crate::model::SuggestSmartRepliesRequest::latest_message].
18579        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18580            self.0.request.latest_message = v.into();
18581            self
18582        }
18583
18584        /// Sets the value of [context_size][crate::model::SuggestSmartRepliesRequest::context_size].
18585        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18586            self.0.request.context_size = v.into();
18587            self
18588        }
18589    }
18590
18591    #[doc(hidden)]
18592    impl crate::RequestBuilder for SuggestSmartReplies {
18593        fn request_options(&mut self) -> &mut crate::RequestOptions {
18594            &mut self.0.options
18595        }
18596    }
18597
18598    /// The request builder for [Participants::suggest_knowledge_assist][crate::client::Participants::suggest_knowledge_assist] calls.
18599    ///
18600    /// # Example
18601    /// ```
18602    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestKnowledgeAssist;
18603    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18604    ///
18605    /// let builder = prepare_request_builder();
18606    /// let response = builder.send().await?;
18607    /// # Ok(()) }
18608    ///
18609    /// fn prepare_request_builder() -> SuggestKnowledgeAssist {
18610    ///   # panic!();
18611    ///   // ... details omitted ...
18612    /// }
18613    /// ```
18614    #[derive(Clone, Debug)]
18615    pub struct SuggestKnowledgeAssist(RequestBuilder<crate::model::SuggestKnowledgeAssistRequest>);
18616
18617    impl SuggestKnowledgeAssist {
18618        pub(crate) fn new(
18619            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18620        ) -> Self {
18621            Self(RequestBuilder::new(stub))
18622        }
18623
18624        /// Sets the full request, replacing any prior values.
18625        pub fn with_request<V: Into<crate::model::SuggestKnowledgeAssistRequest>>(
18626            mut self,
18627            v: V,
18628        ) -> Self {
18629            self.0.request = v.into();
18630            self
18631        }
18632
18633        /// Sets all the options, replacing any prior values.
18634        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18635            self.0.options = v.into();
18636            self
18637        }
18638
18639        /// Sends the request.
18640        pub async fn send(self) -> Result<crate::model::SuggestKnowledgeAssistResponse> {
18641            (*self.0.stub)
18642                .suggest_knowledge_assist(self.0.request, self.0.options)
18643                .await
18644                .map(crate::Response::into_body)
18645        }
18646
18647        /// Sets the value of [parent][crate::model::SuggestKnowledgeAssistRequest::parent].
18648        ///
18649        /// This is a **required** field for requests.
18650        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18651            self.0.request.parent = v.into();
18652            self
18653        }
18654
18655        /// Sets the value of [latest_message][crate::model::SuggestKnowledgeAssistRequest::latest_message].
18656        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18657            self.0.request.latest_message = v.into();
18658            self
18659        }
18660
18661        /// Sets the value of [context_size][crate::model::SuggestKnowledgeAssistRequest::context_size].
18662        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18663            self.0.request.context_size = v.into();
18664            self
18665        }
18666
18667        /// Sets the value of [previous_suggested_query][crate::model::SuggestKnowledgeAssistRequest::previous_suggested_query].
18668        pub fn set_previous_suggested_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
18669            self.0.request.previous_suggested_query = v.into();
18670            self
18671        }
18672    }
18673
18674    #[doc(hidden)]
18675    impl crate::RequestBuilder for SuggestKnowledgeAssist {
18676        fn request_options(&mut self) -> &mut crate::RequestOptions {
18677            &mut self.0.options
18678        }
18679    }
18680
18681    /// The request builder for [Participants::list_locations][crate::client::Participants::list_locations] calls.
18682    ///
18683    /// # Example
18684    /// ```
18685    /// # use google_cloud_dialogflow_v2::builder::participants::ListLocations;
18686    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18687    /// use google_cloud_gax::paginator::ItemPaginator;
18688    ///
18689    /// let builder = prepare_request_builder();
18690    /// let mut items = builder.by_item();
18691    /// while let Some(result) = items.next().await {
18692    ///   let item = result?;
18693    /// }
18694    /// # Ok(()) }
18695    ///
18696    /// fn prepare_request_builder() -> ListLocations {
18697    ///   # panic!();
18698    ///   // ... details omitted ...
18699    /// }
18700    /// ```
18701    #[derive(Clone, Debug)]
18702    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18703
18704    impl ListLocations {
18705        pub(crate) fn new(
18706            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18707        ) -> Self {
18708            Self(RequestBuilder::new(stub))
18709        }
18710
18711        /// Sets the full request, replacing any prior values.
18712        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18713            mut self,
18714            v: V,
18715        ) -> Self {
18716            self.0.request = v.into();
18717            self
18718        }
18719
18720        /// Sets all the options, replacing any prior values.
18721        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18722            self.0.options = v.into();
18723            self
18724        }
18725
18726        /// Sends the request.
18727        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
18728            (*self.0.stub)
18729                .list_locations(self.0.request, self.0.options)
18730                .await
18731                .map(crate::Response::into_body)
18732        }
18733
18734        /// Streams each page in the collection.
18735        pub fn by_page(
18736            self,
18737        ) -> impl google_cloud_gax::paginator::Paginator<
18738            google_cloud_location::model::ListLocationsResponse,
18739            crate::Error,
18740        > {
18741            use std::clone::Clone;
18742            let token = self.0.request.page_token.clone();
18743            let execute = move |token: String| {
18744                let mut builder = self.clone();
18745                builder.0.request = builder.0.request.set_page_token(token);
18746                builder.send()
18747            };
18748            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18749        }
18750
18751        /// Streams each item in the collection.
18752        pub fn by_item(
18753            self,
18754        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18755            google_cloud_location::model::ListLocationsResponse,
18756            crate::Error,
18757        > {
18758            use google_cloud_gax::paginator::Paginator;
18759            self.by_page().items()
18760        }
18761
18762        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
18763        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18764            self.0.request.name = v.into();
18765            self
18766        }
18767
18768        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
18769        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18770            self.0.request.filter = v.into();
18771            self
18772        }
18773
18774        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
18775        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18776            self.0.request.page_size = v.into();
18777            self
18778        }
18779
18780        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
18781        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18782            self.0.request.page_token = v.into();
18783            self
18784        }
18785    }
18786
18787    #[doc(hidden)]
18788    impl crate::RequestBuilder for ListLocations {
18789        fn request_options(&mut self) -> &mut crate::RequestOptions {
18790            &mut self.0.options
18791        }
18792    }
18793
18794    /// The request builder for [Participants::get_location][crate::client::Participants::get_location] calls.
18795    ///
18796    /// # Example
18797    /// ```
18798    /// # use google_cloud_dialogflow_v2::builder::participants::GetLocation;
18799    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18800    ///
18801    /// let builder = prepare_request_builder();
18802    /// let response = builder.send().await?;
18803    /// # Ok(()) }
18804    ///
18805    /// fn prepare_request_builder() -> GetLocation {
18806    ///   # panic!();
18807    ///   // ... details omitted ...
18808    /// }
18809    /// ```
18810    #[derive(Clone, Debug)]
18811    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
18812
18813    impl GetLocation {
18814        pub(crate) fn new(
18815            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18816        ) -> Self {
18817            Self(RequestBuilder::new(stub))
18818        }
18819
18820        /// Sets the full request, replacing any prior values.
18821        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
18822            mut self,
18823            v: V,
18824        ) -> Self {
18825            self.0.request = v.into();
18826            self
18827        }
18828
18829        /// Sets all the options, replacing any prior values.
18830        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18831            self.0.options = v.into();
18832            self
18833        }
18834
18835        /// Sends the request.
18836        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
18837            (*self.0.stub)
18838                .get_location(self.0.request, self.0.options)
18839                .await
18840                .map(crate::Response::into_body)
18841        }
18842
18843        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
18844        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18845            self.0.request.name = v.into();
18846            self
18847        }
18848    }
18849
18850    #[doc(hidden)]
18851    impl crate::RequestBuilder for GetLocation {
18852        fn request_options(&mut self) -> &mut crate::RequestOptions {
18853            &mut self.0.options
18854        }
18855    }
18856
18857    /// The request builder for [Participants::list_operations][crate::client::Participants::list_operations] calls.
18858    ///
18859    /// # Example
18860    /// ```
18861    /// # use google_cloud_dialogflow_v2::builder::participants::ListOperations;
18862    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18863    /// use google_cloud_gax::paginator::ItemPaginator;
18864    ///
18865    /// let builder = prepare_request_builder();
18866    /// let mut items = builder.by_item();
18867    /// while let Some(result) = items.next().await {
18868    ///   let item = result?;
18869    /// }
18870    /// # Ok(()) }
18871    ///
18872    /// fn prepare_request_builder() -> ListOperations {
18873    ///   # panic!();
18874    ///   // ... details omitted ...
18875    /// }
18876    /// ```
18877    #[derive(Clone, Debug)]
18878    pub struct ListOperations(
18879        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
18880    );
18881
18882    impl ListOperations {
18883        pub(crate) fn new(
18884            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18885        ) -> Self {
18886            Self(RequestBuilder::new(stub))
18887        }
18888
18889        /// Sets the full request, replacing any prior values.
18890        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
18891            mut self,
18892            v: V,
18893        ) -> Self {
18894            self.0.request = v.into();
18895            self
18896        }
18897
18898        /// Sets all the options, replacing any prior values.
18899        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18900            self.0.options = v.into();
18901            self
18902        }
18903
18904        /// Sends the request.
18905        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
18906            (*self.0.stub)
18907                .list_operations(self.0.request, self.0.options)
18908                .await
18909                .map(crate::Response::into_body)
18910        }
18911
18912        /// Streams each page in the collection.
18913        pub fn by_page(
18914            self,
18915        ) -> impl google_cloud_gax::paginator::Paginator<
18916            google_cloud_longrunning::model::ListOperationsResponse,
18917            crate::Error,
18918        > {
18919            use std::clone::Clone;
18920            let token = self.0.request.page_token.clone();
18921            let execute = move |token: String| {
18922                let mut builder = self.clone();
18923                builder.0.request = builder.0.request.set_page_token(token);
18924                builder.send()
18925            };
18926            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18927        }
18928
18929        /// Streams each item in the collection.
18930        pub fn by_item(
18931            self,
18932        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18933            google_cloud_longrunning::model::ListOperationsResponse,
18934            crate::Error,
18935        > {
18936            use google_cloud_gax::paginator::Paginator;
18937            self.by_page().items()
18938        }
18939
18940        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
18941        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18942            self.0.request.name = v.into();
18943            self
18944        }
18945
18946        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
18947        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18948            self.0.request.filter = v.into();
18949            self
18950        }
18951
18952        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
18953        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18954            self.0.request.page_size = v.into();
18955            self
18956        }
18957
18958        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
18959        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18960            self.0.request.page_token = v.into();
18961            self
18962        }
18963
18964        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
18965        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
18966            self.0.request.return_partial_success = v.into();
18967            self
18968        }
18969    }
18970
18971    #[doc(hidden)]
18972    impl crate::RequestBuilder for ListOperations {
18973        fn request_options(&mut self) -> &mut crate::RequestOptions {
18974            &mut self.0.options
18975        }
18976    }
18977
18978    /// The request builder for [Participants::get_operation][crate::client::Participants::get_operation] calls.
18979    ///
18980    /// # Example
18981    /// ```
18982    /// # use google_cloud_dialogflow_v2::builder::participants::GetOperation;
18983    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
18984    ///
18985    /// let builder = prepare_request_builder();
18986    /// let response = builder.send().await?;
18987    /// # Ok(()) }
18988    ///
18989    /// fn prepare_request_builder() -> GetOperation {
18990    ///   # panic!();
18991    ///   // ... details omitted ...
18992    /// }
18993    /// ```
18994    #[derive(Clone, Debug)]
18995    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
18996
18997    impl GetOperation {
18998        pub(crate) fn new(
18999            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19000        ) -> Self {
19001            Self(RequestBuilder::new(stub))
19002        }
19003
19004        /// Sets the full request, replacing any prior values.
19005        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19006            mut self,
19007            v: V,
19008        ) -> Self {
19009            self.0.request = v.into();
19010            self
19011        }
19012
19013        /// Sets all the options, replacing any prior values.
19014        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19015            self.0.options = v.into();
19016            self
19017        }
19018
19019        /// Sends the request.
19020        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19021            (*self.0.stub)
19022                .get_operation(self.0.request, self.0.options)
19023                .await
19024                .map(crate::Response::into_body)
19025        }
19026
19027        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19028        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19029            self.0.request.name = v.into();
19030            self
19031        }
19032    }
19033
19034    #[doc(hidden)]
19035    impl crate::RequestBuilder for GetOperation {
19036        fn request_options(&mut self) -> &mut crate::RequestOptions {
19037            &mut self.0.options
19038        }
19039    }
19040
19041    /// The request builder for [Participants::cancel_operation][crate::client::Participants::cancel_operation] calls.
19042    ///
19043    /// # Example
19044    /// ```
19045    /// # use google_cloud_dialogflow_v2::builder::participants::CancelOperation;
19046    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19047    ///
19048    /// let builder = prepare_request_builder();
19049    /// let response = builder.send().await?;
19050    /// # Ok(()) }
19051    ///
19052    /// fn prepare_request_builder() -> CancelOperation {
19053    ///   # panic!();
19054    ///   // ... details omitted ...
19055    /// }
19056    /// ```
19057    #[derive(Clone, Debug)]
19058    pub struct CancelOperation(
19059        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19060    );
19061
19062    impl CancelOperation {
19063        pub(crate) fn new(
19064            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19065        ) -> Self {
19066            Self(RequestBuilder::new(stub))
19067        }
19068
19069        /// Sets the full request, replacing any prior values.
19070        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19071            mut self,
19072            v: V,
19073        ) -> Self {
19074            self.0.request = v.into();
19075            self
19076        }
19077
19078        /// Sets all the options, replacing any prior values.
19079        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19080            self.0.options = v.into();
19081            self
19082        }
19083
19084        /// Sends the request.
19085        pub async fn send(self) -> Result<()> {
19086            (*self.0.stub)
19087                .cancel_operation(self.0.request, self.0.options)
19088                .await
19089                .map(crate::Response::into_body)
19090        }
19091
19092        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19093        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19094            self.0.request.name = v.into();
19095            self
19096        }
19097    }
19098
19099    #[doc(hidden)]
19100    impl crate::RequestBuilder for CancelOperation {
19101        fn request_options(&mut self) -> &mut crate::RequestOptions {
19102            &mut self.0.options
19103        }
19104    }
19105}
19106
19107#[cfg(feature = "sessions")]
19108#[cfg_attr(docsrs, doc(cfg(feature = "sessions")))]
19109pub mod sessions {
19110    use crate::Result;
19111
19112    /// A builder for [Sessions][crate::client::Sessions].
19113    ///
19114    /// ```
19115    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19116    /// # use google_cloud_dialogflow_v2::*;
19117    /// # use builder::sessions::ClientBuilder;
19118    /// # use client::Sessions;
19119    /// let builder : ClientBuilder = Sessions::builder();
19120    /// let client = builder
19121    ///     .with_endpoint("https://dialogflow.googleapis.com")
19122    ///     .build().await?;
19123    /// # Ok(()) }
19124    /// ```
19125    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19126
19127    pub(crate) mod client {
19128        use super::super::super::client::Sessions;
19129        pub struct Factory;
19130        impl crate::ClientFactory for Factory {
19131            type Client = Sessions;
19132            type Credentials = gaxi::options::Credentials;
19133            async fn build(
19134                self,
19135                config: gaxi::options::ClientConfig,
19136            ) -> crate::ClientBuilderResult<Self::Client> {
19137                Self::Client::new(config).await
19138            }
19139        }
19140    }
19141
19142    /// Common implementation for [crate::client::Sessions] request builders.
19143    #[derive(Clone, Debug)]
19144    pub(crate) struct RequestBuilder<R: std::default::Default> {
19145        stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>,
19146        request: R,
19147        options: crate::RequestOptions,
19148    }
19149
19150    impl<R> RequestBuilder<R>
19151    where
19152        R: std::default::Default,
19153    {
19154        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19155            Self {
19156                stub,
19157                request: R::default(),
19158                options: crate::RequestOptions::default(),
19159            }
19160        }
19161    }
19162
19163    /// The request builder for [Sessions::detect_intent][crate::client::Sessions::detect_intent] calls.
19164    ///
19165    /// # Example
19166    /// ```
19167    /// # use google_cloud_dialogflow_v2::builder::sessions::DetectIntent;
19168    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19169    ///
19170    /// let builder = prepare_request_builder();
19171    /// let response = builder.send().await?;
19172    /// # Ok(()) }
19173    ///
19174    /// fn prepare_request_builder() -> DetectIntent {
19175    ///   # panic!();
19176    ///   // ... details omitted ...
19177    /// }
19178    /// ```
19179    #[derive(Clone, Debug)]
19180    pub struct DetectIntent(RequestBuilder<crate::model::DetectIntentRequest>);
19181
19182    impl DetectIntent {
19183        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19184            Self(RequestBuilder::new(stub))
19185        }
19186
19187        /// Sets the full request, replacing any prior values.
19188        pub fn with_request<V: Into<crate::model::DetectIntentRequest>>(mut self, v: V) -> Self {
19189            self.0.request = v.into();
19190            self
19191        }
19192
19193        /// Sets all the options, replacing any prior values.
19194        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19195            self.0.options = v.into();
19196            self
19197        }
19198
19199        /// Sends the request.
19200        pub async fn send(self) -> Result<crate::model::DetectIntentResponse> {
19201            (*self.0.stub)
19202                .detect_intent(self.0.request, self.0.options)
19203                .await
19204                .map(crate::Response::into_body)
19205        }
19206
19207        /// Sets the value of [session][crate::model::DetectIntentRequest::session].
19208        ///
19209        /// This is a **required** field for requests.
19210        pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
19211            self.0.request.session = v.into();
19212            self
19213        }
19214
19215        /// Sets the value of [query_params][crate::model::DetectIntentRequest::query_params].
19216        pub fn set_query_params<T>(mut self, v: T) -> Self
19217        where
19218            T: std::convert::Into<crate::model::QueryParameters>,
19219        {
19220            self.0.request.query_params = std::option::Option::Some(v.into());
19221            self
19222        }
19223
19224        /// Sets or clears the value of [query_params][crate::model::DetectIntentRequest::query_params].
19225        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
19226        where
19227            T: std::convert::Into<crate::model::QueryParameters>,
19228        {
19229            self.0.request.query_params = v.map(|x| x.into());
19230            self
19231        }
19232
19233        /// Sets the value of [query_input][crate::model::DetectIntentRequest::query_input].
19234        ///
19235        /// This is a **required** field for requests.
19236        pub fn set_query_input<T>(mut self, v: T) -> Self
19237        where
19238            T: std::convert::Into<crate::model::QueryInput>,
19239        {
19240            self.0.request.query_input = std::option::Option::Some(v.into());
19241            self
19242        }
19243
19244        /// Sets or clears the value of [query_input][crate::model::DetectIntentRequest::query_input].
19245        ///
19246        /// This is a **required** field for requests.
19247        pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
19248        where
19249            T: std::convert::Into<crate::model::QueryInput>,
19250        {
19251            self.0.request.query_input = v.map(|x| x.into());
19252            self
19253        }
19254
19255        /// Sets the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
19256        pub fn set_output_audio_config<T>(mut self, v: T) -> Self
19257        where
19258            T: std::convert::Into<crate::model::OutputAudioConfig>,
19259        {
19260            self.0.request.output_audio_config = std::option::Option::Some(v.into());
19261            self
19262        }
19263
19264        /// Sets or clears the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
19265        pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
19266        where
19267            T: std::convert::Into<crate::model::OutputAudioConfig>,
19268        {
19269            self.0.request.output_audio_config = v.map(|x| x.into());
19270            self
19271        }
19272
19273        /// Sets the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
19274        pub fn set_output_audio_config_mask<T>(mut self, v: T) -> Self
19275        where
19276            T: std::convert::Into<wkt::FieldMask>,
19277        {
19278            self.0.request.output_audio_config_mask = std::option::Option::Some(v.into());
19279            self
19280        }
19281
19282        /// Sets or clears the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
19283        pub fn set_or_clear_output_audio_config_mask<T>(mut self, v: std::option::Option<T>) -> Self
19284        where
19285            T: std::convert::Into<wkt::FieldMask>,
19286        {
19287            self.0.request.output_audio_config_mask = v.map(|x| x.into());
19288            self
19289        }
19290
19291        /// Sets the value of [input_audio][crate::model::DetectIntentRequest::input_audio].
19292        pub fn set_input_audio<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
19293            self.0.request.input_audio = v.into();
19294            self
19295        }
19296    }
19297
19298    #[doc(hidden)]
19299    impl crate::RequestBuilder for DetectIntent {
19300        fn request_options(&mut self) -> &mut crate::RequestOptions {
19301            &mut self.0.options
19302        }
19303    }
19304
19305    /// The request builder for [Sessions::list_locations][crate::client::Sessions::list_locations] calls.
19306    ///
19307    /// # Example
19308    /// ```
19309    /// # use google_cloud_dialogflow_v2::builder::sessions::ListLocations;
19310    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19311    /// use google_cloud_gax::paginator::ItemPaginator;
19312    ///
19313    /// let builder = prepare_request_builder();
19314    /// let mut items = builder.by_item();
19315    /// while let Some(result) = items.next().await {
19316    ///   let item = result?;
19317    /// }
19318    /// # Ok(()) }
19319    ///
19320    /// fn prepare_request_builder() -> ListLocations {
19321    ///   # panic!();
19322    ///   // ... details omitted ...
19323    /// }
19324    /// ```
19325    #[derive(Clone, Debug)]
19326    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
19327
19328    impl ListLocations {
19329        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19330            Self(RequestBuilder::new(stub))
19331        }
19332
19333        /// Sets the full request, replacing any prior values.
19334        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19335            mut self,
19336            v: V,
19337        ) -> Self {
19338            self.0.request = v.into();
19339            self
19340        }
19341
19342        /// Sets all the options, replacing any prior values.
19343        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19344            self.0.options = v.into();
19345            self
19346        }
19347
19348        /// Sends the request.
19349        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19350            (*self.0.stub)
19351                .list_locations(self.0.request, self.0.options)
19352                .await
19353                .map(crate::Response::into_body)
19354        }
19355
19356        /// Streams each page in the collection.
19357        pub fn by_page(
19358            self,
19359        ) -> impl google_cloud_gax::paginator::Paginator<
19360            google_cloud_location::model::ListLocationsResponse,
19361            crate::Error,
19362        > {
19363            use std::clone::Clone;
19364            let token = self.0.request.page_token.clone();
19365            let execute = move |token: String| {
19366                let mut builder = self.clone();
19367                builder.0.request = builder.0.request.set_page_token(token);
19368                builder.send()
19369            };
19370            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19371        }
19372
19373        /// Streams each item in the collection.
19374        pub fn by_item(
19375            self,
19376        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19377            google_cloud_location::model::ListLocationsResponse,
19378            crate::Error,
19379        > {
19380            use google_cloud_gax::paginator::Paginator;
19381            self.by_page().items()
19382        }
19383
19384        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
19385        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19386            self.0.request.name = v.into();
19387            self
19388        }
19389
19390        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
19391        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19392            self.0.request.filter = v.into();
19393            self
19394        }
19395
19396        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
19397        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19398            self.0.request.page_size = v.into();
19399            self
19400        }
19401
19402        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
19403        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19404            self.0.request.page_token = v.into();
19405            self
19406        }
19407    }
19408
19409    #[doc(hidden)]
19410    impl crate::RequestBuilder for ListLocations {
19411        fn request_options(&mut self) -> &mut crate::RequestOptions {
19412            &mut self.0.options
19413        }
19414    }
19415
19416    /// The request builder for [Sessions::get_location][crate::client::Sessions::get_location] calls.
19417    ///
19418    /// # Example
19419    /// ```
19420    /// # use google_cloud_dialogflow_v2::builder::sessions::GetLocation;
19421    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19422    ///
19423    /// let builder = prepare_request_builder();
19424    /// let response = builder.send().await?;
19425    /// # Ok(()) }
19426    ///
19427    /// fn prepare_request_builder() -> GetLocation {
19428    ///   # panic!();
19429    ///   // ... details omitted ...
19430    /// }
19431    /// ```
19432    #[derive(Clone, Debug)]
19433    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19434
19435    impl GetLocation {
19436        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19437            Self(RequestBuilder::new(stub))
19438        }
19439
19440        /// Sets the full request, replacing any prior values.
19441        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19442            mut self,
19443            v: V,
19444        ) -> Self {
19445            self.0.request = v.into();
19446            self
19447        }
19448
19449        /// Sets all the options, replacing any prior values.
19450        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19451            self.0.options = v.into();
19452            self
19453        }
19454
19455        /// Sends the request.
19456        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19457            (*self.0.stub)
19458                .get_location(self.0.request, self.0.options)
19459                .await
19460                .map(crate::Response::into_body)
19461        }
19462
19463        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
19464        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19465            self.0.request.name = v.into();
19466            self
19467        }
19468    }
19469
19470    #[doc(hidden)]
19471    impl crate::RequestBuilder for GetLocation {
19472        fn request_options(&mut self) -> &mut crate::RequestOptions {
19473            &mut self.0.options
19474        }
19475    }
19476
19477    /// The request builder for [Sessions::list_operations][crate::client::Sessions::list_operations] calls.
19478    ///
19479    /// # Example
19480    /// ```
19481    /// # use google_cloud_dialogflow_v2::builder::sessions::ListOperations;
19482    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19483    /// use google_cloud_gax::paginator::ItemPaginator;
19484    ///
19485    /// let builder = prepare_request_builder();
19486    /// let mut items = builder.by_item();
19487    /// while let Some(result) = items.next().await {
19488    ///   let item = result?;
19489    /// }
19490    /// # Ok(()) }
19491    ///
19492    /// fn prepare_request_builder() -> ListOperations {
19493    ///   # panic!();
19494    ///   // ... details omitted ...
19495    /// }
19496    /// ```
19497    #[derive(Clone, Debug)]
19498    pub struct ListOperations(
19499        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19500    );
19501
19502    impl ListOperations {
19503        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19504            Self(RequestBuilder::new(stub))
19505        }
19506
19507        /// Sets the full request, replacing any prior values.
19508        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19509            mut self,
19510            v: V,
19511        ) -> Self {
19512            self.0.request = v.into();
19513            self
19514        }
19515
19516        /// Sets all the options, replacing any prior values.
19517        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19518            self.0.options = v.into();
19519            self
19520        }
19521
19522        /// Sends the request.
19523        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19524            (*self.0.stub)
19525                .list_operations(self.0.request, self.0.options)
19526                .await
19527                .map(crate::Response::into_body)
19528        }
19529
19530        /// Streams each page in the collection.
19531        pub fn by_page(
19532            self,
19533        ) -> impl google_cloud_gax::paginator::Paginator<
19534            google_cloud_longrunning::model::ListOperationsResponse,
19535            crate::Error,
19536        > {
19537            use std::clone::Clone;
19538            let token = self.0.request.page_token.clone();
19539            let execute = move |token: String| {
19540                let mut builder = self.clone();
19541                builder.0.request = builder.0.request.set_page_token(token);
19542                builder.send()
19543            };
19544            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19545        }
19546
19547        /// Streams each item in the collection.
19548        pub fn by_item(
19549            self,
19550        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19551            google_cloud_longrunning::model::ListOperationsResponse,
19552            crate::Error,
19553        > {
19554            use google_cloud_gax::paginator::Paginator;
19555            self.by_page().items()
19556        }
19557
19558        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
19559        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19560            self.0.request.name = v.into();
19561            self
19562        }
19563
19564        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
19565        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19566            self.0.request.filter = v.into();
19567            self
19568        }
19569
19570        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
19571        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19572            self.0.request.page_size = v.into();
19573            self
19574        }
19575
19576        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
19577        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19578            self.0.request.page_token = v.into();
19579            self
19580        }
19581
19582        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
19583        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19584            self.0.request.return_partial_success = v.into();
19585            self
19586        }
19587    }
19588
19589    #[doc(hidden)]
19590    impl crate::RequestBuilder for ListOperations {
19591        fn request_options(&mut self) -> &mut crate::RequestOptions {
19592            &mut self.0.options
19593        }
19594    }
19595
19596    /// The request builder for [Sessions::get_operation][crate::client::Sessions::get_operation] calls.
19597    ///
19598    /// # Example
19599    /// ```
19600    /// # use google_cloud_dialogflow_v2::builder::sessions::GetOperation;
19601    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19602    ///
19603    /// let builder = prepare_request_builder();
19604    /// let response = builder.send().await?;
19605    /// # Ok(()) }
19606    ///
19607    /// fn prepare_request_builder() -> GetOperation {
19608    ///   # panic!();
19609    ///   // ... details omitted ...
19610    /// }
19611    /// ```
19612    #[derive(Clone, Debug)]
19613    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19614
19615    impl GetOperation {
19616        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19617            Self(RequestBuilder::new(stub))
19618        }
19619
19620        /// Sets the full request, replacing any prior values.
19621        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19622            mut self,
19623            v: V,
19624        ) -> Self {
19625            self.0.request = v.into();
19626            self
19627        }
19628
19629        /// Sets all the options, replacing any prior values.
19630        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19631            self.0.options = v.into();
19632            self
19633        }
19634
19635        /// Sends the request.
19636        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19637            (*self.0.stub)
19638                .get_operation(self.0.request, self.0.options)
19639                .await
19640                .map(crate::Response::into_body)
19641        }
19642
19643        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19644        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19645            self.0.request.name = v.into();
19646            self
19647        }
19648    }
19649
19650    #[doc(hidden)]
19651    impl crate::RequestBuilder for GetOperation {
19652        fn request_options(&mut self) -> &mut crate::RequestOptions {
19653            &mut self.0.options
19654        }
19655    }
19656
19657    /// The request builder for [Sessions::cancel_operation][crate::client::Sessions::cancel_operation] calls.
19658    ///
19659    /// # Example
19660    /// ```
19661    /// # use google_cloud_dialogflow_v2::builder::sessions::CancelOperation;
19662    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19663    ///
19664    /// let builder = prepare_request_builder();
19665    /// let response = builder.send().await?;
19666    /// # Ok(()) }
19667    ///
19668    /// fn prepare_request_builder() -> CancelOperation {
19669    ///   # panic!();
19670    ///   // ... details omitted ...
19671    /// }
19672    /// ```
19673    #[derive(Clone, Debug)]
19674    pub struct CancelOperation(
19675        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19676    );
19677
19678    impl CancelOperation {
19679        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19680            Self(RequestBuilder::new(stub))
19681        }
19682
19683        /// Sets the full request, replacing any prior values.
19684        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19685            mut self,
19686            v: V,
19687        ) -> Self {
19688            self.0.request = v.into();
19689            self
19690        }
19691
19692        /// Sets all the options, replacing any prior values.
19693        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19694            self.0.options = v.into();
19695            self
19696        }
19697
19698        /// Sends the request.
19699        pub async fn send(self) -> Result<()> {
19700            (*self.0.stub)
19701                .cancel_operation(self.0.request, self.0.options)
19702                .await
19703                .map(crate::Response::into_body)
19704        }
19705
19706        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19707        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19708            self.0.request.name = v.into();
19709            self
19710        }
19711    }
19712
19713    #[doc(hidden)]
19714    impl crate::RequestBuilder for CancelOperation {
19715        fn request_options(&mut self) -> &mut crate::RequestOptions {
19716            &mut self.0.options
19717        }
19718    }
19719}
19720
19721#[cfg(feature = "session-entity-types")]
19722#[cfg_attr(docsrs, doc(cfg(feature = "session-entity-types")))]
19723pub mod session_entity_types {
19724    use crate::Result;
19725
19726    /// A builder for [SessionEntityTypes][crate::client::SessionEntityTypes].
19727    ///
19728    /// ```
19729    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19730    /// # use google_cloud_dialogflow_v2::*;
19731    /// # use builder::session_entity_types::ClientBuilder;
19732    /// # use client::SessionEntityTypes;
19733    /// let builder : ClientBuilder = SessionEntityTypes::builder();
19734    /// let client = builder
19735    ///     .with_endpoint("https://dialogflow.googleapis.com")
19736    ///     .build().await?;
19737    /// # Ok(()) }
19738    /// ```
19739    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19740
19741    pub(crate) mod client {
19742        use super::super::super::client::SessionEntityTypes;
19743        pub struct Factory;
19744        impl crate::ClientFactory for Factory {
19745            type Client = SessionEntityTypes;
19746            type Credentials = gaxi::options::Credentials;
19747            async fn build(
19748                self,
19749                config: gaxi::options::ClientConfig,
19750            ) -> crate::ClientBuilderResult<Self::Client> {
19751                Self::Client::new(config).await
19752            }
19753        }
19754    }
19755
19756    /// Common implementation for [crate::client::SessionEntityTypes] request builders.
19757    #[derive(Clone, Debug)]
19758    pub(crate) struct RequestBuilder<R: std::default::Default> {
19759        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19760        request: R,
19761        options: crate::RequestOptions,
19762    }
19763
19764    impl<R> RequestBuilder<R>
19765    where
19766        R: std::default::Default,
19767    {
19768        pub(crate) fn new(
19769            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19770        ) -> Self {
19771            Self {
19772                stub,
19773                request: R::default(),
19774                options: crate::RequestOptions::default(),
19775            }
19776        }
19777    }
19778
19779    /// The request builder for [SessionEntityTypes::list_session_entity_types][crate::client::SessionEntityTypes::list_session_entity_types] calls.
19780    ///
19781    /// # Example
19782    /// ```
19783    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListSessionEntityTypes;
19784    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19785    /// use google_cloud_gax::paginator::ItemPaginator;
19786    ///
19787    /// let builder = prepare_request_builder();
19788    /// let mut items = builder.by_item();
19789    /// while let Some(result) = items.next().await {
19790    ///   let item = result?;
19791    /// }
19792    /// # Ok(()) }
19793    ///
19794    /// fn prepare_request_builder() -> ListSessionEntityTypes {
19795    ///   # panic!();
19796    ///   // ... details omitted ...
19797    /// }
19798    /// ```
19799    #[derive(Clone, Debug)]
19800    pub struct ListSessionEntityTypes(RequestBuilder<crate::model::ListSessionEntityTypesRequest>);
19801
19802    impl ListSessionEntityTypes {
19803        pub(crate) fn new(
19804            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19805        ) -> Self {
19806            Self(RequestBuilder::new(stub))
19807        }
19808
19809        /// Sets the full request, replacing any prior values.
19810        pub fn with_request<V: Into<crate::model::ListSessionEntityTypesRequest>>(
19811            mut self,
19812            v: V,
19813        ) -> Self {
19814            self.0.request = v.into();
19815            self
19816        }
19817
19818        /// Sets all the options, replacing any prior values.
19819        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19820            self.0.options = v.into();
19821            self
19822        }
19823
19824        /// Sends the request.
19825        pub async fn send(self) -> Result<crate::model::ListSessionEntityTypesResponse> {
19826            (*self.0.stub)
19827                .list_session_entity_types(self.0.request, self.0.options)
19828                .await
19829                .map(crate::Response::into_body)
19830        }
19831
19832        /// Streams each page in the collection.
19833        pub fn by_page(
19834            self,
19835        ) -> impl google_cloud_gax::paginator::Paginator<
19836            crate::model::ListSessionEntityTypesResponse,
19837            crate::Error,
19838        > {
19839            use std::clone::Clone;
19840            let token = self.0.request.page_token.clone();
19841            let execute = move |token: String| {
19842                let mut builder = self.clone();
19843                builder.0.request = builder.0.request.set_page_token(token);
19844                builder.send()
19845            };
19846            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19847        }
19848
19849        /// Streams each item in the collection.
19850        pub fn by_item(
19851            self,
19852        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19853            crate::model::ListSessionEntityTypesResponse,
19854            crate::Error,
19855        > {
19856            use google_cloud_gax::paginator::Paginator;
19857            self.by_page().items()
19858        }
19859
19860        /// Sets the value of [parent][crate::model::ListSessionEntityTypesRequest::parent].
19861        ///
19862        /// This is a **required** field for requests.
19863        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19864            self.0.request.parent = v.into();
19865            self
19866        }
19867
19868        /// Sets the value of [page_size][crate::model::ListSessionEntityTypesRequest::page_size].
19869        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19870            self.0.request.page_size = v.into();
19871            self
19872        }
19873
19874        /// Sets the value of [page_token][crate::model::ListSessionEntityTypesRequest::page_token].
19875        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19876            self.0.request.page_token = v.into();
19877            self
19878        }
19879    }
19880
19881    #[doc(hidden)]
19882    impl crate::RequestBuilder for ListSessionEntityTypes {
19883        fn request_options(&mut self) -> &mut crate::RequestOptions {
19884            &mut self.0.options
19885        }
19886    }
19887
19888    /// The request builder for [SessionEntityTypes::get_session_entity_type][crate::client::SessionEntityTypes::get_session_entity_type] calls.
19889    ///
19890    /// # Example
19891    /// ```
19892    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetSessionEntityType;
19893    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19894    ///
19895    /// let builder = prepare_request_builder();
19896    /// let response = builder.send().await?;
19897    /// # Ok(()) }
19898    ///
19899    /// fn prepare_request_builder() -> GetSessionEntityType {
19900    ///   # panic!();
19901    ///   // ... details omitted ...
19902    /// }
19903    /// ```
19904    #[derive(Clone, Debug)]
19905    pub struct GetSessionEntityType(RequestBuilder<crate::model::GetSessionEntityTypeRequest>);
19906
19907    impl GetSessionEntityType {
19908        pub(crate) fn new(
19909            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19910        ) -> Self {
19911            Self(RequestBuilder::new(stub))
19912        }
19913
19914        /// Sets the full request, replacing any prior values.
19915        pub fn with_request<V: Into<crate::model::GetSessionEntityTypeRequest>>(
19916            mut self,
19917            v: V,
19918        ) -> Self {
19919            self.0.request = v.into();
19920            self
19921        }
19922
19923        /// Sets all the options, replacing any prior values.
19924        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19925            self.0.options = v.into();
19926            self
19927        }
19928
19929        /// Sends the request.
19930        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
19931            (*self.0.stub)
19932                .get_session_entity_type(self.0.request, self.0.options)
19933                .await
19934                .map(crate::Response::into_body)
19935        }
19936
19937        /// Sets the value of [name][crate::model::GetSessionEntityTypeRequest::name].
19938        ///
19939        /// This is a **required** field for requests.
19940        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19941            self.0.request.name = v.into();
19942            self
19943        }
19944    }
19945
19946    #[doc(hidden)]
19947    impl crate::RequestBuilder for GetSessionEntityType {
19948        fn request_options(&mut self) -> &mut crate::RequestOptions {
19949            &mut self.0.options
19950        }
19951    }
19952
19953    /// The request builder for [SessionEntityTypes::create_session_entity_type][crate::client::SessionEntityTypes::create_session_entity_type] calls.
19954    ///
19955    /// # Example
19956    /// ```
19957    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::CreateSessionEntityType;
19958    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
19959    ///
19960    /// let builder = prepare_request_builder();
19961    /// let response = builder.send().await?;
19962    /// # Ok(()) }
19963    ///
19964    /// fn prepare_request_builder() -> CreateSessionEntityType {
19965    ///   # panic!();
19966    ///   // ... details omitted ...
19967    /// }
19968    /// ```
19969    #[derive(Clone, Debug)]
19970    pub struct CreateSessionEntityType(
19971        RequestBuilder<crate::model::CreateSessionEntityTypeRequest>,
19972    );
19973
19974    impl CreateSessionEntityType {
19975        pub(crate) fn new(
19976            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19977        ) -> Self {
19978            Self(RequestBuilder::new(stub))
19979        }
19980
19981        /// Sets the full request, replacing any prior values.
19982        pub fn with_request<V: Into<crate::model::CreateSessionEntityTypeRequest>>(
19983            mut self,
19984            v: V,
19985        ) -> Self {
19986            self.0.request = v.into();
19987            self
19988        }
19989
19990        /// Sets all the options, replacing any prior values.
19991        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19992            self.0.options = v.into();
19993            self
19994        }
19995
19996        /// Sends the request.
19997        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
19998            (*self.0.stub)
19999                .create_session_entity_type(self.0.request, self.0.options)
20000                .await
20001                .map(crate::Response::into_body)
20002        }
20003
20004        /// Sets the value of [parent][crate::model::CreateSessionEntityTypeRequest::parent].
20005        ///
20006        /// This is a **required** field for requests.
20007        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20008            self.0.request.parent = v.into();
20009            self
20010        }
20011
20012        /// Sets the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
20013        ///
20014        /// This is a **required** field for requests.
20015        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
20016        where
20017            T: std::convert::Into<crate::model::SessionEntityType>,
20018        {
20019            self.0.request.session_entity_type = std::option::Option::Some(v.into());
20020            self
20021        }
20022
20023        /// Sets or clears the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
20024        ///
20025        /// This is a **required** field for requests.
20026        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
20027        where
20028            T: std::convert::Into<crate::model::SessionEntityType>,
20029        {
20030            self.0.request.session_entity_type = v.map(|x| x.into());
20031            self
20032        }
20033    }
20034
20035    #[doc(hidden)]
20036    impl crate::RequestBuilder for CreateSessionEntityType {
20037        fn request_options(&mut self) -> &mut crate::RequestOptions {
20038            &mut self.0.options
20039        }
20040    }
20041
20042    /// The request builder for [SessionEntityTypes::update_session_entity_type][crate::client::SessionEntityTypes::update_session_entity_type] calls.
20043    ///
20044    /// # Example
20045    /// ```
20046    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::UpdateSessionEntityType;
20047    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20048    ///
20049    /// let builder = prepare_request_builder();
20050    /// let response = builder.send().await?;
20051    /// # Ok(()) }
20052    ///
20053    /// fn prepare_request_builder() -> UpdateSessionEntityType {
20054    ///   # panic!();
20055    ///   // ... details omitted ...
20056    /// }
20057    /// ```
20058    #[derive(Clone, Debug)]
20059    pub struct UpdateSessionEntityType(
20060        RequestBuilder<crate::model::UpdateSessionEntityTypeRequest>,
20061    );
20062
20063    impl UpdateSessionEntityType {
20064        pub(crate) fn new(
20065            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20066        ) -> Self {
20067            Self(RequestBuilder::new(stub))
20068        }
20069
20070        /// Sets the full request, replacing any prior values.
20071        pub fn with_request<V: Into<crate::model::UpdateSessionEntityTypeRequest>>(
20072            mut self,
20073            v: V,
20074        ) -> Self {
20075            self.0.request = v.into();
20076            self
20077        }
20078
20079        /// Sets all the options, replacing any prior values.
20080        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20081            self.0.options = v.into();
20082            self
20083        }
20084
20085        /// Sends the request.
20086        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20087            (*self.0.stub)
20088                .update_session_entity_type(self.0.request, self.0.options)
20089                .await
20090                .map(crate::Response::into_body)
20091        }
20092
20093        /// Sets the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
20094        ///
20095        /// This is a **required** field for requests.
20096        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
20097        where
20098            T: std::convert::Into<crate::model::SessionEntityType>,
20099        {
20100            self.0.request.session_entity_type = std::option::Option::Some(v.into());
20101            self
20102        }
20103
20104        /// Sets or clears the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
20105        ///
20106        /// This is a **required** field for requests.
20107        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
20108        where
20109            T: std::convert::Into<crate::model::SessionEntityType>,
20110        {
20111            self.0.request.session_entity_type = v.map(|x| x.into());
20112            self
20113        }
20114
20115        /// Sets the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
20116        pub fn set_update_mask<T>(mut self, v: T) -> Self
20117        where
20118            T: std::convert::Into<wkt::FieldMask>,
20119        {
20120            self.0.request.update_mask = std::option::Option::Some(v.into());
20121            self
20122        }
20123
20124        /// Sets or clears the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
20125        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20126        where
20127            T: std::convert::Into<wkt::FieldMask>,
20128        {
20129            self.0.request.update_mask = v.map(|x| x.into());
20130            self
20131        }
20132    }
20133
20134    #[doc(hidden)]
20135    impl crate::RequestBuilder for UpdateSessionEntityType {
20136        fn request_options(&mut self) -> &mut crate::RequestOptions {
20137            &mut self.0.options
20138        }
20139    }
20140
20141    /// The request builder for [SessionEntityTypes::delete_session_entity_type][crate::client::SessionEntityTypes::delete_session_entity_type] calls.
20142    ///
20143    /// # Example
20144    /// ```
20145    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::DeleteSessionEntityType;
20146    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20147    ///
20148    /// let builder = prepare_request_builder();
20149    /// let response = builder.send().await?;
20150    /// # Ok(()) }
20151    ///
20152    /// fn prepare_request_builder() -> DeleteSessionEntityType {
20153    ///   # panic!();
20154    ///   // ... details omitted ...
20155    /// }
20156    /// ```
20157    #[derive(Clone, Debug)]
20158    pub struct DeleteSessionEntityType(
20159        RequestBuilder<crate::model::DeleteSessionEntityTypeRequest>,
20160    );
20161
20162    impl DeleteSessionEntityType {
20163        pub(crate) fn new(
20164            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20165        ) -> Self {
20166            Self(RequestBuilder::new(stub))
20167        }
20168
20169        /// Sets the full request, replacing any prior values.
20170        pub fn with_request<V: Into<crate::model::DeleteSessionEntityTypeRequest>>(
20171            mut self,
20172            v: V,
20173        ) -> Self {
20174            self.0.request = v.into();
20175            self
20176        }
20177
20178        /// Sets all the options, replacing any prior values.
20179        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20180            self.0.options = v.into();
20181            self
20182        }
20183
20184        /// Sends the request.
20185        pub async fn send(self) -> Result<()> {
20186            (*self.0.stub)
20187                .delete_session_entity_type(self.0.request, self.0.options)
20188                .await
20189                .map(crate::Response::into_body)
20190        }
20191
20192        /// Sets the value of [name][crate::model::DeleteSessionEntityTypeRequest::name].
20193        ///
20194        /// This is a **required** field for requests.
20195        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20196            self.0.request.name = v.into();
20197            self
20198        }
20199    }
20200
20201    #[doc(hidden)]
20202    impl crate::RequestBuilder for DeleteSessionEntityType {
20203        fn request_options(&mut self) -> &mut crate::RequestOptions {
20204            &mut self.0.options
20205        }
20206    }
20207
20208    /// The request builder for [SessionEntityTypes::list_locations][crate::client::SessionEntityTypes::list_locations] calls.
20209    ///
20210    /// # Example
20211    /// ```
20212    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListLocations;
20213    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20214    /// use google_cloud_gax::paginator::ItemPaginator;
20215    ///
20216    /// let builder = prepare_request_builder();
20217    /// let mut items = builder.by_item();
20218    /// while let Some(result) = items.next().await {
20219    ///   let item = result?;
20220    /// }
20221    /// # Ok(()) }
20222    ///
20223    /// fn prepare_request_builder() -> ListLocations {
20224    ///   # panic!();
20225    ///   // ... details omitted ...
20226    /// }
20227    /// ```
20228    #[derive(Clone, Debug)]
20229    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20230
20231    impl ListLocations {
20232        pub(crate) fn new(
20233            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20234        ) -> Self {
20235            Self(RequestBuilder::new(stub))
20236        }
20237
20238        /// Sets the full request, replacing any prior values.
20239        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20240            mut self,
20241            v: V,
20242        ) -> Self {
20243            self.0.request = v.into();
20244            self
20245        }
20246
20247        /// Sets all the options, replacing any prior values.
20248        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20249            self.0.options = v.into();
20250            self
20251        }
20252
20253        /// Sends the request.
20254        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20255            (*self.0.stub)
20256                .list_locations(self.0.request, self.0.options)
20257                .await
20258                .map(crate::Response::into_body)
20259        }
20260
20261        /// Streams each page in the collection.
20262        pub fn by_page(
20263            self,
20264        ) -> impl google_cloud_gax::paginator::Paginator<
20265            google_cloud_location::model::ListLocationsResponse,
20266            crate::Error,
20267        > {
20268            use std::clone::Clone;
20269            let token = self.0.request.page_token.clone();
20270            let execute = move |token: String| {
20271                let mut builder = self.clone();
20272                builder.0.request = builder.0.request.set_page_token(token);
20273                builder.send()
20274            };
20275            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20276        }
20277
20278        /// Streams each item in the collection.
20279        pub fn by_item(
20280            self,
20281        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20282            google_cloud_location::model::ListLocationsResponse,
20283            crate::Error,
20284        > {
20285            use google_cloud_gax::paginator::Paginator;
20286            self.by_page().items()
20287        }
20288
20289        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
20290        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20291            self.0.request.name = v.into();
20292            self
20293        }
20294
20295        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
20296        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20297            self.0.request.filter = v.into();
20298            self
20299        }
20300
20301        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
20302        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20303            self.0.request.page_size = v.into();
20304            self
20305        }
20306
20307        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
20308        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20309            self.0.request.page_token = v.into();
20310            self
20311        }
20312    }
20313
20314    #[doc(hidden)]
20315    impl crate::RequestBuilder for ListLocations {
20316        fn request_options(&mut self) -> &mut crate::RequestOptions {
20317            &mut self.0.options
20318        }
20319    }
20320
20321    /// The request builder for [SessionEntityTypes::get_location][crate::client::SessionEntityTypes::get_location] calls.
20322    ///
20323    /// # Example
20324    /// ```
20325    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetLocation;
20326    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20327    ///
20328    /// let builder = prepare_request_builder();
20329    /// let response = builder.send().await?;
20330    /// # Ok(()) }
20331    ///
20332    /// fn prepare_request_builder() -> GetLocation {
20333    ///   # panic!();
20334    ///   // ... details omitted ...
20335    /// }
20336    /// ```
20337    #[derive(Clone, Debug)]
20338    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20339
20340    impl GetLocation {
20341        pub(crate) fn new(
20342            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20343        ) -> Self {
20344            Self(RequestBuilder::new(stub))
20345        }
20346
20347        /// Sets the full request, replacing any prior values.
20348        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20349            mut self,
20350            v: V,
20351        ) -> Self {
20352            self.0.request = v.into();
20353            self
20354        }
20355
20356        /// Sets all the options, replacing any prior values.
20357        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20358            self.0.options = v.into();
20359            self
20360        }
20361
20362        /// Sends the request.
20363        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20364            (*self.0.stub)
20365                .get_location(self.0.request, self.0.options)
20366                .await
20367                .map(crate::Response::into_body)
20368        }
20369
20370        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
20371        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20372            self.0.request.name = v.into();
20373            self
20374        }
20375    }
20376
20377    #[doc(hidden)]
20378    impl crate::RequestBuilder for GetLocation {
20379        fn request_options(&mut self) -> &mut crate::RequestOptions {
20380            &mut self.0.options
20381        }
20382    }
20383
20384    /// The request builder for [SessionEntityTypes::list_operations][crate::client::SessionEntityTypes::list_operations] calls.
20385    ///
20386    /// # Example
20387    /// ```
20388    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListOperations;
20389    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20390    /// use google_cloud_gax::paginator::ItemPaginator;
20391    ///
20392    /// let builder = prepare_request_builder();
20393    /// let mut items = builder.by_item();
20394    /// while let Some(result) = items.next().await {
20395    ///   let item = result?;
20396    /// }
20397    /// # Ok(()) }
20398    ///
20399    /// fn prepare_request_builder() -> ListOperations {
20400    ///   # panic!();
20401    ///   // ... details omitted ...
20402    /// }
20403    /// ```
20404    #[derive(Clone, Debug)]
20405    pub struct ListOperations(
20406        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20407    );
20408
20409    impl ListOperations {
20410        pub(crate) fn new(
20411            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20412        ) -> Self {
20413            Self(RequestBuilder::new(stub))
20414        }
20415
20416        /// Sets the full request, replacing any prior values.
20417        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20418            mut self,
20419            v: V,
20420        ) -> Self {
20421            self.0.request = v.into();
20422            self
20423        }
20424
20425        /// Sets all the options, replacing any prior values.
20426        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20427            self.0.options = v.into();
20428            self
20429        }
20430
20431        /// Sends the request.
20432        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20433            (*self.0.stub)
20434                .list_operations(self.0.request, self.0.options)
20435                .await
20436                .map(crate::Response::into_body)
20437        }
20438
20439        /// Streams each page in the collection.
20440        pub fn by_page(
20441            self,
20442        ) -> impl google_cloud_gax::paginator::Paginator<
20443            google_cloud_longrunning::model::ListOperationsResponse,
20444            crate::Error,
20445        > {
20446            use std::clone::Clone;
20447            let token = self.0.request.page_token.clone();
20448            let execute = move |token: String| {
20449                let mut builder = self.clone();
20450                builder.0.request = builder.0.request.set_page_token(token);
20451                builder.send()
20452            };
20453            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20454        }
20455
20456        /// Streams each item in the collection.
20457        pub fn by_item(
20458            self,
20459        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20460            google_cloud_longrunning::model::ListOperationsResponse,
20461            crate::Error,
20462        > {
20463            use google_cloud_gax::paginator::Paginator;
20464            self.by_page().items()
20465        }
20466
20467        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
20468        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20469            self.0.request.name = v.into();
20470            self
20471        }
20472
20473        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
20474        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20475            self.0.request.filter = v.into();
20476            self
20477        }
20478
20479        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
20480        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20481            self.0.request.page_size = v.into();
20482            self
20483        }
20484
20485        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
20486        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20487            self.0.request.page_token = v.into();
20488            self
20489        }
20490
20491        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
20492        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20493            self.0.request.return_partial_success = v.into();
20494            self
20495        }
20496    }
20497
20498    #[doc(hidden)]
20499    impl crate::RequestBuilder for ListOperations {
20500        fn request_options(&mut self) -> &mut crate::RequestOptions {
20501            &mut self.0.options
20502        }
20503    }
20504
20505    /// The request builder for [SessionEntityTypes::get_operation][crate::client::SessionEntityTypes::get_operation] calls.
20506    ///
20507    /// # Example
20508    /// ```
20509    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetOperation;
20510    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20511    ///
20512    /// let builder = prepare_request_builder();
20513    /// let response = builder.send().await?;
20514    /// # Ok(()) }
20515    ///
20516    /// fn prepare_request_builder() -> GetOperation {
20517    ///   # panic!();
20518    ///   // ... details omitted ...
20519    /// }
20520    /// ```
20521    #[derive(Clone, Debug)]
20522    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20523
20524    impl GetOperation {
20525        pub(crate) fn new(
20526            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20527        ) -> Self {
20528            Self(RequestBuilder::new(stub))
20529        }
20530
20531        /// Sets the full request, replacing any prior values.
20532        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20533            mut self,
20534            v: V,
20535        ) -> Self {
20536            self.0.request = v.into();
20537            self
20538        }
20539
20540        /// Sets all the options, replacing any prior values.
20541        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20542            self.0.options = v.into();
20543            self
20544        }
20545
20546        /// Sends the request.
20547        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20548            (*self.0.stub)
20549                .get_operation(self.0.request, self.0.options)
20550                .await
20551                .map(crate::Response::into_body)
20552        }
20553
20554        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
20555        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20556            self.0.request.name = v.into();
20557            self
20558        }
20559    }
20560
20561    #[doc(hidden)]
20562    impl crate::RequestBuilder for GetOperation {
20563        fn request_options(&mut self) -> &mut crate::RequestOptions {
20564            &mut self.0.options
20565        }
20566    }
20567
20568    /// The request builder for [SessionEntityTypes::cancel_operation][crate::client::SessionEntityTypes::cancel_operation] calls.
20569    ///
20570    /// # Example
20571    /// ```
20572    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::CancelOperation;
20573    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20574    ///
20575    /// let builder = prepare_request_builder();
20576    /// let response = builder.send().await?;
20577    /// # Ok(()) }
20578    ///
20579    /// fn prepare_request_builder() -> CancelOperation {
20580    ///   # panic!();
20581    ///   // ... details omitted ...
20582    /// }
20583    /// ```
20584    #[derive(Clone, Debug)]
20585    pub struct CancelOperation(
20586        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20587    );
20588
20589    impl CancelOperation {
20590        pub(crate) fn new(
20591            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20592        ) -> Self {
20593            Self(RequestBuilder::new(stub))
20594        }
20595
20596        /// Sets the full request, replacing any prior values.
20597        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20598            mut self,
20599            v: V,
20600        ) -> Self {
20601            self.0.request = v.into();
20602            self
20603        }
20604
20605        /// Sets all the options, replacing any prior values.
20606        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20607            self.0.options = v.into();
20608            self
20609        }
20610
20611        /// Sends the request.
20612        pub async fn send(self) -> Result<()> {
20613            (*self.0.stub)
20614                .cancel_operation(self.0.request, self.0.options)
20615                .await
20616                .map(crate::Response::into_body)
20617        }
20618
20619        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
20620        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20621            self.0.request.name = v.into();
20622            self
20623        }
20624    }
20625
20626    #[doc(hidden)]
20627    impl crate::RequestBuilder for CancelOperation {
20628        fn request_options(&mut self) -> &mut crate::RequestOptions {
20629            &mut self.0.options
20630        }
20631    }
20632}
20633
20634#[cfg(feature = "sip-trunks")]
20635#[cfg_attr(docsrs, doc(cfg(feature = "sip-trunks")))]
20636pub mod sip_trunks {
20637    use crate::Result;
20638
20639    /// A builder for [SipTrunks][crate::client::SipTrunks].
20640    ///
20641    /// ```
20642    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20643    /// # use google_cloud_dialogflow_v2::*;
20644    /// # use builder::sip_trunks::ClientBuilder;
20645    /// # use client::SipTrunks;
20646    /// let builder : ClientBuilder = SipTrunks::builder();
20647    /// let client = builder
20648    ///     .with_endpoint("https://dialogflow.googleapis.com")
20649    ///     .build().await?;
20650    /// # Ok(()) }
20651    /// ```
20652    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20653
20654    pub(crate) mod client {
20655        use super::super::super::client::SipTrunks;
20656        pub struct Factory;
20657        impl crate::ClientFactory for Factory {
20658            type Client = SipTrunks;
20659            type Credentials = gaxi::options::Credentials;
20660            async fn build(
20661                self,
20662                config: gaxi::options::ClientConfig,
20663            ) -> crate::ClientBuilderResult<Self::Client> {
20664                Self::Client::new(config).await
20665            }
20666        }
20667    }
20668
20669    /// Common implementation for [crate::client::SipTrunks] request builders.
20670    #[derive(Clone, Debug)]
20671    pub(crate) struct RequestBuilder<R: std::default::Default> {
20672        stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20673        request: R,
20674        options: crate::RequestOptions,
20675    }
20676
20677    impl<R> RequestBuilder<R>
20678    where
20679        R: std::default::Default,
20680    {
20681        pub(crate) fn new(
20682            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20683        ) -> Self {
20684            Self {
20685                stub,
20686                request: R::default(),
20687                options: crate::RequestOptions::default(),
20688            }
20689        }
20690    }
20691
20692    /// The request builder for [SipTrunks::create_sip_trunk][crate::client::SipTrunks::create_sip_trunk] calls.
20693    ///
20694    /// # Example
20695    /// ```
20696    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::CreateSipTrunk;
20697    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20698    ///
20699    /// let builder = prepare_request_builder();
20700    /// let response = builder.send().await?;
20701    /// # Ok(()) }
20702    ///
20703    /// fn prepare_request_builder() -> CreateSipTrunk {
20704    ///   # panic!();
20705    ///   // ... details omitted ...
20706    /// }
20707    /// ```
20708    #[derive(Clone, Debug)]
20709    pub struct CreateSipTrunk(RequestBuilder<crate::model::CreateSipTrunkRequest>);
20710
20711    impl CreateSipTrunk {
20712        pub(crate) fn new(
20713            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20714        ) -> Self {
20715            Self(RequestBuilder::new(stub))
20716        }
20717
20718        /// Sets the full request, replacing any prior values.
20719        pub fn with_request<V: Into<crate::model::CreateSipTrunkRequest>>(mut self, v: V) -> Self {
20720            self.0.request = v.into();
20721            self
20722        }
20723
20724        /// Sets all the options, replacing any prior values.
20725        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20726            self.0.options = v.into();
20727            self
20728        }
20729
20730        /// Sends the request.
20731        pub async fn send(self) -> Result<crate::model::SipTrunk> {
20732            (*self.0.stub)
20733                .create_sip_trunk(self.0.request, self.0.options)
20734                .await
20735                .map(crate::Response::into_body)
20736        }
20737
20738        /// Sets the value of [parent][crate::model::CreateSipTrunkRequest::parent].
20739        ///
20740        /// This is a **required** field for requests.
20741        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20742            self.0.request.parent = v.into();
20743            self
20744        }
20745
20746        /// Sets the value of [sip_trunk][crate::model::CreateSipTrunkRequest::sip_trunk].
20747        ///
20748        /// This is a **required** field for requests.
20749        pub fn set_sip_trunk<T>(mut self, v: T) -> Self
20750        where
20751            T: std::convert::Into<crate::model::SipTrunk>,
20752        {
20753            self.0.request.sip_trunk = std::option::Option::Some(v.into());
20754            self
20755        }
20756
20757        /// Sets or clears the value of [sip_trunk][crate::model::CreateSipTrunkRequest::sip_trunk].
20758        ///
20759        /// This is a **required** field for requests.
20760        pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
20761        where
20762            T: std::convert::Into<crate::model::SipTrunk>,
20763        {
20764            self.0.request.sip_trunk = v.map(|x| x.into());
20765            self
20766        }
20767    }
20768
20769    #[doc(hidden)]
20770    impl crate::RequestBuilder for CreateSipTrunk {
20771        fn request_options(&mut self) -> &mut crate::RequestOptions {
20772            &mut self.0.options
20773        }
20774    }
20775
20776    /// The request builder for [SipTrunks::delete_sip_trunk][crate::client::SipTrunks::delete_sip_trunk] calls.
20777    ///
20778    /// # Example
20779    /// ```
20780    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::DeleteSipTrunk;
20781    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20782    ///
20783    /// let builder = prepare_request_builder();
20784    /// let response = builder.send().await?;
20785    /// # Ok(()) }
20786    ///
20787    /// fn prepare_request_builder() -> DeleteSipTrunk {
20788    ///   # panic!();
20789    ///   // ... details omitted ...
20790    /// }
20791    /// ```
20792    #[derive(Clone, Debug)]
20793    pub struct DeleteSipTrunk(RequestBuilder<crate::model::DeleteSipTrunkRequest>);
20794
20795    impl DeleteSipTrunk {
20796        pub(crate) fn new(
20797            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20798        ) -> Self {
20799            Self(RequestBuilder::new(stub))
20800        }
20801
20802        /// Sets the full request, replacing any prior values.
20803        pub fn with_request<V: Into<crate::model::DeleteSipTrunkRequest>>(mut self, v: V) -> Self {
20804            self.0.request = v.into();
20805            self
20806        }
20807
20808        /// Sets all the options, replacing any prior values.
20809        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20810            self.0.options = v.into();
20811            self
20812        }
20813
20814        /// Sends the request.
20815        pub async fn send(self) -> Result<()> {
20816            (*self.0.stub)
20817                .delete_sip_trunk(self.0.request, self.0.options)
20818                .await
20819                .map(crate::Response::into_body)
20820        }
20821
20822        /// Sets the value of [name][crate::model::DeleteSipTrunkRequest::name].
20823        ///
20824        /// This is a **required** field for requests.
20825        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20826            self.0.request.name = v.into();
20827            self
20828        }
20829    }
20830
20831    #[doc(hidden)]
20832    impl crate::RequestBuilder for DeleteSipTrunk {
20833        fn request_options(&mut self) -> &mut crate::RequestOptions {
20834            &mut self.0.options
20835        }
20836    }
20837
20838    /// The request builder for [SipTrunks::list_sip_trunks][crate::client::SipTrunks::list_sip_trunks] calls.
20839    ///
20840    /// # Example
20841    /// ```
20842    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListSipTrunks;
20843    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20844    /// use google_cloud_gax::paginator::ItemPaginator;
20845    ///
20846    /// let builder = prepare_request_builder();
20847    /// let mut items = builder.by_item();
20848    /// while let Some(result) = items.next().await {
20849    ///   let item = result?;
20850    /// }
20851    /// # Ok(()) }
20852    ///
20853    /// fn prepare_request_builder() -> ListSipTrunks {
20854    ///   # panic!();
20855    ///   // ... details omitted ...
20856    /// }
20857    /// ```
20858    #[derive(Clone, Debug)]
20859    pub struct ListSipTrunks(RequestBuilder<crate::model::ListSipTrunksRequest>);
20860
20861    impl ListSipTrunks {
20862        pub(crate) fn new(
20863            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20864        ) -> Self {
20865            Self(RequestBuilder::new(stub))
20866        }
20867
20868        /// Sets the full request, replacing any prior values.
20869        pub fn with_request<V: Into<crate::model::ListSipTrunksRequest>>(mut self, v: V) -> Self {
20870            self.0.request = v.into();
20871            self
20872        }
20873
20874        /// Sets all the options, replacing any prior values.
20875        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20876            self.0.options = v.into();
20877            self
20878        }
20879
20880        /// Sends the request.
20881        pub async fn send(self) -> Result<crate::model::ListSipTrunksResponse> {
20882            (*self.0.stub)
20883                .list_sip_trunks(self.0.request, self.0.options)
20884                .await
20885                .map(crate::Response::into_body)
20886        }
20887
20888        /// Streams each page in the collection.
20889        pub fn by_page(
20890            self,
20891        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSipTrunksResponse, crate::Error>
20892        {
20893            use std::clone::Clone;
20894            let token = self.0.request.page_token.clone();
20895            let execute = move |token: String| {
20896                let mut builder = self.clone();
20897                builder.0.request = builder.0.request.set_page_token(token);
20898                builder.send()
20899            };
20900            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20901        }
20902
20903        /// Streams each item in the collection.
20904        pub fn by_item(
20905            self,
20906        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20907            crate::model::ListSipTrunksResponse,
20908            crate::Error,
20909        > {
20910            use google_cloud_gax::paginator::Paginator;
20911            self.by_page().items()
20912        }
20913
20914        /// Sets the value of [parent][crate::model::ListSipTrunksRequest::parent].
20915        ///
20916        /// This is a **required** field for requests.
20917        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20918            self.0.request.parent = v.into();
20919            self
20920        }
20921
20922        /// Sets the value of [page_size][crate::model::ListSipTrunksRequest::page_size].
20923        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20924            self.0.request.page_size = v.into();
20925            self
20926        }
20927
20928        /// Sets the value of [page_token][crate::model::ListSipTrunksRequest::page_token].
20929        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20930            self.0.request.page_token = v.into();
20931            self
20932        }
20933    }
20934
20935    #[doc(hidden)]
20936    impl crate::RequestBuilder for ListSipTrunks {
20937        fn request_options(&mut self) -> &mut crate::RequestOptions {
20938            &mut self.0.options
20939        }
20940    }
20941
20942    /// The request builder for [SipTrunks::get_sip_trunk][crate::client::SipTrunks::get_sip_trunk] calls.
20943    ///
20944    /// # Example
20945    /// ```
20946    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetSipTrunk;
20947    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
20948    ///
20949    /// let builder = prepare_request_builder();
20950    /// let response = builder.send().await?;
20951    /// # Ok(()) }
20952    ///
20953    /// fn prepare_request_builder() -> GetSipTrunk {
20954    ///   # panic!();
20955    ///   // ... details omitted ...
20956    /// }
20957    /// ```
20958    #[derive(Clone, Debug)]
20959    pub struct GetSipTrunk(RequestBuilder<crate::model::GetSipTrunkRequest>);
20960
20961    impl GetSipTrunk {
20962        pub(crate) fn new(
20963            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20964        ) -> Self {
20965            Self(RequestBuilder::new(stub))
20966        }
20967
20968        /// Sets the full request, replacing any prior values.
20969        pub fn with_request<V: Into<crate::model::GetSipTrunkRequest>>(mut self, v: V) -> Self {
20970            self.0.request = v.into();
20971            self
20972        }
20973
20974        /// Sets all the options, replacing any prior values.
20975        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20976            self.0.options = v.into();
20977            self
20978        }
20979
20980        /// Sends the request.
20981        pub async fn send(self) -> Result<crate::model::SipTrunk> {
20982            (*self.0.stub)
20983                .get_sip_trunk(self.0.request, self.0.options)
20984                .await
20985                .map(crate::Response::into_body)
20986        }
20987
20988        /// Sets the value of [name][crate::model::GetSipTrunkRequest::name].
20989        ///
20990        /// This is a **required** field for requests.
20991        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20992            self.0.request.name = v.into();
20993            self
20994        }
20995    }
20996
20997    #[doc(hidden)]
20998    impl crate::RequestBuilder for GetSipTrunk {
20999        fn request_options(&mut self) -> &mut crate::RequestOptions {
21000            &mut self.0.options
21001        }
21002    }
21003
21004    /// The request builder for [SipTrunks::update_sip_trunk][crate::client::SipTrunks::update_sip_trunk] calls.
21005    ///
21006    /// # Example
21007    /// ```
21008    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::UpdateSipTrunk;
21009    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21010    ///
21011    /// let builder = prepare_request_builder();
21012    /// let response = builder.send().await?;
21013    /// # Ok(()) }
21014    ///
21015    /// fn prepare_request_builder() -> UpdateSipTrunk {
21016    ///   # panic!();
21017    ///   // ... details omitted ...
21018    /// }
21019    /// ```
21020    #[derive(Clone, Debug)]
21021    pub struct UpdateSipTrunk(RequestBuilder<crate::model::UpdateSipTrunkRequest>);
21022
21023    impl UpdateSipTrunk {
21024        pub(crate) fn new(
21025            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21026        ) -> Self {
21027            Self(RequestBuilder::new(stub))
21028        }
21029
21030        /// Sets the full request, replacing any prior values.
21031        pub fn with_request<V: Into<crate::model::UpdateSipTrunkRequest>>(mut self, v: V) -> Self {
21032            self.0.request = v.into();
21033            self
21034        }
21035
21036        /// Sets all the options, replacing any prior values.
21037        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21038            self.0.options = v.into();
21039            self
21040        }
21041
21042        /// Sends the request.
21043        pub async fn send(self) -> Result<crate::model::SipTrunk> {
21044            (*self.0.stub)
21045                .update_sip_trunk(self.0.request, self.0.options)
21046                .await
21047                .map(crate::Response::into_body)
21048        }
21049
21050        /// Sets the value of [sip_trunk][crate::model::UpdateSipTrunkRequest::sip_trunk].
21051        ///
21052        /// This is a **required** field for requests.
21053        pub fn set_sip_trunk<T>(mut self, v: T) -> Self
21054        where
21055            T: std::convert::Into<crate::model::SipTrunk>,
21056        {
21057            self.0.request.sip_trunk = std::option::Option::Some(v.into());
21058            self
21059        }
21060
21061        /// Sets or clears the value of [sip_trunk][crate::model::UpdateSipTrunkRequest::sip_trunk].
21062        ///
21063        /// This is a **required** field for requests.
21064        pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
21065        where
21066            T: std::convert::Into<crate::model::SipTrunk>,
21067        {
21068            self.0.request.sip_trunk = v.map(|x| x.into());
21069            self
21070        }
21071
21072        /// Sets the value of [update_mask][crate::model::UpdateSipTrunkRequest::update_mask].
21073        pub fn set_update_mask<T>(mut self, v: T) -> Self
21074        where
21075            T: std::convert::Into<wkt::FieldMask>,
21076        {
21077            self.0.request.update_mask = std::option::Option::Some(v.into());
21078            self
21079        }
21080
21081        /// Sets or clears the value of [update_mask][crate::model::UpdateSipTrunkRequest::update_mask].
21082        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21083        where
21084            T: std::convert::Into<wkt::FieldMask>,
21085        {
21086            self.0.request.update_mask = v.map(|x| x.into());
21087            self
21088        }
21089    }
21090
21091    #[doc(hidden)]
21092    impl crate::RequestBuilder for UpdateSipTrunk {
21093        fn request_options(&mut self) -> &mut crate::RequestOptions {
21094            &mut self.0.options
21095        }
21096    }
21097
21098    /// The request builder for [SipTrunks::list_locations][crate::client::SipTrunks::list_locations] calls.
21099    ///
21100    /// # Example
21101    /// ```
21102    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListLocations;
21103    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21104    /// use google_cloud_gax::paginator::ItemPaginator;
21105    ///
21106    /// let builder = prepare_request_builder();
21107    /// let mut items = builder.by_item();
21108    /// while let Some(result) = items.next().await {
21109    ///   let item = result?;
21110    /// }
21111    /// # Ok(()) }
21112    ///
21113    /// fn prepare_request_builder() -> ListLocations {
21114    ///   # panic!();
21115    ///   // ... details omitted ...
21116    /// }
21117    /// ```
21118    #[derive(Clone, Debug)]
21119    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21120
21121    impl ListLocations {
21122        pub(crate) fn new(
21123            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21124        ) -> Self {
21125            Self(RequestBuilder::new(stub))
21126        }
21127
21128        /// Sets the full request, replacing any prior values.
21129        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21130            mut self,
21131            v: V,
21132        ) -> Self {
21133            self.0.request = v.into();
21134            self
21135        }
21136
21137        /// Sets all the options, replacing any prior values.
21138        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21139            self.0.options = v.into();
21140            self
21141        }
21142
21143        /// Sends the request.
21144        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21145            (*self.0.stub)
21146                .list_locations(self.0.request, self.0.options)
21147                .await
21148                .map(crate::Response::into_body)
21149        }
21150
21151        /// Streams each page in the collection.
21152        pub fn by_page(
21153            self,
21154        ) -> impl google_cloud_gax::paginator::Paginator<
21155            google_cloud_location::model::ListLocationsResponse,
21156            crate::Error,
21157        > {
21158            use std::clone::Clone;
21159            let token = self.0.request.page_token.clone();
21160            let execute = move |token: String| {
21161                let mut builder = self.clone();
21162                builder.0.request = builder.0.request.set_page_token(token);
21163                builder.send()
21164            };
21165            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21166        }
21167
21168        /// Streams each item in the collection.
21169        pub fn by_item(
21170            self,
21171        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21172            google_cloud_location::model::ListLocationsResponse,
21173            crate::Error,
21174        > {
21175            use google_cloud_gax::paginator::Paginator;
21176            self.by_page().items()
21177        }
21178
21179        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
21180        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21181            self.0.request.name = v.into();
21182            self
21183        }
21184
21185        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
21186        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21187            self.0.request.filter = v.into();
21188            self
21189        }
21190
21191        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
21192        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21193            self.0.request.page_size = v.into();
21194            self
21195        }
21196
21197        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
21198        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21199            self.0.request.page_token = v.into();
21200            self
21201        }
21202    }
21203
21204    #[doc(hidden)]
21205    impl crate::RequestBuilder for ListLocations {
21206        fn request_options(&mut self) -> &mut crate::RequestOptions {
21207            &mut self.0.options
21208        }
21209    }
21210
21211    /// The request builder for [SipTrunks::get_location][crate::client::SipTrunks::get_location] calls.
21212    ///
21213    /// # Example
21214    /// ```
21215    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetLocation;
21216    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21217    ///
21218    /// let builder = prepare_request_builder();
21219    /// let response = builder.send().await?;
21220    /// # Ok(()) }
21221    ///
21222    /// fn prepare_request_builder() -> GetLocation {
21223    ///   # panic!();
21224    ///   // ... details omitted ...
21225    /// }
21226    /// ```
21227    #[derive(Clone, Debug)]
21228    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21229
21230    impl GetLocation {
21231        pub(crate) fn new(
21232            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21233        ) -> Self {
21234            Self(RequestBuilder::new(stub))
21235        }
21236
21237        /// Sets the full request, replacing any prior values.
21238        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21239            mut self,
21240            v: V,
21241        ) -> Self {
21242            self.0.request = v.into();
21243            self
21244        }
21245
21246        /// Sets all the options, replacing any prior values.
21247        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21248            self.0.options = v.into();
21249            self
21250        }
21251
21252        /// Sends the request.
21253        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21254            (*self.0.stub)
21255                .get_location(self.0.request, self.0.options)
21256                .await
21257                .map(crate::Response::into_body)
21258        }
21259
21260        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
21261        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21262            self.0.request.name = v.into();
21263            self
21264        }
21265    }
21266
21267    #[doc(hidden)]
21268    impl crate::RequestBuilder for GetLocation {
21269        fn request_options(&mut self) -> &mut crate::RequestOptions {
21270            &mut self.0.options
21271        }
21272    }
21273
21274    /// The request builder for [SipTrunks::list_operations][crate::client::SipTrunks::list_operations] calls.
21275    ///
21276    /// # Example
21277    /// ```
21278    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListOperations;
21279    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21280    /// use google_cloud_gax::paginator::ItemPaginator;
21281    ///
21282    /// let builder = prepare_request_builder();
21283    /// let mut items = builder.by_item();
21284    /// while let Some(result) = items.next().await {
21285    ///   let item = result?;
21286    /// }
21287    /// # Ok(()) }
21288    ///
21289    /// fn prepare_request_builder() -> ListOperations {
21290    ///   # panic!();
21291    ///   // ... details omitted ...
21292    /// }
21293    /// ```
21294    #[derive(Clone, Debug)]
21295    pub struct ListOperations(
21296        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21297    );
21298
21299    impl ListOperations {
21300        pub(crate) fn new(
21301            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21302        ) -> Self {
21303            Self(RequestBuilder::new(stub))
21304        }
21305
21306        /// Sets the full request, replacing any prior values.
21307        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21308            mut self,
21309            v: V,
21310        ) -> Self {
21311            self.0.request = v.into();
21312            self
21313        }
21314
21315        /// Sets all the options, replacing any prior values.
21316        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21317            self.0.options = v.into();
21318            self
21319        }
21320
21321        /// Sends the request.
21322        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21323            (*self.0.stub)
21324                .list_operations(self.0.request, self.0.options)
21325                .await
21326                .map(crate::Response::into_body)
21327        }
21328
21329        /// Streams each page in the collection.
21330        pub fn by_page(
21331            self,
21332        ) -> impl google_cloud_gax::paginator::Paginator<
21333            google_cloud_longrunning::model::ListOperationsResponse,
21334            crate::Error,
21335        > {
21336            use std::clone::Clone;
21337            let token = self.0.request.page_token.clone();
21338            let execute = move |token: String| {
21339                let mut builder = self.clone();
21340                builder.0.request = builder.0.request.set_page_token(token);
21341                builder.send()
21342            };
21343            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21344        }
21345
21346        /// Streams each item in the collection.
21347        pub fn by_item(
21348            self,
21349        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21350            google_cloud_longrunning::model::ListOperationsResponse,
21351            crate::Error,
21352        > {
21353            use google_cloud_gax::paginator::Paginator;
21354            self.by_page().items()
21355        }
21356
21357        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
21358        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21359            self.0.request.name = v.into();
21360            self
21361        }
21362
21363        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
21364        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21365            self.0.request.filter = v.into();
21366            self
21367        }
21368
21369        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
21370        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21371            self.0.request.page_size = v.into();
21372            self
21373        }
21374
21375        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
21376        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21377            self.0.request.page_token = v.into();
21378            self
21379        }
21380
21381        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
21382        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21383            self.0.request.return_partial_success = v.into();
21384            self
21385        }
21386    }
21387
21388    #[doc(hidden)]
21389    impl crate::RequestBuilder for ListOperations {
21390        fn request_options(&mut self) -> &mut crate::RequestOptions {
21391            &mut self.0.options
21392        }
21393    }
21394
21395    /// The request builder for [SipTrunks::get_operation][crate::client::SipTrunks::get_operation] calls.
21396    ///
21397    /// # Example
21398    /// ```
21399    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetOperation;
21400    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21401    ///
21402    /// let builder = prepare_request_builder();
21403    /// let response = builder.send().await?;
21404    /// # Ok(()) }
21405    ///
21406    /// fn prepare_request_builder() -> GetOperation {
21407    ///   # panic!();
21408    ///   // ... details omitted ...
21409    /// }
21410    /// ```
21411    #[derive(Clone, Debug)]
21412    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21413
21414    impl GetOperation {
21415        pub(crate) fn new(
21416            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21417        ) -> Self {
21418            Self(RequestBuilder::new(stub))
21419        }
21420
21421        /// Sets the full request, replacing any prior values.
21422        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21423            mut self,
21424            v: V,
21425        ) -> Self {
21426            self.0.request = v.into();
21427            self
21428        }
21429
21430        /// Sets all the options, replacing any prior values.
21431        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21432            self.0.options = v.into();
21433            self
21434        }
21435
21436        /// Sends the request.
21437        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21438            (*self.0.stub)
21439                .get_operation(self.0.request, self.0.options)
21440                .await
21441                .map(crate::Response::into_body)
21442        }
21443
21444        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
21445        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21446            self.0.request.name = v.into();
21447            self
21448        }
21449    }
21450
21451    #[doc(hidden)]
21452    impl crate::RequestBuilder for GetOperation {
21453        fn request_options(&mut self) -> &mut crate::RequestOptions {
21454            &mut self.0.options
21455        }
21456    }
21457
21458    /// The request builder for [SipTrunks::cancel_operation][crate::client::SipTrunks::cancel_operation] calls.
21459    ///
21460    /// # Example
21461    /// ```
21462    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::CancelOperation;
21463    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21464    ///
21465    /// let builder = prepare_request_builder();
21466    /// let response = builder.send().await?;
21467    /// # Ok(()) }
21468    ///
21469    /// fn prepare_request_builder() -> CancelOperation {
21470    ///   # panic!();
21471    ///   // ... details omitted ...
21472    /// }
21473    /// ```
21474    #[derive(Clone, Debug)]
21475    pub struct CancelOperation(
21476        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21477    );
21478
21479    impl CancelOperation {
21480        pub(crate) fn new(
21481            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21482        ) -> Self {
21483            Self(RequestBuilder::new(stub))
21484        }
21485
21486        /// Sets the full request, replacing any prior values.
21487        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21488            mut self,
21489            v: V,
21490        ) -> Self {
21491            self.0.request = v.into();
21492            self
21493        }
21494
21495        /// Sets all the options, replacing any prior values.
21496        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21497            self.0.options = v.into();
21498            self
21499        }
21500
21501        /// Sends the request.
21502        pub async fn send(self) -> Result<()> {
21503            (*self.0.stub)
21504                .cancel_operation(self.0.request, self.0.options)
21505                .await
21506                .map(crate::Response::into_body)
21507        }
21508
21509        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
21510        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21511            self.0.request.name = v.into();
21512            self
21513        }
21514    }
21515
21516    #[doc(hidden)]
21517    impl crate::RequestBuilder for CancelOperation {
21518        fn request_options(&mut self) -> &mut crate::RequestOptions {
21519            &mut self.0.options
21520        }
21521    }
21522}
21523
21524#[cfg(feature = "tools")]
21525#[cfg_attr(docsrs, doc(cfg(feature = "tools")))]
21526pub mod tools {
21527    use crate::Result;
21528
21529    /// A builder for [Tools][crate::client::Tools].
21530    ///
21531    /// ```
21532    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
21533    /// # use google_cloud_dialogflow_v2::*;
21534    /// # use builder::tools::ClientBuilder;
21535    /// # use client::Tools;
21536    /// let builder : ClientBuilder = Tools::builder();
21537    /// let client = builder
21538    ///     .with_endpoint("https://dialogflow.googleapis.com")
21539    ///     .build().await?;
21540    /// # Ok(()) }
21541    /// ```
21542    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
21543
21544    pub(crate) mod client {
21545        use super::super::super::client::Tools;
21546        pub struct Factory;
21547        impl crate::ClientFactory for Factory {
21548            type Client = Tools;
21549            type Credentials = gaxi::options::Credentials;
21550            async fn build(
21551                self,
21552                config: gaxi::options::ClientConfig,
21553            ) -> crate::ClientBuilderResult<Self::Client> {
21554                Self::Client::new(config).await
21555            }
21556        }
21557    }
21558
21559    /// Common implementation for [crate::client::Tools] request builders.
21560    #[derive(Clone, Debug)]
21561    pub(crate) struct RequestBuilder<R: std::default::Default> {
21562        stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>,
21563        request: R,
21564        options: crate::RequestOptions,
21565    }
21566
21567    impl<R> RequestBuilder<R>
21568    where
21569        R: std::default::Default,
21570    {
21571        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21572            Self {
21573                stub,
21574                request: R::default(),
21575                options: crate::RequestOptions::default(),
21576            }
21577        }
21578    }
21579
21580    /// The request builder for [Tools::create_tool][crate::client::Tools::create_tool] calls.
21581    ///
21582    /// # Example
21583    /// ```
21584    /// # use google_cloud_dialogflow_v2::builder::tools::CreateTool;
21585    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21586    ///
21587    /// let builder = prepare_request_builder();
21588    /// let response = builder.send().await?;
21589    /// # Ok(()) }
21590    ///
21591    /// fn prepare_request_builder() -> CreateTool {
21592    ///   # panic!();
21593    ///   // ... details omitted ...
21594    /// }
21595    /// ```
21596    #[derive(Clone, Debug)]
21597    pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
21598
21599    impl CreateTool {
21600        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21601            Self(RequestBuilder::new(stub))
21602        }
21603
21604        /// Sets the full request, replacing any prior values.
21605        pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> Self {
21606            self.0.request = v.into();
21607            self
21608        }
21609
21610        /// Sets all the options, replacing any prior values.
21611        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21612            self.0.options = v.into();
21613            self
21614        }
21615
21616        /// Sends the request.
21617        pub async fn send(self) -> Result<crate::model::Tool> {
21618            (*self.0.stub)
21619                .create_tool(self.0.request, self.0.options)
21620                .await
21621                .map(crate::Response::into_body)
21622        }
21623
21624        /// Sets the value of [parent][crate::model::CreateToolRequest::parent].
21625        ///
21626        /// This is a **required** field for requests.
21627        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21628            self.0.request.parent = v.into();
21629            self
21630        }
21631
21632        /// Sets the value of [tool][crate::model::CreateToolRequest::tool].
21633        ///
21634        /// This is a **required** field for requests.
21635        pub fn set_tool<T>(mut self, v: T) -> Self
21636        where
21637            T: std::convert::Into<crate::model::Tool>,
21638        {
21639            self.0.request.tool = std::option::Option::Some(v.into());
21640            self
21641        }
21642
21643        /// Sets or clears the value of [tool][crate::model::CreateToolRequest::tool].
21644        ///
21645        /// This is a **required** field for requests.
21646        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
21647        where
21648            T: std::convert::Into<crate::model::Tool>,
21649        {
21650            self.0.request.tool = v.map(|x| x.into());
21651            self
21652        }
21653
21654        /// Sets the value of [tool_id][crate::model::CreateToolRequest::tool_id].
21655        pub fn set_tool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21656            self.0.request.tool_id = v.into();
21657            self
21658        }
21659    }
21660
21661    #[doc(hidden)]
21662    impl crate::RequestBuilder for CreateTool {
21663        fn request_options(&mut self) -> &mut crate::RequestOptions {
21664            &mut self.0.options
21665        }
21666    }
21667
21668    /// The request builder for [Tools::get_tool][crate::client::Tools::get_tool] calls.
21669    ///
21670    /// # Example
21671    /// ```
21672    /// # use google_cloud_dialogflow_v2::builder::tools::GetTool;
21673    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21674    ///
21675    /// let builder = prepare_request_builder();
21676    /// let response = builder.send().await?;
21677    /// # Ok(()) }
21678    ///
21679    /// fn prepare_request_builder() -> GetTool {
21680    ///   # panic!();
21681    ///   // ... details omitted ...
21682    /// }
21683    /// ```
21684    #[derive(Clone, Debug)]
21685    pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
21686
21687    impl GetTool {
21688        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21689            Self(RequestBuilder::new(stub))
21690        }
21691
21692        /// Sets the full request, replacing any prior values.
21693        pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> Self {
21694            self.0.request = v.into();
21695            self
21696        }
21697
21698        /// Sets all the options, replacing any prior values.
21699        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21700            self.0.options = v.into();
21701            self
21702        }
21703
21704        /// Sends the request.
21705        pub async fn send(self) -> Result<crate::model::Tool> {
21706            (*self.0.stub)
21707                .get_tool(self.0.request, self.0.options)
21708                .await
21709                .map(crate::Response::into_body)
21710        }
21711
21712        /// Sets the value of [name][crate::model::GetToolRequest::name].
21713        ///
21714        /// This is a **required** field for requests.
21715        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21716            self.0.request.name = v.into();
21717            self
21718        }
21719    }
21720
21721    #[doc(hidden)]
21722    impl crate::RequestBuilder for GetTool {
21723        fn request_options(&mut self) -> &mut crate::RequestOptions {
21724            &mut self.0.options
21725        }
21726    }
21727
21728    /// The request builder for [Tools::list_tools][crate::client::Tools::list_tools] calls.
21729    ///
21730    /// # Example
21731    /// ```
21732    /// # use google_cloud_dialogflow_v2::builder::tools::ListTools;
21733    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21734    /// use google_cloud_gax::paginator::ItemPaginator;
21735    ///
21736    /// let builder = prepare_request_builder();
21737    /// let mut items = builder.by_item();
21738    /// while let Some(result) = items.next().await {
21739    ///   let item = result?;
21740    /// }
21741    /// # Ok(()) }
21742    ///
21743    /// fn prepare_request_builder() -> ListTools {
21744    ///   # panic!();
21745    ///   // ... details omitted ...
21746    /// }
21747    /// ```
21748    #[derive(Clone, Debug)]
21749    pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
21750
21751    impl ListTools {
21752        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21753            Self(RequestBuilder::new(stub))
21754        }
21755
21756        /// Sets the full request, replacing any prior values.
21757        pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
21758            self.0.request = v.into();
21759            self
21760        }
21761
21762        /// Sets all the options, replacing any prior values.
21763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21764            self.0.options = v.into();
21765            self
21766        }
21767
21768        /// Sends the request.
21769        pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
21770            (*self.0.stub)
21771                .list_tools(self.0.request, self.0.options)
21772                .await
21773                .map(crate::Response::into_body)
21774        }
21775
21776        /// Streams each page in the collection.
21777        pub fn by_page(
21778            self,
21779        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsResponse, crate::Error>
21780        {
21781            use std::clone::Clone;
21782            let token = self.0.request.page_token.clone();
21783            let execute = move |token: String| {
21784                let mut builder = self.clone();
21785                builder.0.request = builder.0.request.set_page_token(token);
21786                builder.send()
21787            };
21788            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21789        }
21790
21791        /// Streams each item in the collection.
21792        pub fn by_item(
21793            self,
21794        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListToolsResponse, crate::Error>
21795        {
21796            use google_cloud_gax::paginator::Paginator;
21797            self.by_page().items()
21798        }
21799
21800        /// Sets the value of [parent][crate::model::ListToolsRequest::parent].
21801        ///
21802        /// This is a **required** field for requests.
21803        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21804            self.0.request.parent = v.into();
21805            self
21806        }
21807
21808        /// Sets the value of [page_size][crate::model::ListToolsRequest::page_size].
21809        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21810            self.0.request.page_size = v.into();
21811            self
21812        }
21813
21814        /// Sets the value of [page_token][crate::model::ListToolsRequest::page_token].
21815        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21816            self.0.request.page_token = v.into();
21817            self
21818        }
21819    }
21820
21821    #[doc(hidden)]
21822    impl crate::RequestBuilder for ListTools {
21823        fn request_options(&mut self) -> &mut crate::RequestOptions {
21824            &mut self.0.options
21825        }
21826    }
21827
21828    /// The request builder for [Tools::delete_tool][crate::client::Tools::delete_tool] calls.
21829    ///
21830    /// # Example
21831    /// ```
21832    /// # use google_cloud_dialogflow_v2::builder::tools::DeleteTool;
21833    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21834    ///
21835    /// let builder = prepare_request_builder();
21836    /// let response = builder.send().await?;
21837    /// # Ok(()) }
21838    ///
21839    /// fn prepare_request_builder() -> DeleteTool {
21840    ///   # panic!();
21841    ///   // ... details omitted ...
21842    /// }
21843    /// ```
21844    #[derive(Clone, Debug)]
21845    pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
21846
21847    impl DeleteTool {
21848        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21849            Self(RequestBuilder::new(stub))
21850        }
21851
21852        /// Sets the full request, replacing any prior values.
21853        pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
21854            self.0.request = v.into();
21855            self
21856        }
21857
21858        /// Sets all the options, replacing any prior values.
21859        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21860            self.0.options = v.into();
21861            self
21862        }
21863
21864        /// Sends the request.
21865        pub async fn send(self) -> Result<()> {
21866            (*self.0.stub)
21867                .delete_tool(self.0.request, self.0.options)
21868                .await
21869                .map(crate::Response::into_body)
21870        }
21871
21872        /// Sets the value of [name][crate::model::DeleteToolRequest::name].
21873        ///
21874        /// This is a **required** field for requests.
21875        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21876            self.0.request.name = v.into();
21877            self
21878        }
21879    }
21880
21881    #[doc(hidden)]
21882    impl crate::RequestBuilder for DeleteTool {
21883        fn request_options(&mut self) -> &mut crate::RequestOptions {
21884            &mut self.0.options
21885        }
21886    }
21887
21888    /// The request builder for [Tools::update_tool][crate::client::Tools::update_tool] calls.
21889    ///
21890    /// # Example
21891    /// ```
21892    /// # use google_cloud_dialogflow_v2::builder::tools::UpdateTool;
21893    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21894    ///
21895    /// let builder = prepare_request_builder();
21896    /// let response = builder.send().await?;
21897    /// # Ok(()) }
21898    ///
21899    /// fn prepare_request_builder() -> UpdateTool {
21900    ///   # panic!();
21901    ///   // ... details omitted ...
21902    /// }
21903    /// ```
21904    #[derive(Clone, Debug)]
21905    pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
21906
21907    impl UpdateTool {
21908        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21909            Self(RequestBuilder::new(stub))
21910        }
21911
21912        /// Sets the full request, replacing any prior values.
21913        pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
21914            self.0.request = v.into();
21915            self
21916        }
21917
21918        /// Sets all the options, replacing any prior values.
21919        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21920            self.0.options = v.into();
21921            self
21922        }
21923
21924        /// Sends the request.
21925        pub async fn send(self) -> Result<crate::model::Tool> {
21926            (*self.0.stub)
21927                .update_tool(self.0.request, self.0.options)
21928                .await
21929                .map(crate::Response::into_body)
21930        }
21931
21932        /// Sets the value of [tool][crate::model::UpdateToolRequest::tool].
21933        ///
21934        /// This is a **required** field for requests.
21935        pub fn set_tool<T>(mut self, v: T) -> Self
21936        where
21937            T: std::convert::Into<crate::model::Tool>,
21938        {
21939            self.0.request.tool = std::option::Option::Some(v.into());
21940            self
21941        }
21942
21943        /// Sets or clears the value of [tool][crate::model::UpdateToolRequest::tool].
21944        ///
21945        /// This is a **required** field for requests.
21946        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
21947        where
21948            T: std::convert::Into<crate::model::Tool>,
21949        {
21950            self.0.request.tool = v.map(|x| x.into());
21951            self
21952        }
21953
21954        /// Sets the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
21955        pub fn set_update_mask<T>(mut self, v: T) -> Self
21956        where
21957            T: std::convert::Into<wkt::FieldMask>,
21958        {
21959            self.0.request.update_mask = std::option::Option::Some(v.into());
21960            self
21961        }
21962
21963        /// Sets or clears the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
21964        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21965        where
21966            T: std::convert::Into<wkt::FieldMask>,
21967        {
21968            self.0.request.update_mask = v.map(|x| x.into());
21969            self
21970        }
21971    }
21972
21973    #[doc(hidden)]
21974    impl crate::RequestBuilder for UpdateTool {
21975        fn request_options(&mut self) -> &mut crate::RequestOptions {
21976            &mut self.0.options
21977        }
21978    }
21979
21980    /// The request builder for [Tools::list_locations][crate::client::Tools::list_locations] calls.
21981    ///
21982    /// # Example
21983    /// ```
21984    /// # use google_cloud_dialogflow_v2::builder::tools::ListLocations;
21985    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
21986    /// use google_cloud_gax::paginator::ItemPaginator;
21987    ///
21988    /// let builder = prepare_request_builder();
21989    /// let mut items = builder.by_item();
21990    /// while let Some(result) = items.next().await {
21991    ///   let item = result?;
21992    /// }
21993    /// # Ok(()) }
21994    ///
21995    /// fn prepare_request_builder() -> ListLocations {
21996    ///   # panic!();
21997    ///   // ... details omitted ...
21998    /// }
21999    /// ```
22000    #[derive(Clone, Debug)]
22001    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
22002
22003    impl ListLocations {
22004        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22005            Self(RequestBuilder::new(stub))
22006        }
22007
22008        /// Sets the full request, replacing any prior values.
22009        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
22010            mut self,
22011            v: V,
22012        ) -> Self {
22013            self.0.request = v.into();
22014            self
22015        }
22016
22017        /// Sets all the options, replacing any prior values.
22018        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22019            self.0.options = v.into();
22020            self
22021        }
22022
22023        /// Sends the request.
22024        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
22025            (*self.0.stub)
22026                .list_locations(self.0.request, self.0.options)
22027                .await
22028                .map(crate::Response::into_body)
22029        }
22030
22031        /// Streams each page in the collection.
22032        pub fn by_page(
22033            self,
22034        ) -> impl google_cloud_gax::paginator::Paginator<
22035            google_cloud_location::model::ListLocationsResponse,
22036            crate::Error,
22037        > {
22038            use std::clone::Clone;
22039            let token = self.0.request.page_token.clone();
22040            let execute = move |token: String| {
22041                let mut builder = self.clone();
22042                builder.0.request = builder.0.request.set_page_token(token);
22043                builder.send()
22044            };
22045            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22046        }
22047
22048        /// Streams each item in the collection.
22049        pub fn by_item(
22050            self,
22051        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22052            google_cloud_location::model::ListLocationsResponse,
22053            crate::Error,
22054        > {
22055            use google_cloud_gax::paginator::Paginator;
22056            self.by_page().items()
22057        }
22058
22059        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
22060        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22061            self.0.request.name = v.into();
22062            self
22063        }
22064
22065        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
22066        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22067            self.0.request.filter = v.into();
22068            self
22069        }
22070
22071        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
22072        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22073            self.0.request.page_size = v.into();
22074            self
22075        }
22076
22077        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
22078        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22079            self.0.request.page_token = v.into();
22080            self
22081        }
22082    }
22083
22084    #[doc(hidden)]
22085    impl crate::RequestBuilder for ListLocations {
22086        fn request_options(&mut self) -> &mut crate::RequestOptions {
22087            &mut self.0.options
22088        }
22089    }
22090
22091    /// The request builder for [Tools::get_location][crate::client::Tools::get_location] calls.
22092    ///
22093    /// # Example
22094    /// ```
22095    /// # use google_cloud_dialogflow_v2::builder::tools::GetLocation;
22096    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22097    ///
22098    /// let builder = prepare_request_builder();
22099    /// let response = builder.send().await?;
22100    /// # Ok(()) }
22101    ///
22102    /// fn prepare_request_builder() -> GetLocation {
22103    ///   # panic!();
22104    ///   // ... details omitted ...
22105    /// }
22106    /// ```
22107    #[derive(Clone, Debug)]
22108    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
22109
22110    impl GetLocation {
22111        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22112            Self(RequestBuilder::new(stub))
22113        }
22114
22115        /// Sets the full request, replacing any prior values.
22116        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
22117            mut self,
22118            v: V,
22119        ) -> Self {
22120            self.0.request = v.into();
22121            self
22122        }
22123
22124        /// Sets all the options, replacing any prior values.
22125        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22126            self.0.options = v.into();
22127            self
22128        }
22129
22130        /// Sends the request.
22131        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
22132            (*self.0.stub)
22133                .get_location(self.0.request, self.0.options)
22134                .await
22135                .map(crate::Response::into_body)
22136        }
22137
22138        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
22139        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22140            self.0.request.name = v.into();
22141            self
22142        }
22143    }
22144
22145    #[doc(hidden)]
22146    impl crate::RequestBuilder for GetLocation {
22147        fn request_options(&mut self) -> &mut crate::RequestOptions {
22148            &mut self.0.options
22149        }
22150    }
22151
22152    /// The request builder for [Tools::list_operations][crate::client::Tools::list_operations] calls.
22153    ///
22154    /// # Example
22155    /// ```
22156    /// # use google_cloud_dialogflow_v2::builder::tools::ListOperations;
22157    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22158    /// use google_cloud_gax::paginator::ItemPaginator;
22159    ///
22160    /// let builder = prepare_request_builder();
22161    /// let mut items = builder.by_item();
22162    /// while let Some(result) = items.next().await {
22163    ///   let item = result?;
22164    /// }
22165    /// # Ok(()) }
22166    ///
22167    /// fn prepare_request_builder() -> ListOperations {
22168    ///   # panic!();
22169    ///   // ... details omitted ...
22170    /// }
22171    /// ```
22172    #[derive(Clone, Debug)]
22173    pub struct ListOperations(
22174        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
22175    );
22176
22177    impl ListOperations {
22178        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22179            Self(RequestBuilder::new(stub))
22180        }
22181
22182        /// Sets the full request, replacing any prior values.
22183        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
22184            mut self,
22185            v: V,
22186        ) -> Self {
22187            self.0.request = v.into();
22188            self
22189        }
22190
22191        /// Sets all the options, replacing any prior values.
22192        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22193            self.0.options = v.into();
22194            self
22195        }
22196
22197        /// Sends the request.
22198        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
22199            (*self.0.stub)
22200                .list_operations(self.0.request, self.0.options)
22201                .await
22202                .map(crate::Response::into_body)
22203        }
22204
22205        /// Streams each page in the collection.
22206        pub fn by_page(
22207            self,
22208        ) -> impl google_cloud_gax::paginator::Paginator<
22209            google_cloud_longrunning::model::ListOperationsResponse,
22210            crate::Error,
22211        > {
22212            use std::clone::Clone;
22213            let token = self.0.request.page_token.clone();
22214            let execute = move |token: String| {
22215                let mut builder = self.clone();
22216                builder.0.request = builder.0.request.set_page_token(token);
22217                builder.send()
22218            };
22219            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22220        }
22221
22222        /// Streams each item in the collection.
22223        pub fn by_item(
22224            self,
22225        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22226            google_cloud_longrunning::model::ListOperationsResponse,
22227            crate::Error,
22228        > {
22229            use google_cloud_gax::paginator::Paginator;
22230            self.by_page().items()
22231        }
22232
22233        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
22234        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22235            self.0.request.name = v.into();
22236            self
22237        }
22238
22239        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
22240        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22241            self.0.request.filter = v.into();
22242            self
22243        }
22244
22245        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
22246        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22247            self.0.request.page_size = v.into();
22248            self
22249        }
22250
22251        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
22252        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22253            self.0.request.page_token = v.into();
22254            self
22255        }
22256
22257        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
22258        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22259            self.0.request.return_partial_success = v.into();
22260            self
22261        }
22262    }
22263
22264    #[doc(hidden)]
22265    impl crate::RequestBuilder for ListOperations {
22266        fn request_options(&mut self) -> &mut crate::RequestOptions {
22267            &mut self.0.options
22268        }
22269    }
22270
22271    /// The request builder for [Tools::get_operation][crate::client::Tools::get_operation] calls.
22272    ///
22273    /// # Example
22274    /// ```
22275    /// # use google_cloud_dialogflow_v2::builder::tools::GetOperation;
22276    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22277    ///
22278    /// let builder = prepare_request_builder();
22279    /// let response = builder.send().await?;
22280    /// # Ok(()) }
22281    ///
22282    /// fn prepare_request_builder() -> GetOperation {
22283    ///   # panic!();
22284    ///   // ... details omitted ...
22285    /// }
22286    /// ```
22287    #[derive(Clone, Debug)]
22288    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22289
22290    impl GetOperation {
22291        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22292            Self(RequestBuilder::new(stub))
22293        }
22294
22295        /// Sets the full request, replacing any prior values.
22296        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22297            mut self,
22298            v: V,
22299        ) -> Self {
22300            self.0.request = v.into();
22301            self
22302        }
22303
22304        /// Sets all the options, replacing any prior values.
22305        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22306            self.0.options = v.into();
22307            self
22308        }
22309
22310        /// Sends the request.
22311        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22312            (*self.0.stub)
22313                .get_operation(self.0.request, self.0.options)
22314                .await
22315                .map(crate::Response::into_body)
22316        }
22317
22318        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
22319        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22320            self.0.request.name = v.into();
22321            self
22322        }
22323    }
22324
22325    #[doc(hidden)]
22326    impl crate::RequestBuilder for GetOperation {
22327        fn request_options(&mut self) -> &mut crate::RequestOptions {
22328            &mut self.0.options
22329        }
22330    }
22331
22332    /// The request builder for [Tools::cancel_operation][crate::client::Tools::cancel_operation] calls.
22333    ///
22334    /// # Example
22335    /// ```
22336    /// # use google_cloud_dialogflow_v2::builder::tools::CancelOperation;
22337    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22338    ///
22339    /// let builder = prepare_request_builder();
22340    /// let response = builder.send().await?;
22341    /// # Ok(()) }
22342    ///
22343    /// fn prepare_request_builder() -> CancelOperation {
22344    ///   # panic!();
22345    ///   // ... details omitted ...
22346    /// }
22347    /// ```
22348    #[derive(Clone, Debug)]
22349    pub struct CancelOperation(
22350        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22351    );
22352
22353    impl CancelOperation {
22354        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22355            Self(RequestBuilder::new(stub))
22356        }
22357
22358        /// Sets the full request, replacing any prior values.
22359        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22360            mut self,
22361            v: V,
22362        ) -> Self {
22363            self.0.request = v.into();
22364            self
22365        }
22366
22367        /// Sets all the options, replacing any prior values.
22368        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22369            self.0.options = v.into();
22370            self
22371        }
22372
22373        /// Sends the request.
22374        pub async fn send(self) -> Result<()> {
22375            (*self.0.stub)
22376                .cancel_operation(self.0.request, self.0.options)
22377                .await
22378                .map(crate::Response::into_body)
22379        }
22380
22381        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
22382        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22383            self.0.request.name = v.into();
22384            self
22385        }
22386    }
22387
22388    #[doc(hidden)]
22389    impl crate::RequestBuilder for CancelOperation {
22390        fn request_options(&mut self) -> &mut crate::RequestOptions {
22391            &mut self.0.options
22392        }
22393    }
22394}
22395
22396#[cfg(feature = "versions")]
22397#[cfg_attr(docsrs, doc(cfg(feature = "versions")))]
22398pub mod versions {
22399    use crate::Result;
22400
22401    /// A builder for [Versions][crate::client::Versions].
22402    ///
22403    /// ```
22404    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
22405    /// # use google_cloud_dialogflow_v2::*;
22406    /// # use builder::versions::ClientBuilder;
22407    /// # use client::Versions;
22408    /// let builder : ClientBuilder = Versions::builder();
22409    /// let client = builder
22410    ///     .with_endpoint("https://dialogflow.googleapis.com")
22411    ///     .build().await?;
22412    /// # Ok(()) }
22413    /// ```
22414    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22415
22416    pub(crate) mod client {
22417        use super::super::super::client::Versions;
22418        pub struct Factory;
22419        impl crate::ClientFactory for Factory {
22420            type Client = Versions;
22421            type Credentials = gaxi::options::Credentials;
22422            async fn build(
22423                self,
22424                config: gaxi::options::ClientConfig,
22425            ) -> crate::ClientBuilderResult<Self::Client> {
22426                Self::Client::new(config).await
22427            }
22428        }
22429    }
22430
22431    /// Common implementation for [crate::client::Versions] request builders.
22432    #[derive(Clone, Debug)]
22433    pub(crate) struct RequestBuilder<R: std::default::Default> {
22434        stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
22435        request: R,
22436        options: crate::RequestOptions,
22437    }
22438
22439    impl<R> RequestBuilder<R>
22440    where
22441        R: std::default::Default,
22442    {
22443        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22444            Self {
22445                stub,
22446                request: R::default(),
22447                options: crate::RequestOptions::default(),
22448            }
22449        }
22450    }
22451
22452    /// The request builder for [Versions::list_versions][crate::client::Versions::list_versions] calls.
22453    ///
22454    /// # Example
22455    /// ```
22456    /// # use google_cloud_dialogflow_v2::builder::versions::ListVersions;
22457    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22458    /// use google_cloud_gax::paginator::ItemPaginator;
22459    ///
22460    /// let builder = prepare_request_builder();
22461    /// let mut items = builder.by_item();
22462    /// while let Some(result) = items.next().await {
22463    ///   let item = result?;
22464    /// }
22465    /// # Ok(()) }
22466    ///
22467    /// fn prepare_request_builder() -> ListVersions {
22468    ///   # panic!();
22469    ///   // ... details omitted ...
22470    /// }
22471    /// ```
22472    #[derive(Clone, Debug)]
22473    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
22474
22475    impl ListVersions {
22476        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22477            Self(RequestBuilder::new(stub))
22478        }
22479
22480        /// Sets the full request, replacing any prior values.
22481        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
22482            self.0.request = v.into();
22483            self
22484        }
22485
22486        /// Sets all the options, replacing any prior values.
22487        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22488            self.0.options = v.into();
22489            self
22490        }
22491
22492        /// Sends the request.
22493        pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
22494            (*self.0.stub)
22495                .list_versions(self.0.request, self.0.options)
22496                .await
22497                .map(crate::Response::into_body)
22498        }
22499
22500        /// Streams each page in the collection.
22501        pub fn by_page(
22502            self,
22503        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
22504        {
22505            use std::clone::Clone;
22506            let token = self.0.request.page_token.clone();
22507            let execute = move |token: String| {
22508                let mut builder = self.clone();
22509                builder.0.request = builder.0.request.set_page_token(token);
22510                builder.send()
22511            };
22512            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22513        }
22514
22515        /// Streams each item in the collection.
22516        pub fn by_item(
22517            self,
22518        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22519            crate::model::ListVersionsResponse,
22520            crate::Error,
22521        > {
22522            use google_cloud_gax::paginator::Paginator;
22523            self.by_page().items()
22524        }
22525
22526        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
22527        ///
22528        /// This is a **required** field for requests.
22529        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22530            self.0.request.parent = v.into();
22531            self
22532        }
22533
22534        /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
22535        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22536            self.0.request.page_size = v.into();
22537            self
22538        }
22539
22540        /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
22541        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22542            self.0.request.page_token = v.into();
22543            self
22544        }
22545    }
22546
22547    #[doc(hidden)]
22548    impl crate::RequestBuilder for ListVersions {
22549        fn request_options(&mut self) -> &mut crate::RequestOptions {
22550            &mut self.0.options
22551        }
22552    }
22553
22554    /// The request builder for [Versions::get_version][crate::client::Versions::get_version] calls.
22555    ///
22556    /// # Example
22557    /// ```
22558    /// # use google_cloud_dialogflow_v2::builder::versions::GetVersion;
22559    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22560    ///
22561    /// let builder = prepare_request_builder();
22562    /// let response = builder.send().await?;
22563    /// # Ok(()) }
22564    ///
22565    /// fn prepare_request_builder() -> GetVersion {
22566    ///   # panic!();
22567    ///   // ... details omitted ...
22568    /// }
22569    /// ```
22570    #[derive(Clone, Debug)]
22571    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
22572
22573    impl GetVersion {
22574        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22575            Self(RequestBuilder::new(stub))
22576        }
22577
22578        /// Sets the full request, replacing any prior values.
22579        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
22580            self.0.request = v.into();
22581            self
22582        }
22583
22584        /// Sets all the options, replacing any prior values.
22585        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22586            self.0.options = v.into();
22587            self
22588        }
22589
22590        /// Sends the request.
22591        pub async fn send(self) -> Result<crate::model::Version> {
22592            (*self.0.stub)
22593                .get_version(self.0.request, self.0.options)
22594                .await
22595                .map(crate::Response::into_body)
22596        }
22597
22598        /// Sets the value of [name][crate::model::GetVersionRequest::name].
22599        ///
22600        /// This is a **required** field for requests.
22601        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22602            self.0.request.name = v.into();
22603            self
22604        }
22605    }
22606
22607    #[doc(hidden)]
22608    impl crate::RequestBuilder for GetVersion {
22609        fn request_options(&mut self) -> &mut crate::RequestOptions {
22610            &mut self.0.options
22611        }
22612    }
22613
22614    /// The request builder for [Versions::create_version][crate::client::Versions::create_version] calls.
22615    ///
22616    /// # Example
22617    /// ```
22618    /// # use google_cloud_dialogflow_v2::builder::versions::CreateVersion;
22619    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22620    ///
22621    /// let builder = prepare_request_builder();
22622    /// let response = builder.send().await?;
22623    /// # Ok(()) }
22624    ///
22625    /// fn prepare_request_builder() -> CreateVersion {
22626    ///   # panic!();
22627    ///   // ... details omitted ...
22628    /// }
22629    /// ```
22630    #[derive(Clone, Debug)]
22631    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
22632
22633    impl CreateVersion {
22634        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22635            Self(RequestBuilder::new(stub))
22636        }
22637
22638        /// Sets the full request, replacing any prior values.
22639        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
22640            self.0.request = v.into();
22641            self
22642        }
22643
22644        /// Sets all the options, replacing any prior values.
22645        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22646            self.0.options = v.into();
22647            self
22648        }
22649
22650        /// Sends the request.
22651        pub async fn send(self) -> Result<crate::model::Version> {
22652            (*self.0.stub)
22653                .create_version(self.0.request, self.0.options)
22654                .await
22655                .map(crate::Response::into_body)
22656        }
22657
22658        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
22659        ///
22660        /// This is a **required** field for requests.
22661        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22662            self.0.request.parent = v.into();
22663            self
22664        }
22665
22666        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
22667        ///
22668        /// This is a **required** field for requests.
22669        pub fn set_version<T>(mut self, v: T) -> Self
22670        where
22671            T: std::convert::Into<crate::model::Version>,
22672        {
22673            self.0.request.version = std::option::Option::Some(v.into());
22674            self
22675        }
22676
22677        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
22678        ///
22679        /// This is a **required** field for requests.
22680        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
22681        where
22682            T: std::convert::Into<crate::model::Version>,
22683        {
22684            self.0.request.version = v.map(|x| x.into());
22685            self
22686        }
22687    }
22688
22689    #[doc(hidden)]
22690    impl crate::RequestBuilder for CreateVersion {
22691        fn request_options(&mut self) -> &mut crate::RequestOptions {
22692            &mut self.0.options
22693        }
22694    }
22695
22696    /// The request builder for [Versions::update_version][crate::client::Versions::update_version] calls.
22697    ///
22698    /// # Example
22699    /// ```
22700    /// # use google_cloud_dialogflow_v2::builder::versions::UpdateVersion;
22701    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22702    ///
22703    /// let builder = prepare_request_builder();
22704    /// let response = builder.send().await?;
22705    /// # Ok(()) }
22706    ///
22707    /// fn prepare_request_builder() -> UpdateVersion {
22708    ///   # panic!();
22709    ///   // ... details omitted ...
22710    /// }
22711    /// ```
22712    #[derive(Clone, Debug)]
22713    pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
22714
22715    impl UpdateVersion {
22716        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22717            Self(RequestBuilder::new(stub))
22718        }
22719
22720        /// Sets the full request, replacing any prior values.
22721        pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
22722            self.0.request = v.into();
22723            self
22724        }
22725
22726        /// Sets all the options, replacing any prior values.
22727        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22728            self.0.options = v.into();
22729            self
22730        }
22731
22732        /// Sends the request.
22733        pub async fn send(self) -> Result<crate::model::Version> {
22734            (*self.0.stub)
22735                .update_version(self.0.request, self.0.options)
22736                .await
22737                .map(crate::Response::into_body)
22738        }
22739
22740        /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
22741        ///
22742        /// This is a **required** field for requests.
22743        pub fn set_version<T>(mut self, v: T) -> Self
22744        where
22745            T: std::convert::Into<crate::model::Version>,
22746        {
22747            self.0.request.version = std::option::Option::Some(v.into());
22748            self
22749        }
22750
22751        /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
22752        ///
22753        /// This is a **required** field for requests.
22754        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
22755        where
22756            T: std::convert::Into<crate::model::Version>,
22757        {
22758            self.0.request.version = v.map(|x| x.into());
22759            self
22760        }
22761
22762        /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
22763        ///
22764        /// This is a **required** field for requests.
22765        pub fn set_update_mask<T>(mut self, v: T) -> Self
22766        where
22767            T: std::convert::Into<wkt::FieldMask>,
22768        {
22769            self.0.request.update_mask = std::option::Option::Some(v.into());
22770            self
22771        }
22772
22773        /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
22774        ///
22775        /// This is a **required** field for requests.
22776        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22777        where
22778            T: std::convert::Into<wkt::FieldMask>,
22779        {
22780            self.0.request.update_mask = v.map(|x| x.into());
22781            self
22782        }
22783    }
22784
22785    #[doc(hidden)]
22786    impl crate::RequestBuilder for UpdateVersion {
22787        fn request_options(&mut self) -> &mut crate::RequestOptions {
22788            &mut self.0.options
22789        }
22790    }
22791
22792    /// The request builder for [Versions::delete_version][crate::client::Versions::delete_version] calls.
22793    ///
22794    /// # Example
22795    /// ```
22796    /// # use google_cloud_dialogflow_v2::builder::versions::DeleteVersion;
22797    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22798    ///
22799    /// let builder = prepare_request_builder();
22800    /// let response = builder.send().await?;
22801    /// # Ok(()) }
22802    ///
22803    /// fn prepare_request_builder() -> DeleteVersion {
22804    ///   # panic!();
22805    ///   // ... details omitted ...
22806    /// }
22807    /// ```
22808    #[derive(Clone, Debug)]
22809    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
22810
22811    impl DeleteVersion {
22812        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22813            Self(RequestBuilder::new(stub))
22814        }
22815
22816        /// Sets the full request, replacing any prior values.
22817        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
22818            self.0.request = v.into();
22819            self
22820        }
22821
22822        /// Sets all the options, replacing any prior values.
22823        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22824            self.0.options = v.into();
22825            self
22826        }
22827
22828        /// Sends the request.
22829        pub async fn send(self) -> Result<()> {
22830            (*self.0.stub)
22831                .delete_version(self.0.request, self.0.options)
22832                .await
22833                .map(crate::Response::into_body)
22834        }
22835
22836        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
22837        ///
22838        /// This is a **required** field for requests.
22839        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22840            self.0.request.name = v.into();
22841            self
22842        }
22843    }
22844
22845    #[doc(hidden)]
22846    impl crate::RequestBuilder for DeleteVersion {
22847        fn request_options(&mut self) -> &mut crate::RequestOptions {
22848            &mut self.0.options
22849        }
22850    }
22851
22852    /// The request builder for [Versions::list_locations][crate::client::Versions::list_locations] calls.
22853    ///
22854    /// # Example
22855    /// ```
22856    /// # use google_cloud_dialogflow_v2::builder::versions::ListLocations;
22857    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22858    /// use google_cloud_gax::paginator::ItemPaginator;
22859    ///
22860    /// let builder = prepare_request_builder();
22861    /// let mut items = builder.by_item();
22862    /// while let Some(result) = items.next().await {
22863    ///   let item = result?;
22864    /// }
22865    /// # Ok(()) }
22866    ///
22867    /// fn prepare_request_builder() -> ListLocations {
22868    ///   # panic!();
22869    ///   // ... details omitted ...
22870    /// }
22871    /// ```
22872    #[derive(Clone, Debug)]
22873    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
22874
22875    impl ListLocations {
22876        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22877            Self(RequestBuilder::new(stub))
22878        }
22879
22880        /// Sets the full request, replacing any prior values.
22881        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
22882            mut self,
22883            v: V,
22884        ) -> Self {
22885            self.0.request = v.into();
22886            self
22887        }
22888
22889        /// Sets all the options, replacing any prior values.
22890        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22891            self.0.options = v.into();
22892            self
22893        }
22894
22895        /// Sends the request.
22896        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
22897            (*self.0.stub)
22898                .list_locations(self.0.request, self.0.options)
22899                .await
22900                .map(crate::Response::into_body)
22901        }
22902
22903        /// Streams each page in the collection.
22904        pub fn by_page(
22905            self,
22906        ) -> impl google_cloud_gax::paginator::Paginator<
22907            google_cloud_location::model::ListLocationsResponse,
22908            crate::Error,
22909        > {
22910            use std::clone::Clone;
22911            let token = self.0.request.page_token.clone();
22912            let execute = move |token: String| {
22913                let mut builder = self.clone();
22914                builder.0.request = builder.0.request.set_page_token(token);
22915                builder.send()
22916            };
22917            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22918        }
22919
22920        /// Streams each item in the collection.
22921        pub fn by_item(
22922            self,
22923        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22924            google_cloud_location::model::ListLocationsResponse,
22925            crate::Error,
22926        > {
22927            use google_cloud_gax::paginator::Paginator;
22928            self.by_page().items()
22929        }
22930
22931        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
22932        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22933            self.0.request.name = v.into();
22934            self
22935        }
22936
22937        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
22938        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22939            self.0.request.filter = v.into();
22940            self
22941        }
22942
22943        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
22944        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22945            self.0.request.page_size = v.into();
22946            self
22947        }
22948
22949        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
22950        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22951            self.0.request.page_token = v.into();
22952            self
22953        }
22954    }
22955
22956    #[doc(hidden)]
22957    impl crate::RequestBuilder for ListLocations {
22958        fn request_options(&mut self) -> &mut crate::RequestOptions {
22959            &mut self.0.options
22960        }
22961    }
22962
22963    /// The request builder for [Versions::get_location][crate::client::Versions::get_location] calls.
22964    ///
22965    /// # Example
22966    /// ```
22967    /// # use google_cloud_dialogflow_v2::builder::versions::GetLocation;
22968    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
22969    ///
22970    /// let builder = prepare_request_builder();
22971    /// let response = builder.send().await?;
22972    /// # Ok(()) }
22973    ///
22974    /// fn prepare_request_builder() -> GetLocation {
22975    ///   # panic!();
22976    ///   // ... details omitted ...
22977    /// }
22978    /// ```
22979    #[derive(Clone, Debug)]
22980    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
22981
22982    impl GetLocation {
22983        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22984            Self(RequestBuilder::new(stub))
22985        }
22986
22987        /// Sets the full request, replacing any prior values.
22988        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
22989            mut self,
22990            v: V,
22991        ) -> Self {
22992            self.0.request = v.into();
22993            self
22994        }
22995
22996        /// Sets all the options, replacing any prior values.
22997        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22998            self.0.options = v.into();
22999            self
23000        }
23001
23002        /// Sends the request.
23003        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
23004            (*self.0.stub)
23005                .get_location(self.0.request, self.0.options)
23006                .await
23007                .map(crate::Response::into_body)
23008        }
23009
23010        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
23011        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23012            self.0.request.name = v.into();
23013            self
23014        }
23015    }
23016
23017    #[doc(hidden)]
23018    impl crate::RequestBuilder for GetLocation {
23019        fn request_options(&mut self) -> &mut crate::RequestOptions {
23020            &mut self.0.options
23021        }
23022    }
23023
23024    /// The request builder for [Versions::list_operations][crate::client::Versions::list_operations] calls.
23025    ///
23026    /// # Example
23027    /// ```
23028    /// # use google_cloud_dialogflow_v2::builder::versions::ListOperations;
23029    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23030    /// use google_cloud_gax::paginator::ItemPaginator;
23031    ///
23032    /// let builder = prepare_request_builder();
23033    /// let mut items = builder.by_item();
23034    /// while let Some(result) = items.next().await {
23035    ///   let item = result?;
23036    /// }
23037    /// # Ok(()) }
23038    ///
23039    /// fn prepare_request_builder() -> ListOperations {
23040    ///   # panic!();
23041    ///   // ... details omitted ...
23042    /// }
23043    /// ```
23044    #[derive(Clone, Debug)]
23045    pub struct ListOperations(
23046        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
23047    );
23048
23049    impl ListOperations {
23050        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23051            Self(RequestBuilder::new(stub))
23052        }
23053
23054        /// Sets the full request, replacing any prior values.
23055        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
23056            mut self,
23057            v: V,
23058        ) -> Self {
23059            self.0.request = v.into();
23060            self
23061        }
23062
23063        /// Sets all the options, replacing any prior values.
23064        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23065            self.0.options = v.into();
23066            self
23067        }
23068
23069        /// Sends the request.
23070        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
23071            (*self.0.stub)
23072                .list_operations(self.0.request, self.0.options)
23073                .await
23074                .map(crate::Response::into_body)
23075        }
23076
23077        /// Streams each page in the collection.
23078        pub fn by_page(
23079            self,
23080        ) -> impl google_cloud_gax::paginator::Paginator<
23081            google_cloud_longrunning::model::ListOperationsResponse,
23082            crate::Error,
23083        > {
23084            use std::clone::Clone;
23085            let token = self.0.request.page_token.clone();
23086            let execute = move |token: String| {
23087                let mut builder = self.clone();
23088                builder.0.request = builder.0.request.set_page_token(token);
23089                builder.send()
23090            };
23091            google_cloud_gax::paginator::internal::new_paginator(token, execute)
23092        }
23093
23094        /// Streams each item in the collection.
23095        pub fn by_item(
23096            self,
23097        ) -> impl google_cloud_gax::paginator::ItemPaginator<
23098            google_cloud_longrunning::model::ListOperationsResponse,
23099            crate::Error,
23100        > {
23101            use google_cloud_gax::paginator::Paginator;
23102            self.by_page().items()
23103        }
23104
23105        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
23106        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23107            self.0.request.name = v.into();
23108            self
23109        }
23110
23111        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
23112        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
23113            self.0.request.filter = v.into();
23114            self
23115        }
23116
23117        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
23118        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23119            self.0.request.page_size = v.into();
23120            self
23121        }
23122
23123        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
23124        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23125            self.0.request.page_token = v.into();
23126            self
23127        }
23128
23129        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
23130        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
23131            self.0.request.return_partial_success = v.into();
23132            self
23133        }
23134    }
23135
23136    #[doc(hidden)]
23137    impl crate::RequestBuilder for ListOperations {
23138        fn request_options(&mut self) -> &mut crate::RequestOptions {
23139            &mut self.0.options
23140        }
23141    }
23142
23143    /// The request builder for [Versions::get_operation][crate::client::Versions::get_operation] calls.
23144    ///
23145    /// # Example
23146    /// ```
23147    /// # use google_cloud_dialogflow_v2::builder::versions::GetOperation;
23148    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23149    ///
23150    /// let builder = prepare_request_builder();
23151    /// let response = builder.send().await?;
23152    /// # Ok(()) }
23153    ///
23154    /// fn prepare_request_builder() -> GetOperation {
23155    ///   # panic!();
23156    ///   // ... details omitted ...
23157    /// }
23158    /// ```
23159    #[derive(Clone, Debug)]
23160    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
23161
23162    impl GetOperation {
23163        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23164            Self(RequestBuilder::new(stub))
23165        }
23166
23167        /// Sets the full request, replacing any prior values.
23168        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
23169            mut self,
23170            v: V,
23171        ) -> Self {
23172            self.0.request = v.into();
23173            self
23174        }
23175
23176        /// Sets all the options, replacing any prior values.
23177        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23178            self.0.options = v.into();
23179            self
23180        }
23181
23182        /// Sends the request.
23183        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23184            (*self.0.stub)
23185                .get_operation(self.0.request, self.0.options)
23186                .await
23187                .map(crate::Response::into_body)
23188        }
23189
23190        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
23191        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23192            self.0.request.name = v.into();
23193            self
23194        }
23195    }
23196
23197    #[doc(hidden)]
23198    impl crate::RequestBuilder for GetOperation {
23199        fn request_options(&mut self) -> &mut crate::RequestOptions {
23200            &mut self.0.options
23201        }
23202    }
23203
23204    /// The request builder for [Versions::cancel_operation][crate::client::Versions::cancel_operation] calls.
23205    ///
23206    /// # Example
23207    /// ```
23208    /// # use google_cloud_dialogflow_v2::builder::versions::CancelOperation;
23209    /// # async fn sample() -> google_cloud_dialogflow_v2::Result<()> {
23210    ///
23211    /// let builder = prepare_request_builder();
23212    /// let response = builder.send().await?;
23213    /// # Ok(()) }
23214    ///
23215    /// fn prepare_request_builder() -> CancelOperation {
23216    ///   # panic!();
23217    ///   // ... details omitted ...
23218    /// }
23219    /// ```
23220    #[derive(Clone, Debug)]
23221    pub struct CancelOperation(
23222        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
23223    );
23224
23225    impl CancelOperation {
23226        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23227            Self(RequestBuilder::new(stub))
23228        }
23229
23230        /// Sets the full request, replacing any prior values.
23231        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
23232            mut self,
23233            v: V,
23234        ) -> Self {
23235            self.0.request = v.into();
23236            self
23237        }
23238
23239        /// Sets all the options, replacing any prior values.
23240        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23241            self.0.options = v.into();
23242            self
23243        }
23244
23245        /// Sends the request.
23246        pub async fn send(self) -> Result<()> {
23247            (*self.0.stub)
23248                .cancel_operation(self.0.request, self.0.options)
23249                .await
23250                .map(crate::Response::into_body)
23251        }
23252
23253        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
23254        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23255            self.0.request.name = v.into();
23256            self
23257        }
23258    }
23259
23260    #[doc(hidden)]
23261    impl crate::RequestBuilder for CancelOperation {
23262        fn request_options(&mut self) -> &mut crate::RequestOptions {
23263            &mut self.0.options
23264        }
23265    }
23266}