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() -> 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 =
36        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
37
38    pub(crate) mod client {
39        use super::super::super::client::Agents;
40        pub struct Factory;
41        impl gax::client_builder::internal::ClientFactory for Factory {
42            type Client = Agents;
43            type Credentials = gaxi::options::Credentials;
44            async fn build(
45                self,
46                config: gaxi::options::ClientConfig,
47            ) -> gax::client_builder::Result<Self::Client> {
48                Self::Client::new(config).await
49            }
50        }
51    }
52
53    /// Common implementation for [crate::client::Agents] request builders.
54    #[derive(Clone, Debug)]
55    pub(crate) struct RequestBuilder<R: std::default::Default> {
56        stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>,
57        request: R,
58        options: gax::options::RequestOptions,
59    }
60
61    impl<R> RequestBuilder<R>
62    where
63        R: std::default::Default,
64    {
65        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Agents::get_agent][crate::client::Agents::get_agent] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_dialogflow_v2::builder::agents::GetAgent;
79    /// # async fn sample() -> gax::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> GetAgent {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
92
93    impl GetAgent {
94        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
95            Self(RequestBuilder::new(stub))
96        }
97
98        /// Sets the full request, replacing any prior values.
99        pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
100            self.0.request = v.into();
101            self
102        }
103
104        /// Sets all the options, replacing any prior values.
105        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
106            self.0.options = v.into();
107            self
108        }
109
110        /// Sends the request.
111        pub async fn send(self) -> Result<crate::model::Agent> {
112            (*self.0.stub)
113                .get_agent(self.0.request, self.0.options)
114                .await
115                .map(gax::response::Response::into_body)
116        }
117
118        /// Sets the value of [parent][crate::model::GetAgentRequest::parent].
119        ///
120        /// This is a **required** field for requests.
121        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
122            self.0.request.parent = v.into();
123            self
124        }
125    }
126
127    #[doc(hidden)]
128    impl gax::options::internal::RequestBuilder for GetAgent {
129        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
130            &mut self.0.options
131        }
132    }
133
134    /// The request builder for [Agents::set_agent][crate::client::Agents::set_agent] calls.
135    ///
136    /// # Example
137    /// ```
138    /// # use google_cloud_dialogflow_v2::builder::agents::SetAgent;
139    /// # async fn sample() -> gax::Result<()> {
140    ///
141    /// let builder = prepare_request_builder();
142    /// let response = builder.send().await?;
143    /// # Ok(()) }
144    ///
145    /// fn prepare_request_builder() -> SetAgent {
146    ///   # panic!();
147    ///   // ... details omitted ...
148    /// }
149    /// ```
150    #[derive(Clone, Debug)]
151    pub struct SetAgent(RequestBuilder<crate::model::SetAgentRequest>);
152
153    impl SetAgent {
154        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
155            Self(RequestBuilder::new(stub))
156        }
157
158        /// Sets the full request, replacing any prior values.
159        pub fn with_request<V: Into<crate::model::SetAgentRequest>>(mut self, v: V) -> Self {
160            self.0.request = v.into();
161            self
162        }
163
164        /// Sets all the options, replacing any prior values.
165        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
166            self.0.options = v.into();
167            self
168        }
169
170        /// Sends the request.
171        pub async fn send(self) -> Result<crate::model::Agent> {
172            (*self.0.stub)
173                .set_agent(self.0.request, self.0.options)
174                .await
175                .map(gax::response::Response::into_body)
176        }
177
178        /// Sets the value of [agent][crate::model::SetAgentRequest::agent].
179        ///
180        /// This is a **required** field for requests.
181        pub fn set_agent<T>(mut self, v: T) -> Self
182        where
183            T: std::convert::Into<crate::model::Agent>,
184        {
185            self.0.request.agent = std::option::Option::Some(v.into());
186            self
187        }
188
189        /// Sets or clears the value of [agent][crate::model::SetAgentRequest::agent].
190        ///
191        /// This is a **required** field for requests.
192        pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
193        where
194            T: std::convert::Into<crate::model::Agent>,
195        {
196            self.0.request.agent = v.map(|x| x.into());
197            self
198        }
199
200        /// Sets the value of [update_mask][crate::model::SetAgentRequest::update_mask].
201        pub fn set_update_mask<T>(mut self, v: T) -> Self
202        where
203            T: std::convert::Into<wkt::FieldMask>,
204        {
205            self.0.request.update_mask = std::option::Option::Some(v.into());
206            self
207        }
208
209        /// Sets or clears the value of [update_mask][crate::model::SetAgentRequest::update_mask].
210        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
211        where
212            T: std::convert::Into<wkt::FieldMask>,
213        {
214            self.0.request.update_mask = v.map(|x| x.into());
215            self
216        }
217    }
218
219    #[doc(hidden)]
220    impl gax::options::internal::RequestBuilder for SetAgent {
221        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
222            &mut self.0.options
223        }
224    }
225
226    /// The request builder for [Agents::delete_agent][crate::client::Agents::delete_agent] calls.
227    ///
228    /// # Example
229    /// ```
230    /// # use google_cloud_dialogflow_v2::builder::agents::DeleteAgent;
231    /// # async fn sample() -> gax::Result<()> {
232    ///
233    /// let builder = prepare_request_builder();
234    /// let response = builder.send().await?;
235    /// # Ok(()) }
236    ///
237    /// fn prepare_request_builder() -> DeleteAgent {
238    ///   # panic!();
239    ///   // ... details omitted ...
240    /// }
241    /// ```
242    #[derive(Clone, Debug)]
243    pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
244
245    impl DeleteAgent {
246        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
247            Self(RequestBuilder::new(stub))
248        }
249
250        /// Sets the full request, replacing any prior values.
251        pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
252            self.0.request = v.into();
253            self
254        }
255
256        /// Sets all the options, replacing any prior values.
257        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
258            self.0.options = v.into();
259            self
260        }
261
262        /// Sends the request.
263        pub async fn send(self) -> Result<()> {
264            (*self.0.stub)
265                .delete_agent(self.0.request, self.0.options)
266                .await
267                .map(gax::response::Response::into_body)
268        }
269
270        /// Sets the value of [parent][crate::model::DeleteAgentRequest::parent].
271        ///
272        /// This is a **required** field for requests.
273        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
274            self.0.request.parent = v.into();
275            self
276        }
277    }
278
279    #[doc(hidden)]
280    impl gax::options::internal::RequestBuilder for DeleteAgent {
281        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
282            &mut self.0.options
283        }
284    }
285
286    /// The request builder for [Agents::search_agents][crate::client::Agents::search_agents] calls.
287    ///
288    /// # Example
289    /// ```
290    /// # use google_cloud_dialogflow_v2::builder::agents::SearchAgents;
291    /// # async fn sample() -> gax::Result<()> {
292    /// use gax::paginator::ItemPaginator;
293    ///
294    /// let builder = prepare_request_builder();
295    /// let mut items = builder.by_item();
296    /// while let Some(result) = items.next().await {
297    ///   let item = result?;
298    /// }
299    /// # Ok(()) }
300    ///
301    /// fn prepare_request_builder() -> SearchAgents {
302    ///   # panic!();
303    ///   // ... details omitted ...
304    /// }
305    /// ```
306    #[derive(Clone, Debug)]
307    pub struct SearchAgents(RequestBuilder<crate::model::SearchAgentsRequest>);
308
309    impl SearchAgents {
310        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
311            Self(RequestBuilder::new(stub))
312        }
313
314        /// Sets the full request, replacing any prior values.
315        pub fn with_request<V: Into<crate::model::SearchAgentsRequest>>(mut self, v: V) -> Self {
316            self.0.request = v.into();
317            self
318        }
319
320        /// Sets all the options, replacing any prior values.
321        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
322            self.0.options = v.into();
323            self
324        }
325
326        /// Sends the request.
327        pub async fn send(self) -> Result<crate::model::SearchAgentsResponse> {
328            (*self.0.stub)
329                .search_agents(self.0.request, self.0.options)
330                .await
331                .map(gax::response::Response::into_body)
332        }
333
334        /// Streams each page in the collection.
335        pub fn by_page(
336            self,
337        ) -> impl gax::paginator::Paginator<crate::model::SearchAgentsResponse, gax::error::Error>
338        {
339            use std::clone::Clone;
340            let token = self.0.request.page_token.clone();
341            let execute = move |token: String| {
342                let mut builder = self.clone();
343                builder.0.request = builder.0.request.set_page_token(token);
344                builder.send()
345            };
346            gax::paginator::internal::new_paginator(token, execute)
347        }
348
349        /// Streams each item in the collection.
350        pub fn by_item(
351            self,
352        ) -> impl gax::paginator::ItemPaginator<crate::model::SearchAgentsResponse, gax::error::Error>
353        {
354            use gax::paginator::Paginator;
355            self.by_page().items()
356        }
357
358        /// Sets the value of [parent][crate::model::SearchAgentsRequest::parent].
359        ///
360        /// This is a **required** field for requests.
361        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
362            self.0.request.parent = v.into();
363            self
364        }
365
366        /// Sets the value of [page_size][crate::model::SearchAgentsRequest::page_size].
367        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
368            self.0.request.page_size = v.into();
369            self
370        }
371
372        /// Sets the value of [page_token][crate::model::SearchAgentsRequest::page_token].
373        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
374            self.0.request.page_token = v.into();
375            self
376        }
377    }
378
379    #[doc(hidden)]
380    impl gax::options::internal::RequestBuilder for SearchAgents {
381        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
382            &mut self.0.options
383        }
384    }
385
386    /// The request builder for [Agents::train_agent][crate::client::Agents::train_agent] calls.
387    ///
388    /// # Example
389    /// ```
390    /// # use google_cloud_dialogflow_v2::builder::agents::TrainAgent;
391    /// # async fn sample() -> gax::Result<()> {
392    /// use lro::Poller;
393    ///
394    /// let builder = prepare_request_builder();
395    /// let response = builder.poller().until_done().await?;
396    /// # Ok(()) }
397    ///
398    /// fn prepare_request_builder() -> TrainAgent {
399    ///   # panic!();
400    ///   // ... details omitted ...
401    /// }
402    /// ```
403    #[derive(Clone, Debug)]
404    pub struct TrainAgent(RequestBuilder<crate::model::TrainAgentRequest>);
405
406    impl TrainAgent {
407        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
408            Self(RequestBuilder::new(stub))
409        }
410
411        /// Sets the full request, replacing any prior values.
412        pub fn with_request<V: Into<crate::model::TrainAgentRequest>>(mut self, v: V) -> Self {
413            self.0.request = v.into();
414            self
415        }
416
417        /// Sets all the options, replacing any prior values.
418        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
419            self.0.options = v.into();
420            self
421        }
422
423        /// Sends the request.
424        ///
425        /// # Long running operations
426        ///
427        /// This starts, but does not poll, a longrunning operation. More information
428        /// on [train_agent][crate::client::Agents::train_agent].
429        pub async fn send(self) -> Result<longrunning::model::Operation> {
430            (*self.0.stub)
431                .train_agent(self.0.request, self.0.options)
432                .await
433                .map(gax::response::Response::into_body)
434        }
435
436        /// Creates a [Poller][lro::Poller] to work with `train_agent`.
437        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
438            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
439            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
440            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
441
442            let stub = self.0.stub.clone();
443            let mut options = self.0.options.clone();
444            options.set_retry_policy(gax::retry_policy::NeverRetry);
445            let query = move |name| {
446                let stub = stub.clone();
447                let options = options.clone();
448                async {
449                    let op = GetOperation::new(stub)
450                        .set_name(name)
451                        .with_options(options)
452                        .send()
453                        .await?;
454                    Ok(Operation::new(op))
455                }
456            };
457
458            let start = move || async {
459                let op = self.send().await?;
460                Ok(Operation::new(op))
461            };
462
463            lro::internal::new_unit_response_poller(
464                polling_error_policy,
465                polling_backoff_policy,
466                start,
467                query,
468            )
469        }
470
471        /// Sets the value of [parent][crate::model::TrainAgentRequest::parent].
472        ///
473        /// This is a **required** field for requests.
474        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
475            self.0.request.parent = v.into();
476            self
477        }
478    }
479
480    #[doc(hidden)]
481    impl gax::options::internal::RequestBuilder for TrainAgent {
482        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
483            &mut self.0.options
484        }
485    }
486
487    /// The request builder for [Agents::export_agent][crate::client::Agents::export_agent] calls.
488    ///
489    /// # Example
490    /// ```
491    /// # use google_cloud_dialogflow_v2::builder::agents::ExportAgent;
492    /// # async fn sample() -> gax::Result<()> {
493    /// use lro::Poller;
494    ///
495    /// let builder = prepare_request_builder();
496    /// let response = builder.poller().until_done().await?;
497    /// # Ok(()) }
498    ///
499    /// fn prepare_request_builder() -> ExportAgent {
500    ///   # panic!();
501    ///   // ... details omitted ...
502    /// }
503    /// ```
504    #[derive(Clone, Debug)]
505    pub struct ExportAgent(RequestBuilder<crate::model::ExportAgentRequest>);
506
507    impl ExportAgent {
508        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
509            Self(RequestBuilder::new(stub))
510        }
511
512        /// Sets the full request, replacing any prior values.
513        pub fn with_request<V: Into<crate::model::ExportAgentRequest>>(mut self, v: V) -> Self {
514            self.0.request = v.into();
515            self
516        }
517
518        /// Sets all the options, replacing any prior values.
519        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
520            self.0.options = v.into();
521            self
522        }
523
524        /// Sends the request.
525        ///
526        /// # Long running operations
527        ///
528        /// This starts, but does not poll, a longrunning operation. More information
529        /// on [export_agent][crate::client::Agents::export_agent].
530        pub async fn send(self) -> Result<longrunning::model::Operation> {
531            (*self.0.stub)
532                .export_agent(self.0.request, self.0.options)
533                .await
534                .map(gax::response::Response::into_body)
535        }
536
537        /// Creates a [Poller][lro::Poller] to work with `export_agent`.
538        pub fn poller(self) -> impl lro::Poller<crate::model::ExportAgentResponse, wkt::Struct> {
539            type Operation =
540                lro::internal::Operation<crate::model::ExportAgentResponse, wkt::Struct>;
541            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
542            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
543
544            let stub = self.0.stub.clone();
545            let mut options = self.0.options.clone();
546            options.set_retry_policy(gax::retry_policy::NeverRetry);
547            let query = move |name| {
548                let stub = stub.clone();
549                let options = options.clone();
550                async {
551                    let op = GetOperation::new(stub)
552                        .set_name(name)
553                        .with_options(options)
554                        .send()
555                        .await?;
556                    Ok(Operation::new(op))
557                }
558            };
559
560            let start = move || async {
561                let op = self.send().await?;
562                Ok(Operation::new(op))
563            };
564
565            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
566        }
567
568        /// Sets the value of [parent][crate::model::ExportAgentRequest::parent].
569        ///
570        /// This is a **required** field for requests.
571        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
572            self.0.request.parent = v.into();
573            self
574        }
575
576        /// Sets the value of [agent_uri][crate::model::ExportAgentRequest::agent_uri].
577        ///
578        /// This is a **required** field for requests.
579        pub fn set_agent_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
580            self.0.request.agent_uri = v.into();
581            self
582        }
583    }
584
585    #[doc(hidden)]
586    impl gax::options::internal::RequestBuilder for ExportAgent {
587        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
588            &mut self.0.options
589        }
590    }
591
592    /// The request builder for [Agents::import_agent][crate::client::Agents::import_agent] calls.
593    ///
594    /// # Example
595    /// ```
596    /// # use google_cloud_dialogflow_v2::builder::agents::ImportAgent;
597    /// # async fn sample() -> gax::Result<()> {
598    /// use lro::Poller;
599    ///
600    /// let builder = prepare_request_builder();
601    /// let response = builder.poller().until_done().await?;
602    /// # Ok(()) }
603    ///
604    /// fn prepare_request_builder() -> ImportAgent {
605    ///   # panic!();
606    ///   // ... details omitted ...
607    /// }
608    /// ```
609    #[derive(Clone, Debug)]
610    pub struct ImportAgent(RequestBuilder<crate::model::ImportAgentRequest>);
611
612    impl ImportAgent {
613        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
614            Self(RequestBuilder::new(stub))
615        }
616
617        /// Sets the full request, replacing any prior values.
618        pub fn with_request<V: Into<crate::model::ImportAgentRequest>>(mut self, v: V) -> Self {
619            self.0.request = v.into();
620            self
621        }
622
623        /// Sets all the options, replacing any prior values.
624        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
625            self.0.options = v.into();
626            self
627        }
628
629        /// Sends the request.
630        ///
631        /// # Long running operations
632        ///
633        /// This starts, but does not poll, a longrunning operation. More information
634        /// on [import_agent][crate::client::Agents::import_agent].
635        pub async fn send(self) -> Result<longrunning::model::Operation> {
636            (*self.0.stub)
637                .import_agent(self.0.request, self.0.options)
638                .await
639                .map(gax::response::Response::into_body)
640        }
641
642        /// Creates a [Poller][lro::Poller] to work with `import_agent`.
643        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
644            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
645            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
646            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
647
648            let stub = self.0.stub.clone();
649            let mut options = self.0.options.clone();
650            options.set_retry_policy(gax::retry_policy::NeverRetry);
651            let query = move |name| {
652                let stub = stub.clone();
653                let options = options.clone();
654                async {
655                    let op = GetOperation::new(stub)
656                        .set_name(name)
657                        .with_options(options)
658                        .send()
659                        .await?;
660                    Ok(Operation::new(op))
661                }
662            };
663
664            let start = move || async {
665                let op = self.send().await?;
666                Ok(Operation::new(op))
667            };
668
669            lro::internal::new_unit_response_poller(
670                polling_error_policy,
671                polling_backoff_policy,
672                start,
673                query,
674            )
675        }
676
677        /// Sets the value of [parent][crate::model::ImportAgentRequest::parent].
678        ///
679        /// This is a **required** field for requests.
680        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
681            self.0.request.parent = v.into();
682            self
683        }
684
685        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent].
686        ///
687        /// Note that all the setters affecting `agent` are
688        /// mutually exclusive.
689        pub fn set_agent<T: Into<Option<crate::model::import_agent_request::Agent>>>(
690            mut self,
691            v: T,
692        ) -> Self {
693            self.0.request.agent = v.into();
694            self
695        }
696
697        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
698        /// to hold a `AgentUri`.
699        ///
700        /// Note that all the setters affecting `agent` are
701        /// mutually exclusive.
702        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
703            self.0.request = self.0.request.set_agent_uri(v);
704            self
705        }
706
707        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
708        /// to hold a `AgentContent`.
709        ///
710        /// Note that all the setters affecting `agent` are
711        /// mutually exclusive.
712        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
713            self.0.request = self.0.request.set_agent_content(v);
714            self
715        }
716    }
717
718    #[doc(hidden)]
719    impl gax::options::internal::RequestBuilder for ImportAgent {
720        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
721            &mut self.0.options
722        }
723    }
724
725    /// The request builder for [Agents::restore_agent][crate::client::Agents::restore_agent] calls.
726    ///
727    /// # Example
728    /// ```
729    /// # use google_cloud_dialogflow_v2::builder::agents::RestoreAgent;
730    /// # async fn sample() -> gax::Result<()> {
731    /// use lro::Poller;
732    ///
733    /// let builder = prepare_request_builder();
734    /// let response = builder.poller().until_done().await?;
735    /// # Ok(()) }
736    ///
737    /// fn prepare_request_builder() -> RestoreAgent {
738    ///   # panic!();
739    ///   // ... details omitted ...
740    /// }
741    /// ```
742    #[derive(Clone, Debug)]
743    pub struct RestoreAgent(RequestBuilder<crate::model::RestoreAgentRequest>);
744
745    impl RestoreAgent {
746        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
747            Self(RequestBuilder::new(stub))
748        }
749
750        /// Sets the full request, replacing any prior values.
751        pub fn with_request<V: Into<crate::model::RestoreAgentRequest>>(mut self, v: V) -> Self {
752            self.0.request = v.into();
753            self
754        }
755
756        /// Sets all the options, replacing any prior values.
757        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
758            self.0.options = v.into();
759            self
760        }
761
762        /// Sends the request.
763        ///
764        /// # Long running operations
765        ///
766        /// This starts, but does not poll, a longrunning operation. More information
767        /// on [restore_agent][crate::client::Agents::restore_agent].
768        pub async fn send(self) -> Result<longrunning::model::Operation> {
769            (*self.0.stub)
770                .restore_agent(self.0.request, self.0.options)
771                .await
772                .map(gax::response::Response::into_body)
773        }
774
775        /// Creates a [Poller][lro::Poller] to work with `restore_agent`.
776        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
777            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
778            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
779            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
780
781            let stub = self.0.stub.clone();
782            let mut options = self.0.options.clone();
783            options.set_retry_policy(gax::retry_policy::NeverRetry);
784            let query = move |name| {
785                let stub = stub.clone();
786                let options = options.clone();
787                async {
788                    let op = GetOperation::new(stub)
789                        .set_name(name)
790                        .with_options(options)
791                        .send()
792                        .await?;
793                    Ok(Operation::new(op))
794                }
795            };
796
797            let start = move || async {
798                let op = self.send().await?;
799                Ok(Operation::new(op))
800            };
801
802            lro::internal::new_unit_response_poller(
803                polling_error_policy,
804                polling_backoff_policy,
805                start,
806                query,
807            )
808        }
809
810        /// Sets the value of [parent][crate::model::RestoreAgentRequest::parent].
811        ///
812        /// This is a **required** field for requests.
813        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
814            self.0.request.parent = v.into();
815            self
816        }
817
818        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent].
819        ///
820        /// Note that all the setters affecting `agent` are
821        /// mutually exclusive.
822        pub fn set_agent<T: Into<Option<crate::model::restore_agent_request::Agent>>>(
823            mut self,
824            v: T,
825        ) -> Self {
826            self.0.request.agent = v.into();
827            self
828        }
829
830        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
831        /// to hold a `AgentUri`.
832        ///
833        /// Note that all the setters affecting `agent` are
834        /// mutually exclusive.
835        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
836            self.0.request = self.0.request.set_agent_uri(v);
837            self
838        }
839
840        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
841        /// to hold a `AgentContent`.
842        ///
843        /// Note that all the setters affecting `agent` are
844        /// mutually exclusive.
845        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
846            self.0.request = self.0.request.set_agent_content(v);
847            self
848        }
849    }
850
851    #[doc(hidden)]
852    impl gax::options::internal::RequestBuilder for RestoreAgent {
853        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
854            &mut self.0.options
855        }
856    }
857
858    /// The request builder for [Agents::get_validation_result][crate::client::Agents::get_validation_result] calls.
859    ///
860    /// # Example
861    /// ```
862    /// # use google_cloud_dialogflow_v2::builder::agents::GetValidationResult;
863    /// # async fn sample() -> gax::Result<()> {
864    ///
865    /// let builder = prepare_request_builder();
866    /// let response = builder.send().await?;
867    /// # Ok(()) }
868    ///
869    /// fn prepare_request_builder() -> GetValidationResult {
870    ///   # panic!();
871    ///   // ... details omitted ...
872    /// }
873    /// ```
874    #[derive(Clone, Debug)]
875    pub struct GetValidationResult(RequestBuilder<crate::model::GetValidationResultRequest>);
876
877    impl GetValidationResult {
878        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
879            Self(RequestBuilder::new(stub))
880        }
881
882        /// Sets the full request, replacing any prior values.
883        pub fn with_request<V: Into<crate::model::GetValidationResultRequest>>(
884            mut self,
885            v: V,
886        ) -> Self {
887            self.0.request = v.into();
888            self
889        }
890
891        /// Sets all the options, replacing any prior values.
892        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
893            self.0.options = v.into();
894            self
895        }
896
897        /// Sends the request.
898        pub async fn send(self) -> Result<crate::model::ValidationResult> {
899            (*self.0.stub)
900                .get_validation_result(self.0.request, self.0.options)
901                .await
902                .map(gax::response::Response::into_body)
903        }
904
905        /// Sets the value of [parent][crate::model::GetValidationResultRequest::parent].
906        ///
907        /// This is a **required** field for requests.
908        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
909            self.0.request.parent = v.into();
910            self
911        }
912
913        /// Sets the value of [language_code][crate::model::GetValidationResultRequest::language_code].
914        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
915            self.0.request.language_code = v.into();
916            self
917        }
918    }
919
920    #[doc(hidden)]
921    impl gax::options::internal::RequestBuilder for GetValidationResult {
922        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
923            &mut self.0.options
924        }
925    }
926
927    /// The request builder for [Agents::list_locations][crate::client::Agents::list_locations] calls.
928    ///
929    /// # Example
930    /// ```
931    /// # use google_cloud_dialogflow_v2::builder::agents::ListLocations;
932    /// # async fn sample() -> gax::Result<()> {
933    /// use gax::paginator::ItemPaginator;
934    ///
935    /// let builder = prepare_request_builder();
936    /// let mut items = builder.by_item();
937    /// while let Some(result) = items.next().await {
938    ///   let item = result?;
939    /// }
940    /// # Ok(()) }
941    ///
942    /// fn prepare_request_builder() -> ListLocations {
943    ///   # panic!();
944    ///   // ... details omitted ...
945    /// }
946    /// ```
947    #[derive(Clone, Debug)]
948    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
949
950    impl ListLocations {
951        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
952            Self(RequestBuilder::new(stub))
953        }
954
955        /// Sets the full request, replacing any prior values.
956        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
957            mut self,
958            v: V,
959        ) -> Self {
960            self.0.request = v.into();
961            self
962        }
963
964        /// Sets all the options, replacing any prior values.
965        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
966            self.0.options = v.into();
967            self
968        }
969
970        /// Sends the request.
971        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
972            (*self.0.stub)
973                .list_locations(self.0.request, self.0.options)
974                .await
975                .map(gax::response::Response::into_body)
976        }
977
978        /// Streams each page in the collection.
979        pub fn by_page(
980            self,
981        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
982        {
983            use std::clone::Clone;
984            let token = self.0.request.page_token.clone();
985            let execute = move |token: String| {
986                let mut builder = self.clone();
987                builder.0.request = builder.0.request.set_page_token(token);
988                builder.send()
989            };
990            gax::paginator::internal::new_paginator(token, execute)
991        }
992
993        /// Streams each item in the collection.
994        pub fn by_item(
995            self,
996        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
997        {
998            use gax::paginator::Paginator;
999            self.by_page().items()
1000        }
1001
1002        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1003        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1004            self.0.request.name = v.into();
1005            self
1006        }
1007
1008        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1009        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1010            self.0.request.filter = v.into();
1011            self
1012        }
1013
1014        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1015        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1016            self.0.request.page_size = v.into();
1017            self
1018        }
1019
1020        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1021        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1022            self.0.request.page_token = v.into();
1023            self
1024        }
1025    }
1026
1027    #[doc(hidden)]
1028    impl gax::options::internal::RequestBuilder for ListLocations {
1029        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1030            &mut self.0.options
1031        }
1032    }
1033
1034    /// The request builder for [Agents::get_location][crate::client::Agents::get_location] calls.
1035    ///
1036    /// # Example
1037    /// ```
1038    /// # use google_cloud_dialogflow_v2::builder::agents::GetLocation;
1039    /// # async fn sample() -> gax::Result<()> {
1040    ///
1041    /// let builder = prepare_request_builder();
1042    /// let response = builder.send().await?;
1043    /// # Ok(()) }
1044    ///
1045    /// fn prepare_request_builder() -> GetLocation {
1046    ///   # panic!();
1047    ///   // ... details omitted ...
1048    /// }
1049    /// ```
1050    #[derive(Clone, Debug)]
1051    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1052
1053    impl GetLocation {
1054        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1055            Self(RequestBuilder::new(stub))
1056        }
1057
1058        /// Sets the full request, replacing any prior values.
1059        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1060            self.0.request = v.into();
1061            self
1062        }
1063
1064        /// Sets all the options, replacing any prior values.
1065        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1066            self.0.options = v.into();
1067            self
1068        }
1069
1070        /// Sends the request.
1071        pub async fn send(self) -> Result<location::model::Location> {
1072            (*self.0.stub)
1073                .get_location(self.0.request, self.0.options)
1074                .await
1075                .map(gax::response::Response::into_body)
1076        }
1077
1078        /// Sets the value of [name][location::model::GetLocationRequest::name].
1079        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1080            self.0.request.name = v.into();
1081            self
1082        }
1083    }
1084
1085    #[doc(hidden)]
1086    impl gax::options::internal::RequestBuilder for GetLocation {
1087        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1088            &mut self.0.options
1089        }
1090    }
1091
1092    /// The request builder for [Agents::list_operations][crate::client::Agents::list_operations] calls.
1093    ///
1094    /// # Example
1095    /// ```
1096    /// # use google_cloud_dialogflow_v2::builder::agents::ListOperations;
1097    /// # async fn sample() -> gax::Result<()> {
1098    /// use gax::paginator::ItemPaginator;
1099    ///
1100    /// let builder = prepare_request_builder();
1101    /// let mut items = builder.by_item();
1102    /// while let Some(result) = items.next().await {
1103    ///   let item = result?;
1104    /// }
1105    /// # Ok(()) }
1106    ///
1107    /// fn prepare_request_builder() -> ListOperations {
1108    ///   # panic!();
1109    ///   // ... details omitted ...
1110    /// }
1111    /// ```
1112    #[derive(Clone, Debug)]
1113    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1114
1115    impl ListOperations {
1116        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1117            Self(RequestBuilder::new(stub))
1118        }
1119
1120        /// Sets the full request, replacing any prior values.
1121        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1122            mut self,
1123            v: V,
1124        ) -> Self {
1125            self.0.request = v.into();
1126            self
1127        }
1128
1129        /// Sets all the options, replacing any prior values.
1130        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1131            self.0.options = v.into();
1132            self
1133        }
1134
1135        /// Sends the request.
1136        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1137            (*self.0.stub)
1138                .list_operations(self.0.request, self.0.options)
1139                .await
1140                .map(gax::response::Response::into_body)
1141        }
1142
1143        /// Streams each page in the collection.
1144        pub fn by_page(
1145            self,
1146        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1147        {
1148            use std::clone::Clone;
1149            let token = self.0.request.page_token.clone();
1150            let execute = move |token: String| {
1151                let mut builder = self.clone();
1152                builder.0.request = builder.0.request.set_page_token(token);
1153                builder.send()
1154            };
1155            gax::paginator::internal::new_paginator(token, execute)
1156        }
1157
1158        /// Streams each item in the collection.
1159        pub fn by_item(
1160            self,
1161        ) -> impl gax::paginator::ItemPaginator<
1162            longrunning::model::ListOperationsResponse,
1163            gax::error::Error,
1164        > {
1165            use gax::paginator::Paginator;
1166            self.by_page().items()
1167        }
1168
1169        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1170        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1171            self.0.request.name = v.into();
1172            self
1173        }
1174
1175        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1176        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1177            self.0.request.filter = v.into();
1178            self
1179        }
1180
1181        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1182        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1183            self.0.request.page_size = v.into();
1184            self
1185        }
1186
1187        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1188        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1189            self.0.request.page_token = v.into();
1190            self
1191        }
1192
1193        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1194        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1195            self.0.request.return_partial_success = v.into();
1196            self
1197        }
1198    }
1199
1200    #[doc(hidden)]
1201    impl gax::options::internal::RequestBuilder for ListOperations {
1202        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1203            &mut self.0.options
1204        }
1205    }
1206
1207    /// The request builder for [Agents::get_operation][crate::client::Agents::get_operation] calls.
1208    ///
1209    /// # Example
1210    /// ```
1211    /// # use google_cloud_dialogflow_v2::builder::agents::GetOperation;
1212    /// # async fn sample() -> gax::Result<()> {
1213    ///
1214    /// let builder = prepare_request_builder();
1215    /// let response = builder.send().await?;
1216    /// # Ok(()) }
1217    ///
1218    /// fn prepare_request_builder() -> GetOperation {
1219    ///   # panic!();
1220    ///   // ... details omitted ...
1221    /// }
1222    /// ```
1223    #[derive(Clone, Debug)]
1224    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1225
1226    impl GetOperation {
1227        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1228            Self(RequestBuilder::new(stub))
1229        }
1230
1231        /// Sets the full request, replacing any prior values.
1232        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1233            mut self,
1234            v: V,
1235        ) -> Self {
1236            self.0.request = v.into();
1237            self
1238        }
1239
1240        /// Sets all the options, replacing any prior values.
1241        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1242            self.0.options = v.into();
1243            self
1244        }
1245
1246        /// Sends the request.
1247        pub async fn send(self) -> Result<longrunning::model::Operation> {
1248            (*self.0.stub)
1249                .get_operation(self.0.request, self.0.options)
1250                .await
1251                .map(gax::response::Response::into_body)
1252        }
1253
1254        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1255        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1256            self.0.request.name = v.into();
1257            self
1258        }
1259    }
1260
1261    #[doc(hidden)]
1262    impl gax::options::internal::RequestBuilder for GetOperation {
1263        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1264            &mut self.0.options
1265        }
1266    }
1267
1268    /// The request builder for [Agents::cancel_operation][crate::client::Agents::cancel_operation] calls.
1269    ///
1270    /// # Example
1271    /// ```
1272    /// # use google_cloud_dialogflow_v2::builder::agents::CancelOperation;
1273    /// # async fn sample() -> gax::Result<()> {
1274    ///
1275    /// let builder = prepare_request_builder();
1276    /// let response = builder.send().await?;
1277    /// # Ok(()) }
1278    ///
1279    /// fn prepare_request_builder() -> CancelOperation {
1280    ///   # panic!();
1281    ///   // ... details omitted ...
1282    /// }
1283    /// ```
1284    #[derive(Clone, Debug)]
1285    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1286
1287    impl CancelOperation {
1288        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1289            Self(RequestBuilder::new(stub))
1290        }
1291
1292        /// Sets the full request, replacing any prior values.
1293        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1294            mut self,
1295            v: V,
1296        ) -> Self {
1297            self.0.request = v.into();
1298            self
1299        }
1300
1301        /// Sets all the options, replacing any prior values.
1302        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1303            self.0.options = v.into();
1304            self
1305        }
1306
1307        /// Sends the request.
1308        pub async fn send(self) -> Result<()> {
1309            (*self.0.stub)
1310                .cancel_operation(self.0.request, self.0.options)
1311                .await
1312                .map(gax::response::Response::into_body)
1313        }
1314
1315        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1316        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1317            self.0.request.name = v.into();
1318            self
1319        }
1320    }
1321
1322    #[doc(hidden)]
1323    impl gax::options::internal::RequestBuilder for CancelOperation {
1324        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1325            &mut self.0.options
1326        }
1327    }
1328}
1329
1330#[cfg(feature = "answer-records")]
1331#[cfg_attr(docsrs, doc(cfg(feature = "answer-records")))]
1332pub mod answer_records {
1333    use crate::Result;
1334
1335    /// A builder for [AnswerRecords][crate::client::AnswerRecords].
1336    ///
1337    /// ```
1338    /// # async fn sample() -> gax::client_builder::Result<()> {
1339    /// # use google_cloud_dialogflow_v2::*;
1340    /// # use builder::answer_records::ClientBuilder;
1341    /// # use client::AnswerRecords;
1342    /// let builder : ClientBuilder = AnswerRecords::builder();
1343    /// let client = builder
1344    ///     .with_endpoint("https://dialogflow.googleapis.com")
1345    ///     .build().await?;
1346    /// # Ok(()) }
1347    /// ```
1348    pub type ClientBuilder =
1349        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1350
1351    pub(crate) mod client {
1352        use super::super::super::client::AnswerRecords;
1353        pub struct Factory;
1354        impl gax::client_builder::internal::ClientFactory for Factory {
1355            type Client = AnswerRecords;
1356            type Credentials = gaxi::options::Credentials;
1357            async fn build(
1358                self,
1359                config: gaxi::options::ClientConfig,
1360            ) -> gax::client_builder::Result<Self::Client> {
1361                Self::Client::new(config).await
1362            }
1363        }
1364    }
1365
1366    /// Common implementation for [crate::client::AnswerRecords] request builders.
1367    #[derive(Clone, Debug)]
1368    pub(crate) struct RequestBuilder<R: std::default::Default> {
1369        stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1370        request: R,
1371        options: gax::options::RequestOptions,
1372    }
1373
1374    impl<R> RequestBuilder<R>
1375    where
1376        R: std::default::Default,
1377    {
1378        pub(crate) fn new(
1379            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1380        ) -> Self {
1381            Self {
1382                stub,
1383                request: R::default(),
1384                options: gax::options::RequestOptions::default(),
1385            }
1386        }
1387    }
1388
1389    /// The request builder for [AnswerRecords::list_answer_records][crate::client::AnswerRecords::list_answer_records] calls.
1390    ///
1391    /// # Example
1392    /// ```
1393    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListAnswerRecords;
1394    /// # async fn sample() -> gax::Result<()> {
1395    /// use gax::paginator::ItemPaginator;
1396    ///
1397    /// let builder = prepare_request_builder();
1398    /// let mut items = builder.by_item();
1399    /// while let Some(result) = items.next().await {
1400    ///   let item = result?;
1401    /// }
1402    /// # Ok(()) }
1403    ///
1404    /// fn prepare_request_builder() -> ListAnswerRecords {
1405    ///   # panic!();
1406    ///   // ... details omitted ...
1407    /// }
1408    /// ```
1409    #[derive(Clone, Debug)]
1410    pub struct ListAnswerRecords(RequestBuilder<crate::model::ListAnswerRecordsRequest>);
1411
1412    impl ListAnswerRecords {
1413        pub(crate) fn new(
1414            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1415        ) -> Self {
1416            Self(RequestBuilder::new(stub))
1417        }
1418
1419        /// Sets the full request, replacing any prior values.
1420        pub fn with_request<V: Into<crate::model::ListAnswerRecordsRequest>>(
1421            mut self,
1422            v: V,
1423        ) -> Self {
1424            self.0.request = v.into();
1425            self
1426        }
1427
1428        /// Sets all the options, replacing any prior values.
1429        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1430            self.0.options = v.into();
1431            self
1432        }
1433
1434        /// Sends the request.
1435        pub async fn send(self) -> Result<crate::model::ListAnswerRecordsResponse> {
1436            (*self.0.stub)
1437                .list_answer_records(self.0.request, self.0.options)
1438                .await
1439                .map(gax::response::Response::into_body)
1440        }
1441
1442        /// Streams each page in the collection.
1443        pub fn by_page(
1444            self,
1445        ) -> impl gax::paginator::Paginator<crate::model::ListAnswerRecordsResponse, gax::error::Error>
1446        {
1447            use std::clone::Clone;
1448            let token = self.0.request.page_token.clone();
1449            let execute = move |token: String| {
1450                let mut builder = self.clone();
1451                builder.0.request = builder.0.request.set_page_token(token);
1452                builder.send()
1453            };
1454            gax::paginator::internal::new_paginator(token, execute)
1455        }
1456
1457        /// Streams each item in the collection.
1458        pub fn by_item(
1459            self,
1460        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAnswerRecordsResponse, gax::error::Error>
1461        {
1462            use gax::paginator::Paginator;
1463            self.by_page().items()
1464        }
1465
1466        /// Sets the value of [parent][crate::model::ListAnswerRecordsRequest::parent].
1467        ///
1468        /// This is a **required** field for requests.
1469        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470            self.0.request.parent = v.into();
1471            self
1472        }
1473
1474        /// Sets the value of [filter][crate::model::ListAnswerRecordsRequest::filter].
1475        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1476            self.0.request.filter = v.into();
1477            self
1478        }
1479
1480        /// Sets the value of [page_size][crate::model::ListAnswerRecordsRequest::page_size].
1481        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1482            self.0.request.page_size = v.into();
1483            self
1484        }
1485
1486        /// Sets the value of [page_token][crate::model::ListAnswerRecordsRequest::page_token].
1487        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488            self.0.request.page_token = v.into();
1489            self
1490        }
1491    }
1492
1493    #[doc(hidden)]
1494    impl gax::options::internal::RequestBuilder for ListAnswerRecords {
1495        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1496            &mut self.0.options
1497        }
1498    }
1499
1500    /// The request builder for [AnswerRecords::update_answer_record][crate::client::AnswerRecords::update_answer_record] calls.
1501    ///
1502    /// # Example
1503    /// ```
1504    /// # use google_cloud_dialogflow_v2::builder::answer_records::UpdateAnswerRecord;
1505    /// # async fn sample() -> gax::Result<()> {
1506    ///
1507    /// let builder = prepare_request_builder();
1508    /// let response = builder.send().await?;
1509    /// # Ok(()) }
1510    ///
1511    /// fn prepare_request_builder() -> UpdateAnswerRecord {
1512    ///   # panic!();
1513    ///   // ... details omitted ...
1514    /// }
1515    /// ```
1516    #[derive(Clone, Debug)]
1517    pub struct UpdateAnswerRecord(RequestBuilder<crate::model::UpdateAnswerRecordRequest>);
1518
1519    impl UpdateAnswerRecord {
1520        pub(crate) fn new(
1521            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1522        ) -> Self {
1523            Self(RequestBuilder::new(stub))
1524        }
1525
1526        /// Sets the full request, replacing any prior values.
1527        pub fn with_request<V: Into<crate::model::UpdateAnswerRecordRequest>>(
1528            mut self,
1529            v: V,
1530        ) -> Self {
1531            self.0.request = v.into();
1532            self
1533        }
1534
1535        /// Sets all the options, replacing any prior values.
1536        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1537            self.0.options = v.into();
1538            self
1539        }
1540
1541        /// Sends the request.
1542        pub async fn send(self) -> Result<crate::model::AnswerRecord> {
1543            (*self.0.stub)
1544                .update_answer_record(self.0.request, self.0.options)
1545                .await
1546                .map(gax::response::Response::into_body)
1547        }
1548
1549        /// Sets the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1550        ///
1551        /// This is a **required** field for requests.
1552        pub fn set_answer_record<T>(mut self, v: T) -> Self
1553        where
1554            T: std::convert::Into<crate::model::AnswerRecord>,
1555        {
1556            self.0.request.answer_record = std::option::Option::Some(v.into());
1557            self
1558        }
1559
1560        /// Sets or clears the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1561        ///
1562        /// This is a **required** field for requests.
1563        pub fn set_or_clear_answer_record<T>(mut self, v: std::option::Option<T>) -> Self
1564        where
1565            T: std::convert::Into<crate::model::AnswerRecord>,
1566        {
1567            self.0.request.answer_record = v.map(|x| x.into());
1568            self
1569        }
1570
1571        /// Sets the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1572        ///
1573        /// This is a **required** field for requests.
1574        pub fn set_update_mask<T>(mut self, v: T) -> Self
1575        where
1576            T: std::convert::Into<wkt::FieldMask>,
1577        {
1578            self.0.request.update_mask = std::option::Option::Some(v.into());
1579            self
1580        }
1581
1582        /// Sets or clears the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1583        ///
1584        /// This is a **required** field for requests.
1585        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1586        where
1587            T: std::convert::Into<wkt::FieldMask>,
1588        {
1589            self.0.request.update_mask = v.map(|x| x.into());
1590            self
1591        }
1592    }
1593
1594    #[doc(hidden)]
1595    impl gax::options::internal::RequestBuilder for UpdateAnswerRecord {
1596        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1597            &mut self.0.options
1598        }
1599    }
1600
1601    /// The request builder for [AnswerRecords::list_locations][crate::client::AnswerRecords::list_locations] calls.
1602    ///
1603    /// # Example
1604    /// ```
1605    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListLocations;
1606    /// # async fn sample() -> gax::Result<()> {
1607    /// use gax::paginator::ItemPaginator;
1608    ///
1609    /// let builder = prepare_request_builder();
1610    /// let mut items = builder.by_item();
1611    /// while let Some(result) = items.next().await {
1612    ///   let item = result?;
1613    /// }
1614    /// # Ok(()) }
1615    ///
1616    /// fn prepare_request_builder() -> ListLocations {
1617    ///   # panic!();
1618    ///   // ... details omitted ...
1619    /// }
1620    /// ```
1621    #[derive(Clone, Debug)]
1622    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1623
1624    impl ListLocations {
1625        pub(crate) fn new(
1626            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1627        ) -> Self {
1628            Self(RequestBuilder::new(stub))
1629        }
1630
1631        /// Sets the full request, replacing any prior values.
1632        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1633            mut self,
1634            v: V,
1635        ) -> Self {
1636            self.0.request = v.into();
1637            self
1638        }
1639
1640        /// Sets all the options, replacing any prior values.
1641        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1642            self.0.options = v.into();
1643            self
1644        }
1645
1646        /// Sends the request.
1647        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1648            (*self.0.stub)
1649                .list_locations(self.0.request, self.0.options)
1650                .await
1651                .map(gax::response::Response::into_body)
1652        }
1653
1654        /// Streams each page in the collection.
1655        pub fn by_page(
1656            self,
1657        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1658        {
1659            use std::clone::Clone;
1660            let token = self.0.request.page_token.clone();
1661            let execute = move |token: String| {
1662                let mut builder = self.clone();
1663                builder.0.request = builder.0.request.set_page_token(token);
1664                builder.send()
1665            };
1666            gax::paginator::internal::new_paginator(token, execute)
1667        }
1668
1669        /// Streams each item in the collection.
1670        pub fn by_item(
1671            self,
1672        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1673        {
1674            use gax::paginator::Paginator;
1675            self.by_page().items()
1676        }
1677
1678        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1679        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1680            self.0.request.name = v.into();
1681            self
1682        }
1683
1684        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1685        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1686            self.0.request.filter = v.into();
1687            self
1688        }
1689
1690        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1691        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1692            self.0.request.page_size = v.into();
1693            self
1694        }
1695
1696        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1697        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698            self.0.request.page_token = v.into();
1699            self
1700        }
1701    }
1702
1703    #[doc(hidden)]
1704    impl gax::options::internal::RequestBuilder for ListLocations {
1705        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1706            &mut self.0.options
1707        }
1708    }
1709
1710    /// The request builder for [AnswerRecords::get_location][crate::client::AnswerRecords::get_location] calls.
1711    ///
1712    /// # Example
1713    /// ```
1714    /// # use google_cloud_dialogflow_v2::builder::answer_records::GetLocation;
1715    /// # async fn sample() -> gax::Result<()> {
1716    ///
1717    /// let builder = prepare_request_builder();
1718    /// let response = builder.send().await?;
1719    /// # Ok(()) }
1720    ///
1721    /// fn prepare_request_builder() -> GetLocation {
1722    ///   # panic!();
1723    ///   // ... details omitted ...
1724    /// }
1725    /// ```
1726    #[derive(Clone, Debug)]
1727    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1728
1729    impl GetLocation {
1730        pub(crate) fn new(
1731            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1732        ) -> Self {
1733            Self(RequestBuilder::new(stub))
1734        }
1735
1736        /// Sets the full request, replacing any prior values.
1737        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1738            self.0.request = v.into();
1739            self
1740        }
1741
1742        /// Sets all the options, replacing any prior values.
1743        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1744            self.0.options = v.into();
1745            self
1746        }
1747
1748        /// Sends the request.
1749        pub async fn send(self) -> Result<location::model::Location> {
1750            (*self.0.stub)
1751                .get_location(self.0.request, self.0.options)
1752                .await
1753                .map(gax::response::Response::into_body)
1754        }
1755
1756        /// Sets the value of [name][location::model::GetLocationRequest::name].
1757        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1758            self.0.request.name = v.into();
1759            self
1760        }
1761    }
1762
1763    #[doc(hidden)]
1764    impl gax::options::internal::RequestBuilder for GetLocation {
1765        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1766            &mut self.0.options
1767        }
1768    }
1769
1770    /// The request builder for [AnswerRecords::list_operations][crate::client::AnswerRecords::list_operations] calls.
1771    ///
1772    /// # Example
1773    /// ```
1774    /// # use google_cloud_dialogflow_v2::builder::answer_records::ListOperations;
1775    /// # async fn sample() -> gax::Result<()> {
1776    /// use gax::paginator::ItemPaginator;
1777    ///
1778    /// let builder = prepare_request_builder();
1779    /// let mut items = builder.by_item();
1780    /// while let Some(result) = items.next().await {
1781    ///   let item = result?;
1782    /// }
1783    /// # Ok(()) }
1784    ///
1785    /// fn prepare_request_builder() -> ListOperations {
1786    ///   # panic!();
1787    ///   // ... details omitted ...
1788    /// }
1789    /// ```
1790    #[derive(Clone, Debug)]
1791    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1792
1793    impl ListOperations {
1794        pub(crate) fn new(
1795            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1796        ) -> Self {
1797            Self(RequestBuilder::new(stub))
1798        }
1799
1800        /// Sets the full request, replacing any prior values.
1801        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1802            mut self,
1803            v: V,
1804        ) -> Self {
1805            self.0.request = v.into();
1806            self
1807        }
1808
1809        /// Sets all the options, replacing any prior values.
1810        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1811            self.0.options = v.into();
1812            self
1813        }
1814
1815        /// Sends the request.
1816        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1817            (*self.0.stub)
1818                .list_operations(self.0.request, self.0.options)
1819                .await
1820                .map(gax::response::Response::into_body)
1821        }
1822
1823        /// Streams each page in the collection.
1824        pub fn by_page(
1825            self,
1826        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1827        {
1828            use std::clone::Clone;
1829            let token = self.0.request.page_token.clone();
1830            let execute = move |token: String| {
1831                let mut builder = self.clone();
1832                builder.0.request = builder.0.request.set_page_token(token);
1833                builder.send()
1834            };
1835            gax::paginator::internal::new_paginator(token, execute)
1836        }
1837
1838        /// Streams each item in the collection.
1839        pub fn by_item(
1840            self,
1841        ) -> impl gax::paginator::ItemPaginator<
1842            longrunning::model::ListOperationsResponse,
1843            gax::error::Error,
1844        > {
1845            use gax::paginator::Paginator;
1846            self.by_page().items()
1847        }
1848
1849        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1850        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1851            self.0.request.name = v.into();
1852            self
1853        }
1854
1855        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1856        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1857            self.0.request.filter = v.into();
1858            self
1859        }
1860
1861        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1862        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1863            self.0.request.page_size = v.into();
1864            self
1865        }
1866
1867        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1868        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1869            self.0.request.page_token = v.into();
1870            self
1871        }
1872
1873        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1874        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1875            self.0.request.return_partial_success = v.into();
1876            self
1877        }
1878    }
1879
1880    #[doc(hidden)]
1881    impl gax::options::internal::RequestBuilder for ListOperations {
1882        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1883            &mut self.0.options
1884        }
1885    }
1886
1887    /// The request builder for [AnswerRecords::get_operation][crate::client::AnswerRecords::get_operation] calls.
1888    ///
1889    /// # Example
1890    /// ```
1891    /// # use google_cloud_dialogflow_v2::builder::answer_records::GetOperation;
1892    /// # async fn sample() -> gax::Result<()> {
1893    ///
1894    /// let builder = prepare_request_builder();
1895    /// let response = builder.send().await?;
1896    /// # Ok(()) }
1897    ///
1898    /// fn prepare_request_builder() -> GetOperation {
1899    ///   # panic!();
1900    ///   // ... details omitted ...
1901    /// }
1902    /// ```
1903    #[derive(Clone, Debug)]
1904    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1905
1906    impl GetOperation {
1907        pub(crate) fn new(
1908            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1909        ) -> Self {
1910            Self(RequestBuilder::new(stub))
1911        }
1912
1913        /// Sets the full request, replacing any prior values.
1914        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1915            mut self,
1916            v: V,
1917        ) -> Self {
1918            self.0.request = v.into();
1919            self
1920        }
1921
1922        /// Sets all the options, replacing any prior values.
1923        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1924            self.0.options = v.into();
1925            self
1926        }
1927
1928        /// Sends the request.
1929        pub async fn send(self) -> Result<longrunning::model::Operation> {
1930            (*self.0.stub)
1931                .get_operation(self.0.request, self.0.options)
1932                .await
1933                .map(gax::response::Response::into_body)
1934        }
1935
1936        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1937        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1938            self.0.request.name = v.into();
1939            self
1940        }
1941    }
1942
1943    #[doc(hidden)]
1944    impl gax::options::internal::RequestBuilder for GetOperation {
1945        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1946            &mut self.0.options
1947        }
1948    }
1949
1950    /// The request builder for [AnswerRecords::cancel_operation][crate::client::AnswerRecords::cancel_operation] calls.
1951    ///
1952    /// # Example
1953    /// ```
1954    /// # use google_cloud_dialogflow_v2::builder::answer_records::CancelOperation;
1955    /// # async fn sample() -> gax::Result<()> {
1956    ///
1957    /// let builder = prepare_request_builder();
1958    /// let response = builder.send().await?;
1959    /// # Ok(()) }
1960    ///
1961    /// fn prepare_request_builder() -> CancelOperation {
1962    ///   # panic!();
1963    ///   // ... details omitted ...
1964    /// }
1965    /// ```
1966    #[derive(Clone, Debug)]
1967    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1968
1969    impl CancelOperation {
1970        pub(crate) fn new(
1971            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1972        ) -> Self {
1973            Self(RequestBuilder::new(stub))
1974        }
1975
1976        /// Sets the full request, replacing any prior values.
1977        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1978            mut self,
1979            v: V,
1980        ) -> Self {
1981            self.0.request = v.into();
1982            self
1983        }
1984
1985        /// Sets all the options, replacing any prior values.
1986        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1987            self.0.options = v.into();
1988            self
1989        }
1990
1991        /// Sends the request.
1992        pub async fn send(self) -> Result<()> {
1993            (*self.0.stub)
1994                .cancel_operation(self.0.request, self.0.options)
1995                .await
1996                .map(gax::response::Response::into_body)
1997        }
1998
1999        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2000        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2001            self.0.request.name = v.into();
2002            self
2003        }
2004    }
2005
2006    #[doc(hidden)]
2007    impl gax::options::internal::RequestBuilder for CancelOperation {
2008        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2009            &mut self.0.options
2010        }
2011    }
2012}
2013
2014#[cfg(feature = "contexts")]
2015#[cfg_attr(docsrs, doc(cfg(feature = "contexts")))]
2016pub mod contexts {
2017    use crate::Result;
2018
2019    /// A builder for [Contexts][crate::client::Contexts].
2020    ///
2021    /// ```
2022    /// # async fn sample() -> gax::client_builder::Result<()> {
2023    /// # use google_cloud_dialogflow_v2::*;
2024    /// # use builder::contexts::ClientBuilder;
2025    /// # use client::Contexts;
2026    /// let builder : ClientBuilder = Contexts::builder();
2027    /// let client = builder
2028    ///     .with_endpoint("https://dialogflow.googleapis.com")
2029    ///     .build().await?;
2030    /// # Ok(()) }
2031    /// ```
2032    pub type ClientBuilder =
2033        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2034
2035    pub(crate) mod client {
2036        use super::super::super::client::Contexts;
2037        pub struct Factory;
2038        impl gax::client_builder::internal::ClientFactory for Factory {
2039            type Client = Contexts;
2040            type Credentials = gaxi::options::Credentials;
2041            async fn build(
2042                self,
2043                config: gaxi::options::ClientConfig,
2044            ) -> gax::client_builder::Result<Self::Client> {
2045                Self::Client::new(config).await
2046            }
2047        }
2048    }
2049
2050    /// Common implementation for [crate::client::Contexts] request builders.
2051    #[derive(Clone, Debug)]
2052    pub(crate) struct RequestBuilder<R: std::default::Default> {
2053        stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>,
2054        request: R,
2055        options: gax::options::RequestOptions,
2056    }
2057
2058    impl<R> RequestBuilder<R>
2059    where
2060        R: std::default::Default,
2061    {
2062        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2063            Self {
2064                stub,
2065                request: R::default(),
2066                options: gax::options::RequestOptions::default(),
2067            }
2068        }
2069    }
2070
2071    /// The request builder for [Contexts::list_contexts][crate::client::Contexts::list_contexts] calls.
2072    ///
2073    /// # Example
2074    /// ```
2075    /// # use google_cloud_dialogflow_v2::builder::contexts::ListContexts;
2076    /// # async fn sample() -> gax::Result<()> {
2077    /// use gax::paginator::ItemPaginator;
2078    ///
2079    /// let builder = prepare_request_builder();
2080    /// let mut items = builder.by_item();
2081    /// while let Some(result) = items.next().await {
2082    ///   let item = result?;
2083    /// }
2084    /// # Ok(()) }
2085    ///
2086    /// fn prepare_request_builder() -> ListContexts {
2087    ///   # panic!();
2088    ///   // ... details omitted ...
2089    /// }
2090    /// ```
2091    #[derive(Clone, Debug)]
2092    pub struct ListContexts(RequestBuilder<crate::model::ListContextsRequest>);
2093
2094    impl ListContexts {
2095        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2096            Self(RequestBuilder::new(stub))
2097        }
2098
2099        /// Sets the full request, replacing any prior values.
2100        pub fn with_request<V: Into<crate::model::ListContextsRequest>>(mut self, v: V) -> Self {
2101            self.0.request = v.into();
2102            self
2103        }
2104
2105        /// Sets all the options, replacing any prior values.
2106        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2107            self.0.options = v.into();
2108            self
2109        }
2110
2111        /// Sends the request.
2112        pub async fn send(self) -> Result<crate::model::ListContextsResponse> {
2113            (*self.0.stub)
2114                .list_contexts(self.0.request, self.0.options)
2115                .await
2116                .map(gax::response::Response::into_body)
2117        }
2118
2119        /// Streams each page in the collection.
2120        pub fn by_page(
2121            self,
2122        ) -> impl gax::paginator::Paginator<crate::model::ListContextsResponse, gax::error::Error>
2123        {
2124            use std::clone::Clone;
2125            let token = self.0.request.page_token.clone();
2126            let execute = move |token: String| {
2127                let mut builder = self.clone();
2128                builder.0.request = builder.0.request.set_page_token(token);
2129                builder.send()
2130            };
2131            gax::paginator::internal::new_paginator(token, execute)
2132        }
2133
2134        /// Streams each item in the collection.
2135        pub fn by_item(
2136            self,
2137        ) -> impl gax::paginator::ItemPaginator<crate::model::ListContextsResponse, gax::error::Error>
2138        {
2139            use gax::paginator::Paginator;
2140            self.by_page().items()
2141        }
2142
2143        /// Sets the value of [parent][crate::model::ListContextsRequest::parent].
2144        ///
2145        /// This is a **required** field for requests.
2146        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2147            self.0.request.parent = v.into();
2148            self
2149        }
2150
2151        /// Sets the value of [page_size][crate::model::ListContextsRequest::page_size].
2152        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2153            self.0.request.page_size = v.into();
2154            self
2155        }
2156
2157        /// Sets the value of [page_token][crate::model::ListContextsRequest::page_token].
2158        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2159            self.0.request.page_token = v.into();
2160            self
2161        }
2162    }
2163
2164    #[doc(hidden)]
2165    impl gax::options::internal::RequestBuilder for ListContexts {
2166        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2167            &mut self.0.options
2168        }
2169    }
2170
2171    /// The request builder for [Contexts::get_context][crate::client::Contexts::get_context] calls.
2172    ///
2173    /// # Example
2174    /// ```
2175    /// # use google_cloud_dialogflow_v2::builder::contexts::GetContext;
2176    /// # async fn sample() -> gax::Result<()> {
2177    ///
2178    /// let builder = prepare_request_builder();
2179    /// let response = builder.send().await?;
2180    /// # Ok(()) }
2181    ///
2182    /// fn prepare_request_builder() -> GetContext {
2183    ///   # panic!();
2184    ///   // ... details omitted ...
2185    /// }
2186    /// ```
2187    #[derive(Clone, Debug)]
2188    pub struct GetContext(RequestBuilder<crate::model::GetContextRequest>);
2189
2190    impl GetContext {
2191        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2192            Self(RequestBuilder::new(stub))
2193        }
2194
2195        /// Sets the full request, replacing any prior values.
2196        pub fn with_request<V: Into<crate::model::GetContextRequest>>(mut self, v: V) -> Self {
2197            self.0.request = v.into();
2198            self
2199        }
2200
2201        /// Sets all the options, replacing any prior values.
2202        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2203            self.0.options = v.into();
2204            self
2205        }
2206
2207        /// Sends the request.
2208        pub async fn send(self) -> Result<crate::model::Context> {
2209            (*self.0.stub)
2210                .get_context(self.0.request, self.0.options)
2211                .await
2212                .map(gax::response::Response::into_body)
2213        }
2214
2215        /// Sets the value of [name][crate::model::GetContextRequest::name].
2216        ///
2217        /// This is a **required** field for requests.
2218        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2219            self.0.request.name = v.into();
2220            self
2221        }
2222    }
2223
2224    #[doc(hidden)]
2225    impl gax::options::internal::RequestBuilder for GetContext {
2226        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2227            &mut self.0.options
2228        }
2229    }
2230
2231    /// The request builder for [Contexts::create_context][crate::client::Contexts::create_context] calls.
2232    ///
2233    /// # Example
2234    /// ```
2235    /// # use google_cloud_dialogflow_v2::builder::contexts::CreateContext;
2236    /// # async fn sample() -> gax::Result<()> {
2237    ///
2238    /// let builder = prepare_request_builder();
2239    /// let response = builder.send().await?;
2240    /// # Ok(()) }
2241    ///
2242    /// fn prepare_request_builder() -> CreateContext {
2243    ///   # panic!();
2244    ///   // ... details omitted ...
2245    /// }
2246    /// ```
2247    #[derive(Clone, Debug)]
2248    pub struct CreateContext(RequestBuilder<crate::model::CreateContextRequest>);
2249
2250    impl CreateContext {
2251        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2252            Self(RequestBuilder::new(stub))
2253        }
2254
2255        /// Sets the full request, replacing any prior values.
2256        pub fn with_request<V: Into<crate::model::CreateContextRequest>>(mut self, v: V) -> Self {
2257            self.0.request = v.into();
2258            self
2259        }
2260
2261        /// Sets all the options, replacing any prior values.
2262        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2263            self.0.options = v.into();
2264            self
2265        }
2266
2267        /// Sends the request.
2268        pub async fn send(self) -> Result<crate::model::Context> {
2269            (*self.0.stub)
2270                .create_context(self.0.request, self.0.options)
2271                .await
2272                .map(gax::response::Response::into_body)
2273        }
2274
2275        /// Sets the value of [parent][crate::model::CreateContextRequest::parent].
2276        ///
2277        /// This is a **required** field for requests.
2278        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2279            self.0.request.parent = v.into();
2280            self
2281        }
2282
2283        /// Sets the value of [context][crate::model::CreateContextRequest::context].
2284        ///
2285        /// This is a **required** field for requests.
2286        pub fn set_context<T>(mut self, v: T) -> Self
2287        where
2288            T: std::convert::Into<crate::model::Context>,
2289        {
2290            self.0.request.context = std::option::Option::Some(v.into());
2291            self
2292        }
2293
2294        /// Sets or clears the value of [context][crate::model::CreateContextRequest::context].
2295        ///
2296        /// This is a **required** field for requests.
2297        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2298        where
2299            T: std::convert::Into<crate::model::Context>,
2300        {
2301            self.0.request.context = v.map(|x| x.into());
2302            self
2303        }
2304    }
2305
2306    #[doc(hidden)]
2307    impl gax::options::internal::RequestBuilder for CreateContext {
2308        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2309            &mut self.0.options
2310        }
2311    }
2312
2313    /// The request builder for [Contexts::update_context][crate::client::Contexts::update_context] calls.
2314    ///
2315    /// # Example
2316    /// ```
2317    /// # use google_cloud_dialogflow_v2::builder::contexts::UpdateContext;
2318    /// # async fn sample() -> gax::Result<()> {
2319    ///
2320    /// let builder = prepare_request_builder();
2321    /// let response = builder.send().await?;
2322    /// # Ok(()) }
2323    ///
2324    /// fn prepare_request_builder() -> UpdateContext {
2325    ///   # panic!();
2326    ///   // ... details omitted ...
2327    /// }
2328    /// ```
2329    #[derive(Clone, Debug)]
2330    pub struct UpdateContext(RequestBuilder<crate::model::UpdateContextRequest>);
2331
2332    impl UpdateContext {
2333        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2334            Self(RequestBuilder::new(stub))
2335        }
2336
2337        /// Sets the full request, replacing any prior values.
2338        pub fn with_request<V: Into<crate::model::UpdateContextRequest>>(mut self, v: V) -> Self {
2339            self.0.request = v.into();
2340            self
2341        }
2342
2343        /// Sets all the options, replacing any prior values.
2344        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2345            self.0.options = v.into();
2346            self
2347        }
2348
2349        /// Sends the request.
2350        pub async fn send(self) -> Result<crate::model::Context> {
2351            (*self.0.stub)
2352                .update_context(self.0.request, self.0.options)
2353                .await
2354                .map(gax::response::Response::into_body)
2355        }
2356
2357        /// Sets the value of [context][crate::model::UpdateContextRequest::context].
2358        ///
2359        /// This is a **required** field for requests.
2360        pub fn set_context<T>(mut self, v: T) -> Self
2361        where
2362            T: std::convert::Into<crate::model::Context>,
2363        {
2364            self.0.request.context = std::option::Option::Some(v.into());
2365            self
2366        }
2367
2368        /// Sets or clears the value of [context][crate::model::UpdateContextRequest::context].
2369        ///
2370        /// This is a **required** field for requests.
2371        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2372        where
2373            T: std::convert::Into<crate::model::Context>,
2374        {
2375            self.0.request.context = v.map(|x| x.into());
2376            self
2377        }
2378
2379        /// Sets the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2380        pub fn set_update_mask<T>(mut self, v: T) -> Self
2381        where
2382            T: std::convert::Into<wkt::FieldMask>,
2383        {
2384            self.0.request.update_mask = std::option::Option::Some(v.into());
2385            self
2386        }
2387
2388        /// Sets or clears the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2389        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2390        where
2391            T: std::convert::Into<wkt::FieldMask>,
2392        {
2393            self.0.request.update_mask = v.map(|x| x.into());
2394            self
2395        }
2396    }
2397
2398    #[doc(hidden)]
2399    impl gax::options::internal::RequestBuilder for UpdateContext {
2400        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2401            &mut self.0.options
2402        }
2403    }
2404
2405    /// The request builder for [Contexts::delete_context][crate::client::Contexts::delete_context] calls.
2406    ///
2407    /// # Example
2408    /// ```
2409    /// # use google_cloud_dialogflow_v2::builder::contexts::DeleteContext;
2410    /// # async fn sample() -> gax::Result<()> {
2411    ///
2412    /// let builder = prepare_request_builder();
2413    /// let response = builder.send().await?;
2414    /// # Ok(()) }
2415    ///
2416    /// fn prepare_request_builder() -> DeleteContext {
2417    ///   # panic!();
2418    ///   // ... details omitted ...
2419    /// }
2420    /// ```
2421    #[derive(Clone, Debug)]
2422    pub struct DeleteContext(RequestBuilder<crate::model::DeleteContextRequest>);
2423
2424    impl DeleteContext {
2425        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2426            Self(RequestBuilder::new(stub))
2427        }
2428
2429        /// Sets the full request, replacing any prior values.
2430        pub fn with_request<V: Into<crate::model::DeleteContextRequest>>(mut self, v: V) -> Self {
2431            self.0.request = v.into();
2432            self
2433        }
2434
2435        /// Sets all the options, replacing any prior values.
2436        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2437            self.0.options = v.into();
2438            self
2439        }
2440
2441        /// Sends the request.
2442        pub async fn send(self) -> Result<()> {
2443            (*self.0.stub)
2444                .delete_context(self.0.request, self.0.options)
2445                .await
2446                .map(gax::response::Response::into_body)
2447        }
2448
2449        /// Sets the value of [name][crate::model::DeleteContextRequest::name].
2450        ///
2451        /// This is a **required** field for requests.
2452        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2453            self.0.request.name = v.into();
2454            self
2455        }
2456    }
2457
2458    #[doc(hidden)]
2459    impl gax::options::internal::RequestBuilder for DeleteContext {
2460        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2461            &mut self.0.options
2462        }
2463    }
2464
2465    /// The request builder for [Contexts::delete_all_contexts][crate::client::Contexts::delete_all_contexts] calls.
2466    ///
2467    /// # Example
2468    /// ```
2469    /// # use google_cloud_dialogflow_v2::builder::contexts::DeleteAllContexts;
2470    /// # async fn sample() -> gax::Result<()> {
2471    ///
2472    /// let builder = prepare_request_builder();
2473    /// let response = builder.send().await?;
2474    /// # Ok(()) }
2475    ///
2476    /// fn prepare_request_builder() -> DeleteAllContexts {
2477    ///   # panic!();
2478    ///   // ... details omitted ...
2479    /// }
2480    /// ```
2481    #[derive(Clone, Debug)]
2482    pub struct DeleteAllContexts(RequestBuilder<crate::model::DeleteAllContextsRequest>);
2483
2484    impl DeleteAllContexts {
2485        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2486            Self(RequestBuilder::new(stub))
2487        }
2488
2489        /// Sets the full request, replacing any prior values.
2490        pub fn with_request<V: Into<crate::model::DeleteAllContextsRequest>>(
2491            mut self,
2492            v: V,
2493        ) -> Self {
2494            self.0.request = v.into();
2495            self
2496        }
2497
2498        /// Sets all the options, replacing any prior values.
2499        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2500            self.0.options = v.into();
2501            self
2502        }
2503
2504        /// Sends the request.
2505        pub async fn send(self) -> Result<()> {
2506            (*self.0.stub)
2507                .delete_all_contexts(self.0.request, self.0.options)
2508                .await
2509                .map(gax::response::Response::into_body)
2510        }
2511
2512        /// Sets the value of [parent][crate::model::DeleteAllContextsRequest::parent].
2513        ///
2514        /// This is a **required** field for requests.
2515        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2516            self.0.request.parent = v.into();
2517            self
2518        }
2519    }
2520
2521    #[doc(hidden)]
2522    impl gax::options::internal::RequestBuilder for DeleteAllContexts {
2523        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2524            &mut self.0.options
2525        }
2526    }
2527
2528    /// The request builder for [Contexts::list_locations][crate::client::Contexts::list_locations] calls.
2529    ///
2530    /// # Example
2531    /// ```
2532    /// # use google_cloud_dialogflow_v2::builder::contexts::ListLocations;
2533    /// # async fn sample() -> gax::Result<()> {
2534    /// use gax::paginator::ItemPaginator;
2535    ///
2536    /// let builder = prepare_request_builder();
2537    /// let mut items = builder.by_item();
2538    /// while let Some(result) = items.next().await {
2539    ///   let item = result?;
2540    /// }
2541    /// # Ok(()) }
2542    ///
2543    /// fn prepare_request_builder() -> ListLocations {
2544    ///   # panic!();
2545    ///   // ... details omitted ...
2546    /// }
2547    /// ```
2548    #[derive(Clone, Debug)]
2549    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2550
2551    impl ListLocations {
2552        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2553            Self(RequestBuilder::new(stub))
2554        }
2555
2556        /// Sets the full request, replacing any prior values.
2557        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2558            mut self,
2559            v: V,
2560        ) -> Self {
2561            self.0.request = v.into();
2562            self
2563        }
2564
2565        /// Sets all the options, replacing any prior values.
2566        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2567            self.0.options = v.into();
2568            self
2569        }
2570
2571        /// Sends the request.
2572        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2573            (*self.0.stub)
2574                .list_locations(self.0.request, self.0.options)
2575                .await
2576                .map(gax::response::Response::into_body)
2577        }
2578
2579        /// Streams each page in the collection.
2580        pub fn by_page(
2581            self,
2582        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2583        {
2584            use std::clone::Clone;
2585            let token = self.0.request.page_token.clone();
2586            let execute = move |token: String| {
2587                let mut builder = self.clone();
2588                builder.0.request = builder.0.request.set_page_token(token);
2589                builder.send()
2590            };
2591            gax::paginator::internal::new_paginator(token, execute)
2592        }
2593
2594        /// Streams each item in the collection.
2595        pub fn by_item(
2596            self,
2597        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2598        {
2599            use gax::paginator::Paginator;
2600            self.by_page().items()
2601        }
2602
2603        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2604        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2605            self.0.request.name = v.into();
2606            self
2607        }
2608
2609        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2610        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2611            self.0.request.filter = v.into();
2612            self
2613        }
2614
2615        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2616        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2617            self.0.request.page_size = v.into();
2618            self
2619        }
2620
2621        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2622        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2623            self.0.request.page_token = v.into();
2624            self
2625        }
2626    }
2627
2628    #[doc(hidden)]
2629    impl gax::options::internal::RequestBuilder for ListLocations {
2630        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2631            &mut self.0.options
2632        }
2633    }
2634
2635    /// The request builder for [Contexts::get_location][crate::client::Contexts::get_location] calls.
2636    ///
2637    /// # Example
2638    /// ```
2639    /// # use google_cloud_dialogflow_v2::builder::contexts::GetLocation;
2640    /// # async fn sample() -> gax::Result<()> {
2641    ///
2642    /// let builder = prepare_request_builder();
2643    /// let response = builder.send().await?;
2644    /// # Ok(()) }
2645    ///
2646    /// fn prepare_request_builder() -> GetLocation {
2647    ///   # panic!();
2648    ///   // ... details omitted ...
2649    /// }
2650    /// ```
2651    #[derive(Clone, Debug)]
2652    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2653
2654    impl GetLocation {
2655        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2656            Self(RequestBuilder::new(stub))
2657        }
2658
2659        /// Sets the full request, replacing any prior values.
2660        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2661            self.0.request = v.into();
2662            self
2663        }
2664
2665        /// Sets all the options, replacing any prior values.
2666        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2667            self.0.options = v.into();
2668            self
2669        }
2670
2671        /// Sends the request.
2672        pub async fn send(self) -> Result<location::model::Location> {
2673            (*self.0.stub)
2674                .get_location(self.0.request, self.0.options)
2675                .await
2676                .map(gax::response::Response::into_body)
2677        }
2678
2679        /// Sets the value of [name][location::model::GetLocationRequest::name].
2680        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2681            self.0.request.name = v.into();
2682            self
2683        }
2684    }
2685
2686    #[doc(hidden)]
2687    impl gax::options::internal::RequestBuilder for GetLocation {
2688        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2689            &mut self.0.options
2690        }
2691    }
2692
2693    /// The request builder for [Contexts::list_operations][crate::client::Contexts::list_operations] calls.
2694    ///
2695    /// # Example
2696    /// ```
2697    /// # use google_cloud_dialogflow_v2::builder::contexts::ListOperations;
2698    /// # async fn sample() -> gax::Result<()> {
2699    /// use gax::paginator::ItemPaginator;
2700    ///
2701    /// let builder = prepare_request_builder();
2702    /// let mut items = builder.by_item();
2703    /// while let Some(result) = items.next().await {
2704    ///   let item = result?;
2705    /// }
2706    /// # Ok(()) }
2707    ///
2708    /// fn prepare_request_builder() -> ListOperations {
2709    ///   # panic!();
2710    ///   // ... details omitted ...
2711    /// }
2712    /// ```
2713    #[derive(Clone, Debug)]
2714    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2715
2716    impl ListOperations {
2717        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2718            Self(RequestBuilder::new(stub))
2719        }
2720
2721        /// Sets the full request, replacing any prior values.
2722        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2723            mut self,
2724            v: V,
2725        ) -> Self {
2726            self.0.request = v.into();
2727            self
2728        }
2729
2730        /// Sets all the options, replacing any prior values.
2731        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2732            self.0.options = v.into();
2733            self
2734        }
2735
2736        /// Sends the request.
2737        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2738            (*self.0.stub)
2739                .list_operations(self.0.request, self.0.options)
2740                .await
2741                .map(gax::response::Response::into_body)
2742        }
2743
2744        /// Streams each page in the collection.
2745        pub fn by_page(
2746            self,
2747        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2748        {
2749            use std::clone::Clone;
2750            let token = self.0.request.page_token.clone();
2751            let execute = move |token: String| {
2752                let mut builder = self.clone();
2753                builder.0.request = builder.0.request.set_page_token(token);
2754                builder.send()
2755            };
2756            gax::paginator::internal::new_paginator(token, execute)
2757        }
2758
2759        /// Streams each item in the collection.
2760        pub fn by_item(
2761            self,
2762        ) -> impl gax::paginator::ItemPaginator<
2763            longrunning::model::ListOperationsResponse,
2764            gax::error::Error,
2765        > {
2766            use gax::paginator::Paginator;
2767            self.by_page().items()
2768        }
2769
2770        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2771        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2772            self.0.request.name = v.into();
2773            self
2774        }
2775
2776        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2777        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2778            self.0.request.filter = v.into();
2779            self
2780        }
2781
2782        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2783        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2784            self.0.request.page_size = v.into();
2785            self
2786        }
2787
2788        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2789        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2790            self.0.request.page_token = v.into();
2791            self
2792        }
2793
2794        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
2795        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2796            self.0.request.return_partial_success = v.into();
2797            self
2798        }
2799    }
2800
2801    #[doc(hidden)]
2802    impl gax::options::internal::RequestBuilder for ListOperations {
2803        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2804            &mut self.0.options
2805        }
2806    }
2807
2808    /// The request builder for [Contexts::get_operation][crate::client::Contexts::get_operation] calls.
2809    ///
2810    /// # Example
2811    /// ```
2812    /// # use google_cloud_dialogflow_v2::builder::contexts::GetOperation;
2813    /// # async fn sample() -> gax::Result<()> {
2814    ///
2815    /// let builder = prepare_request_builder();
2816    /// let response = builder.send().await?;
2817    /// # Ok(()) }
2818    ///
2819    /// fn prepare_request_builder() -> GetOperation {
2820    ///   # panic!();
2821    ///   // ... details omitted ...
2822    /// }
2823    /// ```
2824    #[derive(Clone, Debug)]
2825    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2826
2827    impl GetOperation {
2828        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2829            Self(RequestBuilder::new(stub))
2830        }
2831
2832        /// Sets the full request, replacing any prior values.
2833        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2834            mut self,
2835            v: V,
2836        ) -> Self {
2837            self.0.request = v.into();
2838            self
2839        }
2840
2841        /// Sets all the options, replacing any prior values.
2842        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2843            self.0.options = v.into();
2844            self
2845        }
2846
2847        /// Sends the request.
2848        pub async fn send(self) -> Result<longrunning::model::Operation> {
2849            (*self.0.stub)
2850                .get_operation(self.0.request, self.0.options)
2851                .await
2852                .map(gax::response::Response::into_body)
2853        }
2854
2855        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2856        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2857            self.0.request.name = v.into();
2858            self
2859        }
2860    }
2861
2862    #[doc(hidden)]
2863    impl gax::options::internal::RequestBuilder for GetOperation {
2864        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2865            &mut self.0.options
2866        }
2867    }
2868
2869    /// The request builder for [Contexts::cancel_operation][crate::client::Contexts::cancel_operation] calls.
2870    ///
2871    /// # Example
2872    /// ```
2873    /// # use google_cloud_dialogflow_v2::builder::contexts::CancelOperation;
2874    /// # async fn sample() -> gax::Result<()> {
2875    ///
2876    /// let builder = prepare_request_builder();
2877    /// let response = builder.send().await?;
2878    /// # Ok(()) }
2879    ///
2880    /// fn prepare_request_builder() -> CancelOperation {
2881    ///   # panic!();
2882    ///   // ... details omitted ...
2883    /// }
2884    /// ```
2885    #[derive(Clone, Debug)]
2886    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2887
2888    impl CancelOperation {
2889        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2890            Self(RequestBuilder::new(stub))
2891        }
2892
2893        /// Sets the full request, replacing any prior values.
2894        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2895            mut self,
2896            v: V,
2897        ) -> Self {
2898            self.0.request = v.into();
2899            self
2900        }
2901
2902        /// Sets all the options, replacing any prior values.
2903        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2904            self.0.options = v.into();
2905            self
2906        }
2907
2908        /// Sends the request.
2909        pub async fn send(self) -> Result<()> {
2910            (*self.0.stub)
2911                .cancel_operation(self.0.request, self.0.options)
2912                .await
2913                .map(gax::response::Response::into_body)
2914        }
2915
2916        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2917        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2918            self.0.request.name = v.into();
2919            self
2920        }
2921    }
2922
2923    #[doc(hidden)]
2924    impl gax::options::internal::RequestBuilder for CancelOperation {
2925        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2926            &mut self.0.options
2927        }
2928    }
2929}
2930
2931#[cfg(feature = "conversations")]
2932#[cfg_attr(docsrs, doc(cfg(feature = "conversations")))]
2933pub mod conversations {
2934    use crate::Result;
2935
2936    /// A builder for [Conversations][crate::client::Conversations].
2937    ///
2938    /// ```
2939    /// # async fn sample() -> gax::client_builder::Result<()> {
2940    /// # use google_cloud_dialogflow_v2::*;
2941    /// # use builder::conversations::ClientBuilder;
2942    /// # use client::Conversations;
2943    /// let builder : ClientBuilder = Conversations::builder();
2944    /// let client = builder
2945    ///     .with_endpoint("https://dialogflow.googleapis.com")
2946    ///     .build().await?;
2947    /// # Ok(()) }
2948    /// ```
2949    pub type ClientBuilder =
2950        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2951
2952    pub(crate) mod client {
2953        use super::super::super::client::Conversations;
2954        pub struct Factory;
2955        impl gax::client_builder::internal::ClientFactory for Factory {
2956            type Client = Conversations;
2957            type Credentials = gaxi::options::Credentials;
2958            async fn build(
2959                self,
2960                config: gaxi::options::ClientConfig,
2961            ) -> gax::client_builder::Result<Self::Client> {
2962                Self::Client::new(config).await
2963            }
2964        }
2965    }
2966
2967    /// Common implementation for [crate::client::Conversations] request builders.
2968    #[derive(Clone, Debug)]
2969    pub(crate) struct RequestBuilder<R: std::default::Default> {
2970        stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
2971        request: R,
2972        options: gax::options::RequestOptions,
2973    }
2974
2975    impl<R> RequestBuilder<R>
2976    where
2977        R: std::default::Default,
2978    {
2979        pub(crate) fn new(
2980            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
2981        ) -> Self {
2982            Self {
2983                stub,
2984                request: R::default(),
2985                options: gax::options::RequestOptions::default(),
2986            }
2987        }
2988    }
2989
2990    /// The request builder for [Conversations::create_conversation][crate::client::Conversations::create_conversation] calls.
2991    ///
2992    /// # Example
2993    /// ```
2994    /// # use google_cloud_dialogflow_v2::builder::conversations::CreateConversation;
2995    /// # async fn sample() -> gax::Result<()> {
2996    ///
2997    /// let builder = prepare_request_builder();
2998    /// let response = builder.send().await?;
2999    /// # Ok(()) }
3000    ///
3001    /// fn prepare_request_builder() -> CreateConversation {
3002    ///   # panic!();
3003    ///   // ... details omitted ...
3004    /// }
3005    /// ```
3006    #[derive(Clone, Debug)]
3007    pub struct CreateConversation(RequestBuilder<crate::model::CreateConversationRequest>);
3008
3009    impl CreateConversation {
3010        pub(crate) fn new(
3011            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3012        ) -> Self {
3013            Self(RequestBuilder::new(stub))
3014        }
3015
3016        /// Sets the full request, replacing any prior values.
3017        pub fn with_request<V: Into<crate::model::CreateConversationRequest>>(
3018            mut self,
3019            v: V,
3020        ) -> Self {
3021            self.0.request = v.into();
3022            self
3023        }
3024
3025        /// Sets all the options, replacing any prior values.
3026        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3027            self.0.options = v.into();
3028            self
3029        }
3030
3031        /// Sends the request.
3032        pub async fn send(self) -> Result<crate::model::Conversation> {
3033            (*self.0.stub)
3034                .create_conversation(self.0.request, self.0.options)
3035                .await
3036                .map(gax::response::Response::into_body)
3037        }
3038
3039        /// Sets the value of [parent][crate::model::CreateConversationRequest::parent].
3040        ///
3041        /// This is a **required** field for requests.
3042        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3043            self.0.request.parent = v.into();
3044            self
3045        }
3046
3047        /// Sets the value of [conversation][crate::model::CreateConversationRequest::conversation].
3048        ///
3049        /// This is a **required** field for requests.
3050        pub fn set_conversation<T>(mut self, v: T) -> Self
3051        where
3052            T: std::convert::Into<crate::model::Conversation>,
3053        {
3054            self.0.request.conversation = std::option::Option::Some(v.into());
3055            self
3056        }
3057
3058        /// Sets or clears the value of [conversation][crate::model::CreateConversationRequest::conversation].
3059        ///
3060        /// This is a **required** field for requests.
3061        pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3062        where
3063            T: std::convert::Into<crate::model::Conversation>,
3064        {
3065            self.0.request.conversation = v.map(|x| x.into());
3066            self
3067        }
3068
3069        /// Sets the value of [conversation_id][crate::model::CreateConversationRequest::conversation_id].
3070        pub fn set_conversation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3071            self.0.request.conversation_id = v.into();
3072            self
3073        }
3074    }
3075
3076    #[doc(hidden)]
3077    impl gax::options::internal::RequestBuilder for CreateConversation {
3078        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3079            &mut self.0.options
3080        }
3081    }
3082
3083    /// The request builder for [Conversations::list_conversations][crate::client::Conversations::list_conversations] calls.
3084    ///
3085    /// # Example
3086    /// ```
3087    /// # use google_cloud_dialogflow_v2::builder::conversations::ListConversations;
3088    /// # async fn sample() -> gax::Result<()> {
3089    /// use gax::paginator::ItemPaginator;
3090    ///
3091    /// let builder = prepare_request_builder();
3092    /// let mut items = builder.by_item();
3093    /// while let Some(result) = items.next().await {
3094    ///   let item = result?;
3095    /// }
3096    /// # Ok(()) }
3097    ///
3098    /// fn prepare_request_builder() -> ListConversations {
3099    ///   # panic!();
3100    ///   // ... details omitted ...
3101    /// }
3102    /// ```
3103    #[derive(Clone, Debug)]
3104    pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);
3105
3106    impl ListConversations {
3107        pub(crate) fn new(
3108            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3109        ) -> Self {
3110            Self(RequestBuilder::new(stub))
3111        }
3112
3113        /// Sets the full request, replacing any prior values.
3114        pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
3115            mut self,
3116            v: V,
3117        ) -> Self {
3118            self.0.request = v.into();
3119            self
3120        }
3121
3122        /// Sets all the options, replacing any prior values.
3123        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3124            self.0.options = v.into();
3125            self
3126        }
3127
3128        /// Sends the request.
3129        pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
3130            (*self.0.stub)
3131                .list_conversations(self.0.request, self.0.options)
3132                .await
3133                .map(gax::response::Response::into_body)
3134        }
3135
3136        /// Streams each page in the collection.
3137        pub fn by_page(
3138            self,
3139        ) -> impl gax::paginator::Paginator<crate::model::ListConversationsResponse, gax::error::Error>
3140        {
3141            use std::clone::Clone;
3142            let token = self.0.request.page_token.clone();
3143            let execute = move |token: String| {
3144                let mut builder = self.clone();
3145                builder.0.request = builder.0.request.set_page_token(token);
3146                builder.send()
3147            };
3148            gax::paginator::internal::new_paginator(token, execute)
3149        }
3150
3151        /// Streams each item in the collection.
3152        pub fn by_item(
3153            self,
3154        ) -> impl gax::paginator::ItemPaginator<crate::model::ListConversationsResponse, gax::error::Error>
3155        {
3156            use gax::paginator::Paginator;
3157            self.by_page().items()
3158        }
3159
3160        /// Sets the value of [parent][crate::model::ListConversationsRequest::parent].
3161        ///
3162        /// This is a **required** field for requests.
3163        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3164            self.0.request.parent = v.into();
3165            self
3166        }
3167
3168        /// Sets the value of [page_size][crate::model::ListConversationsRequest::page_size].
3169        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3170            self.0.request.page_size = v.into();
3171            self
3172        }
3173
3174        /// Sets the value of [page_token][crate::model::ListConversationsRequest::page_token].
3175        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3176            self.0.request.page_token = v.into();
3177            self
3178        }
3179
3180        /// Sets the value of [filter][crate::model::ListConversationsRequest::filter].
3181        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3182            self.0.request.filter = v.into();
3183            self
3184        }
3185    }
3186
3187    #[doc(hidden)]
3188    impl gax::options::internal::RequestBuilder for ListConversations {
3189        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3190            &mut self.0.options
3191        }
3192    }
3193
3194    /// The request builder for [Conversations::get_conversation][crate::client::Conversations::get_conversation] calls.
3195    ///
3196    /// # Example
3197    /// ```
3198    /// # use google_cloud_dialogflow_v2::builder::conversations::GetConversation;
3199    /// # async fn sample() -> gax::Result<()> {
3200    ///
3201    /// let builder = prepare_request_builder();
3202    /// let response = builder.send().await?;
3203    /// # Ok(()) }
3204    ///
3205    /// fn prepare_request_builder() -> GetConversation {
3206    ///   # panic!();
3207    ///   // ... details omitted ...
3208    /// }
3209    /// ```
3210    #[derive(Clone, Debug)]
3211    pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);
3212
3213    impl GetConversation {
3214        pub(crate) fn new(
3215            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3216        ) -> Self {
3217            Self(RequestBuilder::new(stub))
3218        }
3219
3220        /// Sets the full request, replacing any prior values.
3221        pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
3222            self.0.request = v.into();
3223            self
3224        }
3225
3226        /// Sets all the options, replacing any prior values.
3227        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3228            self.0.options = v.into();
3229            self
3230        }
3231
3232        /// Sends the request.
3233        pub async fn send(self) -> Result<crate::model::Conversation> {
3234            (*self.0.stub)
3235                .get_conversation(self.0.request, self.0.options)
3236                .await
3237                .map(gax::response::Response::into_body)
3238        }
3239
3240        /// Sets the value of [name][crate::model::GetConversationRequest::name].
3241        ///
3242        /// This is a **required** field for requests.
3243        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3244            self.0.request.name = v.into();
3245            self
3246        }
3247    }
3248
3249    #[doc(hidden)]
3250    impl gax::options::internal::RequestBuilder for GetConversation {
3251        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3252            &mut self.0.options
3253        }
3254    }
3255
3256    /// The request builder for [Conversations::complete_conversation][crate::client::Conversations::complete_conversation] calls.
3257    ///
3258    /// # Example
3259    /// ```
3260    /// # use google_cloud_dialogflow_v2::builder::conversations::CompleteConversation;
3261    /// # async fn sample() -> gax::Result<()> {
3262    ///
3263    /// let builder = prepare_request_builder();
3264    /// let response = builder.send().await?;
3265    /// # Ok(()) }
3266    ///
3267    /// fn prepare_request_builder() -> CompleteConversation {
3268    ///   # panic!();
3269    ///   // ... details omitted ...
3270    /// }
3271    /// ```
3272    #[derive(Clone, Debug)]
3273    pub struct CompleteConversation(RequestBuilder<crate::model::CompleteConversationRequest>);
3274
3275    impl CompleteConversation {
3276        pub(crate) fn new(
3277            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3278        ) -> Self {
3279            Self(RequestBuilder::new(stub))
3280        }
3281
3282        /// Sets the full request, replacing any prior values.
3283        pub fn with_request<V: Into<crate::model::CompleteConversationRequest>>(
3284            mut self,
3285            v: V,
3286        ) -> Self {
3287            self.0.request = v.into();
3288            self
3289        }
3290
3291        /// Sets all the options, replacing any prior values.
3292        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3293            self.0.options = v.into();
3294            self
3295        }
3296
3297        /// Sends the request.
3298        pub async fn send(self) -> Result<crate::model::Conversation> {
3299            (*self.0.stub)
3300                .complete_conversation(self.0.request, self.0.options)
3301                .await
3302                .map(gax::response::Response::into_body)
3303        }
3304
3305        /// Sets the value of [name][crate::model::CompleteConversationRequest::name].
3306        ///
3307        /// This is a **required** field for requests.
3308        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3309            self.0.request.name = v.into();
3310            self
3311        }
3312    }
3313
3314    #[doc(hidden)]
3315    impl gax::options::internal::RequestBuilder for CompleteConversation {
3316        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3317            &mut self.0.options
3318        }
3319    }
3320
3321    /// The request builder for [Conversations::ingest_context_references][crate::client::Conversations::ingest_context_references] calls.
3322    ///
3323    /// # Example
3324    /// ```
3325    /// # use google_cloud_dialogflow_v2::builder::conversations::IngestContextReferences;
3326    /// # async fn sample() -> gax::Result<()> {
3327    ///
3328    /// let builder = prepare_request_builder();
3329    /// let response = builder.send().await?;
3330    /// # Ok(()) }
3331    ///
3332    /// fn prepare_request_builder() -> IngestContextReferences {
3333    ///   # panic!();
3334    ///   // ... details omitted ...
3335    /// }
3336    /// ```
3337    #[derive(Clone, Debug)]
3338    pub struct IngestContextReferences(
3339        RequestBuilder<crate::model::IngestContextReferencesRequest>,
3340    );
3341
3342    impl IngestContextReferences {
3343        pub(crate) fn new(
3344            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3345        ) -> Self {
3346            Self(RequestBuilder::new(stub))
3347        }
3348
3349        /// Sets the full request, replacing any prior values.
3350        pub fn with_request<V: Into<crate::model::IngestContextReferencesRequest>>(
3351            mut self,
3352            v: V,
3353        ) -> Self {
3354            self.0.request = v.into();
3355            self
3356        }
3357
3358        /// Sets all the options, replacing any prior values.
3359        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3360            self.0.options = v.into();
3361            self
3362        }
3363
3364        /// Sends the request.
3365        pub async fn send(self) -> Result<crate::model::IngestContextReferencesResponse> {
3366            (*self.0.stub)
3367                .ingest_context_references(self.0.request, self.0.options)
3368                .await
3369                .map(gax::response::Response::into_body)
3370        }
3371
3372        /// Sets the value of [conversation][crate::model::IngestContextReferencesRequest::conversation].
3373        ///
3374        /// This is a **required** field for requests.
3375        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3376            self.0.request.conversation = v.into();
3377            self
3378        }
3379
3380        /// Sets the value of [context_references][crate::model::IngestContextReferencesRequest::context_references].
3381        ///
3382        /// This is a **required** field for requests.
3383        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3384        where
3385            T: std::iter::IntoIterator<Item = (K, V)>,
3386            K: std::convert::Into<std::string::String>,
3387            V: std::convert::Into<crate::model::conversation::ContextReference>,
3388        {
3389            self.0.request.context_references =
3390                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3391            self
3392        }
3393    }
3394
3395    #[doc(hidden)]
3396    impl gax::options::internal::RequestBuilder for IngestContextReferences {
3397        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3398            &mut self.0.options
3399        }
3400    }
3401
3402    /// The request builder for [Conversations::list_messages][crate::client::Conversations::list_messages] calls.
3403    ///
3404    /// # Example
3405    /// ```
3406    /// # use google_cloud_dialogflow_v2::builder::conversations::ListMessages;
3407    /// # async fn sample() -> gax::Result<()> {
3408    /// use gax::paginator::ItemPaginator;
3409    ///
3410    /// let builder = prepare_request_builder();
3411    /// let mut items = builder.by_item();
3412    /// while let Some(result) = items.next().await {
3413    ///   let item = result?;
3414    /// }
3415    /// # Ok(()) }
3416    ///
3417    /// fn prepare_request_builder() -> ListMessages {
3418    ///   # panic!();
3419    ///   // ... details omitted ...
3420    /// }
3421    /// ```
3422    #[derive(Clone, Debug)]
3423    pub struct ListMessages(RequestBuilder<crate::model::ListMessagesRequest>);
3424
3425    impl ListMessages {
3426        pub(crate) fn new(
3427            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3428        ) -> Self {
3429            Self(RequestBuilder::new(stub))
3430        }
3431
3432        /// Sets the full request, replacing any prior values.
3433        pub fn with_request<V: Into<crate::model::ListMessagesRequest>>(mut self, v: V) -> Self {
3434            self.0.request = v.into();
3435            self
3436        }
3437
3438        /// Sets all the options, replacing any prior values.
3439        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3440            self.0.options = v.into();
3441            self
3442        }
3443
3444        /// Sends the request.
3445        pub async fn send(self) -> Result<crate::model::ListMessagesResponse> {
3446            (*self.0.stub)
3447                .list_messages(self.0.request, self.0.options)
3448                .await
3449                .map(gax::response::Response::into_body)
3450        }
3451
3452        /// Streams each page in the collection.
3453        pub fn by_page(
3454            self,
3455        ) -> impl gax::paginator::Paginator<crate::model::ListMessagesResponse, gax::error::Error>
3456        {
3457            use std::clone::Clone;
3458            let token = self.0.request.page_token.clone();
3459            let execute = move |token: String| {
3460                let mut builder = self.clone();
3461                builder.0.request = builder.0.request.set_page_token(token);
3462                builder.send()
3463            };
3464            gax::paginator::internal::new_paginator(token, execute)
3465        }
3466
3467        /// Streams each item in the collection.
3468        pub fn by_item(
3469            self,
3470        ) -> impl gax::paginator::ItemPaginator<crate::model::ListMessagesResponse, gax::error::Error>
3471        {
3472            use gax::paginator::Paginator;
3473            self.by_page().items()
3474        }
3475
3476        /// Sets the value of [parent][crate::model::ListMessagesRequest::parent].
3477        ///
3478        /// This is a **required** field for requests.
3479        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3480            self.0.request.parent = v.into();
3481            self
3482        }
3483
3484        /// Sets the value of [filter][crate::model::ListMessagesRequest::filter].
3485        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3486            self.0.request.filter = v.into();
3487            self
3488        }
3489
3490        /// Sets the value of [page_size][crate::model::ListMessagesRequest::page_size].
3491        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3492            self.0.request.page_size = v.into();
3493            self
3494        }
3495
3496        /// Sets the value of [page_token][crate::model::ListMessagesRequest::page_token].
3497        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3498            self.0.request.page_token = v.into();
3499            self
3500        }
3501    }
3502
3503    #[doc(hidden)]
3504    impl gax::options::internal::RequestBuilder for ListMessages {
3505        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3506            &mut self.0.options
3507        }
3508    }
3509
3510    /// The request builder for [Conversations::suggest_conversation_summary][crate::client::Conversations::suggest_conversation_summary] calls.
3511    ///
3512    /// # Example
3513    /// ```
3514    /// # use google_cloud_dialogflow_v2::builder::conversations::SuggestConversationSummary;
3515    /// # async fn sample() -> gax::Result<()> {
3516    ///
3517    /// let builder = prepare_request_builder();
3518    /// let response = builder.send().await?;
3519    /// # Ok(()) }
3520    ///
3521    /// fn prepare_request_builder() -> SuggestConversationSummary {
3522    ///   # panic!();
3523    ///   // ... details omitted ...
3524    /// }
3525    /// ```
3526    #[derive(Clone, Debug)]
3527    pub struct SuggestConversationSummary(
3528        RequestBuilder<crate::model::SuggestConversationSummaryRequest>,
3529    );
3530
3531    impl SuggestConversationSummary {
3532        pub(crate) fn new(
3533            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3534        ) -> Self {
3535            Self(RequestBuilder::new(stub))
3536        }
3537
3538        /// Sets the full request, replacing any prior values.
3539        pub fn with_request<V: Into<crate::model::SuggestConversationSummaryRequest>>(
3540            mut self,
3541            v: V,
3542        ) -> Self {
3543            self.0.request = v.into();
3544            self
3545        }
3546
3547        /// Sets all the options, replacing any prior values.
3548        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3549            self.0.options = v.into();
3550            self
3551        }
3552
3553        /// Sends the request.
3554        pub async fn send(self) -> Result<crate::model::SuggestConversationSummaryResponse> {
3555            (*self.0.stub)
3556                .suggest_conversation_summary(self.0.request, self.0.options)
3557                .await
3558                .map(gax::response::Response::into_body)
3559        }
3560
3561        /// Sets the value of [conversation][crate::model::SuggestConversationSummaryRequest::conversation].
3562        ///
3563        /// This is a **required** field for requests.
3564        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3565            self.0.request.conversation = v.into();
3566            self
3567        }
3568
3569        /// Sets the value of [latest_message][crate::model::SuggestConversationSummaryRequest::latest_message].
3570        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3571            self.0.request.latest_message = v.into();
3572            self
3573        }
3574
3575        /// Sets the value of [context_size][crate::model::SuggestConversationSummaryRequest::context_size].
3576        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3577            self.0.request.context_size = v.into();
3578            self
3579        }
3580
3581        /// Sets the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3582        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
3583        where
3584            T: std::convert::Into<crate::model::AssistQueryParameters>,
3585        {
3586            self.0.request.assist_query_params = std::option::Option::Some(v.into());
3587            self
3588        }
3589
3590        /// Sets or clears the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3591        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
3592        where
3593            T: std::convert::Into<crate::model::AssistQueryParameters>,
3594        {
3595            self.0.request.assist_query_params = v.map(|x| x.into());
3596            self
3597        }
3598    }
3599
3600    #[doc(hidden)]
3601    impl gax::options::internal::RequestBuilder for SuggestConversationSummary {
3602        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3603            &mut self.0.options
3604        }
3605    }
3606
3607    /// The request builder for [Conversations::generate_stateless_summary][crate::client::Conversations::generate_stateless_summary] calls.
3608    ///
3609    /// # Example
3610    /// ```
3611    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateStatelessSummary;
3612    /// # async fn sample() -> gax::Result<()> {
3613    ///
3614    /// let builder = prepare_request_builder();
3615    /// let response = builder.send().await?;
3616    /// # Ok(()) }
3617    ///
3618    /// fn prepare_request_builder() -> GenerateStatelessSummary {
3619    ///   # panic!();
3620    ///   // ... details omitted ...
3621    /// }
3622    /// ```
3623    #[derive(Clone, Debug)]
3624    pub struct GenerateStatelessSummary(
3625        RequestBuilder<crate::model::GenerateStatelessSummaryRequest>,
3626    );
3627
3628    impl GenerateStatelessSummary {
3629        pub(crate) fn new(
3630            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3631        ) -> Self {
3632            Self(RequestBuilder::new(stub))
3633        }
3634
3635        /// Sets the full request, replacing any prior values.
3636        pub fn with_request<V: Into<crate::model::GenerateStatelessSummaryRequest>>(
3637            mut self,
3638            v: V,
3639        ) -> Self {
3640            self.0.request = v.into();
3641            self
3642        }
3643
3644        /// Sets all the options, replacing any prior values.
3645        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3646            self.0.options = v.into();
3647            self
3648        }
3649
3650        /// Sends the request.
3651        pub async fn send(self) -> Result<crate::model::GenerateStatelessSummaryResponse> {
3652            (*self.0.stub)
3653                .generate_stateless_summary(self.0.request, self.0.options)
3654                .await
3655                .map(gax::response::Response::into_body)
3656        }
3657
3658        /// Sets the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3659        ///
3660        /// This is a **required** field for requests.
3661        pub fn set_stateless_conversation<T>(mut self, v: T) -> Self
3662        where
3663            T: std::convert::Into<
3664                    crate::model::generate_stateless_summary_request::MinimalConversation,
3665                >,
3666        {
3667            self.0.request.stateless_conversation = std::option::Option::Some(v.into());
3668            self
3669        }
3670
3671        /// Sets or clears the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3672        ///
3673        /// This is a **required** field for requests.
3674        pub fn set_or_clear_stateless_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3675        where
3676            T: std::convert::Into<
3677                    crate::model::generate_stateless_summary_request::MinimalConversation,
3678                >,
3679        {
3680            self.0.request.stateless_conversation = v.map(|x| x.into());
3681            self
3682        }
3683
3684        /// Sets the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3685        ///
3686        /// This is a **required** field for requests.
3687        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
3688        where
3689            T: std::convert::Into<crate::model::ConversationProfile>,
3690        {
3691            self.0.request.conversation_profile = std::option::Option::Some(v.into());
3692            self
3693        }
3694
3695        /// Sets or clears the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3696        ///
3697        /// This is a **required** field for requests.
3698        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
3699        where
3700            T: std::convert::Into<crate::model::ConversationProfile>,
3701        {
3702            self.0.request.conversation_profile = v.map(|x| x.into());
3703            self
3704        }
3705
3706        /// Sets the value of [latest_message][crate::model::GenerateStatelessSummaryRequest::latest_message].
3707        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3708            self.0.request.latest_message = v.into();
3709            self
3710        }
3711
3712        /// Sets the value of [max_context_size][crate::model::GenerateStatelessSummaryRequest::max_context_size].
3713        pub fn set_max_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3714            self.0.request.max_context_size = v.into();
3715            self
3716        }
3717    }
3718
3719    #[doc(hidden)]
3720    impl gax::options::internal::RequestBuilder for GenerateStatelessSummary {
3721        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3722            &mut self.0.options
3723        }
3724    }
3725
3726    /// The request builder for [Conversations::generate_stateless_suggestion][crate::client::Conversations::generate_stateless_suggestion] calls.
3727    ///
3728    /// # Example
3729    /// ```
3730    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateStatelessSuggestion;
3731    /// # async fn sample() -> gax::Result<()> {
3732    ///
3733    /// let builder = prepare_request_builder();
3734    /// let response = builder.send().await?;
3735    /// # Ok(()) }
3736    ///
3737    /// fn prepare_request_builder() -> GenerateStatelessSuggestion {
3738    ///   # panic!();
3739    ///   // ... details omitted ...
3740    /// }
3741    /// ```
3742    #[derive(Clone, Debug)]
3743    pub struct GenerateStatelessSuggestion(
3744        RequestBuilder<crate::model::GenerateStatelessSuggestionRequest>,
3745    );
3746
3747    impl GenerateStatelessSuggestion {
3748        pub(crate) fn new(
3749            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3750        ) -> Self {
3751            Self(RequestBuilder::new(stub))
3752        }
3753
3754        /// Sets the full request, replacing any prior values.
3755        pub fn with_request<V: Into<crate::model::GenerateStatelessSuggestionRequest>>(
3756            mut self,
3757            v: V,
3758        ) -> Self {
3759            self.0.request = v.into();
3760            self
3761        }
3762
3763        /// Sets all the options, replacing any prior values.
3764        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3765            self.0.options = v.into();
3766            self
3767        }
3768
3769        /// Sends the request.
3770        pub async fn send(self) -> Result<crate::model::GenerateStatelessSuggestionResponse> {
3771            (*self.0.stub)
3772                .generate_stateless_suggestion(self.0.request, self.0.options)
3773                .await
3774                .map(gax::response::Response::into_body)
3775        }
3776
3777        /// Sets the value of [parent][crate::model::GenerateStatelessSuggestionRequest::parent].
3778        ///
3779        /// This is a **required** field for requests.
3780        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3781            self.0.request.parent = v.into();
3782            self
3783        }
3784
3785        /// Sets the value of [context_references][crate::model::GenerateStatelessSuggestionRequest::context_references].
3786        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3787        where
3788            T: std::iter::IntoIterator<Item = (K, V)>,
3789            K: std::convert::Into<std::string::String>,
3790            V: std::convert::Into<crate::model::conversation::ContextReference>,
3791        {
3792            self.0.request.context_references =
3793                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3794            self
3795        }
3796
3797        /// Sets the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3798        pub fn set_conversation_context<T>(mut self, v: T) -> Self
3799        where
3800            T: std::convert::Into<crate::model::ConversationContext>,
3801        {
3802            self.0.request.conversation_context = std::option::Option::Some(v.into());
3803            self
3804        }
3805
3806        /// Sets or clears the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3807        pub fn set_or_clear_conversation_context<T>(mut self, v: std::option::Option<T>) -> Self
3808        where
3809            T: std::convert::Into<crate::model::ConversationContext>,
3810        {
3811            self.0.request.conversation_context = v.map(|x| x.into());
3812            self
3813        }
3814
3815        /// Sets the value of [trigger_events][crate::model::GenerateStatelessSuggestionRequest::trigger_events].
3816        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
3817        where
3818            T: std::iter::IntoIterator<Item = V>,
3819            V: std::convert::Into<crate::model::TriggerEvent>,
3820        {
3821            use std::iter::Iterator;
3822            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
3823            self
3824        }
3825
3826        /// Sets the value of [security_settings][crate::model::GenerateStatelessSuggestionRequest::security_settings].
3827        pub fn set_security_settings<T: Into<std::string::String>>(mut self, v: T) -> Self {
3828            self.0.request.security_settings = v.into();
3829            self
3830        }
3831
3832        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource].
3833        ///
3834        /// Note that all the setters affecting `generator_resource` are
3835        /// mutually exclusive.
3836        pub fn set_generator_resource<
3837            T: Into<Option<crate::model::generate_stateless_suggestion_request::GeneratorResource>>,
3838        >(
3839            mut self,
3840            v: T,
3841        ) -> Self {
3842            self.0.request.generator_resource = v.into();
3843            self
3844        }
3845
3846        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3847        /// to hold a `Generator`.
3848        ///
3849        /// Note that all the setters affecting `generator_resource` are
3850        /// mutually exclusive.
3851        pub fn set_generator<T: std::convert::Into<std::boxed::Box<crate::model::Generator>>>(
3852            mut self,
3853            v: T,
3854        ) -> Self {
3855            self.0.request = self.0.request.set_generator(v);
3856            self
3857        }
3858
3859        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3860        /// to hold a `GeneratorName`.
3861        ///
3862        /// Note that all the setters affecting `generator_resource` are
3863        /// mutually exclusive.
3864        pub fn set_generator_name<T: std::convert::Into<std::string::String>>(
3865            mut self,
3866            v: T,
3867        ) -> Self {
3868            self.0.request = self.0.request.set_generator_name(v);
3869            self
3870        }
3871    }
3872
3873    #[doc(hidden)]
3874    impl gax::options::internal::RequestBuilder for GenerateStatelessSuggestion {
3875        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3876            &mut self.0.options
3877        }
3878    }
3879
3880    /// The request builder for [Conversations::search_knowledge][crate::client::Conversations::search_knowledge] calls.
3881    ///
3882    /// # Example
3883    /// ```
3884    /// # use google_cloud_dialogflow_v2::builder::conversations::SearchKnowledge;
3885    /// # async fn sample() -> gax::Result<()> {
3886    ///
3887    /// let builder = prepare_request_builder();
3888    /// let response = builder.send().await?;
3889    /// # Ok(()) }
3890    ///
3891    /// fn prepare_request_builder() -> SearchKnowledge {
3892    ///   # panic!();
3893    ///   // ... details omitted ...
3894    /// }
3895    /// ```
3896    #[derive(Clone, Debug)]
3897    pub struct SearchKnowledge(RequestBuilder<crate::model::SearchKnowledgeRequest>);
3898
3899    impl SearchKnowledge {
3900        pub(crate) fn new(
3901            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3902        ) -> Self {
3903            Self(RequestBuilder::new(stub))
3904        }
3905
3906        /// Sets the full request, replacing any prior values.
3907        pub fn with_request<V: Into<crate::model::SearchKnowledgeRequest>>(mut self, v: V) -> Self {
3908            self.0.request = v.into();
3909            self
3910        }
3911
3912        /// Sets all the options, replacing any prior values.
3913        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3914            self.0.options = v.into();
3915            self
3916        }
3917
3918        /// Sends the request.
3919        pub async fn send(self) -> Result<crate::model::SearchKnowledgeResponse> {
3920            (*self.0.stub)
3921                .search_knowledge(self.0.request, self.0.options)
3922                .await
3923                .map(gax::response::Response::into_body)
3924        }
3925
3926        /// Sets the value of [parent][crate::model::SearchKnowledgeRequest::parent].
3927        ///
3928        /// This is a **required** field for requests.
3929        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3930            self.0.request.parent = v.into();
3931            self
3932        }
3933
3934        /// Sets the value of [query][crate::model::SearchKnowledgeRequest::query].
3935        ///
3936        /// This is a **required** field for requests.
3937        pub fn set_query<T>(mut self, v: T) -> Self
3938        where
3939            T: std::convert::Into<crate::model::TextInput>,
3940        {
3941            self.0.request.query = std::option::Option::Some(v.into());
3942            self
3943        }
3944
3945        /// Sets or clears the value of [query][crate::model::SearchKnowledgeRequest::query].
3946        ///
3947        /// This is a **required** field for requests.
3948        pub fn set_or_clear_query<T>(mut self, v: std::option::Option<T>) -> Self
3949        where
3950            T: std::convert::Into<crate::model::TextInput>,
3951        {
3952            self.0.request.query = v.map(|x| x.into());
3953            self
3954        }
3955
3956        /// Sets the value of [conversation_profile][crate::model::SearchKnowledgeRequest::conversation_profile].
3957        ///
3958        /// This is a **required** field for requests.
3959        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
3960            self.0.request.conversation_profile = v.into();
3961            self
3962        }
3963
3964        /// Sets the value of [session_id][crate::model::SearchKnowledgeRequest::session_id].
3965        ///
3966        /// This is a **required** field for requests.
3967        pub fn set_session_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3968            self.0.request.session_id = v.into();
3969            self
3970        }
3971
3972        /// Sets the value of [conversation][crate::model::SearchKnowledgeRequest::conversation].
3973        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3974            self.0.request.conversation = v.into();
3975            self
3976        }
3977
3978        /// Sets the value of [latest_message][crate::model::SearchKnowledgeRequest::latest_message].
3979        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3980            self.0.request.latest_message = v.into();
3981            self
3982        }
3983
3984        /// Sets the value of [query_source][crate::model::SearchKnowledgeRequest::query_source].
3985        pub fn set_query_source<T: Into<crate::model::search_knowledge_request::QuerySource>>(
3986            mut self,
3987            v: T,
3988        ) -> Self {
3989            self.0.request.query_source = v.into();
3990            self
3991        }
3992
3993        /// Sets the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
3994        pub fn set_end_user_metadata<T>(mut self, v: T) -> Self
3995        where
3996            T: std::convert::Into<wkt::Struct>,
3997        {
3998            self.0.request.end_user_metadata = std::option::Option::Some(v.into());
3999            self
4000        }
4001
4002        /// Sets or clears the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4003        pub fn set_or_clear_end_user_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4004        where
4005            T: std::convert::Into<wkt::Struct>,
4006        {
4007            self.0.request.end_user_metadata = v.map(|x| x.into());
4008            self
4009        }
4010
4011        /// Sets the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4012        pub fn set_search_config<T>(mut self, v: T) -> Self
4013        where
4014            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4015        {
4016            self.0.request.search_config = std::option::Option::Some(v.into());
4017            self
4018        }
4019
4020        /// Sets or clears the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4021        pub fn set_or_clear_search_config<T>(mut self, v: std::option::Option<T>) -> Self
4022        where
4023            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4024        {
4025            self.0.request.search_config = v.map(|x| x.into());
4026            self
4027        }
4028
4029        /// Sets the value of [exact_search][crate::model::SearchKnowledgeRequest::exact_search].
4030        pub fn set_exact_search<T: Into<bool>>(mut self, v: T) -> Self {
4031            self.0.request.exact_search = v.into();
4032            self
4033        }
4034    }
4035
4036    #[doc(hidden)]
4037    impl gax::options::internal::RequestBuilder for SearchKnowledge {
4038        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4039            &mut self.0.options
4040        }
4041    }
4042
4043    /// The request builder for [Conversations::generate_suggestions][crate::client::Conversations::generate_suggestions] calls.
4044    ///
4045    /// # Example
4046    /// ```
4047    /// # use google_cloud_dialogflow_v2::builder::conversations::GenerateSuggestions;
4048    /// # async fn sample() -> gax::Result<()> {
4049    ///
4050    /// let builder = prepare_request_builder();
4051    /// let response = builder.send().await?;
4052    /// # Ok(()) }
4053    ///
4054    /// fn prepare_request_builder() -> GenerateSuggestions {
4055    ///   # panic!();
4056    ///   // ... details omitted ...
4057    /// }
4058    /// ```
4059    #[derive(Clone, Debug)]
4060    pub struct GenerateSuggestions(RequestBuilder<crate::model::GenerateSuggestionsRequest>);
4061
4062    impl GenerateSuggestions {
4063        pub(crate) fn new(
4064            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4065        ) -> Self {
4066            Self(RequestBuilder::new(stub))
4067        }
4068
4069        /// Sets the full request, replacing any prior values.
4070        pub fn with_request<V: Into<crate::model::GenerateSuggestionsRequest>>(
4071            mut self,
4072            v: V,
4073        ) -> Self {
4074            self.0.request = v.into();
4075            self
4076        }
4077
4078        /// Sets all the options, replacing any prior values.
4079        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4080            self.0.options = v.into();
4081            self
4082        }
4083
4084        /// Sends the request.
4085        pub async fn send(self) -> Result<crate::model::GenerateSuggestionsResponse> {
4086            (*self.0.stub)
4087                .generate_suggestions(self.0.request, self.0.options)
4088                .await
4089                .map(gax::response::Response::into_body)
4090        }
4091
4092        /// Sets the value of [conversation][crate::model::GenerateSuggestionsRequest::conversation].
4093        ///
4094        /// This is a **required** field for requests.
4095        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4096            self.0.request.conversation = v.into();
4097            self
4098        }
4099
4100        /// Sets the value of [latest_message][crate::model::GenerateSuggestionsRequest::latest_message].
4101        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4102            self.0.request.latest_message = v.into();
4103            self
4104        }
4105
4106        /// Sets the value of [trigger_events][crate::model::GenerateSuggestionsRequest::trigger_events].
4107        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
4108        where
4109            T: std::iter::IntoIterator<Item = V>,
4110            V: std::convert::Into<crate::model::TriggerEvent>,
4111        {
4112            use std::iter::Iterator;
4113            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
4114            self
4115        }
4116    }
4117
4118    #[doc(hidden)]
4119    impl gax::options::internal::RequestBuilder for GenerateSuggestions {
4120        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4121            &mut self.0.options
4122        }
4123    }
4124
4125    /// The request builder for [Conversations::list_locations][crate::client::Conversations::list_locations] calls.
4126    ///
4127    /// # Example
4128    /// ```
4129    /// # use google_cloud_dialogflow_v2::builder::conversations::ListLocations;
4130    /// # async fn sample() -> gax::Result<()> {
4131    /// use gax::paginator::ItemPaginator;
4132    ///
4133    /// let builder = prepare_request_builder();
4134    /// let mut items = builder.by_item();
4135    /// while let Some(result) = items.next().await {
4136    ///   let item = result?;
4137    /// }
4138    /// # Ok(()) }
4139    ///
4140    /// fn prepare_request_builder() -> ListLocations {
4141    ///   # panic!();
4142    ///   // ... details omitted ...
4143    /// }
4144    /// ```
4145    #[derive(Clone, Debug)]
4146    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4147
4148    impl ListLocations {
4149        pub(crate) fn new(
4150            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4151        ) -> Self {
4152            Self(RequestBuilder::new(stub))
4153        }
4154
4155        /// Sets the full request, replacing any prior values.
4156        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4157            mut self,
4158            v: V,
4159        ) -> Self {
4160            self.0.request = v.into();
4161            self
4162        }
4163
4164        /// Sets all the options, replacing any prior values.
4165        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4166            self.0.options = v.into();
4167            self
4168        }
4169
4170        /// Sends the request.
4171        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4172            (*self.0.stub)
4173                .list_locations(self.0.request, self.0.options)
4174                .await
4175                .map(gax::response::Response::into_body)
4176        }
4177
4178        /// Streams each page in the collection.
4179        pub fn by_page(
4180            self,
4181        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4182        {
4183            use std::clone::Clone;
4184            let token = self.0.request.page_token.clone();
4185            let execute = move |token: String| {
4186                let mut builder = self.clone();
4187                builder.0.request = builder.0.request.set_page_token(token);
4188                builder.send()
4189            };
4190            gax::paginator::internal::new_paginator(token, execute)
4191        }
4192
4193        /// Streams each item in the collection.
4194        pub fn by_item(
4195            self,
4196        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4197        {
4198            use gax::paginator::Paginator;
4199            self.by_page().items()
4200        }
4201
4202        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4203        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4204            self.0.request.name = v.into();
4205            self
4206        }
4207
4208        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4209        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4210            self.0.request.filter = v.into();
4211            self
4212        }
4213
4214        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4215        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4216            self.0.request.page_size = v.into();
4217            self
4218        }
4219
4220        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
4221        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4222            self.0.request.page_token = v.into();
4223            self
4224        }
4225    }
4226
4227    #[doc(hidden)]
4228    impl gax::options::internal::RequestBuilder for ListLocations {
4229        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4230            &mut self.0.options
4231        }
4232    }
4233
4234    /// The request builder for [Conversations::get_location][crate::client::Conversations::get_location] calls.
4235    ///
4236    /// # Example
4237    /// ```
4238    /// # use google_cloud_dialogflow_v2::builder::conversations::GetLocation;
4239    /// # async fn sample() -> gax::Result<()> {
4240    ///
4241    /// let builder = prepare_request_builder();
4242    /// let response = builder.send().await?;
4243    /// # Ok(()) }
4244    ///
4245    /// fn prepare_request_builder() -> GetLocation {
4246    ///   # panic!();
4247    ///   // ... details omitted ...
4248    /// }
4249    /// ```
4250    #[derive(Clone, Debug)]
4251    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4252
4253    impl GetLocation {
4254        pub(crate) fn new(
4255            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4256        ) -> Self {
4257            Self(RequestBuilder::new(stub))
4258        }
4259
4260        /// Sets the full request, replacing any prior values.
4261        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4262            self.0.request = v.into();
4263            self
4264        }
4265
4266        /// Sets all the options, replacing any prior values.
4267        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4268            self.0.options = v.into();
4269            self
4270        }
4271
4272        /// Sends the request.
4273        pub async fn send(self) -> Result<location::model::Location> {
4274            (*self.0.stub)
4275                .get_location(self.0.request, self.0.options)
4276                .await
4277                .map(gax::response::Response::into_body)
4278        }
4279
4280        /// Sets the value of [name][location::model::GetLocationRequest::name].
4281        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4282            self.0.request.name = v.into();
4283            self
4284        }
4285    }
4286
4287    #[doc(hidden)]
4288    impl gax::options::internal::RequestBuilder for GetLocation {
4289        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4290            &mut self.0.options
4291        }
4292    }
4293
4294    /// The request builder for [Conversations::list_operations][crate::client::Conversations::list_operations] calls.
4295    ///
4296    /// # Example
4297    /// ```
4298    /// # use google_cloud_dialogflow_v2::builder::conversations::ListOperations;
4299    /// # async fn sample() -> gax::Result<()> {
4300    /// use gax::paginator::ItemPaginator;
4301    ///
4302    /// let builder = prepare_request_builder();
4303    /// let mut items = builder.by_item();
4304    /// while let Some(result) = items.next().await {
4305    ///   let item = result?;
4306    /// }
4307    /// # Ok(()) }
4308    ///
4309    /// fn prepare_request_builder() -> ListOperations {
4310    ///   # panic!();
4311    ///   // ... details omitted ...
4312    /// }
4313    /// ```
4314    #[derive(Clone, Debug)]
4315    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4316
4317    impl ListOperations {
4318        pub(crate) fn new(
4319            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4320        ) -> Self {
4321            Self(RequestBuilder::new(stub))
4322        }
4323
4324        /// Sets the full request, replacing any prior values.
4325        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4326            mut self,
4327            v: V,
4328        ) -> Self {
4329            self.0.request = v.into();
4330            self
4331        }
4332
4333        /// Sets all the options, replacing any prior values.
4334        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4335            self.0.options = v.into();
4336            self
4337        }
4338
4339        /// Sends the request.
4340        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4341            (*self.0.stub)
4342                .list_operations(self.0.request, self.0.options)
4343                .await
4344                .map(gax::response::Response::into_body)
4345        }
4346
4347        /// Streams each page in the collection.
4348        pub fn by_page(
4349            self,
4350        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4351        {
4352            use std::clone::Clone;
4353            let token = self.0.request.page_token.clone();
4354            let execute = move |token: String| {
4355                let mut builder = self.clone();
4356                builder.0.request = builder.0.request.set_page_token(token);
4357                builder.send()
4358            };
4359            gax::paginator::internal::new_paginator(token, execute)
4360        }
4361
4362        /// Streams each item in the collection.
4363        pub fn by_item(
4364            self,
4365        ) -> impl gax::paginator::ItemPaginator<
4366            longrunning::model::ListOperationsResponse,
4367            gax::error::Error,
4368        > {
4369            use gax::paginator::Paginator;
4370            self.by_page().items()
4371        }
4372
4373        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4374        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4375            self.0.request.name = v.into();
4376            self
4377        }
4378
4379        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4380        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4381            self.0.request.filter = v.into();
4382            self
4383        }
4384
4385        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4386        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4387            self.0.request.page_size = v.into();
4388            self
4389        }
4390
4391        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4392        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4393            self.0.request.page_token = v.into();
4394            self
4395        }
4396
4397        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
4398        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4399            self.0.request.return_partial_success = v.into();
4400            self
4401        }
4402    }
4403
4404    #[doc(hidden)]
4405    impl gax::options::internal::RequestBuilder for ListOperations {
4406        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4407            &mut self.0.options
4408        }
4409    }
4410
4411    /// The request builder for [Conversations::get_operation][crate::client::Conversations::get_operation] calls.
4412    ///
4413    /// # Example
4414    /// ```
4415    /// # use google_cloud_dialogflow_v2::builder::conversations::GetOperation;
4416    /// # async fn sample() -> gax::Result<()> {
4417    ///
4418    /// let builder = prepare_request_builder();
4419    /// let response = builder.send().await?;
4420    /// # Ok(()) }
4421    ///
4422    /// fn prepare_request_builder() -> GetOperation {
4423    ///   # panic!();
4424    ///   // ... details omitted ...
4425    /// }
4426    /// ```
4427    #[derive(Clone, Debug)]
4428    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4429
4430    impl GetOperation {
4431        pub(crate) fn new(
4432            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4433        ) -> Self {
4434            Self(RequestBuilder::new(stub))
4435        }
4436
4437        /// Sets the full request, replacing any prior values.
4438        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4439            mut self,
4440            v: V,
4441        ) -> Self {
4442            self.0.request = v.into();
4443            self
4444        }
4445
4446        /// Sets all the options, replacing any prior values.
4447        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4448            self.0.options = v.into();
4449            self
4450        }
4451
4452        /// Sends the request.
4453        pub async fn send(self) -> Result<longrunning::model::Operation> {
4454            (*self.0.stub)
4455                .get_operation(self.0.request, self.0.options)
4456                .await
4457                .map(gax::response::Response::into_body)
4458        }
4459
4460        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
4461        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4462            self.0.request.name = v.into();
4463            self
4464        }
4465    }
4466
4467    #[doc(hidden)]
4468    impl gax::options::internal::RequestBuilder for GetOperation {
4469        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4470            &mut self.0.options
4471        }
4472    }
4473
4474    /// The request builder for [Conversations::cancel_operation][crate::client::Conversations::cancel_operation] calls.
4475    ///
4476    /// # Example
4477    /// ```
4478    /// # use google_cloud_dialogflow_v2::builder::conversations::CancelOperation;
4479    /// # async fn sample() -> gax::Result<()> {
4480    ///
4481    /// let builder = prepare_request_builder();
4482    /// let response = builder.send().await?;
4483    /// # Ok(()) }
4484    ///
4485    /// fn prepare_request_builder() -> CancelOperation {
4486    ///   # panic!();
4487    ///   // ... details omitted ...
4488    /// }
4489    /// ```
4490    #[derive(Clone, Debug)]
4491    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4492
4493    impl CancelOperation {
4494        pub(crate) fn new(
4495            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4496        ) -> Self {
4497            Self(RequestBuilder::new(stub))
4498        }
4499
4500        /// Sets the full request, replacing any prior values.
4501        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4502            mut self,
4503            v: V,
4504        ) -> Self {
4505            self.0.request = v.into();
4506            self
4507        }
4508
4509        /// Sets all the options, replacing any prior values.
4510        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4511            self.0.options = v.into();
4512            self
4513        }
4514
4515        /// Sends the request.
4516        pub async fn send(self) -> Result<()> {
4517            (*self.0.stub)
4518                .cancel_operation(self.0.request, self.0.options)
4519                .await
4520                .map(gax::response::Response::into_body)
4521        }
4522
4523        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
4524        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4525            self.0.request.name = v.into();
4526            self
4527        }
4528    }
4529
4530    #[doc(hidden)]
4531    impl gax::options::internal::RequestBuilder for CancelOperation {
4532        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4533            &mut self.0.options
4534        }
4535    }
4536}
4537
4538#[cfg(feature = "conversation-datasets")]
4539#[cfg_attr(docsrs, doc(cfg(feature = "conversation-datasets")))]
4540pub mod conversation_datasets {
4541    use crate::Result;
4542
4543    /// A builder for [ConversationDatasets][crate::client::ConversationDatasets].
4544    ///
4545    /// ```
4546    /// # async fn sample() -> gax::client_builder::Result<()> {
4547    /// # use google_cloud_dialogflow_v2::*;
4548    /// # use builder::conversation_datasets::ClientBuilder;
4549    /// # use client::ConversationDatasets;
4550    /// let builder : ClientBuilder = ConversationDatasets::builder();
4551    /// let client = builder
4552    ///     .with_endpoint("https://dialogflow.googleapis.com")
4553    ///     .build().await?;
4554    /// # Ok(()) }
4555    /// ```
4556    pub type ClientBuilder =
4557        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4558
4559    pub(crate) mod client {
4560        use super::super::super::client::ConversationDatasets;
4561        pub struct Factory;
4562        impl gax::client_builder::internal::ClientFactory for Factory {
4563            type Client = ConversationDatasets;
4564            type Credentials = gaxi::options::Credentials;
4565            async fn build(
4566                self,
4567                config: gaxi::options::ClientConfig,
4568            ) -> gax::client_builder::Result<Self::Client> {
4569                Self::Client::new(config).await
4570            }
4571        }
4572    }
4573
4574    /// Common implementation for [crate::client::ConversationDatasets] request builders.
4575    #[derive(Clone, Debug)]
4576    pub(crate) struct RequestBuilder<R: std::default::Default> {
4577        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4578        request: R,
4579        options: gax::options::RequestOptions,
4580    }
4581
4582    impl<R> RequestBuilder<R>
4583    where
4584        R: std::default::Default,
4585    {
4586        pub(crate) fn new(
4587            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4588        ) -> Self {
4589            Self {
4590                stub,
4591                request: R::default(),
4592                options: gax::options::RequestOptions::default(),
4593            }
4594        }
4595    }
4596
4597    /// The request builder for [ConversationDatasets::create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset] calls.
4598    ///
4599    /// # Example
4600    /// ```
4601    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::CreateConversationDataset;
4602    /// # async fn sample() -> gax::Result<()> {
4603    /// use lro::Poller;
4604    ///
4605    /// let builder = prepare_request_builder();
4606    /// let response = builder.poller().until_done().await?;
4607    /// # Ok(()) }
4608    ///
4609    /// fn prepare_request_builder() -> CreateConversationDataset {
4610    ///   # panic!();
4611    ///   // ... details omitted ...
4612    /// }
4613    /// ```
4614    #[derive(Clone, Debug)]
4615    pub struct CreateConversationDataset(
4616        RequestBuilder<crate::model::CreateConversationDatasetRequest>,
4617    );
4618
4619    impl CreateConversationDataset {
4620        pub(crate) fn new(
4621            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4622        ) -> Self {
4623            Self(RequestBuilder::new(stub))
4624        }
4625
4626        /// Sets the full request, replacing any prior values.
4627        pub fn with_request<V: Into<crate::model::CreateConversationDatasetRequest>>(
4628            mut self,
4629            v: V,
4630        ) -> Self {
4631            self.0.request = v.into();
4632            self
4633        }
4634
4635        /// Sets all the options, replacing any prior values.
4636        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4637            self.0.options = v.into();
4638            self
4639        }
4640
4641        /// Sends the request.
4642        ///
4643        /// # Long running operations
4644        ///
4645        /// This starts, but does not poll, a longrunning operation. More information
4646        /// on [create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset].
4647        pub async fn send(self) -> Result<longrunning::model::Operation> {
4648            (*self.0.stub)
4649                .create_conversation_dataset(self.0.request, self.0.options)
4650                .await
4651                .map(gax::response::Response::into_body)
4652        }
4653
4654        /// Creates a [Poller][lro::Poller] to work with `create_conversation_dataset`.
4655        pub fn poller(
4656            self,
4657        ) -> impl lro::Poller<
4658            crate::model::ConversationDataset,
4659            crate::model::CreateConversationDatasetOperationMetadata,
4660        > {
4661            type Operation = lro::internal::Operation<
4662                crate::model::ConversationDataset,
4663                crate::model::CreateConversationDatasetOperationMetadata,
4664            >;
4665            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4666            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4667
4668            let stub = self.0.stub.clone();
4669            let mut options = self.0.options.clone();
4670            options.set_retry_policy(gax::retry_policy::NeverRetry);
4671            let query = move |name| {
4672                let stub = stub.clone();
4673                let options = options.clone();
4674                async {
4675                    let op = GetOperation::new(stub)
4676                        .set_name(name)
4677                        .with_options(options)
4678                        .send()
4679                        .await?;
4680                    Ok(Operation::new(op))
4681                }
4682            };
4683
4684            let start = move || async {
4685                let op = self.send().await?;
4686                Ok(Operation::new(op))
4687            };
4688
4689            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4690        }
4691
4692        /// Sets the value of [parent][crate::model::CreateConversationDatasetRequest::parent].
4693        ///
4694        /// This is a **required** field for requests.
4695        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4696            self.0.request.parent = v.into();
4697            self
4698        }
4699
4700        /// Sets the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4701        ///
4702        /// This is a **required** field for requests.
4703        pub fn set_conversation_dataset<T>(mut self, v: T) -> Self
4704        where
4705            T: std::convert::Into<crate::model::ConversationDataset>,
4706        {
4707            self.0.request.conversation_dataset = std::option::Option::Some(v.into());
4708            self
4709        }
4710
4711        /// Sets or clears the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4712        ///
4713        /// This is a **required** field for requests.
4714        pub fn set_or_clear_conversation_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4715        where
4716            T: std::convert::Into<crate::model::ConversationDataset>,
4717        {
4718            self.0.request.conversation_dataset = v.map(|x| x.into());
4719            self
4720        }
4721    }
4722
4723    #[doc(hidden)]
4724    impl gax::options::internal::RequestBuilder for CreateConversationDataset {
4725        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4726            &mut self.0.options
4727        }
4728    }
4729
4730    /// The request builder for [ConversationDatasets::get_conversation_dataset][crate::client::ConversationDatasets::get_conversation_dataset] calls.
4731    ///
4732    /// # Example
4733    /// ```
4734    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetConversationDataset;
4735    /// # async fn sample() -> gax::Result<()> {
4736    ///
4737    /// let builder = prepare_request_builder();
4738    /// let response = builder.send().await?;
4739    /// # Ok(()) }
4740    ///
4741    /// fn prepare_request_builder() -> GetConversationDataset {
4742    ///   # panic!();
4743    ///   // ... details omitted ...
4744    /// }
4745    /// ```
4746    #[derive(Clone, Debug)]
4747    pub struct GetConversationDataset(RequestBuilder<crate::model::GetConversationDatasetRequest>);
4748
4749    impl GetConversationDataset {
4750        pub(crate) fn new(
4751            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4752        ) -> Self {
4753            Self(RequestBuilder::new(stub))
4754        }
4755
4756        /// Sets the full request, replacing any prior values.
4757        pub fn with_request<V: Into<crate::model::GetConversationDatasetRequest>>(
4758            mut self,
4759            v: V,
4760        ) -> Self {
4761            self.0.request = v.into();
4762            self
4763        }
4764
4765        /// Sets all the options, replacing any prior values.
4766        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4767            self.0.options = v.into();
4768            self
4769        }
4770
4771        /// Sends the request.
4772        pub async fn send(self) -> Result<crate::model::ConversationDataset> {
4773            (*self.0.stub)
4774                .get_conversation_dataset(self.0.request, self.0.options)
4775                .await
4776                .map(gax::response::Response::into_body)
4777        }
4778
4779        /// Sets the value of [name][crate::model::GetConversationDatasetRequest::name].
4780        ///
4781        /// This is a **required** field for requests.
4782        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4783            self.0.request.name = v.into();
4784            self
4785        }
4786    }
4787
4788    #[doc(hidden)]
4789    impl gax::options::internal::RequestBuilder for GetConversationDataset {
4790        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4791            &mut self.0.options
4792        }
4793    }
4794
4795    /// The request builder for [ConversationDatasets::list_conversation_datasets][crate::client::ConversationDatasets::list_conversation_datasets] calls.
4796    ///
4797    /// # Example
4798    /// ```
4799    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListConversationDatasets;
4800    /// # async fn sample() -> gax::Result<()> {
4801    /// use gax::paginator::ItemPaginator;
4802    ///
4803    /// let builder = prepare_request_builder();
4804    /// let mut items = builder.by_item();
4805    /// while let Some(result) = items.next().await {
4806    ///   let item = result?;
4807    /// }
4808    /// # Ok(()) }
4809    ///
4810    /// fn prepare_request_builder() -> ListConversationDatasets {
4811    ///   # panic!();
4812    ///   // ... details omitted ...
4813    /// }
4814    /// ```
4815    #[derive(Clone, Debug)]
4816    pub struct ListConversationDatasets(
4817        RequestBuilder<crate::model::ListConversationDatasetsRequest>,
4818    );
4819
4820    impl ListConversationDatasets {
4821        pub(crate) fn new(
4822            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4823        ) -> Self {
4824            Self(RequestBuilder::new(stub))
4825        }
4826
4827        /// Sets the full request, replacing any prior values.
4828        pub fn with_request<V: Into<crate::model::ListConversationDatasetsRequest>>(
4829            mut self,
4830            v: V,
4831        ) -> Self {
4832            self.0.request = v.into();
4833            self
4834        }
4835
4836        /// Sets all the options, replacing any prior values.
4837        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4838            self.0.options = v.into();
4839            self
4840        }
4841
4842        /// Sends the request.
4843        pub async fn send(self) -> Result<crate::model::ListConversationDatasetsResponse> {
4844            (*self.0.stub)
4845                .list_conversation_datasets(self.0.request, self.0.options)
4846                .await
4847                .map(gax::response::Response::into_body)
4848        }
4849
4850        /// Streams each page in the collection.
4851        pub fn by_page(
4852            self,
4853        ) -> impl gax::paginator::Paginator<
4854            crate::model::ListConversationDatasetsResponse,
4855            gax::error::Error,
4856        > {
4857            use std::clone::Clone;
4858            let token = self.0.request.page_token.clone();
4859            let execute = move |token: String| {
4860                let mut builder = self.clone();
4861                builder.0.request = builder.0.request.set_page_token(token);
4862                builder.send()
4863            };
4864            gax::paginator::internal::new_paginator(token, execute)
4865        }
4866
4867        /// Streams each item in the collection.
4868        pub fn by_item(
4869            self,
4870        ) -> impl gax::paginator::ItemPaginator<
4871            crate::model::ListConversationDatasetsResponse,
4872            gax::error::Error,
4873        > {
4874            use gax::paginator::Paginator;
4875            self.by_page().items()
4876        }
4877
4878        /// Sets the value of [parent][crate::model::ListConversationDatasetsRequest::parent].
4879        ///
4880        /// This is a **required** field for requests.
4881        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4882            self.0.request.parent = v.into();
4883            self
4884        }
4885
4886        /// Sets the value of [page_size][crate::model::ListConversationDatasetsRequest::page_size].
4887        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4888            self.0.request.page_size = v.into();
4889            self
4890        }
4891
4892        /// Sets the value of [page_token][crate::model::ListConversationDatasetsRequest::page_token].
4893        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4894            self.0.request.page_token = v.into();
4895            self
4896        }
4897    }
4898
4899    #[doc(hidden)]
4900    impl gax::options::internal::RequestBuilder for ListConversationDatasets {
4901        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4902            &mut self.0.options
4903        }
4904    }
4905
4906    /// The request builder for [ConversationDatasets::delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset] calls.
4907    ///
4908    /// # Example
4909    /// ```
4910    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::DeleteConversationDataset;
4911    /// # async fn sample() -> gax::Result<()> {
4912    /// use lro::Poller;
4913    ///
4914    /// let builder = prepare_request_builder();
4915    /// let response = builder.poller().until_done().await?;
4916    /// # Ok(()) }
4917    ///
4918    /// fn prepare_request_builder() -> DeleteConversationDataset {
4919    ///   # panic!();
4920    ///   // ... details omitted ...
4921    /// }
4922    /// ```
4923    #[derive(Clone, Debug)]
4924    pub struct DeleteConversationDataset(
4925        RequestBuilder<crate::model::DeleteConversationDatasetRequest>,
4926    );
4927
4928    impl DeleteConversationDataset {
4929        pub(crate) fn new(
4930            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4931        ) -> Self {
4932            Self(RequestBuilder::new(stub))
4933        }
4934
4935        /// Sets the full request, replacing any prior values.
4936        pub fn with_request<V: Into<crate::model::DeleteConversationDatasetRequest>>(
4937            mut self,
4938            v: V,
4939        ) -> Self {
4940            self.0.request = v.into();
4941            self
4942        }
4943
4944        /// Sets all the options, replacing any prior values.
4945        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4946            self.0.options = v.into();
4947            self
4948        }
4949
4950        /// Sends the request.
4951        ///
4952        /// # Long running operations
4953        ///
4954        /// This starts, but does not poll, a longrunning operation. More information
4955        /// on [delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset].
4956        pub async fn send(self) -> Result<longrunning::model::Operation> {
4957            (*self.0.stub)
4958                .delete_conversation_dataset(self.0.request, self.0.options)
4959                .await
4960                .map(gax::response::Response::into_body)
4961        }
4962
4963        /// Creates a [Poller][lro::Poller] to work with `delete_conversation_dataset`.
4964        pub fn poller(
4965            self,
4966        ) -> impl lro::Poller<(), crate::model::DeleteConversationDatasetOperationMetadata>
4967        {
4968            type Operation = lro::internal::Operation<
4969                wkt::Empty,
4970                crate::model::DeleteConversationDatasetOperationMetadata,
4971            >;
4972            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4973            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4974
4975            let stub = self.0.stub.clone();
4976            let mut options = self.0.options.clone();
4977            options.set_retry_policy(gax::retry_policy::NeverRetry);
4978            let query = move |name| {
4979                let stub = stub.clone();
4980                let options = options.clone();
4981                async {
4982                    let op = GetOperation::new(stub)
4983                        .set_name(name)
4984                        .with_options(options)
4985                        .send()
4986                        .await?;
4987                    Ok(Operation::new(op))
4988                }
4989            };
4990
4991            let start = move || async {
4992                let op = self.send().await?;
4993                Ok(Operation::new(op))
4994            };
4995
4996            lro::internal::new_unit_response_poller(
4997                polling_error_policy,
4998                polling_backoff_policy,
4999                start,
5000                query,
5001            )
5002        }
5003
5004        /// Sets the value of [name][crate::model::DeleteConversationDatasetRequest::name].
5005        ///
5006        /// This is a **required** field for requests.
5007        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5008            self.0.request.name = v.into();
5009            self
5010        }
5011    }
5012
5013    #[doc(hidden)]
5014    impl gax::options::internal::RequestBuilder for DeleteConversationDataset {
5015        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5016            &mut self.0.options
5017        }
5018    }
5019
5020    /// The request builder for [ConversationDatasets::import_conversation_data][crate::client::ConversationDatasets::import_conversation_data] calls.
5021    ///
5022    /// # Example
5023    /// ```
5024    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ImportConversationData;
5025    /// # async fn sample() -> gax::Result<()> {
5026    /// use lro::Poller;
5027    ///
5028    /// let builder = prepare_request_builder();
5029    /// let response = builder.poller().until_done().await?;
5030    /// # Ok(()) }
5031    ///
5032    /// fn prepare_request_builder() -> ImportConversationData {
5033    ///   # panic!();
5034    ///   // ... details omitted ...
5035    /// }
5036    /// ```
5037    #[derive(Clone, Debug)]
5038    pub struct ImportConversationData(RequestBuilder<crate::model::ImportConversationDataRequest>);
5039
5040    impl ImportConversationData {
5041        pub(crate) fn new(
5042            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5043        ) -> Self {
5044            Self(RequestBuilder::new(stub))
5045        }
5046
5047        /// Sets the full request, replacing any prior values.
5048        pub fn with_request<V: Into<crate::model::ImportConversationDataRequest>>(
5049            mut self,
5050            v: V,
5051        ) -> Self {
5052            self.0.request = v.into();
5053            self
5054        }
5055
5056        /// Sets all the options, replacing any prior values.
5057        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5058            self.0.options = v.into();
5059            self
5060        }
5061
5062        /// Sends the request.
5063        ///
5064        /// # Long running operations
5065        ///
5066        /// This starts, but does not poll, a longrunning operation. More information
5067        /// on [import_conversation_data][crate::client::ConversationDatasets::import_conversation_data].
5068        pub async fn send(self) -> Result<longrunning::model::Operation> {
5069            (*self.0.stub)
5070                .import_conversation_data(self.0.request, self.0.options)
5071                .await
5072                .map(gax::response::Response::into_body)
5073        }
5074
5075        /// Creates a [Poller][lro::Poller] to work with `import_conversation_data`.
5076        pub fn poller(
5077            self,
5078        ) -> impl lro::Poller<
5079            crate::model::ImportConversationDataOperationResponse,
5080            crate::model::ImportConversationDataOperationMetadata,
5081        > {
5082            type Operation = lro::internal::Operation<
5083                crate::model::ImportConversationDataOperationResponse,
5084                crate::model::ImportConversationDataOperationMetadata,
5085            >;
5086            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5087            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5088
5089            let stub = self.0.stub.clone();
5090            let mut options = self.0.options.clone();
5091            options.set_retry_policy(gax::retry_policy::NeverRetry);
5092            let query = move |name| {
5093                let stub = stub.clone();
5094                let options = options.clone();
5095                async {
5096                    let op = GetOperation::new(stub)
5097                        .set_name(name)
5098                        .with_options(options)
5099                        .send()
5100                        .await?;
5101                    Ok(Operation::new(op))
5102                }
5103            };
5104
5105            let start = move || async {
5106                let op = self.send().await?;
5107                Ok(Operation::new(op))
5108            };
5109
5110            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5111        }
5112
5113        /// Sets the value of [name][crate::model::ImportConversationDataRequest::name].
5114        ///
5115        /// This is a **required** field for requests.
5116        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5117            self.0.request.name = v.into();
5118            self
5119        }
5120
5121        /// Sets the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5122        ///
5123        /// This is a **required** field for requests.
5124        pub fn set_input_config<T>(mut self, v: T) -> Self
5125        where
5126            T: std::convert::Into<crate::model::InputConfig>,
5127        {
5128            self.0.request.input_config = std::option::Option::Some(v.into());
5129            self
5130        }
5131
5132        /// Sets or clears the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5133        ///
5134        /// This is a **required** field for requests.
5135        pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5136        where
5137            T: std::convert::Into<crate::model::InputConfig>,
5138        {
5139            self.0.request.input_config = v.map(|x| x.into());
5140            self
5141        }
5142    }
5143
5144    #[doc(hidden)]
5145    impl gax::options::internal::RequestBuilder for ImportConversationData {
5146        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5147            &mut self.0.options
5148        }
5149    }
5150
5151    /// The request builder for [ConversationDatasets::list_locations][crate::client::ConversationDatasets::list_locations] calls.
5152    ///
5153    /// # Example
5154    /// ```
5155    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListLocations;
5156    /// # async fn sample() -> gax::Result<()> {
5157    /// use gax::paginator::ItemPaginator;
5158    ///
5159    /// let builder = prepare_request_builder();
5160    /// let mut items = builder.by_item();
5161    /// while let Some(result) = items.next().await {
5162    ///   let item = result?;
5163    /// }
5164    /// # Ok(()) }
5165    ///
5166    /// fn prepare_request_builder() -> ListLocations {
5167    ///   # panic!();
5168    ///   // ... details omitted ...
5169    /// }
5170    /// ```
5171    #[derive(Clone, Debug)]
5172    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5173
5174    impl ListLocations {
5175        pub(crate) fn new(
5176            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5177        ) -> Self {
5178            Self(RequestBuilder::new(stub))
5179        }
5180
5181        /// Sets the full request, replacing any prior values.
5182        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5183            mut self,
5184            v: V,
5185        ) -> Self {
5186            self.0.request = v.into();
5187            self
5188        }
5189
5190        /// Sets all the options, replacing any prior values.
5191        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5192            self.0.options = v.into();
5193            self
5194        }
5195
5196        /// Sends the request.
5197        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5198            (*self.0.stub)
5199                .list_locations(self.0.request, self.0.options)
5200                .await
5201                .map(gax::response::Response::into_body)
5202        }
5203
5204        /// Streams each page in the collection.
5205        pub fn by_page(
5206            self,
5207        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5208        {
5209            use std::clone::Clone;
5210            let token = self.0.request.page_token.clone();
5211            let execute = move |token: String| {
5212                let mut builder = self.clone();
5213                builder.0.request = builder.0.request.set_page_token(token);
5214                builder.send()
5215            };
5216            gax::paginator::internal::new_paginator(token, execute)
5217        }
5218
5219        /// Streams each item in the collection.
5220        pub fn by_item(
5221            self,
5222        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5223        {
5224            use gax::paginator::Paginator;
5225            self.by_page().items()
5226        }
5227
5228        /// Sets the value of [name][location::model::ListLocationsRequest::name].
5229        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5230            self.0.request.name = v.into();
5231            self
5232        }
5233
5234        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
5235        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5236            self.0.request.filter = v.into();
5237            self
5238        }
5239
5240        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
5241        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5242            self.0.request.page_size = v.into();
5243            self
5244        }
5245
5246        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
5247        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5248            self.0.request.page_token = v.into();
5249            self
5250        }
5251    }
5252
5253    #[doc(hidden)]
5254    impl gax::options::internal::RequestBuilder for ListLocations {
5255        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5256            &mut self.0.options
5257        }
5258    }
5259
5260    /// The request builder for [ConversationDatasets::get_location][crate::client::ConversationDatasets::get_location] calls.
5261    ///
5262    /// # Example
5263    /// ```
5264    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetLocation;
5265    /// # async fn sample() -> gax::Result<()> {
5266    ///
5267    /// let builder = prepare_request_builder();
5268    /// let response = builder.send().await?;
5269    /// # Ok(()) }
5270    ///
5271    /// fn prepare_request_builder() -> GetLocation {
5272    ///   # panic!();
5273    ///   // ... details omitted ...
5274    /// }
5275    /// ```
5276    #[derive(Clone, Debug)]
5277    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5278
5279    impl GetLocation {
5280        pub(crate) fn new(
5281            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5282        ) -> Self {
5283            Self(RequestBuilder::new(stub))
5284        }
5285
5286        /// Sets the full request, replacing any prior values.
5287        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5288            self.0.request = v.into();
5289            self
5290        }
5291
5292        /// Sets all the options, replacing any prior values.
5293        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5294            self.0.options = v.into();
5295            self
5296        }
5297
5298        /// Sends the request.
5299        pub async fn send(self) -> Result<location::model::Location> {
5300            (*self.0.stub)
5301                .get_location(self.0.request, self.0.options)
5302                .await
5303                .map(gax::response::Response::into_body)
5304        }
5305
5306        /// Sets the value of [name][location::model::GetLocationRequest::name].
5307        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5308            self.0.request.name = v.into();
5309            self
5310        }
5311    }
5312
5313    #[doc(hidden)]
5314    impl gax::options::internal::RequestBuilder for GetLocation {
5315        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5316            &mut self.0.options
5317        }
5318    }
5319
5320    /// The request builder for [ConversationDatasets::list_operations][crate::client::ConversationDatasets::list_operations] calls.
5321    ///
5322    /// # Example
5323    /// ```
5324    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::ListOperations;
5325    /// # async fn sample() -> gax::Result<()> {
5326    /// use gax::paginator::ItemPaginator;
5327    ///
5328    /// let builder = prepare_request_builder();
5329    /// let mut items = builder.by_item();
5330    /// while let Some(result) = items.next().await {
5331    ///   let item = result?;
5332    /// }
5333    /// # Ok(()) }
5334    ///
5335    /// fn prepare_request_builder() -> ListOperations {
5336    ///   # panic!();
5337    ///   // ... details omitted ...
5338    /// }
5339    /// ```
5340    #[derive(Clone, Debug)]
5341    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5342
5343    impl ListOperations {
5344        pub(crate) fn new(
5345            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5346        ) -> Self {
5347            Self(RequestBuilder::new(stub))
5348        }
5349
5350        /// Sets the full request, replacing any prior values.
5351        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5352            mut self,
5353            v: V,
5354        ) -> Self {
5355            self.0.request = v.into();
5356            self
5357        }
5358
5359        /// Sets all the options, replacing any prior values.
5360        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5361            self.0.options = v.into();
5362            self
5363        }
5364
5365        /// Sends the request.
5366        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5367            (*self.0.stub)
5368                .list_operations(self.0.request, self.0.options)
5369                .await
5370                .map(gax::response::Response::into_body)
5371        }
5372
5373        /// Streams each page in the collection.
5374        pub fn by_page(
5375            self,
5376        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5377        {
5378            use std::clone::Clone;
5379            let token = self.0.request.page_token.clone();
5380            let execute = move |token: String| {
5381                let mut builder = self.clone();
5382                builder.0.request = builder.0.request.set_page_token(token);
5383                builder.send()
5384            };
5385            gax::paginator::internal::new_paginator(token, execute)
5386        }
5387
5388        /// Streams each item in the collection.
5389        pub fn by_item(
5390            self,
5391        ) -> impl gax::paginator::ItemPaginator<
5392            longrunning::model::ListOperationsResponse,
5393            gax::error::Error,
5394        > {
5395            use gax::paginator::Paginator;
5396            self.by_page().items()
5397        }
5398
5399        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
5400        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5401            self.0.request.name = v.into();
5402            self
5403        }
5404
5405        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
5406        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5407            self.0.request.filter = v.into();
5408            self
5409        }
5410
5411        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
5412        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5413            self.0.request.page_size = v.into();
5414            self
5415        }
5416
5417        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
5418        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5419            self.0.request.page_token = v.into();
5420            self
5421        }
5422
5423        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
5424        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5425            self.0.request.return_partial_success = v.into();
5426            self
5427        }
5428    }
5429
5430    #[doc(hidden)]
5431    impl gax::options::internal::RequestBuilder for ListOperations {
5432        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5433            &mut self.0.options
5434        }
5435    }
5436
5437    /// The request builder for [ConversationDatasets::get_operation][crate::client::ConversationDatasets::get_operation] calls.
5438    ///
5439    /// # Example
5440    /// ```
5441    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::GetOperation;
5442    /// # async fn sample() -> gax::Result<()> {
5443    ///
5444    /// let builder = prepare_request_builder();
5445    /// let response = builder.send().await?;
5446    /// # Ok(()) }
5447    ///
5448    /// fn prepare_request_builder() -> GetOperation {
5449    ///   # panic!();
5450    ///   // ... details omitted ...
5451    /// }
5452    /// ```
5453    #[derive(Clone, Debug)]
5454    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5455
5456    impl GetOperation {
5457        pub(crate) fn new(
5458            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5459        ) -> Self {
5460            Self(RequestBuilder::new(stub))
5461        }
5462
5463        /// Sets the full request, replacing any prior values.
5464        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5465            mut self,
5466            v: V,
5467        ) -> Self {
5468            self.0.request = v.into();
5469            self
5470        }
5471
5472        /// Sets all the options, replacing any prior values.
5473        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5474            self.0.options = v.into();
5475            self
5476        }
5477
5478        /// Sends the request.
5479        pub async fn send(self) -> Result<longrunning::model::Operation> {
5480            (*self.0.stub)
5481                .get_operation(self.0.request, self.0.options)
5482                .await
5483                .map(gax::response::Response::into_body)
5484        }
5485
5486        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
5487        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5488            self.0.request.name = v.into();
5489            self
5490        }
5491    }
5492
5493    #[doc(hidden)]
5494    impl gax::options::internal::RequestBuilder for GetOperation {
5495        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5496            &mut self.0.options
5497        }
5498    }
5499
5500    /// The request builder for [ConversationDatasets::cancel_operation][crate::client::ConversationDatasets::cancel_operation] calls.
5501    ///
5502    /// # Example
5503    /// ```
5504    /// # use google_cloud_dialogflow_v2::builder::conversation_datasets::CancelOperation;
5505    /// # async fn sample() -> gax::Result<()> {
5506    ///
5507    /// let builder = prepare_request_builder();
5508    /// let response = builder.send().await?;
5509    /// # Ok(()) }
5510    ///
5511    /// fn prepare_request_builder() -> CancelOperation {
5512    ///   # panic!();
5513    ///   // ... details omitted ...
5514    /// }
5515    /// ```
5516    #[derive(Clone, Debug)]
5517    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5518
5519    impl CancelOperation {
5520        pub(crate) fn new(
5521            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5522        ) -> Self {
5523            Self(RequestBuilder::new(stub))
5524        }
5525
5526        /// Sets the full request, replacing any prior values.
5527        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5528            mut self,
5529            v: V,
5530        ) -> Self {
5531            self.0.request = v.into();
5532            self
5533        }
5534
5535        /// Sets all the options, replacing any prior values.
5536        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5537            self.0.options = v.into();
5538            self
5539        }
5540
5541        /// Sends the request.
5542        pub async fn send(self) -> Result<()> {
5543            (*self.0.stub)
5544                .cancel_operation(self.0.request, self.0.options)
5545                .await
5546                .map(gax::response::Response::into_body)
5547        }
5548
5549        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
5550        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5551            self.0.request.name = v.into();
5552            self
5553        }
5554    }
5555
5556    #[doc(hidden)]
5557    impl gax::options::internal::RequestBuilder for CancelOperation {
5558        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5559            &mut self.0.options
5560        }
5561    }
5562}
5563
5564#[cfg(feature = "conversation-models")]
5565#[cfg_attr(docsrs, doc(cfg(feature = "conversation-models")))]
5566pub mod conversation_models {
5567    use crate::Result;
5568
5569    /// A builder for [ConversationModels][crate::client::ConversationModels].
5570    ///
5571    /// ```
5572    /// # async fn sample() -> gax::client_builder::Result<()> {
5573    /// # use google_cloud_dialogflow_v2::*;
5574    /// # use builder::conversation_models::ClientBuilder;
5575    /// # use client::ConversationModels;
5576    /// let builder : ClientBuilder = ConversationModels::builder();
5577    /// let client = builder
5578    ///     .with_endpoint("https://dialogflow.googleapis.com")
5579    ///     .build().await?;
5580    /// # Ok(()) }
5581    /// ```
5582    pub type ClientBuilder =
5583        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5584
5585    pub(crate) mod client {
5586        use super::super::super::client::ConversationModels;
5587        pub struct Factory;
5588        impl gax::client_builder::internal::ClientFactory for Factory {
5589            type Client = ConversationModels;
5590            type Credentials = gaxi::options::Credentials;
5591            async fn build(
5592                self,
5593                config: gaxi::options::ClientConfig,
5594            ) -> gax::client_builder::Result<Self::Client> {
5595                Self::Client::new(config).await
5596            }
5597        }
5598    }
5599
5600    /// Common implementation for [crate::client::ConversationModels] request builders.
5601    #[derive(Clone, Debug)]
5602    pub(crate) struct RequestBuilder<R: std::default::Default> {
5603        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5604        request: R,
5605        options: gax::options::RequestOptions,
5606    }
5607
5608    impl<R> RequestBuilder<R>
5609    where
5610        R: std::default::Default,
5611    {
5612        pub(crate) fn new(
5613            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5614        ) -> Self {
5615            Self {
5616                stub,
5617                request: R::default(),
5618                options: gax::options::RequestOptions::default(),
5619            }
5620        }
5621    }
5622
5623    /// The request builder for [ConversationModels::create_conversation_model][crate::client::ConversationModels::create_conversation_model] calls.
5624    ///
5625    /// # Example
5626    /// ```
5627    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CreateConversationModel;
5628    /// # async fn sample() -> gax::Result<()> {
5629    /// use lro::Poller;
5630    ///
5631    /// let builder = prepare_request_builder();
5632    /// let response = builder.poller().until_done().await?;
5633    /// # Ok(()) }
5634    ///
5635    /// fn prepare_request_builder() -> CreateConversationModel {
5636    ///   # panic!();
5637    ///   // ... details omitted ...
5638    /// }
5639    /// ```
5640    #[derive(Clone, Debug)]
5641    pub struct CreateConversationModel(
5642        RequestBuilder<crate::model::CreateConversationModelRequest>,
5643    );
5644
5645    impl CreateConversationModel {
5646        pub(crate) fn new(
5647            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5648        ) -> Self {
5649            Self(RequestBuilder::new(stub))
5650        }
5651
5652        /// Sets the full request, replacing any prior values.
5653        pub fn with_request<V: Into<crate::model::CreateConversationModelRequest>>(
5654            mut self,
5655            v: V,
5656        ) -> Self {
5657            self.0.request = v.into();
5658            self
5659        }
5660
5661        /// Sets all the options, replacing any prior values.
5662        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5663            self.0.options = v.into();
5664            self
5665        }
5666
5667        /// Sends the request.
5668        ///
5669        /// # Long running operations
5670        ///
5671        /// This starts, but does not poll, a longrunning operation. More information
5672        /// on [create_conversation_model][crate::client::ConversationModels::create_conversation_model].
5673        pub async fn send(self) -> Result<longrunning::model::Operation> {
5674            (*self.0.stub)
5675                .create_conversation_model(self.0.request, self.0.options)
5676                .await
5677                .map(gax::response::Response::into_body)
5678        }
5679
5680        /// Creates a [Poller][lro::Poller] to work with `create_conversation_model`.
5681        pub fn poller(
5682            self,
5683        ) -> impl lro::Poller<
5684            crate::model::ConversationModel,
5685            crate::model::CreateConversationModelOperationMetadata,
5686        > {
5687            type Operation = lro::internal::Operation<
5688                crate::model::ConversationModel,
5689                crate::model::CreateConversationModelOperationMetadata,
5690            >;
5691            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5692            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5693
5694            let stub = self.0.stub.clone();
5695            let mut options = self.0.options.clone();
5696            options.set_retry_policy(gax::retry_policy::NeverRetry);
5697            let query = move |name| {
5698                let stub = stub.clone();
5699                let options = options.clone();
5700                async {
5701                    let op = GetOperation::new(stub)
5702                        .set_name(name)
5703                        .with_options(options)
5704                        .send()
5705                        .await?;
5706                    Ok(Operation::new(op))
5707                }
5708            };
5709
5710            let start = move || async {
5711                let op = self.send().await?;
5712                Ok(Operation::new(op))
5713            };
5714
5715            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5716        }
5717
5718        /// Sets the value of [parent][crate::model::CreateConversationModelRequest::parent].
5719        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5720            self.0.request.parent = v.into();
5721            self
5722        }
5723
5724        /// Sets the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5725        ///
5726        /// This is a **required** field for requests.
5727        pub fn set_conversation_model<T>(mut self, v: T) -> Self
5728        where
5729            T: std::convert::Into<crate::model::ConversationModel>,
5730        {
5731            self.0.request.conversation_model = std::option::Option::Some(v.into());
5732            self
5733        }
5734
5735        /// Sets or clears the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5736        ///
5737        /// This is a **required** field for requests.
5738        pub fn set_or_clear_conversation_model<T>(mut self, v: std::option::Option<T>) -> Self
5739        where
5740            T: std::convert::Into<crate::model::ConversationModel>,
5741        {
5742            self.0.request.conversation_model = v.map(|x| x.into());
5743            self
5744        }
5745    }
5746
5747    #[doc(hidden)]
5748    impl gax::options::internal::RequestBuilder for CreateConversationModel {
5749        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5750            &mut self.0.options
5751        }
5752    }
5753
5754    /// The request builder for [ConversationModels::get_conversation_model][crate::client::ConversationModels::get_conversation_model] calls.
5755    ///
5756    /// # Example
5757    /// ```
5758    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetConversationModel;
5759    /// # async fn sample() -> gax::Result<()> {
5760    ///
5761    /// let builder = prepare_request_builder();
5762    /// let response = builder.send().await?;
5763    /// # Ok(()) }
5764    ///
5765    /// fn prepare_request_builder() -> GetConversationModel {
5766    ///   # panic!();
5767    ///   // ... details omitted ...
5768    /// }
5769    /// ```
5770    #[derive(Clone, Debug)]
5771    pub struct GetConversationModel(RequestBuilder<crate::model::GetConversationModelRequest>);
5772
5773    impl GetConversationModel {
5774        pub(crate) fn new(
5775            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5776        ) -> Self {
5777            Self(RequestBuilder::new(stub))
5778        }
5779
5780        /// Sets the full request, replacing any prior values.
5781        pub fn with_request<V: Into<crate::model::GetConversationModelRequest>>(
5782            mut self,
5783            v: V,
5784        ) -> Self {
5785            self.0.request = v.into();
5786            self
5787        }
5788
5789        /// Sets all the options, replacing any prior values.
5790        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5791            self.0.options = v.into();
5792            self
5793        }
5794
5795        /// Sends the request.
5796        pub async fn send(self) -> Result<crate::model::ConversationModel> {
5797            (*self.0.stub)
5798                .get_conversation_model(self.0.request, self.0.options)
5799                .await
5800                .map(gax::response::Response::into_body)
5801        }
5802
5803        /// Sets the value of [name][crate::model::GetConversationModelRequest::name].
5804        ///
5805        /// This is a **required** field for requests.
5806        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5807            self.0.request.name = v.into();
5808            self
5809        }
5810    }
5811
5812    #[doc(hidden)]
5813    impl gax::options::internal::RequestBuilder for GetConversationModel {
5814        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5815            &mut self.0.options
5816        }
5817    }
5818
5819    /// The request builder for [ConversationModels::list_conversation_models][crate::client::ConversationModels::list_conversation_models] calls.
5820    ///
5821    /// # Example
5822    /// ```
5823    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListConversationModels;
5824    /// # async fn sample() -> gax::Result<()> {
5825    /// use gax::paginator::ItemPaginator;
5826    ///
5827    /// let builder = prepare_request_builder();
5828    /// let mut items = builder.by_item();
5829    /// while let Some(result) = items.next().await {
5830    ///   let item = result?;
5831    /// }
5832    /// # Ok(()) }
5833    ///
5834    /// fn prepare_request_builder() -> ListConversationModels {
5835    ///   # panic!();
5836    ///   // ... details omitted ...
5837    /// }
5838    /// ```
5839    #[derive(Clone, Debug)]
5840    pub struct ListConversationModels(RequestBuilder<crate::model::ListConversationModelsRequest>);
5841
5842    impl ListConversationModels {
5843        pub(crate) fn new(
5844            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5845        ) -> Self {
5846            Self(RequestBuilder::new(stub))
5847        }
5848
5849        /// Sets the full request, replacing any prior values.
5850        pub fn with_request<V: Into<crate::model::ListConversationModelsRequest>>(
5851            mut self,
5852            v: V,
5853        ) -> Self {
5854            self.0.request = v.into();
5855            self
5856        }
5857
5858        /// Sets all the options, replacing any prior values.
5859        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5860            self.0.options = v.into();
5861            self
5862        }
5863
5864        /// Sends the request.
5865        pub async fn send(self) -> Result<crate::model::ListConversationModelsResponse> {
5866            (*self.0.stub)
5867                .list_conversation_models(self.0.request, self.0.options)
5868                .await
5869                .map(gax::response::Response::into_body)
5870        }
5871
5872        /// Streams each page in the collection.
5873        pub fn by_page(
5874            self,
5875        ) -> impl gax::paginator::Paginator<
5876            crate::model::ListConversationModelsResponse,
5877            gax::error::Error,
5878        > {
5879            use std::clone::Clone;
5880            let token = self.0.request.page_token.clone();
5881            let execute = move |token: String| {
5882                let mut builder = self.clone();
5883                builder.0.request = builder.0.request.set_page_token(token);
5884                builder.send()
5885            };
5886            gax::paginator::internal::new_paginator(token, execute)
5887        }
5888
5889        /// Streams each item in the collection.
5890        pub fn by_item(
5891            self,
5892        ) -> impl gax::paginator::ItemPaginator<
5893            crate::model::ListConversationModelsResponse,
5894            gax::error::Error,
5895        > {
5896            use gax::paginator::Paginator;
5897            self.by_page().items()
5898        }
5899
5900        /// Sets the value of [parent][crate::model::ListConversationModelsRequest::parent].
5901        ///
5902        /// This is a **required** field for requests.
5903        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5904            self.0.request.parent = v.into();
5905            self
5906        }
5907
5908        /// Sets the value of [page_size][crate::model::ListConversationModelsRequest::page_size].
5909        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5910            self.0.request.page_size = v.into();
5911            self
5912        }
5913
5914        /// Sets the value of [page_token][crate::model::ListConversationModelsRequest::page_token].
5915        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5916            self.0.request.page_token = v.into();
5917            self
5918        }
5919    }
5920
5921    #[doc(hidden)]
5922    impl gax::options::internal::RequestBuilder for ListConversationModels {
5923        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5924            &mut self.0.options
5925        }
5926    }
5927
5928    /// The request builder for [ConversationModels::delete_conversation_model][crate::client::ConversationModels::delete_conversation_model] calls.
5929    ///
5930    /// # Example
5931    /// ```
5932    /// # use google_cloud_dialogflow_v2::builder::conversation_models::DeleteConversationModel;
5933    /// # async fn sample() -> gax::Result<()> {
5934    /// use lro::Poller;
5935    ///
5936    /// let builder = prepare_request_builder();
5937    /// let response = builder.poller().until_done().await?;
5938    /// # Ok(()) }
5939    ///
5940    /// fn prepare_request_builder() -> DeleteConversationModel {
5941    ///   # panic!();
5942    ///   // ... details omitted ...
5943    /// }
5944    /// ```
5945    #[derive(Clone, Debug)]
5946    pub struct DeleteConversationModel(
5947        RequestBuilder<crate::model::DeleteConversationModelRequest>,
5948    );
5949
5950    impl DeleteConversationModel {
5951        pub(crate) fn new(
5952            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5953        ) -> Self {
5954            Self(RequestBuilder::new(stub))
5955        }
5956
5957        /// Sets the full request, replacing any prior values.
5958        pub fn with_request<V: Into<crate::model::DeleteConversationModelRequest>>(
5959            mut self,
5960            v: V,
5961        ) -> Self {
5962            self.0.request = v.into();
5963            self
5964        }
5965
5966        /// Sets all the options, replacing any prior values.
5967        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5968            self.0.options = v.into();
5969            self
5970        }
5971
5972        /// Sends the request.
5973        ///
5974        /// # Long running operations
5975        ///
5976        /// This starts, but does not poll, a longrunning operation. More information
5977        /// on [delete_conversation_model][crate::client::ConversationModels::delete_conversation_model].
5978        pub async fn send(self) -> Result<longrunning::model::Operation> {
5979            (*self.0.stub)
5980                .delete_conversation_model(self.0.request, self.0.options)
5981                .await
5982                .map(gax::response::Response::into_body)
5983        }
5984
5985        /// Creates a [Poller][lro::Poller] to work with `delete_conversation_model`.
5986        pub fn poller(
5987            self,
5988        ) -> impl lro::Poller<(), crate::model::DeleteConversationModelOperationMetadata> {
5989            type Operation = lro::internal::Operation<
5990                wkt::Empty,
5991                crate::model::DeleteConversationModelOperationMetadata,
5992            >;
5993            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5994            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5995
5996            let stub = self.0.stub.clone();
5997            let mut options = self.0.options.clone();
5998            options.set_retry_policy(gax::retry_policy::NeverRetry);
5999            let query = move |name| {
6000                let stub = stub.clone();
6001                let options = options.clone();
6002                async {
6003                    let op = GetOperation::new(stub)
6004                        .set_name(name)
6005                        .with_options(options)
6006                        .send()
6007                        .await?;
6008                    Ok(Operation::new(op))
6009                }
6010            };
6011
6012            let start = move || async {
6013                let op = self.send().await?;
6014                Ok(Operation::new(op))
6015            };
6016
6017            lro::internal::new_unit_response_poller(
6018                polling_error_policy,
6019                polling_backoff_policy,
6020                start,
6021                query,
6022            )
6023        }
6024
6025        /// Sets the value of [name][crate::model::DeleteConversationModelRequest::name].
6026        ///
6027        /// This is a **required** field for requests.
6028        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6029            self.0.request.name = v.into();
6030            self
6031        }
6032    }
6033
6034    #[doc(hidden)]
6035    impl gax::options::internal::RequestBuilder for DeleteConversationModel {
6036        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6037            &mut self.0.options
6038        }
6039    }
6040
6041    /// The request builder for [ConversationModels::deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model] calls.
6042    ///
6043    /// # Example
6044    /// ```
6045    /// # use google_cloud_dialogflow_v2::builder::conversation_models::DeployConversationModel;
6046    /// # async fn sample() -> gax::Result<()> {
6047    /// use lro::Poller;
6048    ///
6049    /// let builder = prepare_request_builder();
6050    /// let response = builder.poller().until_done().await?;
6051    /// # Ok(()) }
6052    ///
6053    /// fn prepare_request_builder() -> DeployConversationModel {
6054    ///   # panic!();
6055    ///   // ... details omitted ...
6056    /// }
6057    /// ```
6058    #[derive(Clone, Debug)]
6059    pub struct DeployConversationModel(
6060        RequestBuilder<crate::model::DeployConversationModelRequest>,
6061    );
6062
6063    impl DeployConversationModel {
6064        pub(crate) fn new(
6065            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6066        ) -> Self {
6067            Self(RequestBuilder::new(stub))
6068        }
6069
6070        /// Sets the full request, replacing any prior values.
6071        pub fn with_request<V: Into<crate::model::DeployConversationModelRequest>>(
6072            mut self,
6073            v: V,
6074        ) -> Self {
6075            self.0.request = v.into();
6076            self
6077        }
6078
6079        /// Sets all the options, replacing any prior values.
6080        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6081            self.0.options = v.into();
6082            self
6083        }
6084
6085        /// Sends the request.
6086        ///
6087        /// # Long running operations
6088        ///
6089        /// This starts, but does not poll, a longrunning operation. More information
6090        /// on [deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model].
6091        pub async fn send(self) -> Result<longrunning::model::Operation> {
6092            (*self.0.stub)
6093                .deploy_conversation_model(self.0.request, self.0.options)
6094                .await
6095                .map(gax::response::Response::into_body)
6096        }
6097
6098        /// Creates a [Poller][lro::Poller] to work with `deploy_conversation_model`.
6099        pub fn poller(
6100            self,
6101        ) -> impl lro::Poller<(), crate::model::DeployConversationModelOperationMetadata> {
6102            type Operation = lro::internal::Operation<
6103                wkt::Empty,
6104                crate::model::DeployConversationModelOperationMetadata,
6105            >;
6106            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6107            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6108
6109            let stub = self.0.stub.clone();
6110            let mut options = self.0.options.clone();
6111            options.set_retry_policy(gax::retry_policy::NeverRetry);
6112            let query = move |name| {
6113                let stub = stub.clone();
6114                let options = options.clone();
6115                async {
6116                    let op = GetOperation::new(stub)
6117                        .set_name(name)
6118                        .with_options(options)
6119                        .send()
6120                        .await?;
6121                    Ok(Operation::new(op))
6122                }
6123            };
6124
6125            let start = move || async {
6126                let op = self.send().await?;
6127                Ok(Operation::new(op))
6128            };
6129
6130            lro::internal::new_unit_response_poller(
6131                polling_error_policy,
6132                polling_backoff_policy,
6133                start,
6134                query,
6135            )
6136        }
6137
6138        /// Sets the value of [name][crate::model::DeployConversationModelRequest::name].
6139        ///
6140        /// This is a **required** field for requests.
6141        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6142            self.0.request.name = v.into();
6143            self
6144        }
6145    }
6146
6147    #[doc(hidden)]
6148    impl gax::options::internal::RequestBuilder for DeployConversationModel {
6149        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6150            &mut self.0.options
6151        }
6152    }
6153
6154    /// The request builder for [ConversationModels::undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model] calls.
6155    ///
6156    /// # Example
6157    /// ```
6158    /// # use google_cloud_dialogflow_v2::builder::conversation_models::UndeployConversationModel;
6159    /// # async fn sample() -> gax::Result<()> {
6160    /// use lro::Poller;
6161    ///
6162    /// let builder = prepare_request_builder();
6163    /// let response = builder.poller().until_done().await?;
6164    /// # Ok(()) }
6165    ///
6166    /// fn prepare_request_builder() -> UndeployConversationModel {
6167    ///   # panic!();
6168    ///   // ... details omitted ...
6169    /// }
6170    /// ```
6171    #[derive(Clone, Debug)]
6172    pub struct UndeployConversationModel(
6173        RequestBuilder<crate::model::UndeployConversationModelRequest>,
6174    );
6175
6176    impl UndeployConversationModel {
6177        pub(crate) fn new(
6178            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6179        ) -> Self {
6180            Self(RequestBuilder::new(stub))
6181        }
6182
6183        /// Sets the full request, replacing any prior values.
6184        pub fn with_request<V: Into<crate::model::UndeployConversationModelRequest>>(
6185            mut self,
6186            v: V,
6187        ) -> Self {
6188            self.0.request = v.into();
6189            self
6190        }
6191
6192        /// Sets all the options, replacing any prior values.
6193        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6194            self.0.options = v.into();
6195            self
6196        }
6197
6198        /// Sends the request.
6199        ///
6200        /// # Long running operations
6201        ///
6202        /// This starts, but does not poll, a longrunning operation. More information
6203        /// on [undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model].
6204        pub async fn send(self) -> Result<longrunning::model::Operation> {
6205            (*self.0.stub)
6206                .undeploy_conversation_model(self.0.request, self.0.options)
6207                .await
6208                .map(gax::response::Response::into_body)
6209        }
6210
6211        /// Creates a [Poller][lro::Poller] to work with `undeploy_conversation_model`.
6212        pub fn poller(
6213            self,
6214        ) -> impl lro::Poller<(), crate::model::UndeployConversationModelOperationMetadata>
6215        {
6216            type Operation = lro::internal::Operation<
6217                wkt::Empty,
6218                crate::model::UndeployConversationModelOperationMetadata,
6219            >;
6220            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6221            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6222
6223            let stub = self.0.stub.clone();
6224            let mut options = self.0.options.clone();
6225            options.set_retry_policy(gax::retry_policy::NeverRetry);
6226            let query = move |name| {
6227                let stub = stub.clone();
6228                let options = options.clone();
6229                async {
6230                    let op = GetOperation::new(stub)
6231                        .set_name(name)
6232                        .with_options(options)
6233                        .send()
6234                        .await?;
6235                    Ok(Operation::new(op))
6236                }
6237            };
6238
6239            let start = move || async {
6240                let op = self.send().await?;
6241                Ok(Operation::new(op))
6242            };
6243
6244            lro::internal::new_unit_response_poller(
6245                polling_error_policy,
6246                polling_backoff_policy,
6247                start,
6248                query,
6249            )
6250        }
6251
6252        /// Sets the value of [name][crate::model::UndeployConversationModelRequest::name].
6253        ///
6254        /// This is a **required** field for requests.
6255        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6256            self.0.request.name = v.into();
6257            self
6258        }
6259    }
6260
6261    #[doc(hidden)]
6262    impl gax::options::internal::RequestBuilder for UndeployConversationModel {
6263        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6264            &mut self.0.options
6265        }
6266    }
6267
6268    /// The request builder for [ConversationModels::get_conversation_model_evaluation][crate::client::ConversationModels::get_conversation_model_evaluation] calls.
6269    ///
6270    /// # Example
6271    /// ```
6272    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetConversationModelEvaluation;
6273    /// # async fn sample() -> gax::Result<()> {
6274    ///
6275    /// let builder = prepare_request_builder();
6276    /// let response = builder.send().await?;
6277    /// # Ok(()) }
6278    ///
6279    /// fn prepare_request_builder() -> GetConversationModelEvaluation {
6280    ///   # panic!();
6281    ///   // ... details omitted ...
6282    /// }
6283    /// ```
6284    #[derive(Clone, Debug)]
6285    pub struct GetConversationModelEvaluation(
6286        RequestBuilder<crate::model::GetConversationModelEvaluationRequest>,
6287    );
6288
6289    impl GetConversationModelEvaluation {
6290        pub(crate) fn new(
6291            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6292        ) -> Self {
6293            Self(RequestBuilder::new(stub))
6294        }
6295
6296        /// Sets the full request, replacing any prior values.
6297        pub fn with_request<V: Into<crate::model::GetConversationModelEvaluationRequest>>(
6298            mut self,
6299            v: V,
6300        ) -> Self {
6301            self.0.request = v.into();
6302            self
6303        }
6304
6305        /// Sets all the options, replacing any prior values.
6306        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6307            self.0.options = v.into();
6308            self
6309        }
6310
6311        /// Sends the request.
6312        pub async fn send(self) -> Result<crate::model::ConversationModelEvaluation> {
6313            (*self.0.stub)
6314                .get_conversation_model_evaluation(self.0.request, self.0.options)
6315                .await
6316                .map(gax::response::Response::into_body)
6317        }
6318
6319        /// Sets the value of [name][crate::model::GetConversationModelEvaluationRequest::name].
6320        ///
6321        /// This is a **required** field for requests.
6322        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6323            self.0.request.name = v.into();
6324            self
6325        }
6326    }
6327
6328    #[doc(hidden)]
6329    impl gax::options::internal::RequestBuilder for GetConversationModelEvaluation {
6330        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6331            &mut self.0.options
6332        }
6333    }
6334
6335    /// The request builder for [ConversationModels::list_conversation_model_evaluations][crate::client::ConversationModels::list_conversation_model_evaluations] calls.
6336    ///
6337    /// # Example
6338    /// ```
6339    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListConversationModelEvaluations;
6340    /// # async fn sample() -> gax::Result<()> {
6341    /// use gax::paginator::ItemPaginator;
6342    ///
6343    /// let builder = prepare_request_builder();
6344    /// let mut items = builder.by_item();
6345    /// while let Some(result) = items.next().await {
6346    ///   let item = result?;
6347    /// }
6348    /// # Ok(()) }
6349    ///
6350    /// fn prepare_request_builder() -> ListConversationModelEvaluations {
6351    ///   # panic!();
6352    ///   // ... details omitted ...
6353    /// }
6354    /// ```
6355    #[derive(Clone, Debug)]
6356    pub struct ListConversationModelEvaluations(
6357        RequestBuilder<crate::model::ListConversationModelEvaluationsRequest>,
6358    );
6359
6360    impl ListConversationModelEvaluations {
6361        pub(crate) fn new(
6362            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6363        ) -> Self {
6364            Self(RequestBuilder::new(stub))
6365        }
6366
6367        /// Sets the full request, replacing any prior values.
6368        pub fn with_request<V: Into<crate::model::ListConversationModelEvaluationsRequest>>(
6369            mut self,
6370            v: V,
6371        ) -> Self {
6372            self.0.request = v.into();
6373            self
6374        }
6375
6376        /// Sets all the options, replacing any prior values.
6377        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6378            self.0.options = v.into();
6379            self
6380        }
6381
6382        /// Sends the request.
6383        pub async fn send(self) -> Result<crate::model::ListConversationModelEvaluationsResponse> {
6384            (*self.0.stub)
6385                .list_conversation_model_evaluations(self.0.request, self.0.options)
6386                .await
6387                .map(gax::response::Response::into_body)
6388        }
6389
6390        /// Streams each page in the collection.
6391        pub fn by_page(
6392            self,
6393        ) -> impl gax::paginator::Paginator<
6394            crate::model::ListConversationModelEvaluationsResponse,
6395            gax::error::Error,
6396        > {
6397            use std::clone::Clone;
6398            let token = self.0.request.page_token.clone();
6399            let execute = move |token: String| {
6400                let mut builder = self.clone();
6401                builder.0.request = builder.0.request.set_page_token(token);
6402                builder.send()
6403            };
6404            gax::paginator::internal::new_paginator(token, execute)
6405        }
6406
6407        /// Streams each item in the collection.
6408        pub fn by_item(
6409            self,
6410        ) -> impl gax::paginator::ItemPaginator<
6411            crate::model::ListConversationModelEvaluationsResponse,
6412            gax::error::Error,
6413        > {
6414            use gax::paginator::Paginator;
6415            self.by_page().items()
6416        }
6417
6418        /// Sets the value of [parent][crate::model::ListConversationModelEvaluationsRequest::parent].
6419        ///
6420        /// This is a **required** field for requests.
6421        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6422            self.0.request.parent = v.into();
6423            self
6424        }
6425
6426        /// Sets the value of [page_size][crate::model::ListConversationModelEvaluationsRequest::page_size].
6427        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6428            self.0.request.page_size = v.into();
6429            self
6430        }
6431
6432        /// Sets the value of [page_token][crate::model::ListConversationModelEvaluationsRequest::page_token].
6433        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6434            self.0.request.page_token = v.into();
6435            self
6436        }
6437    }
6438
6439    #[doc(hidden)]
6440    impl gax::options::internal::RequestBuilder for ListConversationModelEvaluations {
6441        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6442            &mut self.0.options
6443        }
6444    }
6445
6446    /// The request builder for [ConversationModels::create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation] calls.
6447    ///
6448    /// # Example
6449    /// ```
6450    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CreateConversationModelEvaluation;
6451    /// # async fn sample() -> gax::Result<()> {
6452    /// use lro::Poller;
6453    ///
6454    /// let builder = prepare_request_builder();
6455    /// let response = builder.poller().until_done().await?;
6456    /// # Ok(()) }
6457    ///
6458    /// fn prepare_request_builder() -> CreateConversationModelEvaluation {
6459    ///   # panic!();
6460    ///   // ... details omitted ...
6461    /// }
6462    /// ```
6463    #[derive(Clone, Debug)]
6464    pub struct CreateConversationModelEvaluation(
6465        RequestBuilder<crate::model::CreateConversationModelEvaluationRequest>,
6466    );
6467
6468    impl CreateConversationModelEvaluation {
6469        pub(crate) fn new(
6470            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6471        ) -> Self {
6472            Self(RequestBuilder::new(stub))
6473        }
6474
6475        /// Sets the full request, replacing any prior values.
6476        pub fn with_request<V: Into<crate::model::CreateConversationModelEvaluationRequest>>(
6477            mut self,
6478            v: V,
6479        ) -> Self {
6480            self.0.request = v.into();
6481            self
6482        }
6483
6484        /// Sets all the options, replacing any prior values.
6485        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6486            self.0.options = v.into();
6487            self
6488        }
6489
6490        /// Sends the request.
6491        ///
6492        /// # Long running operations
6493        ///
6494        /// This starts, but does not poll, a longrunning operation. More information
6495        /// on [create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation].
6496        pub async fn send(self) -> Result<longrunning::model::Operation> {
6497            (*self.0.stub)
6498                .create_conversation_model_evaluation(self.0.request, self.0.options)
6499                .await
6500                .map(gax::response::Response::into_body)
6501        }
6502
6503        /// Creates a [Poller][lro::Poller] to work with `create_conversation_model_evaluation`.
6504        pub fn poller(
6505            self,
6506        ) -> impl lro::Poller<
6507            crate::model::ConversationModelEvaluation,
6508            crate::model::CreateConversationModelEvaluationOperationMetadata,
6509        > {
6510            type Operation = lro::internal::Operation<
6511                crate::model::ConversationModelEvaluation,
6512                crate::model::CreateConversationModelEvaluationOperationMetadata,
6513            >;
6514            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6515            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6516
6517            let stub = self.0.stub.clone();
6518            let mut options = self.0.options.clone();
6519            options.set_retry_policy(gax::retry_policy::NeverRetry);
6520            let query = move |name| {
6521                let stub = stub.clone();
6522                let options = options.clone();
6523                async {
6524                    let op = GetOperation::new(stub)
6525                        .set_name(name)
6526                        .with_options(options)
6527                        .send()
6528                        .await?;
6529                    Ok(Operation::new(op))
6530                }
6531            };
6532
6533            let start = move || async {
6534                let op = self.send().await?;
6535                Ok(Operation::new(op))
6536            };
6537
6538            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6539        }
6540
6541        /// Sets the value of [parent][crate::model::CreateConversationModelEvaluationRequest::parent].
6542        ///
6543        /// This is a **required** field for requests.
6544        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6545            self.0.request.parent = v.into();
6546            self
6547        }
6548
6549        /// Sets the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6550        ///
6551        /// This is a **required** field for requests.
6552        pub fn set_conversation_model_evaluation<T>(mut self, v: T) -> Self
6553        where
6554            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6555        {
6556            self.0.request.conversation_model_evaluation = std::option::Option::Some(v.into());
6557            self
6558        }
6559
6560        /// Sets or clears the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6561        ///
6562        /// This is a **required** field for requests.
6563        pub fn set_or_clear_conversation_model_evaluation<T>(
6564            mut self,
6565            v: std::option::Option<T>,
6566        ) -> Self
6567        where
6568            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6569        {
6570            self.0.request.conversation_model_evaluation = v.map(|x| x.into());
6571            self
6572        }
6573    }
6574
6575    #[doc(hidden)]
6576    impl gax::options::internal::RequestBuilder for CreateConversationModelEvaluation {
6577        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6578            &mut self.0.options
6579        }
6580    }
6581
6582    /// The request builder for [ConversationModels::list_locations][crate::client::ConversationModels::list_locations] calls.
6583    ///
6584    /// # Example
6585    /// ```
6586    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListLocations;
6587    /// # async fn sample() -> gax::Result<()> {
6588    /// use gax::paginator::ItemPaginator;
6589    ///
6590    /// let builder = prepare_request_builder();
6591    /// let mut items = builder.by_item();
6592    /// while let Some(result) = items.next().await {
6593    ///   let item = result?;
6594    /// }
6595    /// # Ok(()) }
6596    ///
6597    /// fn prepare_request_builder() -> ListLocations {
6598    ///   # panic!();
6599    ///   // ... details omitted ...
6600    /// }
6601    /// ```
6602    #[derive(Clone, Debug)]
6603    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
6604
6605    impl ListLocations {
6606        pub(crate) fn new(
6607            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6608        ) -> Self {
6609            Self(RequestBuilder::new(stub))
6610        }
6611
6612        /// Sets the full request, replacing any prior values.
6613        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
6614            mut self,
6615            v: V,
6616        ) -> Self {
6617            self.0.request = v.into();
6618            self
6619        }
6620
6621        /// Sets all the options, replacing any prior values.
6622        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6623            self.0.options = v.into();
6624            self
6625        }
6626
6627        /// Sends the request.
6628        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
6629            (*self.0.stub)
6630                .list_locations(self.0.request, self.0.options)
6631                .await
6632                .map(gax::response::Response::into_body)
6633        }
6634
6635        /// Streams each page in the collection.
6636        pub fn by_page(
6637            self,
6638        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
6639        {
6640            use std::clone::Clone;
6641            let token = self.0.request.page_token.clone();
6642            let execute = move |token: String| {
6643                let mut builder = self.clone();
6644                builder.0.request = builder.0.request.set_page_token(token);
6645                builder.send()
6646            };
6647            gax::paginator::internal::new_paginator(token, execute)
6648        }
6649
6650        /// Streams each item in the collection.
6651        pub fn by_item(
6652            self,
6653        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
6654        {
6655            use gax::paginator::Paginator;
6656            self.by_page().items()
6657        }
6658
6659        /// Sets the value of [name][location::model::ListLocationsRequest::name].
6660        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6661            self.0.request.name = v.into();
6662            self
6663        }
6664
6665        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
6666        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6667            self.0.request.filter = v.into();
6668            self
6669        }
6670
6671        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
6672        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6673            self.0.request.page_size = v.into();
6674            self
6675        }
6676
6677        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
6678        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6679            self.0.request.page_token = v.into();
6680            self
6681        }
6682    }
6683
6684    #[doc(hidden)]
6685    impl gax::options::internal::RequestBuilder for ListLocations {
6686        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6687            &mut self.0.options
6688        }
6689    }
6690
6691    /// The request builder for [ConversationModels::get_location][crate::client::ConversationModels::get_location] calls.
6692    ///
6693    /// # Example
6694    /// ```
6695    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetLocation;
6696    /// # async fn sample() -> gax::Result<()> {
6697    ///
6698    /// let builder = prepare_request_builder();
6699    /// let response = builder.send().await?;
6700    /// # Ok(()) }
6701    ///
6702    /// fn prepare_request_builder() -> GetLocation {
6703    ///   # panic!();
6704    ///   // ... details omitted ...
6705    /// }
6706    /// ```
6707    #[derive(Clone, Debug)]
6708    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
6709
6710    impl GetLocation {
6711        pub(crate) fn new(
6712            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6713        ) -> Self {
6714            Self(RequestBuilder::new(stub))
6715        }
6716
6717        /// Sets the full request, replacing any prior values.
6718        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6719            self.0.request = v.into();
6720            self
6721        }
6722
6723        /// Sets all the options, replacing any prior values.
6724        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6725            self.0.options = v.into();
6726            self
6727        }
6728
6729        /// Sends the request.
6730        pub async fn send(self) -> Result<location::model::Location> {
6731            (*self.0.stub)
6732                .get_location(self.0.request, self.0.options)
6733                .await
6734                .map(gax::response::Response::into_body)
6735        }
6736
6737        /// Sets the value of [name][location::model::GetLocationRequest::name].
6738        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6739            self.0.request.name = v.into();
6740            self
6741        }
6742    }
6743
6744    #[doc(hidden)]
6745    impl gax::options::internal::RequestBuilder for GetLocation {
6746        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6747            &mut self.0.options
6748        }
6749    }
6750
6751    /// The request builder for [ConversationModels::list_operations][crate::client::ConversationModels::list_operations] calls.
6752    ///
6753    /// # Example
6754    /// ```
6755    /// # use google_cloud_dialogflow_v2::builder::conversation_models::ListOperations;
6756    /// # async fn sample() -> gax::Result<()> {
6757    /// use gax::paginator::ItemPaginator;
6758    ///
6759    /// let builder = prepare_request_builder();
6760    /// let mut items = builder.by_item();
6761    /// while let Some(result) = items.next().await {
6762    ///   let item = result?;
6763    /// }
6764    /// # Ok(()) }
6765    ///
6766    /// fn prepare_request_builder() -> ListOperations {
6767    ///   # panic!();
6768    ///   // ... details omitted ...
6769    /// }
6770    /// ```
6771    #[derive(Clone, Debug)]
6772    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6773
6774    impl ListOperations {
6775        pub(crate) fn new(
6776            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6777        ) -> Self {
6778            Self(RequestBuilder::new(stub))
6779        }
6780
6781        /// Sets the full request, replacing any prior values.
6782        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6783            mut self,
6784            v: V,
6785        ) -> Self {
6786            self.0.request = v.into();
6787            self
6788        }
6789
6790        /// Sets all the options, replacing any prior values.
6791        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6792            self.0.options = v.into();
6793            self
6794        }
6795
6796        /// Sends the request.
6797        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6798            (*self.0.stub)
6799                .list_operations(self.0.request, self.0.options)
6800                .await
6801                .map(gax::response::Response::into_body)
6802        }
6803
6804        /// Streams each page in the collection.
6805        pub fn by_page(
6806            self,
6807        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6808        {
6809            use std::clone::Clone;
6810            let token = self.0.request.page_token.clone();
6811            let execute = move |token: String| {
6812                let mut builder = self.clone();
6813                builder.0.request = builder.0.request.set_page_token(token);
6814                builder.send()
6815            };
6816            gax::paginator::internal::new_paginator(token, execute)
6817        }
6818
6819        /// Streams each item in the collection.
6820        pub fn by_item(
6821            self,
6822        ) -> impl gax::paginator::ItemPaginator<
6823            longrunning::model::ListOperationsResponse,
6824            gax::error::Error,
6825        > {
6826            use gax::paginator::Paginator;
6827            self.by_page().items()
6828        }
6829
6830        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
6831        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6832            self.0.request.name = v.into();
6833            self
6834        }
6835
6836        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
6837        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6838            self.0.request.filter = v.into();
6839            self
6840        }
6841
6842        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
6843        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6844            self.0.request.page_size = v.into();
6845            self
6846        }
6847
6848        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
6849        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6850            self.0.request.page_token = v.into();
6851            self
6852        }
6853
6854        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
6855        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6856            self.0.request.return_partial_success = v.into();
6857            self
6858        }
6859    }
6860
6861    #[doc(hidden)]
6862    impl gax::options::internal::RequestBuilder for ListOperations {
6863        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6864            &mut self.0.options
6865        }
6866    }
6867
6868    /// The request builder for [ConversationModels::get_operation][crate::client::ConversationModels::get_operation] calls.
6869    ///
6870    /// # Example
6871    /// ```
6872    /// # use google_cloud_dialogflow_v2::builder::conversation_models::GetOperation;
6873    /// # async fn sample() -> gax::Result<()> {
6874    ///
6875    /// let builder = prepare_request_builder();
6876    /// let response = builder.send().await?;
6877    /// # Ok(()) }
6878    ///
6879    /// fn prepare_request_builder() -> GetOperation {
6880    ///   # panic!();
6881    ///   // ... details omitted ...
6882    /// }
6883    /// ```
6884    #[derive(Clone, Debug)]
6885    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6886
6887    impl GetOperation {
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<longrunning::model::GetOperationRequest>>(
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<gax::options::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<longrunning::model::Operation> {
6911            (*self.0.stub)
6912                .get_operation(self.0.request, self.0.options)
6913                .await
6914                .map(gax::response::Response::into_body)
6915        }
6916
6917        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
6918        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6919            self.0.request.name = v.into();
6920            self
6921        }
6922    }
6923
6924    #[doc(hidden)]
6925    impl gax::options::internal::RequestBuilder for GetOperation {
6926        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6927            &mut self.0.options
6928        }
6929    }
6930
6931    /// The request builder for [ConversationModels::cancel_operation][crate::client::ConversationModels::cancel_operation] calls.
6932    ///
6933    /// # Example
6934    /// ```
6935    /// # use google_cloud_dialogflow_v2::builder::conversation_models::CancelOperation;
6936    /// # async fn sample() -> gax::Result<()> {
6937    ///
6938    /// let builder = prepare_request_builder();
6939    /// let response = builder.send().await?;
6940    /// # Ok(()) }
6941    ///
6942    /// fn prepare_request_builder() -> CancelOperation {
6943    ///   # panic!();
6944    ///   // ... details omitted ...
6945    /// }
6946    /// ```
6947    #[derive(Clone, Debug)]
6948    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6949
6950    impl CancelOperation {
6951        pub(crate) fn new(
6952            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6953        ) -> Self {
6954            Self(RequestBuilder::new(stub))
6955        }
6956
6957        /// Sets the full request, replacing any prior values.
6958        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6959            mut self,
6960            v: V,
6961        ) -> Self {
6962            self.0.request = v.into();
6963            self
6964        }
6965
6966        /// Sets all the options, replacing any prior values.
6967        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6968            self.0.options = v.into();
6969            self
6970        }
6971
6972        /// Sends the request.
6973        pub async fn send(self) -> Result<()> {
6974            (*self.0.stub)
6975                .cancel_operation(self.0.request, self.0.options)
6976                .await
6977                .map(gax::response::Response::into_body)
6978        }
6979
6980        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
6981        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6982            self.0.request.name = v.into();
6983            self
6984        }
6985    }
6986
6987    #[doc(hidden)]
6988    impl gax::options::internal::RequestBuilder for CancelOperation {
6989        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6990            &mut self.0.options
6991        }
6992    }
6993}
6994
6995#[cfg(feature = "conversation-profiles")]
6996#[cfg_attr(docsrs, doc(cfg(feature = "conversation-profiles")))]
6997pub mod conversation_profiles {
6998    use crate::Result;
6999
7000    /// A builder for [ConversationProfiles][crate::client::ConversationProfiles].
7001    ///
7002    /// ```
7003    /// # async fn sample() -> gax::client_builder::Result<()> {
7004    /// # use google_cloud_dialogflow_v2::*;
7005    /// # use builder::conversation_profiles::ClientBuilder;
7006    /// # use client::ConversationProfiles;
7007    /// let builder : ClientBuilder = ConversationProfiles::builder();
7008    /// let client = builder
7009    ///     .with_endpoint("https://dialogflow.googleapis.com")
7010    ///     .build().await?;
7011    /// # Ok(()) }
7012    /// ```
7013    pub type ClientBuilder =
7014        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7015
7016    pub(crate) mod client {
7017        use super::super::super::client::ConversationProfiles;
7018        pub struct Factory;
7019        impl gax::client_builder::internal::ClientFactory for Factory {
7020            type Client = ConversationProfiles;
7021            type Credentials = gaxi::options::Credentials;
7022            async fn build(
7023                self,
7024                config: gaxi::options::ClientConfig,
7025            ) -> gax::client_builder::Result<Self::Client> {
7026                Self::Client::new(config).await
7027            }
7028        }
7029    }
7030
7031    /// Common implementation for [crate::client::ConversationProfiles] request builders.
7032    #[derive(Clone, Debug)]
7033    pub(crate) struct RequestBuilder<R: std::default::Default> {
7034        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7035        request: R,
7036        options: gax::options::RequestOptions,
7037    }
7038
7039    impl<R> RequestBuilder<R>
7040    where
7041        R: std::default::Default,
7042    {
7043        pub(crate) fn new(
7044            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7045        ) -> Self {
7046            Self {
7047                stub,
7048                request: R::default(),
7049                options: gax::options::RequestOptions::default(),
7050            }
7051        }
7052    }
7053
7054    /// The request builder for [ConversationProfiles::list_conversation_profiles][crate::client::ConversationProfiles::list_conversation_profiles] calls.
7055    ///
7056    /// # Example
7057    /// ```
7058    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListConversationProfiles;
7059    /// # async fn sample() -> gax::Result<()> {
7060    /// use gax::paginator::ItemPaginator;
7061    ///
7062    /// let builder = prepare_request_builder();
7063    /// let mut items = builder.by_item();
7064    /// while let Some(result) = items.next().await {
7065    ///   let item = result?;
7066    /// }
7067    /// # Ok(()) }
7068    ///
7069    /// fn prepare_request_builder() -> ListConversationProfiles {
7070    ///   # panic!();
7071    ///   // ... details omitted ...
7072    /// }
7073    /// ```
7074    #[derive(Clone, Debug)]
7075    pub struct ListConversationProfiles(
7076        RequestBuilder<crate::model::ListConversationProfilesRequest>,
7077    );
7078
7079    impl ListConversationProfiles {
7080        pub(crate) fn new(
7081            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7082        ) -> Self {
7083            Self(RequestBuilder::new(stub))
7084        }
7085
7086        /// Sets the full request, replacing any prior values.
7087        pub fn with_request<V: Into<crate::model::ListConversationProfilesRequest>>(
7088            mut self,
7089            v: V,
7090        ) -> Self {
7091            self.0.request = v.into();
7092            self
7093        }
7094
7095        /// Sets all the options, replacing any prior values.
7096        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7097            self.0.options = v.into();
7098            self
7099        }
7100
7101        /// Sends the request.
7102        pub async fn send(self) -> Result<crate::model::ListConversationProfilesResponse> {
7103            (*self.0.stub)
7104                .list_conversation_profiles(self.0.request, self.0.options)
7105                .await
7106                .map(gax::response::Response::into_body)
7107        }
7108
7109        /// Streams each page in the collection.
7110        pub fn by_page(
7111            self,
7112        ) -> impl gax::paginator::Paginator<
7113            crate::model::ListConversationProfilesResponse,
7114            gax::error::Error,
7115        > {
7116            use std::clone::Clone;
7117            let token = self.0.request.page_token.clone();
7118            let execute = move |token: String| {
7119                let mut builder = self.clone();
7120                builder.0.request = builder.0.request.set_page_token(token);
7121                builder.send()
7122            };
7123            gax::paginator::internal::new_paginator(token, execute)
7124        }
7125
7126        /// Streams each item in the collection.
7127        pub fn by_item(
7128            self,
7129        ) -> impl gax::paginator::ItemPaginator<
7130            crate::model::ListConversationProfilesResponse,
7131            gax::error::Error,
7132        > {
7133            use gax::paginator::Paginator;
7134            self.by_page().items()
7135        }
7136
7137        /// Sets the value of [parent][crate::model::ListConversationProfilesRequest::parent].
7138        ///
7139        /// This is a **required** field for requests.
7140        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7141            self.0.request.parent = v.into();
7142            self
7143        }
7144
7145        /// Sets the value of [page_size][crate::model::ListConversationProfilesRequest::page_size].
7146        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7147            self.0.request.page_size = v.into();
7148            self
7149        }
7150
7151        /// Sets the value of [page_token][crate::model::ListConversationProfilesRequest::page_token].
7152        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7153            self.0.request.page_token = v.into();
7154            self
7155        }
7156    }
7157
7158    #[doc(hidden)]
7159    impl gax::options::internal::RequestBuilder for ListConversationProfiles {
7160        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7161            &mut self.0.options
7162        }
7163    }
7164
7165    /// The request builder for [ConversationProfiles::get_conversation_profile][crate::client::ConversationProfiles::get_conversation_profile] calls.
7166    ///
7167    /// # Example
7168    /// ```
7169    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetConversationProfile;
7170    /// # async fn sample() -> gax::Result<()> {
7171    ///
7172    /// let builder = prepare_request_builder();
7173    /// let response = builder.send().await?;
7174    /// # Ok(()) }
7175    ///
7176    /// fn prepare_request_builder() -> GetConversationProfile {
7177    ///   # panic!();
7178    ///   // ... details omitted ...
7179    /// }
7180    /// ```
7181    #[derive(Clone, Debug)]
7182    pub struct GetConversationProfile(RequestBuilder<crate::model::GetConversationProfileRequest>);
7183
7184    impl GetConversationProfile {
7185        pub(crate) fn new(
7186            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7187        ) -> Self {
7188            Self(RequestBuilder::new(stub))
7189        }
7190
7191        /// Sets the full request, replacing any prior values.
7192        pub fn with_request<V: Into<crate::model::GetConversationProfileRequest>>(
7193            mut self,
7194            v: V,
7195        ) -> Self {
7196            self.0.request = v.into();
7197            self
7198        }
7199
7200        /// Sets all the options, replacing any prior values.
7201        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7202            self.0.options = v.into();
7203            self
7204        }
7205
7206        /// Sends the request.
7207        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7208            (*self.0.stub)
7209                .get_conversation_profile(self.0.request, self.0.options)
7210                .await
7211                .map(gax::response::Response::into_body)
7212        }
7213
7214        /// Sets the value of [name][crate::model::GetConversationProfileRequest::name].
7215        ///
7216        /// This is a **required** field for requests.
7217        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7218            self.0.request.name = v.into();
7219            self
7220        }
7221    }
7222
7223    #[doc(hidden)]
7224    impl gax::options::internal::RequestBuilder for GetConversationProfile {
7225        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7226            &mut self.0.options
7227        }
7228    }
7229
7230    /// The request builder for [ConversationProfiles::create_conversation_profile][crate::client::ConversationProfiles::create_conversation_profile] calls.
7231    ///
7232    /// # Example
7233    /// ```
7234    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::CreateConversationProfile;
7235    /// # async fn sample() -> gax::Result<()> {
7236    ///
7237    /// let builder = prepare_request_builder();
7238    /// let response = builder.send().await?;
7239    /// # Ok(()) }
7240    ///
7241    /// fn prepare_request_builder() -> CreateConversationProfile {
7242    ///   # panic!();
7243    ///   // ... details omitted ...
7244    /// }
7245    /// ```
7246    #[derive(Clone, Debug)]
7247    pub struct CreateConversationProfile(
7248        RequestBuilder<crate::model::CreateConversationProfileRequest>,
7249    );
7250
7251    impl CreateConversationProfile {
7252        pub(crate) fn new(
7253            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7254        ) -> Self {
7255            Self(RequestBuilder::new(stub))
7256        }
7257
7258        /// Sets the full request, replacing any prior values.
7259        pub fn with_request<V: Into<crate::model::CreateConversationProfileRequest>>(
7260            mut self,
7261            v: V,
7262        ) -> Self {
7263            self.0.request = v.into();
7264            self
7265        }
7266
7267        /// Sets all the options, replacing any prior values.
7268        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7269            self.0.options = v.into();
7270            self
7271        }
7272
7273        /// Sends the request.
7274        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7275            (*self.0.stub)
7276                .create_conversation_profile(self.0.request, self.0.options)
7277                .await
7278                .map(gax::response::Response::into_body)
7279        }
7280
7281        /// Sets the value of [parent][crate::model::CreateConversationProfileRequest::parent].
7282        ///
7283        /// This is a **required** field for requests.
7284        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7285            self.0.request.parent = v.into();
7286            self
7287        }
7288
7289        /// Sets the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7290        ///
7291        /// This is a **required** field for requests.
7292        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7293        where
7294            T: std::convert::Into<crate::model::ConversationProfile>,
7295        {
7296            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7297            self
7298        }
7299
7300        /// Sets or clears the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7301        ///
7302        /// This is a **required** field for requests.
7303        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7304        where
7305            T: std::convert::Into<crate::model::ConversationProfile>,
7306        {
7307            self.0.request.conversation_profile = v.map(|x| x.into());
7308            self
7309        }
7310    }
7311
7312    #[doc(hidden)]
7313    impl gax::options::internal::RequestBuilder for CreateConversationProfile {
7314        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7315            &mut self.0.options
7316        }
7317    }
7318
7319    /// The request builder for [ConversationProfiles::update_conversation_profile][crate::client::ConversationProfiles::update_conversation_profile] calls.
7320    ///
7321    /// # Example
7322    /// ```
7323    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::UpdateConversationProfile;
7324    /// # async fn sample() -> gax::Result<()> {
7325    ///
7326    /// let builder = prepare_request_builder();
7327    /// let response = builder.send().await?;
7328    /// # Ok(()) }
7329    ///
7330    /// fn prepare_request_builder() -> UpdateConversationProfile {
7331    ///   # panic!();
7332    ///   // ... details omitted ...
7333    /// }
7334    /// ```
7335    #[derive(Clone, Debug)]
7336    pub struct UpdateConversationProfile(
7337        RequestBuilder<crate::model::UpdateConversationProfileRequest>,
7338    );
7339
7340    impl UpdateConversationProfile {
7341        pub(crate) fn new(
7342            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7343        ) -> Self {
7344            Self(RequestBuilder::new(stub))
7345        }
7346
7347        /// Sets the full request, replacing any prior values.
7348        pub fn with_request<V: Into<crate::model::UpdateConversationProfileRequest>>(
7349            mut self,
7350            v: V,
7351        ) -> Self {
7352            self.0.request = v.into();
7353            self
7354        }
7355
7356        /// Sets all the options, replacing any prior values.
7357        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7358            self.0.options = v.into();
7359            self
7360        }
7361
7362        /// Sends the request.
7363        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7364            (*self.0.stub)
7365                .update_conversation_profile(self.0.request, self.0.options)
7366                .await
7367                .map(gax::response::Response::into_body)
7368        }
7369
7370        /// Sets the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7371        ///
7372        /// This is a **required** field for requests.
7373        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7374        where
7375            T: std::convert::Into<crate::model::ConversationProfile>,
7376        {
7377            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7378            self
7379        }
7380
7381        /// Sets or clears the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7382        ///
7383        /// This is a **required** field for requests.
7384        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7385        where
7386            T: std::convert::Into<crate::model::ConversationProfile>,
7387        {
7388            self.0.request.conversation_profile = v.map(|x| x.into());
7389            self
7390        }
7391
7392        /// Sets the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7393        ///
7394        /// This is a **required** field for requests.
7395        pub fn set_update_mask<T>(mut self, v: T) -> Self
7396        where
7397            T: std::convert::Into<wkt::FieldMask>,
7398        {
7399            self.0.request.update_mask = std::option::Option::Some(v.into());
7400            self
7401        }
7402
7403        /// Sets or clears the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7404        ///
7405        /// This is a **required** field for requests.
7406        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7407        where
7408            T: std::convert::Into<wkt::FieldMask>,
7409        {
7410            self.0.request.update_mask = v.map(|x| x.into());
7411            self
7412        }
7413    }
7414
7415    #[doc(hidden)]
7416    impl gax::options::internal::RequestBuilder for UpdateConversationProfile {
7417        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7418            &mut self.0.options
7419        }
7420    }
7421
7422    /// The request builder for [ConversationProfiles::delete_conversation_profile][crate::client::ConversationProfiles::delete_conversation_profile] calls.
7423    ///
7424    /// # Example
7425    /// ```
7426    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::DeleteConversationProfile;
7427    /// # async fn sample() -> gax::Result<()> {
7428    ///
7429    /// let builder = prepare_request_builder();
7430    /// let response = builder.send().await?;
7431    /// # Ok(()) }
7432    ///
7433    /// fn prepare_request_builder() -> DeleteConversationProfile {
7434    ///   # panic!();
7435    ///   // ... details omitted ...
7436    /// }
7437    /// ```
7438    #[derive(Clone, Debug)]
7439    pub struct DeleteConversationProfile(
7440        RequestBuilder<crate::model::DeleteConversationProfileRequest>,
7441    );
7442
7443    impl DeleteConversationProfile {
7444        pub(crate) fn new(
7445            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7446        ) -> Self {
7447            Self(RequestBuilder::new(stub))
7448        }
7449
7450        /// Sets the full request, replacing any prior values.
7451        pub fn with_request<V: Into<crate::model::DeleteConversationProfileRequest>>(
7452            mut self,
7453            v: V,
7454        ) -> Self {
7455            self.0.request = v.into();
7456            self
7457        }
7458
7459        /// Sets all the options, replacing any prior values.
7460        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7461            self.0.options = v.into();
7462            self
7463        }
7464
7465        /// Sends the request.
7466        pub async fn send(self) -> Result<()> {
7467            (*self.0.stub)
7468                .delete_conversation_profile(self.0.request, self.0.options)
7469                .await
7470                .map(gax::response::Response::into_body)
7471        }
7472
7473        /// Sets the value of [name][crate::model::DeleteConversationProfileRequest::name].
7474        ///
7475        /// This is a **required** field for requests.
7476        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7477            self.0.request.name = v.into();
7478            self
7479        }
7480    }
7481
7482    #[doc(hidden)]
7483    impl gax::options::internal::RequestBuilder for DeleteConversationProfile {
7484        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7485            &mut self.0.options
7486        }
7487    }
7488
7489    /// The request builder for [ConversationProfiles::set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config] calls.
7490    ///
7491    /// # Example
7492    /// ```
7493    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::SetSuggestionFeatureConfig;
7494    /// # async fn sample() -> gax::Result<()> {
7495    /// use lro::Poller;
7496    ///
7497    /// let builder = prepare_request_builder();
7498    /// let response = builder.poller().until_done().await?;
7499    /// # Ok(()) }
7500    ///
7501    /// fn prepare_request_builder() -> SetSuggestionFeatureConfig {
7502    ///   # panic!();
7503    ///   // ... details omitted ...
7504    /// }
7505    /// ```
7506    #[derive(Clone, Debug)]
7507    pub struct SetSuggestionFeatureConfig(
7508        RequestBuilder<crate::model::SetSuggestionFeatureConfigRequest>,
7509    );
7510
7511    impl SetSuggestionFeatureConfig {
7512        pub(crate) fn new(
7513            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7514        ) -> Self {
7515            Self(RequestBuilder::new(stub))
7516        }
7517
7518        /// Sets the full request, replacing any prior values.
7519        pub fn with_request<V: Into<crate::model::SetSuggestionFeatureConfigRequest>>(
7520            mut self,
7521            v: V,
7522        ) -> Self {
7523            self.0.request = v.into();
7524            self
7525        }
7526
7527        /// Sets all the options, replacing any prior values.
7528        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7529            self.0.options = v.into();
7530            self
7531        }
7532
7533        /// Sends the request.
7534        ///
7535        /// # Long running operations
7536        ///
7537        /// This starts, but does not poll, a longrunning operation. More information
7538        /// on [set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config].
7539        pub async fn send(self) -> Result<longrunning::model::Operation> {
7540            (*self.0.stub)
7541                .set_suggestion_feature_config(self.0.request, self.0.options)
7542                .await
7543                .map(gax::response::Response::into_body)
7544        }
7545
7546        /// Creates a [Poller][lro::Poller] to work with `set_suggestion_feature_config`.
7547        pub fn poller(
7548            self,
7549        ) -> impl lro::Poller<
7550            crate::model::ConversationProfile,
7551            crate::model::SetSuggestionFeatureConfigOperationMetadata,
7552        > {
7553            type Operation = lro::internal::Operation<
7554                crate::model::ConversationProfile,
7555                crate::model::SetSuggestionFeatureConfigOperationMetadata,
7556            >;
7557            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7558            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7559
7560            let stub = self.0.stub.clone();
7561            let mut options = self.0.options.clone();
7562            options.set_retry_policy(gax::retry_policy::NeverRetry);
7563            let query = move |name| {
7564                let stub = stub.clone();
7565                let options = options.clone();
7566                async {
7567                    let op = GetOperation::new(stub)
7568                        .set_name(name)
7569                        .with_options(options)
7570                        .send()
7571                        .await?;
7572                    Ok(Operation::new(op))
7573                }
7574            };
7575
7576            let start = move || async {
7577                let op = self.send().await?;
7578                Ok(Operation::new(op))
7579            };
7580
7581            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7582        }
7583
7584        /// Sets the value of [conversation_profile][crate::model::SetSuggestionFeatureConfigRequest::conversation_profile].
7585        ///
7586        /// This is a **required** field for requests.
7587        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7588            self.0.request.conversation_profile = v.into();
7589            self
7590        }
7591
7592        /// Sets the value of [participant_role][crate::model::SetSuggestionFeatureConfigRequest::participant_role].
7593        ///
7594        /// This is a **required** field for requests.
7595        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7596            mut self,
7597            v: T,
7598        ) -> Self {
7599            self.0.request.participant_role = v.into();
7600            self
7601        }
7602
7603        /// Sets the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7604        ///
7605        /// This is a **required** field for requests.
7606        pub fn set_suggestion_feature_config<T>(mut self, v: T) -> Self
7607        where
7608            T: std::convert::Into<
7609                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7610                >,
7611        {
7612            self.0.request.suggestion_feature_config = std::option::Option::Some(v.into());
7613            self
7614        }
7615
7616        /// Sets or clears the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7617        ///
7618        /// This is a **required** field for requests.
7619        pub fn set_or_clear_suggestion_feature_config<T>(
7620            mut self,
7621            v: std::option::Option<T>,
7622        ) -> Self
7623        where
7624            T: std::convert::Into<
7625                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7626                >,
7627        {
7628            self.0.request.suggestion_feature_config = v.map(|x| x.into());
7629            self
7630        }
7631    }
7632
7633    #[doc(hidden)]
7634    impl gax::options::internal::RequestBuilder for SetSuggestionFeatureConfig {
7635        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7636            &mut self.0.options
7637        }
7638    }
7639
7640    /// The request builder for [ConversationProfiles::clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config] calls.
7641    ///
7642    /// # Example
7643    /// ```
7644    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ClearSuggestionFeatureConfig;
7645    /// # async fn sample() -> gax::Result<()> {
7646    /// use lro::Poller;
7647    ///
7648    /// let builder = prepare_request_builder();
7649    /// let response = builder.poller().until_done().await?;
7650    /// # Ok(()) }
7651    ///
7652    /// fn prepare_request_builder() -> ClearSuggestionFeatureConfig {
7653    ///   # panic!();
7654    ///   // ... details omitted ...
7655    /// }
7656    /// ```
7657    #[derive(Clone, Debug)]
7658    pub struct ClearSuggestionFeatureConfig(
7659        RequestBuilder<crate::model::ClearSuggestionFeatureConfigRequest>,
7660    );
7661
7662    impl ClearSuggestionFeatureConfig {
7663        pub(crate) fn new(
7664            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7665        ) -> Self {
7666            Self(RequestBuilder::new(stub))
7667        }
7668
7669        /// Sets the full request, replacing any prior values.
7670        pub fn with_request<V: Into<crate::model::ClearSuggestionFeatureConfigRequest>>(
7671            mut self,
7672            v: V,
7673        ) -> Self {
7674            self.0.request = v.into();
7675            self
7676        }
7677
7678        /// Sets all the options, replacing any prior values.
7679        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7680            self.0.options = v.into();
7681            self
7682        }
7683
7684        /// Sends the request.
7685        ///
7686        /// # Long running operations
7687        ///
7688        /// This starts, but does not poll, a longrunning operation. More information
7689        /// on [clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config].
7690        pub async fn send(self) -> Result<longrunning::model::Operation> {
7691            (*self.0.stub)
7692                .clear_suggestion_feature_config(self.0.request, self.0.options)
7693                .await
7694                .map(gax::response::Response::into_body)
7695        }
7696
7697        /// Creates a [Poller][lro::Poller] to work with `clear_suggestion_feature_config`.
7698        pub fn poller(
7699            self,
7700        ) -> impl lro::Poller<
7701            crate::model::ConversationProfile,
7702            crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7703        > {
7704            type Operation = lro::internal::Operation<
7705                crate::model::ConversationProfile,
7706                crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7707            >;
7708            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7709            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7710
7711            let stub = self.0.stub.clone();
7712            let mut options = self.0.options.clone();
7713            options.set_retry_policy(gax::retry_policy::NeverRetry);
7714            let query = move |name| {
7715                let stub = stub.clone();
7716                let options = options.clone();
7717                async {
7718                    let op = GetOperation::new(stub)
7719                        .set_name(name)
7720                        .with_options(options)
7721                        .send()
7722                        .await?;
7723                    Ok(Operation::new(op))
7724                }
7725            };
7726
7727            let start = move || async {
7728                let op = self.send().await?;
7729                Ok(Operation::new(op))
7730            };
7731
7732            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7733        }
7734
7735        /// Sets the value of [conversation_profile][crate::model::ClearSuggestionFeatureConfigRequest::conversation_profile].
7736        ///
7737        /// This is a **required** field for requests.
7738        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7739            self.0.request.conversation_profile = v.into();
7740            self
7741        }
7742
7743        /// Sets the value of [participant_role][crate::model::ClearSuggestionFeatureConfigRequest::participant_role].
7744        ///
7745        /// This is a **required** field for requests.
7746        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7747            mut self,
7748            v: T,
7749        ) -> Self {
7750            self.0.request.participant_role = v.into();
7751            self
7752        }
7753
7754        /// Sets the value of [suggestion_feature_type][crate::model::ClearSuggestionFeatureConfigRequest::suggestion_feature_type].
7755        ///
7756        /// This is a **required** field for requests.
7757        pub fn set_suggestion_feature_type<T: Into<crate::model::suggestion_feature::Type>>(
7758            mut self,
7759            v: T,
7760        ) -> Self {
7761            self.0.request.suggestion_feature_type = v.into();
7762            self
7763        }
7764    }
7765
7766    #[doc(hidden)]
7767    impl gax::options::internal::RequestBuilder for ClearSuggestionFeatureConfig {
7768        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7769            &mut self.0.options
7770        }
7771    }
7772
7773    /// The request builder for [ConversationProfiles::list_locations][crate::client::ConversationProfiles::list_locations] calls.
7774    ///
7775    /// # Example
7776    /// ```
7777    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListLocations;
7778    /// # async fn sample() -> gax::Result<()> {
7779    /// use gax::paginator::ItemPaginator;
7780    ///
7781    /// let builder = prepare_request_builder();
7782    /// let mut items = builder.by_item();
7783    /// while let Some(result) = items.next().await {
7784    ///   let item = result?;
7785    /// }
7786    /// # Ok(()) }
7787    ///
7788    /// fn prepare_request_builder() -> ListLocations {
7789    ///   # panic!();
7790    ///   // ... details omitted ...
7791    /// }
7792    /// ```
7793    #[derive(Clone, Debug)]
7794    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7795
7796    impl ListLocations {
7797        pub(crate) fn new(
7798            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7799        ) -> Self {
7800            Self(RequestBuilder::new(stub))
7801        }
7802
7803        /// Sets the full request, replacing any prior values.
7804        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7805            mut self,
7806            v: V,
7807        ) -> Self {
7808            self.0.request = v.into();
7809            self
7810        }
7811
7812        /// Sets all the options, replacing any prior values.
7813        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7814            self.0.options = v.into();
7815            self
7816        }
7817
7818        /// Sends the request.
7819        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7820            (*self.0.stub)
7821                .list_locations(self.0.request, self.0.options)
7822                .await
7823                .map(gax::response::Response::into_body)
7824        }
7825
7826        /// Streams each page in the collection.
7827        pub fn by_page(
7828            self,
7829        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7830        {
7831            use std::clone::Clone;
7832            let token = self.0.request.page_token.clone();
7833            let execute = move |token: String| {
7834                let mut builder = self.clone();
7835                builder.0.request = builder.0.request.set_page_token(token);
7836                builder.send()
7837            };
7838            gax::paginator::internal::new_paginator(token, execute)
7839        }
7840
7841        /// Streams each item in the collection.
7842        pub fn by_item(
7843            self,
7844        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7845        {
7846            use gax::paginator::Paginator;
7847            self.by_page().items()
7848        }
7849
7850        /// Sets the value of [name][location::model::ListLocationsRequest::name].
7851        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7852            self.0.request.name = v.into();
7853            self
7854        }
7855
7856        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
7857        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7858            self.0.request.filter = v.into();
7859            self
7860        }
7861
7862        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
7863        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7864            self.0.request.page_size = v.into();
7865            self
7866        }
7867
7868        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
7869        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7870            self.0.request.page_token = v.into();
7871            self
7872        }
7873    }
7874
7875    #[doc(hidden)]
7876    impl gax::options::internal::RequestBuilder for ListLocations {
7877        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7878            &mut self.0.options
7879        }
7880    }
7881
7882    /// The request builder for [ConversationProfiles::get_location][crate::client::ConversationProfiles::get_location] calls.
7883    ///
7884    /// # Example
7885    /// ```
7886    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetLocation;
7887    /// # async fn sample() -> gax::Result<()> {
7888    ///
7889    /// let builder = prepare_request_builder();
7890    /// let response = builder.send().await?;
7891    /// # Ok(()) }
7892    ///
7893    /// fn prepare_request_builder() -> GetLocation {
7894    ///   # panic!();
7895    ///   // ... details omitted ...
7896    /// }
7897    /// ```
7898    #[derive(Clone, Debug)]
7899    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7900
7901    impl GetLocation {
7902        pub(crate) fn new(
7903            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7904        ) -> Self {
7905            Self(RequestBuilder::new(stub))
7906        }
7907
7908        /// Sets the full request, replacing any prior values.
7909        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7910            self.0.request = v.into();
7911            self
7912        }
7913
7914        /// Sets all the options, replacing any prior values.
7915        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7916            self.0.options = v.into();
7917            self
7918        }
7919
7920        /// Sends the request.
7921        pub async fn send(self) -> Result<location::model::Location> {
7922            (*self.0.stub)
7923                .get_location(self.0.request, self.0.options)
7924                .await
7925                .map(gax::response::Response::into_body)
7926        }
7927
7928        /// Sets the value of [name][location::model::GetLocationRequest::name].
7929        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7930            self.0.request.name = v.into();
7931            self
7932        }
7933    }
7934
7935    #[doc(hidden)]
7936    impl gax::options::internal::RequestBuilder for GetLocation {
7937        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7938            &mut self.0.options
7939        }
7940    }
7941
7942    /// The request builder for [ConversationProfiles::list_operations][crate::client::ConversationProfiles::list_operations] calls.
7943    ///
7944    /// # Example
7945    /// ```
7946    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::ListOperations;
7947    /// # async fn sample() -> gax::Result<()> {
7948    /// use gax::paginator::ItemPaginator;
7949    ///
7950    /// let builder = prepare_request_builder();
7951    /// let mut items = builder.by_item();
7952    /// while let Some(result) = items.next().await {
7953    ///   let item = result?;
7954    /// }
7955    /// # Ok(()) }
7956    ///
7957    /// fn prepare_request_builder() -> ListOperations {
7958    ///   # panic!();
7959    ///   // ... details omitted ...
7960    /// }
7961    /// ```
7962    #[derive(Clone, Debug)]
7963    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7964
7965    impl ListOperations {
7966        pub(crate) fn new(
7967            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7968        ) -> Self {
7969            Self(RequestBuilder::new(stub))
7970        }
7971
7972        /// Sets the full request, replacing any prior values.
7973        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7974            mut self,
7975            v: V,
7976        ) -> Self {
7977            self.0.request = v.into();
7978            self
7979        }
7980
7981        /// Sets all the options, replacing any prior values.
7982        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7983            self.0.options = v.into();
7984            self
7985        }
7986
7987        /// Sends the request.
7988        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7989            (*self.0.stub)
7990                .list_operations(self.0.request, self.0.options)
7991                .await
7992                .map(gax::response::Response::into_body)
7993        }
7994
7995        /// Streams each page in the collection.
7996        pub fn by_page(
7997            self,
7998        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7999        {
8000            use std::clone::Clone;
8001            let token = self.0.request.page_token.clone();
8002            let execute = move |token: String| {
8003                let mut builder = self.clone();
8004                builder.0.request = builder.0.request.set_page_token(token);
8005                builder.send()
8006            };
8007            gax::paginator::internal::new_paginator(token, execute)
8008        }
8009
8010        /// Streams each item in the collection.
8011        pub fn by_item(
8012            self,
8013        ) -> impl gax::paginator::ItemPaginator<
8014            longrunning::model::ListOperationsResponse,
8015            gax::error::Error,
8016        > {
8017            use gax::paginator::Paginator;
8018            self.by_page().items()
8019        }
8020
8021        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
8022        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8023            self.0.request.name = v.into();
8024            self
8025        }
8026
8027        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
8028        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8029            self.0.request.filter = v.into();
8030            self
8031        }
8032
8033        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
8034        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8035            self.0.request.page_size = v.into();
8036            self
8037        }
8038
8039        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
8040        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8041            self.0.request.page_token = v.into();
8042            self
8043        }
8044
8045        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
8046        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8047            self.0.request.return_partial_success = v.into();
8048            self
8049        }
8050    }
8051
8052    #[doc(hidden)]
8053    impl gax::options::internal::RequestBuilder for ListOperations {
8054        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8055            &mut self.0.options
8056        }
8057    }
8058
8059    /// The request builder for [ConversationProfiles::get_operation][crate::client::ConversationProfiles::get_operation] calls.
8060    ///
8061    /// # Example
8062    /// ```
8063    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::GetOperation;
8064    /// # async fn sample() -> gax::Result<()> {
8065    ///
8066    /// let builder = prepare_request_builder();
8067    /// let response = builder.send().await?;
8068    /// # Ok(()) }
8069    ///
8070    /// fn prepare_request_builder() -> GetOperation {
8071    ///   # panic!();
8072    ///   // ... details omitted ...
8073    /// }
8074    /// ```
8075    #[derive(Clone, Debug)]
8076    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8077
8078    impl GetOperation {
8079        pub(crate) fn new(
8080            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8081        ) -> Self {
8082            Self(RequestBuilder::new(stub))
8083        }
8084
8085        /// Sets the full request, replacing any prior values.
8086        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8087            mut self,
8088            v: V,
8089        ) -> Self {
8090            self.0.request = v.into();
8091            self
8092        }
8093
8094        /// Sets all the options, replacing any prior values.
8095        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8096            self.0.options = v.into();
8097            self
8098        }
8099
8100        /// Sends the request.
8101        pub async fn send(self) -> Result<longrunning::model::Operation> {
8102            (*self.0.stub)
8103                .get_operation(self.0.request, self.0.options)
8104                .await
8105                .map(gax::response::Response::into_body)
8106        }
8107
8108        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
8109        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8110            self.0.request.name = v.into();
8111            self
8112        }
8113    }
8114
8115    #[doc(hidden)]
8116    impl gax::options::internal::RequestBuilder for GetOperation {
8117        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8118            &mut self.0.options
8119        }
8120    }
8121
8122    /// The request builder for [ConversationProfiles::cancel_operation][crate::client::ConversationProfiles::cancel_operation] calls.
8123    ///
8124    /// # Example
8125    /// ```
8126    /// # use google_cloud_dialogflow_v2::builder::conversation_profiles::CancelOperation;
8127    /// # async fn sample() -> gax::Result<()> {
8128    ///
8129    /// let builder = prepare_request_builder();
8130    /// let response = builder.send().await?;
8131    /// # Ok(()) }
8132    ///
8133    /// fn prepare_request_builder() -> CancelOperation {
8134    ///   # panic!();
8135    ///   // ... details omitted ...
8136    /// }
8137    /// ```
8138    #[derive(Clone, Debug)]
8139    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8140
8141    impl CancelOperation {
8142        pub(crate) fn new(
8143            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8144        ) -> Self {
8145            Self(RequestBuilder::new(stub))
8146        }
8147
8148        /// Sets the full request, replacing any prior values.
8149        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8150            mut self,
8151            v: V,
8152        ) -> Self {
8153            self.0.request = v.into();
8154            self
8155        }
8156
8157        /// Sets all the options, replacing any prior values.
8158        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8159            self.0.options = v.into();
8160            self
8161        }
8162
8163        /// Sends the request.
8164        pub async fn send(self) -> Result<()> {
8165            (*self.0.stub)
8166                .cancel_operation(self.0.request, self.0.options)
8167                .await
8168                .map(gax::response::Response::into_body)
8169        }
8170
8171        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
8172        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8173            self.0.request.name = v.into();
8174            self
8175        }
8176    }
8177
8178    #[doc(hidden)]
8179    impl gax::options::internal::RequestBuilder for CancelOperation {
8180        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8181            &mut self.0.options
8182        }
8183    }
8184}
8185
8186#[cfg(feature = "documents")]
8187#[cfg_attr(docsrs, doc(cfg(feature = "documents")))]
8188pub mod documents {
8189    use crate::Result;
8190
8191    /// A builder for [Documents][crate::client::Documents].
8192    ///
8193    /// ```
8194    /// # async fn sample() -> gax::client_builder::Result<()> {
8195    /// # use google_cloud_dialogflow_v2::*;
8196    /// # use builder::documents::ClientBuilder;
8197    /// # use client::Documents;
8198    /// let builder : ClientBuilder = Documents::builder();
8199    /// let client = builder
8200    ///     .with_endpoint("https://dialogflow.googleapis.com")
8201    ///     .build().await?;
8202    /// # Ok(()) }
8203    /// ```
8204    pub type ClientBuilder =
8205        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8206
8207    pub(crate) mod client {
8208        use super::super::super::client::Documents;
8209        pub struct Factory;
8210        impl gax::client_builder::internal::ClientFactory for Factory {
8211            type Client = Documents;
8212            type Credentials = gaxi::options::Credentials;
8213            async fn build(
8214                self,
8215                config: gaxi::options::ClientConfig,
8216            ) -> gax::client_builder::Result<Self::Client> {
8217                Self::Client::new(config).await
8218            }
8219        }
8220    }
8221
8222    /// Common implementation for [crate::client::Documents] request builders.
8223    #[derive(Clone, Debug)]
8224    pub(crate) struct RequestBuilder<R: std::default::Default> {
8225        stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8226        request: R,
8227        options: gax::options::RequestOptions,
8228    }
8229
8230    impl<R> RequestBuilder<R>
8231    where
8232        R: std::default::Default,
8233    {
8234        pub(crate) fn new(
8235            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8236        ) -> Self {
8237            Self {
8238                stub,
8239                request: R::default(),
8240                options: gax::options::RequestOptions::default(),
8241            }
8242        }
8243    }
8244
8245    /// The request builder for [Documents::list_documents][crate::client::Documents::list_documents] calls.
8246    ///
8247    /// # Example
8248    /// ```
8249    /// # use google_cloud_dialogflow_v2::builder::documents::ListDocuments;
8250    /// # async fn sample() -> gax::Result<()> {
8251    /// use gax::paginator::ItemPaginator;
8252    ///
8253    /// let builder = prepare_request_builder();
8254    /// let mut items = builder.by_item();
8255    /// while let Some(result) = items.next().await {
8256    ///   let item = result?;
8257    /// }
8258    /// # Ok(()) }
8259    ///
8260    /// fn prepare_request_builder() -> ListDocuments {
8261    ///   # panic!();
8262    ///   // ... details omitted ...
8263    /// }
8264    /// ```
8265    #[derive(Clone, Debug)]
8266    pub struct ListDocuments(RequestBuilder<crate::model::ListDocumentsRequest>);
8267
8268    impl ListDocuments {
8269        pub(crate) fn new(
8270            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8271        ) -> Self {
8272            Self(RequestBuilder::new(stub))
8273        }
8274
8275        /// Sets the full request, replacing any prior values.
8276        pub fn with_request<V: Into<crate::model::ListDocumentsRequest>>(mut self, v: V) -> Self {
8277            self.0.request = v.into();
8278            self
8279        }
8280
8281        /// Sets all the options, replacing any prior values.
8282        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8283            self.0.options = v.into();
8284            self
8285        }
8286
8287        /// Sends the request.
8288        pub async fn send(self) -> Result<crate::model::ListDocumentsResponse> {
8289            (*self.0.stub)
8290                .list_documents(self.0.request, self.0.options)
8291                .await
8292                .map(gax::response::Response::into_body)
8293        }
8294
8295        /// Streams each page in the collection.
8296        pub fn by_page(
8297            self,
8298        ) -> impl gax::paginator::Paginator<crate::model::ListDocumentsResponse, gax::error::Error>
8299        {
8300            use std::clone::Clone;
8301            let token = self.0.request.page_token.clone();
8302            let execute = move |token: String| {
8303                let mut builder = self.clone();
8304                builder.0.request = builder.0.request.set_page_token(token);
8305                builder.send()
8306            };
8307            gax::paginator::internal::new_paginator(token, execute)
8308        }
8309
8310        /// Streams each item in the collection.
8311        pub fn by_item(
8312            self,
8313        ) -> impl gax::paginator::ItemPaginator<crate::model::ListDocumentsResponse, gax::error::Error>
8314        {
8315            use gax::paginator::Paginator;
8316            self.by_page().items()
8317        }
8318
8319        /// Sets the value of [parent][crate::model::ListDocumentsRequest::parent].
8320        ///
8321        /// This is a **required** field for requests.
8322        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8323            self.0.request.parent = v.into();
8324            self
8325        }
8326
8327        /// Sets the value of [page_size][crate::model::ListDocumentsRequest::page_size].
8328        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8329            self.0.request.page_size = v.into();
8330            self
8331        }
8332
8333        /// Sets the value of [page_token][crate::model::ListDocumentsRequest::page_token].
8334        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8335            self.0.request.page_token = v.into();
8336            self
8337        }
8338
8339        /// Sets the value of [filter][crate::model::ListDocumentsRequest::filter].
8340        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8341            self.0.request.filter = v.into();
8342            self
8343        }
8344    }
8345
8346    #[doc(hidden)]
8347    impl gax::options::internal::RequestBuilder for ListDocuments {
8348        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8349            &mut self.0.options
8350        }
8351    }
8352
8353    /// The request builder for [Documents::get_document][crate::client::Documents::get_document] calls.
8354    ///
8355    /// # Example
8356    /// ```
8357    /// # use google_cloud_dialogflow_v2::builder::documents::GetDocument;
8358    /// # async fn sample() -> gax::Result<()> {
8359    ///
8360    /// let builder = prepare_request_builder();
8361    /// let response = builder.send().await?;
8362    /// # Ok(()) }
8363    ///
8364    /// fn prepare_request_builder() -> GetDocument {
8365    ///   # panic!();
8366    ///   // ... details omitted ...
8367    /// }
8368    /// ```
8369    #[derive(Clone, Debug)]
8370    pub struct GetDocument(RequestBuilder<crate::model::GetDocumentRequest>);
8371
8372    impl GetDocument {
8373        pub(crate) fn new(
8374            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8375        ) -> Self {
8376            Self(RequestBuilder::new(stub))
8377        }
8378
8379        /// Sets the full request, replacing any prior values.
8380        pub fn with_request<V: Into<crate::model::GetDocumentRequest>>(mut self, v: V) -> Self {
8381            self.0.request = v.into();
8382            self
8383        }
8384
8385        /// Sets all the options, replacing any prior values.
8386        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8387            self.0.options = v.into();
8388            self
8389        }
8390
8391        /// Sends the request.
8392        pub async fn send(self) -> Result<crate::model::Document> {
8393            (*self.0.stub)
8394                .get_document(self.0.request, self.0.options)
8395                .await
8396                .map(gax::response::Response::into_body)
8397        }
8398
8399        /// Sets the value of [name][crate::model::GetDocumentRequest::name].
8400        ///
8401        /// This is a **required** field for requests.
8402        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8403            self.0.request.name = v.into();
8404            self
8405        }
8406    }
8407
8408    #[doc(hidden)]
8409    impl gax::options::internal::RequestBuilder for GetDocument {
8410        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8411            &mut self.0.options
8412        }
8413    }
8414
8415    /// The request builder for [Documents::create_document][crate::client::Documents::create_document] calls.
8416    ///
8417    /// # Example
8418    /// ```
8419    /// # use google_cloud_dialogflow_v2::builder::documents::CreateDocument;
8420    /// # async fn sample() -> gax::Result<()> {
8421    /// use lro::Poller;
8422    ///
8423    /// let builder = prepare_request_builder();
8424    /// let response = builder.poller().until_done().await?;
8425    /// # Ok(()) }
8426    ///
8427    /// fn prepare_request_builder() -> CreateDocument {
8428    ///   # panic!();
8429    ///   // ... details omitted ...
8430    /// }
8431    /// ```
8432    #[derive(Clone, Debug)]
8433    pub struct CreateDocument(RequestBuilder<crate::model::CreateDocumentRequest>);
8434
8435    impl CreateDocument {
8436        pub(crate) fn new(
8437            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8438        ) -> Self {
8439            Self(RequestBuilder::new(stub))
8440        }
8441
8442        /// Sets the full request, replacing any prior values.
8443        pub fn with_request<V: Into<crate::model::CreateDocumentRequest>>(mut self, v: V) -> Self {
8444            self.0.request = v.into();
8445            self
8446        }
8447
8448        /// Sets all the options, replacing any prior values.
8449        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8450            self.0.options = v.into();
8451            self
8452        }
8453
8454        /// Sends the request.
8455        ///
8456        /// # Long running operations
8457        ///
8458        /// This starts, but does not poll, a longrunning operation. More information
8459        /// on [create_document][crate::client::Documents::create_document].
8460        pub async fn send(self) -> Result<longrunning::model::Operation> {
8461            (*self.0.stub)
8462                .create_document(self.0.request, self.0.options)
8463                .await
8464                .map(gax::response::Response::into_body)
8465        }
8466
8467        /// Creates a [Poller][lro::Poller] to work with `create_document`.
8468        pub fn poller(
8469            self,
8470        ) -> impl lro::Poller<crate::model::Document, crate::model::KnowledgeOperationMetadata>
8471        {
8472            type Operation = lro::internal::Operation<
8473                crate::model::Document,
8474                crate::model::KnowledgeOperationMetadata,
8475            >;
8476            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8477            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8478
8479            let stub = self.0.stub.clone();
8480            let mut options = self.0.options.clone();
8481            options.set_retry_policy(gax::retry_policy::NeverRetry);
8482            let query = move |name| {
8483                let stub = stub.clone();
8484                let options = options.clone();
8485                async {
8486                    let op = GetOperation::new(stub)
8487                        .set_name(name)
8488                        .with_options(options)
8489                        .send()
8490                        .await?;
8491                    Ok(Operation::new(op))
8492                }
8493            };
8494
8495            let start = move || async {
8496                let op = self.send().await?;
8497                Ok(Operation::new(op))
8498            };
8499
8500            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8501        }
8502
8503        /// Sets the value of [parent][crate::model::CreateDocumentRequest::parent].
8504        ///
8505        /// This is a **required** field for requests.
8506        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8507            self.0.request.parent = v.into();
8508            self
8509        }
8510
8511        /// Sets the value of [document][crate::model::CreateDocumentRequest::document].
8512        ///
8513        /// This is a **required** field for requests.
8514        pub fn set_document<T>(mut self, v: T) -> Self
8515        where
8516            T: std::convert::Into<crate::model::Document>,
8517        {
8518            self.0.request.document = std::option::Option::Some(v.into());
8519            self
8520        }
8521
8522        /// Sets or clears the value of [document][crate::model::CreateDocumentRequest::document].
8523        ///
8524        /// This is a **required** field for requests.
8525        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
8526        where
8527            T: std::convert::Into<crate::model::Document>,
8528        {
8529            self.0.request.document = v.map(|x| x.into());
8530            self
8531        }
8532    }
8533
8534    #[doc(hidden)]
8535    impl gax::options::internal::RequestBuilder for CreateDocument {
8536        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8537            &mut self.0.options
8538        }
8539    }
8540
8541    /// The request builder for [Documents::import_documents][crate::client::Documents::import_documents] calls.
8542    ///
8543    /// # Example
8544    /// ```
8545    /// # use google_cloud_dialogflow_v2::builder::documents::ImportDocuments;
8546    /// # async fn sample() -> gax::Result<()> {
8547    /// use lro::Poller;
8548    ///
8549    /// let builder = prepare_request_builder();
8550    /// let response = builder.poller().until_done().await?;
8551    /// # Ok(()) }
8552    ///
8553    /// fn prepare_request_builder() -> ImportDocuments {
8554    ///   # panic!();
8555    ///   // ... details omitted ...
8556    /// }
8557    /// ```
8558    #[derive(Clone, Debug)]
8559    pub struct ImportDocuments(RequestBuilder<crate::model::ImportDocumentsRequest>);
8560
8561    impl ImportDocuments {
8562        pub(crate) fn new(
8563            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8564        ) -> Self {
8565            Self(RequestBuilder::new(stub))
8566        }
8567
8568        /// Sets the full request, replacing any prior values.
8569        pub fn with_request<V: Into<crate::model::ImportDocumentsRequest>>(mut self, v: V) -> Self {
8570            self.0.request = v.into();
8571            self
8572        }
8573
8574        /// Sets all the options, replacing any prior values.
8575        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8576            self.0.options = v.into();
8577            self
8578        }
8579
8580        /// Sends the request.
8581        ///
8582        /// # Long running operations
8583        ///
8584        /// This starts, but does not poll, a longrunning operation. More information
8585        /// on [import_documents][crate::client::Documents::import_documents].
8586        pub async fn send(self) -> Result<longrunning::model::Operation> {
8587            (*self.0.stub)
8588                .import_documents(self.0.request, self.0.options)
8589                .await
8590                .map(gax::response::Response::into_body)
8591        }
8592
8593        /// Creates a [Poller][lro::Poller] to work with `import_documents`.
8594        pub fn poller(
8595            self,
8596        ) -> impl lro::Poller<
8597            crate::model::ImportDocumentsResponse,
8598            crate::model::KnowledgeOperationMetadata,
8599        > {
8600            type Operation = lro::internal::Operation<
8601                crate::model::ImportDocumentsResponse,
8602                crate::model::KnowledgeOperationMetadata,
8603            >;
8604            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8605            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8606
8607            let stub = self.0.stub.clone();
8608            let mut options = self.0.options.clone();
8609            options.set_retry_policy(gax::retry_policy::NeverRetry);
8610            let query = move |name| {
8611                let stub = stub.clone();
8612                let options = options.clone();
8613                async {
8614                    let op = GetOperation::new(stub)
8615                        .set_name(name)
8616                        .with_options(options)
8617                        .send()
8618                        .await?;
8619                    Ok(Operation::new(op))
8620                }
8621            };
8622
8623            let start = move || async {
8624                let op = self.send().await?;
8625                Ok(Operation::new(op))
8626            };
8627
8628            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8629        }
8630
8631        /// Sets the value of [parent][crate::model::ImportDocumentsRequest::parent].
8632        ///
8633        /// This is a **required** field for requests.
8634        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8635            self.0.request.parent = v.into();
8636            self
8637        }
8638
8639        /// Sets the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8640        ///
8641        /// This is a **required** field for requests.
8642        pub fn set_document_template<T>(mut self, v: T) -> Self
8643        where
8644            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8645        {
8646            self.0.request.document_template = std::option::Option::Some(v.into());
8647            self
8648        }
8649
8650        /// Sets or clears the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8651        ///
8652        /// This is a **required** field for requests.
8653        pub fn set_or_clear_document_template<T>(mut self, v: std::option::Option<T>) -> Self
8654        where
8655            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8656        {
8657            self.0.request.document_template = v.map(|x| x.into());
8658            self
8659        }
8660
8661        /// Sets the value of [import_gcs_custom_metadata][crate::model::ImportDocumentsRequest::import_gcs_custom_metadata].
8662        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
8663            self.0.request.import_gcs_custom_metadata = v.into();
8664            self
8665        }
8666
8667        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source].
8668        ///
8669        /// Note that all the setters affecting `source` are
8670        /// mutually exclusive.
8671        pub fn set_source<T: Into<Option<crate::model::import_documents_request::Source>>>(
8672            mut self,
8673            v: T,
8674        ) -> Self {
8675            self.0.request.source = v.into();
8676            self
8677        }
8678
8679        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source]
8680        /// to hold a `GcsSource`.
8681        ///
8682        /// Note that all the setters affecting `source` are
8683        /// mutually exclusive.
8684        pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSources>>>(
8685            mut self,
8686            v: T,
8687        ) -> Self {
8688            self.0.request = self.0.request.set_gcs_source(v);
8689            self
8690        }
8691    }
8692
8693    #[doc(hidden)]
8694    impl gax::options::internal::RequestBuilder for ImportDocuments {
8695        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8696            &mut self.0.options
8697        }
8698    }
8699
8700    /// The request builder for [Documents::delete_document][crate::client::Documents::delete_document] calls.
8701    ///
8702    /// # Example
8703    /// ```
8704    /// # use google_cloud_dialogflow_v2::builder::documents::DeleteDocument;
8705    /// # async fn sample() -> gax::Result<()> {
8706    /// use lro::Poller;
8707    ///
8708    /// let builder = prepare_request_builder();
8709    /// let response = builder.poller().until_done().await?;
8710    /// # Ok(()) }
8711    ///
8712    /// fn prepare_request_builder() -> DeleteDocument {
8713    ///   # panic!();
8714    ///   // ... details omitted ...
8715    /// }
8716    /// ```
8717    #[derive(Clone, Debug)]
8718    pub struct DeleteDocument(RequestBuilder<crate::model::DeleteDocumentRequest>);
8719
8720    impl DeleteDocument {
8721        pub(crate) fn new(
8722            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8723        ) -> Self {
8724            Self(RequestBuilder::new(stub))
8725        }
8726
8727        /// Sets the full request, replacing any prior values.
8728        pub fn with_request<V: Into<crate::model::DeleteDocumentRequest>>(mut self, v: V) -> Self {
8729            self.0.request = v.into();
8730            self
8731        }
8732
8733        /// Sets all the options, replacing any prior values.
8734        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8735            self.0.options = v.into();
8736            self
8737        }
8738
8739        /// Sends the request.
8740        ///
8741        /// # Long running operations
8742        ///
8743        /// This starts, but does not poll, a longrunning operation. More information
8744        /// on [delete_document][crate::client::Documents::delete_document].
8745        pub async fn send(self) -> Result<longrunning::model::Operation> {
8746            (*self.0.stub)
8747                .delete_document(self.0.request, self.0.options)
8748                .await
8749                .map(gax::response::Response::into_body)
8750        }
8751
8752        /// Creates a [Poller][lro::Poller] to work with `delete_document`.
8753        pub fn poller(self) -> impl lro::Poller<(), crate::model::KnowledgeOperationMetadata> {
8754            type Operation =
8755                lro::internal::Operation<wkt::Empty, crate::model::KnowledgeOperationMetadata>;
8756            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8757            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8758
8759            let stub = self.0.stub.clone();
8760            let mut options = self.0.options.clone();
8761            options.set_retry_policy(gax::retry_policy::NeverRetry);
8762            let query = move |name| {
8763                let stub = stub.clone();
8764                let options = options.clone();
8765                async {
8766                    let op = GetOperation::new(stub)
8767                        .set_name(name)
8768                        .with_options(options)
8769                        .send()
8770                        .await?;
8771                    Ok(Operation::new(op))
8772                }
8773            };
8774
8775            let start = move || async {
8776                let op = self.send().await?;
8777                Ok(Operation::new(op))
8778            };
8779
8780            lro::internal::new_unit_response_poller(
8781                polling_error_policy,
8782                polling_backoff_policy,
8783                start,
8784                query,
8785            )
8786        }
8787
8788        /// Sets the value of [name][crate::model::DeleteDocumentRequest::name].
8789        ///
8790        /// This is a **required** field for requests.
8791        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8792            self.0.request.name = v.into();
8793            self
8794        }
8795    }
8796
8797    #[doc(hidden)]
8798    impl gax::options::internal::RequestBuilder for DeleteDocument {
8799        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8800            &mut self.0.options
8801        }
8802    }
8803
8804    /// The request builder for [Documents::update_document][crate::client::Documents::update_document] calls.
8805    ///
8806    /// # Example
8807    /// ```
8808    /// # use google_cloud_dialogflow_v2::builder::documents::UpdateDocument;
8809    /// # async fn sample() -> gax::Result<()> {
8810    /// use lro::Poller;
8811    ///
8812    /// let builder = prepare_request_builder();
8813    /// let response = builder.poller().until_done().await?;
8814    /// # Ok(()) }
8815    ///
8816    /// fn prepare_request_builder() -> UpdateDocument {
8817    ///   # panic!();
8818    ///   // ... details omitted ...
8819    /// }
8820    /// ```
8821    #[derive(Clone, Debug)]
8822    pub struct UpdateDocument(RequestBuilder<crate::model::UpdateDocumentRequest>);
8823
8824    impl UpdateDocument {
8825        pub(crate) fn new(
8826            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8827        ) -> Self {
8828            Self(RequestBuilder::new(stub))
8829        }
8830
8831        /// Sets the full request, replacing any prior values.
8832        pub fn with_request<V: Into<crate::model::UpdateDocumentRequest>>(mut self, v: V) -> Self {
8833            self.0.request = v.into();
8834            self
8835        }
8836
8837        /// Sets all the options, replacing any prior values.
8838        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8839            self.0.options = v.into();
8840            self
8841        }
8842
8843        /// Sends the request.
8844        ///
8845        /// # Long running operations
8846        ///
8847        /// This starts, but does not poll, a longrunning operation. More information
8848        /// on [update_document][crate::client::Documents::update_document].
8849        pub async fn send(self) -> Result<longrunning::model::Operation> {
8850            (*self.0.stub)
8851                .update_document(self.0.request, self.0.options)
8852                .await
8853                .map(gax::response::Response::into_body)
8854        }
8855
8856        /// Creates a [Poller][lro::Poller] to work with `update_document`.
8857        pub fn poller(
8858            self,
8859        ) -> impl lro::Poller<crate::model::Document, crate::model::KnowledgeOperationMetadata>
8860        {
8861            type Operation = lro::internal::Operation<
8862                crate::model::Document,
8863                crate::model::KnowledgeOperationMetadata,
8864            >;
8865            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8866            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8867
8868            let stub = self.0.stub.clone();
8869            let mut options = self.0.options.clone();
8870            options.set_retry_policy(gax::retry_policy::NeverRetry);
8871            let query = move |name| {
8872                let stub = stub.clone();
8873                let options = options.clone();
8874                async {
8875                    let op = GetOperation::new(stub)
8876                        .set_name(name)
8877                        .with_options(options)
8878                        .send()
8879                        .await?;
8880                    Ok(Operation::new(op))
8881                }
8882            };
8883
8884            let start = move || async {
8885                let op = self.send().await?;
8886                Ok(Operation::new(op))
8887            };
8888
8889            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8890        }
8891
8892        /// Sets the value of [document][crate::model::UpdateDocumentRequest::document].
8893        ///
8894        /// This is a **required** field for requests.
8895        pub fn set_document<T>(mut self, v: T) -> Self
8896        where
8897            T: std::convert::Into<crate::model::Document>,
8898        {
8899            self.0.request.document = std::option::Option::Some(v.into());
8900            self
8901        }
8902
8903        /// Sets or clears the value of [document][crate::model::UpdateDocumentRequest::document].
8904        ///
8905        /// This is a **required** field for requests.
8906        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
8907        where
8908            T: std::convert::Into<crate::model::Document>,
8909        {
8910            self.0.request.document = v.map(|x| x.into());
8911            self
8912        }
8913
8914        /// Sets the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
8915        pub fn set_update_mask<T>(mut self, v: T) -> Self
8916        where
8917            T: std::convert::Into<wkt::FieldMask>,
8918        {
8919            self.0.request.update_mask = std::option::Option::Some(v.into());
8920            self
8921        }
8922
8923        /// Sets or clears the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
8924        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8925        where
8926            T: std::convert::Into<wkt::FieldMask>,
8927        {
8928            self.0.request.update_mask = v.map(|x| x.into());
8929            self
8930        }
8931    }
8932
8933    #[doc(hidden)]
8934    impl gax::options::internal::RequestBuilder for UpdateDocument {
8935        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8936            &mut self.0.options
8937        }
8938    }
8939
8940    /// The request builder for [Documents::reload_document][crate::client::Documents::reload_document] calls.
8941    ///
8942    /// # Example
8943    /// ```
8944    /// # use google_cloud_dialogflow_v2::builder::documents::ReloadDocument;
8945    /// # async fn sample() -> gax::Result<()> {
8946    /// use lro::Poller;
8947    ///
8948    /// let builder = prepare_request_builder();
8949    /// let response = builder.poller().until_done().await?;
8950    /// # Ok(()) }
8951    ///
8952    /// fn prepare_request_builder() -> ReloadDocument {
8953    ///   # panic!();
8954    ///   // ... details omitted ...
8955    /// }
8956    /// ```
8957    #[derive(Clone, Debug)]
8958    pub struct ReloadDocument(RequestBuilder<crate::model::ReloadDocumentRequest>);
8959
8960    impl ReloadDocument {
8961        pub(crate) fn new(
8962            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8963        ) -> Self {
8964            Self(RequestBuilder::new(stub))
8965        }
8966
8967        /// Sets the full request, replacing any prior values.
8968        pub fn with_request<V: Into<crate::model::ReloadDocumentRequest>>(mut self, v: V) -> Self {
8969            self.0.request = v.into();
8970            self
8971        }
8972
8973        /// Sets all the options, replacing any prior values.
8974        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8975            self.0.options = v.into();
8976            self
8977        }
8978
8979        /// Sends the request.
8980        ///
8981        /// # Long running operations
8982        ///
8983        /// This starts, but does not poll, a longrunning operation. More information
8984        /// on [reload_document][crate::client::Documents::reload_document].
8985        pub async fn send(self) -> Result<longrunning::model::Operation> {
8986            (*self.0.stub)
8987                .reload_document(self.0.request, self.0.options)
8988                .await
8989                .map(gax::response::Response::into_body)
8990        }
8991
8992        /// Creates a [Poller][lro::Poller] to work with `reload_document`.
8993        pub fn poller(
8994            self,
8995        ) -> impl lro::Poller<crate::model::Document, crate::model::KnowledgeOperationMetadata>
8996        {
8997            type Operation = lro::internal::Operation<
8998                crate::model::Document,
8999                crate::model::KnowledgeOperationMetadata,
9000            >;
9001            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9002            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9003
9004            let stub = self.0.stub.clone();
9005            let mut options = self.0.options.clone();
9006            options.set_retry_policy(gax::retry_policy::NeverRetry);
9007            let query = move |name| {
9008                let stub = stub.clone();
9009                let options = options.clone();
9010                async {
9011                    let op = GetOperation::new(stub)
9012                        .set_name(name)
9013                        .with_options(options)
9014                        .send()
9015                        .await?;
9016                    Ok(Operation::new(op))
9017                }
9018            };
9019
9020            let start = move || async {
9021                let op = self.send().await?;
9022                Ok(Operation::new(op))
9023            };
9024
9025            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9026        }
9027
9028        /// Sets the value of [name][crate::model::ReloadDocumentRequest::name].
9029        ///
9030        /// This is a **required** field for requests.
9031        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9032            self.0.request.name = v.into();
9033            self
9034        }
9035
9036        /// Sets the value of [import_gcs_custom_metadata][crate::model::ReloadDocumentRequest::import_gcs_custom_metadata].
9037        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
9038            self.0.request.import_gcs_custom_metadata = v.into();
9039            self
9040        }
9041
9042        /// Sets the value of [smart_messaging_partial_update][crate::model::ReloadDocumentRequest::smart_messaging_partial_update].
9043        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9044            self.0.request.smart_messaging_partial_update = v.into();
9045            self
9046        }
9047
9048        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source].
9049        ///
9050        /// Note that all the setters affecting `source` are
9051        /// mutually exclusive.
9052        pub fn set_source<T: Into<Option<crate::model::reload_document_request::Source>>>(
9053            mut self,
9054            v: T,
9055        ) -> Self {
9056            self.0.request.source = v.into();
9057            self
9058        }
9059
9060        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source]
9061        /// to hold a `ContentUri`.
9062        ///
9063        /// Note that all the setters affecting `source` are
9064        /// mutually exclusive.
9065        pub fn set_content_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9066            self.0.request = self.0.request.set_content_uri(v);
9067            self
9068        }
9069    }
9070
9071    #[doc(hidden)]
9072    impl gax::options::internal::RequestBuilder for ReloadDocument {
9073        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9074            &mut self.0.options
9075        }
9076    }
9077
9078    /// The request builder for [Documents::export_document][crate::client::Documents::export_document] calls.
9079    ///
9080    /// # Example
9081    /// ```
9082    /// # use google_cloud_dialogflow_v2::builder::documents::ExportDocument;
9083    /// # async fn sample() -> gax::Result<()> {
9084    /// use lro::Poller;
9085    ///
9086    /// let builder = prepare_request_builder();
9087    /// let response = builder.poller().until_done().await?;
9088    /// # Ok(()) }
9089    ///
9090    /// fn prepare_request_builder() -> ExportDocument {
9091    ///   # panic!();
9092    ///   // ... details omitted ...
9093    /// }
9094    /// ```
9095    #[derive(Clone, Debug)]
9096    pub struct ExportDocument(RequestBuilder<crate::model::ExportDocumentRequest>);
9097
9098    impl ExportDocument {
9099        pub(crate) fn new(
9100            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9101        ) -> Self {
9102            Self(RequestBuilder::new(stub))
9103        }
9104
9105        /// Sets the full request, replacing any prior values.
9106        pub fn with_request<V: Into<crate::model::ExportDocumentRequest>>(mut self, v: V) -> Self {
9107            self.0.request = v.into();
9108            self
9109        }
9110
9111        /// Sets all the options, replacing any prior values.
9112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9113            self.0.options = v.into();
9114            self
9115        }
9116
9117        /// Sends the request.
9118        ///
9119        /// # Long running operations
9120        ///
9121        /// This starts, but does not poll, a longrunning operation. More information
9122        /// on [export_document][crate::client::Documents::export_document].
9123        pub async fn send(self) -> Result<longrunning::model::Operation> {
9124            (*self.0.stub)
9125                .export_document(self.0.request, self.0.options)
9126                .await
9127                .map(gax::response::Response::into_body)
9128        }
9129
9130        /// Creates a [Poller][lro::Poller] to work with `export_document`.
9131        pub fn poller(
9132            self,
9133        ) -> impl lro::Poller<crate::model::Document, crate::model::KnowledgeOperationMetadata>
9134        {
9135            type Operation = lro::internal::Operation<
9136                crate::model::Document,
9137                crate::model::KnowledgeOperationMetadata,
9138            >;
9139            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9140            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9141
9142            let stub = self.0.stub.clone();
9143            let mut options = self.0.options.clone();
9144            options.set_retry_policy(gax::retry_policy::NeverRetry);
9145            let query = move |name| {
9146                let stub = stub.clone();
9147                let options = options.clone();
9148                async {
9149                    let op = GetOperation::new(stub)
9150                        .set_name(name)
9151                        .with_options(options)
9152                        .send()
9153                        .await?;
9154                    Ok(Operation::new(op))
9155                }
9156            };
9157
9158            let start = move || async {
9159                let op = self.send().await?;
9160                Ok(Operation::new(op))
9161            };
9162
9163            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9164        }
9165
9166        /// Sets the value of [name][crate::model::ExportDocumentRequest::name].
9167        ///
9168        /// This is a **required** field for requests.
9169        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9170            self.0.request.name = v.into();
9171            self
9172        }
9173
9174        /// Sets the value of [export_full_content][crate::model::ExportDocumentRequest::export_full_content].
9175        pub fn set_export_full_content<T: Into<bool>>(mut self, v: T) -> Self {
9176            self.0.request.export_full_content = v.into();
9177            self
9178        }
9179
9180        /// Sets the value of [smart_messaging_partial_update][crate::model::ExportDocumentRequest::smart_messaging_partial_update].
9181        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9182            self.0.request.smart_messaging_partial_update = v.into();
9183            self
9184        }
9185
9186        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination].
9187        ///
9188        /// Note that all the setters affecting `destination` are
9189        /// mutually exclusive.
9190        pub fn set_destination<
9191            T: Into<Option<crate::model::export_document_request::Destination>>,
9192        >(
9193            mut self,
9194            v: T,
9195        ) -> Self {
9196            self.0.request.destination = v.into();
9197            self
9198        }
9199
9200        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination]
9201        /// to hold a `GcsDestination`.
9202        ///
9203        /// Note that all the setters affecting `destination` are
9204        /// mutually exclusive.
9205        pub fn set_gcs_destination<
9206            T: std::convert::Into<std::boxed::Box<crate::model::GcsDestination>>,
9207        >(
9208            mut self,
9209            v: T,
9210        ) -> Self {
9211            self.0.request = self.0.request.set_gcs_destination(v);
9212            self
9213        }
9214    }
9215
9216    #[doc(hidden)]
9217    impl gax::options::internal::RequestBuilder for ExportDocument {
9218        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9219            &mut self.0.options
9220        }
9221    }
9222
9223    /// The request builder for [Documents::list_locations][crate::client::Documents::list_locations] calls.
9224    ///
9225    /// # Example
9226    /// ```
9227    /// # use google_cloud_dialogflow_v2::builder::documents::ListLocations;
9228    /// # async fn sample() -> gax::Result<()> {
9229    /// use gax::paginator::ItemPaginator;
9230    ///
9231    /// let builder = prepare_request_builder();
9232    /// let mut items = builder.by_item();
9233    /// while let Some(result) = items.next().await {
9234    ///   let item = result?;
9235    /// }
9236    /// # Ok(()) }
9237    ///
9238    /// fn prepare_request_builder() -> ListLocations {
9239    ///   # panic!();
9240    ///   // ... details omitted ...
9241    /// }
9242    /// ```
9243    #[derive(Clone, Debug)]
9244    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9245
9246    impl ListLocations {
9247        pub(crate) fn new(
9248            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9249        ) -> Self {
9250            Self(RequestBuilder::new(stub))
9251        }
9252
9253        /// Sets the full request, replacing any prior values.
9254        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9255            mut self,
9256            v: V,
9257        ) -> Self {
9258            self.0.request = v.into();
9259            self
9260        }
9261
9262        /// Sets all the options, replacing any prior values.
9263        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9264            self.0.options = v.into();
9265            self
9266        }
9267
9268        /// Sends the request.
9269        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9270            (*self.0.stub)
9271                .list_locations(self.0.request, self.0.options)
9272                .await
9273                .map(gax::response::Response::into_body)
9274        }
9275
9276        /// Streams each page in the collection.
9277        pub fn by_page(
9278            self,
9279        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9280        {
9281            use std::clone::Clone;
9282            let token = self.0.request.page_token.clone();
9283            let execute = move |token: String| {
9284                let mut builder = self.clone();
9285                builder.0.request = builder.0.request.set_page_token(token);
9286                builder.send()
9287            };
9288            gax::paginator::internal::new_paginator(token, execute)
9289        }
9290
9291        /// Streams each item in the collection.
9292        pub fn by_item(
9293            self,
9294        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9295        {
9296            use gax::paginator::Paginator;
9297            self.by_page().items()
9298        }
9299
9300        /// Sets the value of [name][location::model::ListLocationsRequest::name].
9301        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9302            self.0.request.name = v.into();
9303            self
9304        }
9305
9306        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
9307        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9308            self.0.request.filter = v.into();
9309            self
9310        }
9311
9312        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
9313        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9314            self.0.request.page_size = v.into();
9315            self
9316        }
9317
9318        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
9319        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9320            self.0.request.page_token = v.into();
9321            self
9322        }
9323    }
9324
9325    #[doc(hidden)]
9326    impl gax::options::internal::RequestBuilder for ListLocations {
9327        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9328            &mut self.0.options
9329        }
9330    }
9331
9332    /// The request builder for [Documents::get_location][crate::client::Documents::get_location] calls.
9333    ///
9334    /// # Example
9335    /// ```
9336    /// # use google_cloud_dialogflow_v2::builder::documents::GetLocation;
9337    /// # async fn sample() -> gax::Result<()> {
9338    ///
9339    /// let builder = prepare_request_builder();
9340    /// let response = builder.send().await?;
9341    /// # Ok(()) }
9342    ///
9343    /// fn prepare_request_builder() -> GetLocation {
9344    ///   # panic!();
9345    ///   // ... details omitted ...
9346    /// }
9347    /// ```
9348    #[derive(Clone, Debug)]
9349    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
9350
9351    impl GetLocation {
9352        pub(crate) fn new(
9353            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9354        ) -> Self {
9355            Self(RequestBuilder::new(stub))
9356        }
9357
9358        /// Sets the full request, replacing any prior values.
9359        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
9360            self.0.request = v.into();
9361            self
9362        }
9363
9364        /// Sets all the options, replacing any prior values.
9365        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9366            self.0.options = v.into();
9367            self
9368        }
9369
9370        /// Sends the request.
9371        pub async fn send(self) -> Result<location::model::Location> {
9372            (*self.0.stub)
9373                .get_location(self.0.request, self.0.options)
9374                .await
9375                .map(gax::response::Response::into_body)
9376        }
9377
9378        /// Sets the value of [name][location::model::GetLocationRequest::name].
9379        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9380            self.0.request.name = v.into();
9381            self
9382        }
9383    }
9384
9385    #[doc(hidden)]
9386    impl gax::options::internal::RequestBuilder for GetLocation {
9387        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9388            &mut self.0.options
9389        }
9390    }
9391
9392    /// The request builder for [Documents::list_operations][crate::client::Documents::list_operations] calls.
9393    ///
9394    /// # Example
9395    /// ```
9396    /// # use google_cloud_dialogflow_v2::builder::documents::ListOperations;
9397    /// # async fn sample() -> gax::Result<()> {
9398    /// use gax::paginator::ItemPaginator;
9399    ///
9400    /// let builder = prepare_request_builder();
9401    /// let mut items = builder.by_item();
9402    /// while let Some(result) = items.next().await {
9403    ///   let item = result?;
9404    /// }
9405    /// # Ok(()) }
9406    ///
9407    /// fn prepare_request_builder() -> ListOperations {
9408    ///   # panic!();
9409    ///   // ... details omitted ...
9410    /// }
9411    /// ```
9412    #[derive(Clone, Debug)]
9413    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
9414
9415    impl ListOperations {
9416        pub(crate) fn new(
9417            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9418        ) -> Self {
9419            Self(RequestBuilder::new(stub))
9420        }
9421
9422        /// Sets the full request, replacing any prior values.
9423        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
9424            mut self,
9425            v: V,
9426        ) -> Self {
9427            self.0.request = v.into();
9428            self
9429        }
9430
9431        /// Sets all the options, replacing any prior values.
9432        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9433            self.0.options = v.into();
9434            self
9435        }
9436
9437        /// Sends the request.
9438        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
9439            (*self.0.stub)
9440                .list_operations(self.0.request, self.0.options)
9441                .await
9442                .map(gax::response::Response::into_body)
9443        }
9444
9445        /// Streams each page in the collection.
9446        pub fn by_page(
9447            self,
9448        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
9449        {
9450            use std::clone::Clone;
9451            let token = self.0.request.page_token.clone();
9452            let execute = move |token: String| {
9453                let mut builder = self.clone();
9454                builder.0.request = builder.0.request.set_page_token(token);
9455                builder.send()
9456            };
9457            gax::paginator::internal::new_paginator(token, execute)
9458        }
9459
9460        /// Streams each item in the collection.
9461        pub fn by_item(
9462            self,
9463        ) -> impl gax::paginator::ItemPaginator<
9464            longrunning::model::ListOperationsResponse,
9465            gax::error::Error,
9466        > {
9467            use gax::paginator::Paginator;
9468            self.by_page().items()
9469        }
9470
9471        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
9472        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9473            self.0.request.name = v.into();
9474            self
9475        }
9476
9477        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
9478        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9479            self.0.request.filter = v.into();
9480            self
9481        }
9482
9483        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
9484        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9485            self.0.request.page_size = v.into();
9486            self
9487        }
9488
9489        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
9490        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9491            self.0.request.page_token = v.into();
9492            self
9493        }
9494
9495        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
9496        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9497            self.0.request.return_partial_success = v.into();
9498            self
9499        }
9500    }
9501
9502    #[doc(hidden)]
9503    impl gax::options::internal::RequestBuilder for ListOperations {
9504        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9505            &mut self.0.options
9506        }
9507    }
9508
9509    /// The request builder for [Documents::get_operation][crate::client::Documents::get_operation] calls.
9510    ///
9511    /// # Example
9512    /// ```
9513    /// # use google_cloud_dialogflow_v2::builder::documents::GetOperation;
9514    /// # async fn sample() -> gax::Result<()> {
9515    ///
9516    /// let builder = prepare_request_builder();
9517    /// let response = builder.send().await?;
9518    /// # Ok(()) }
9519    ///
9520    /// fn prepare_request_builder() -> GetOperation {
9521    ///   # panic!();
9522    ///   // ... details omitted ...
9523    /// }
9524    /// ```
9525    #[derive(Clone, Debug)]
9526    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
9527
9528    impl GetOperation {
9529        pub(crate) fn new(
9530            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9531        ) -> Self {
9532            Self(RequestBuilder::new(stub))
9533        }
9534
9535        /// Sets the full request, replacing any prior values.
9536        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
9537            mut self,
9538            v: V,
9539        ) -> Self {
9540            self.0.request = v.into();
9541            self
9542        }
9543
9544        /// Sets all the options, replacing any prior values.
9545        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9546            self.0.options = v.into();
9547            self
9548        }
9549
9550        /// Sends the request.
9551        pub async fn send(self) -> Result<longrunning::model::Operation> {
9552            (*self.0.stub)
9553                .get_operation(self.0.request, self.0.options)
9554                .await
9555                .map(gax::response::Response::into_body)
9556        }
9557
9558        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
9559        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9560            self.0.request.name = v.into();
9561            self
9562        }
9563    }
9564
9565    #[doc(hidden)]
9566    impl gax::options::internal::RequestBuilder for GetOperation {
9567        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9568            &mut self.0.options
9569        }
9570    }
9571
9572    /// The request builder for [Documents::cancel_operation][crate::client::Documents::cancel_operation] calls.
9573    ///
9574    /// # Example
9575    /// ```
9576    /// # use google_cloud_dialogflow_v2::builder::documents::CancelOperation;
9577    /// # async fn sample() -> gax::Result<()> {
9578    ///
9579    /// let builder = prepare_request_builder();
9580    /// let response = builder.send().await?;
9581    /// # Ok(()) }
9582    ///
9583    /// fn prepare_request_builder() -> CancelOperation {
9584    ///   # panic!();
9585    ///   // ... details omitted ...
9586    /// }
9587    /// ```
9588    #[derive(Clone, Debug)]
9589    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
9590
9591    impl CancelOperation {
9592        pub(crate) fn new(
9593            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9594        ) -> Self {
9595            Self(RequestBuilder::new(stub))
9596        }
9597
9598        /// Sets the full request, replacing any prior values.
9599        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
9600            mut self,
9601            v: V,
9602        ) -> Self {
9603            self.0.request = v.into();
9604            self
9605        }
9606
9607        /// Sets all the options, replacing any prior values.
9608        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9609            self.0.options = v.into();
9610            self
9611        }
9612
9613        /// Sends the request.
9614        pub async fn send(self) -> Result<()> {
9615            (*self.0.stub)
9616                .cancel_operation(self.0.request, self.0.options)
9617                .await
9618                .map(gax::response::Response::into_body)
9619        }
9620
9621        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
9622        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9623            self.0.request.name = v.into();
9624            self
9625        }
9626    }
9627
9628    #[doc(hidden)]
9629    impl gax::options::internal::RequestBuilder for CancelOperation {
9630        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9631            &mut self.0.options
9632        }
9633    }
9634}
9635
9636#[cfg(feature = "encryption-spec-service")]
9637#[cfg_attr(docsrs, doc(cfg(feature = "encryption-spec-service")))]
9638pub mod encryption_spec_service {
9639    use crate::Result;
9640
9641    /// A builder for [EncryptionSpecService][crate::client::EncryptionSpecService].
9642    ///
9643    /// ```
9644    /// # async fn sample() -> gax::client_builder::Result<()> {
9645    /// # use google_cloud_dialogflow_v2::*;
9646    /// # use builder::encryption_spec_service::ClientBuilder;
9647    /// # use client::EncryptionSpecService;
9648    /// let builder : ClientBuilder = EncryptionSpecService::builder();
9649    /// let client = builder
9650    ///     .with_endpoint("https://dialogflow.googleapis.com")
9651    ///     .build().await?;
9652    /// # Ok(()) }
9653    /// ```
9654    pub type ClientBuilder =
9655        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9656
9657    pub(crate) mod client {
9658        use super::super::super::client::EncryptionSpecService;
9659        pub struct Factory;
9660        impl gax::client_builder::internal::ClientFactory for Factory {
9661            type Client = EncryptionSpecService;
9662            type Credentials = gaxi::options::Credentials;
9663            async fn build(
9664                self,
9665                config: gaxi::options::ClientConfig,
9666            ) -> gax::client_builder::Result<Self::Client> {
9667                Self::Client::new(config).await
9668            }
9669        }
9670    }
9671
9672    /// Common implementation for [crate::client::EncryptionSpecService] request builders.
9673    #[derive(Clone, Debug)]
9674    pub(crate) struct RequestBuilder<R: std::default::Default> {
9675        stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9676        request: R,
9677        options: gax::options::RequestOptions,
9678    }
9679
9680    impl<R> RequestBuilder<R>
9681    where
9682        R: std::default::Default,
9683    {
9684        pub(crate) fn new(
9685            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9686        ) -> Self {
9687            Self {
9688                stub,
9689                request: R::default(),
9690                options: gax::options::RequestOptions::default(),
9691            }
9692        }
9693    }
9694
9695    /// The request builder for [EncryptionSpecService::get_encryption_spec][crate::client::EncryptionSpecService::get_encryption_spec] calls.
9696    ///
9697    /// # Example
9698    /// ```
9699    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetEncryptionSpec;
9700    /// # async fn sample() -> gax::Result<()> {
9701    ///
9702    /// let builder = prepare_request_builder();
9703    /// let response = builder.send().await?;
9704    /// # Ok(()) }
9705    ///
9706    /// fn prepare_request_builder() -> GetEncryptionSpec {
9707    ///   # panic!();
9708    ///   // ... details omitted ...
9709    /// }
9710    /// ```
9711    #[derive(Clone, Debug)]
9712    pub struct GetEncryptionSpec(RequestBuilder<crate::model::GetEncryptionSpecRequest>);
9713
9714    impl GetEncryptionSpec {
9715        pub(crate) fn new(
9716            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9717        ) -> Self {
9718            Self(RequestBuilder::new(stub))
9719        }
9720
9721        /// Sets the full request, replacing any prior values.
9722        pub fn with_request<V: Into<crate::model::GetEncryptionSpecRequest>>(
9723            mut self,
9724            v: V,
9725        ) -> Self {
9726            self.0.request = v.into();
9727            self
9728        }
9729
9730        /// Sets all the options, replacing any prior values.
9731        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9732            self.0.options = v.into();
9733            self
9734        }
9735
9736        /// Sends the request.
9737        pub async fn send(self) -> Result<crate::model::EncryptionSpec> {
9738            (*self.0.stub)
9739                .get_encryption_spec(self.0.request, self.0.options)
9740                .await
9741                .map(gax::response::Response::into_body)
9742        }
9743
9744        /// Sets the value of [name][crate::model::GetEncryptionSpecRequest::name].
9745        ///
9746        /// This is a **required** field for requests.
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 gax::options::internal::RequestBuilder for GetEncryptionSpec {
9755        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9756            &mut self.0.options
9757        }
9758    }
9759
9760    /// The request builder for [EncryptionSpecService::initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec] calls.
9761    ///
9762    /// # Example
9763    /// ```
9764    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::InitializeEncryptionSpec;
9765    /// # async fn sample() -> gax::Result<()> {
9766    /// use lro::Poller;
9767    ///
9768    /// let builder = prepare_request_builder();
9769    /// let response = builder.poller().until_done().await?;
9770    /// # Ok(()) }
9771    ///
9772    /// fn prepare_request_builder() -> InitializeEncryptionSpec {
9773    ///   # panic!();
9774    ///   // ... details omitted ...
9775    /// }
9776    /// ```
9777    #[derive(Clone, Debug)]
9778    pub struct InitializeEncryptionSpec(
9779        RequestBuilder<crate::model::InitializeEncryptionSpecRequest>,
9780    );
9781
9782    impl InitializeEncryptionSpec {
9783        pub(crate) fn new(
9784            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9785        ) -> Self {
9786            Self(RequestBuilder::new(stub))
9787        }
9788
9789        /// Sets the full request, replacing any prior values.
9790        pub fn with_request<V: Into<crate::model::InitializeEncryptionSpecRequest>>(
9791            mut self,
9792            v: V,
9793        ) -> Self {
9794            self.0.request = v.into();
9795            self
9796        }
9797
9798        /// Sets all the options, replacing any prior values.
9799        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9800            self.0.options = v.into();
9801            self
9802        }
9803
9804        /// Sends the request.
9805        ///
9806        /// # Long running operations
9807        ///
9808        /// This starts, but does not poll, a longrunning operation. More information
9809        /// on [initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec].
9810        pub async fn send(self) -> Result<longrunning::model::Operation> {
9811            (*self.0.stub)
9812                .initialize_encryption_spec(self.0.request, self.0.options)
9813                .await
9814                .map(gax::response::Response::into_body)
9815        }
9816
9817        /// Creates a [Poller][lro::Poller] to work with `initialize_encryption_spec`.
9818        pub fn poller(
9819            self,
9820        ) -> impl lro::Poller<
9821            crate::model::InitializeEncryptionSpecResponse,
9822            crate::model::InitializeEncryptionSpecMetadata,
9823        > {
9824            type Operation = lro::internal::Operation<
9825                crate::model::InitializeEncryptionSpecResponse,
9826                crate::model::InitializeEncryptionSpecMetadata,
9827            >;
9828            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9829            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9830
9831            let stub = self.0.stub.clone();
9832            let mut options = self.0.options.clone();
9833            options.set_retry_policy(gax::retry_policy::NeverRetry);
9834            let query = move |name| {
9835                let stub = stub.clone();
9836                let options = options.clone();
9837                async {
9838                    let op = GetOperation::new(stub)
9839                        .set_name(name)
9840                        .with_options(options)
9841                        .send()
9842                        .await?;
9843                    Ok(Operation::new(op))
9844                }
9845            };
9846
9847            let start = move || async {
9848                let op = self.send().await?;
9849                Ok(Operation::new(op))
9850            };
9851
9852            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9853        }
9854
9855        /// Sets the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
9856        ///
9857        /// This is a **required** field for requests.
9858        pub fn set_encryption_spec<T>(mut self, v: T) -> Self
9859        where
9860            T: std::convert::Into<crate::model::EncryptionSpec>,
9861        {
9862            self.0.request.encryption_spec = std::option::Option::Some(v.into());
9863            self
9864        }
9865
9866        /// Sets or clears the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
9867        ///
9868        /// This is a **required** field for requests.
9869        pub fn set_or_clear_encryption_spec<T>(mut self, v: std::option::Option<T>) -> Self
9870        where
9871            T: std::convert::Into<crate::model::EncryptionSpec>,
9872        {
9873            self.0.request.encryption_spec = v.map(|x| x.into());
9874            self
9875        }
9876    }
9877
9878    #[doc(hidden)]
9879    impl gax::options::internal::RequestBuilder for InitializeEncryptionSpec {
9880        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9881            &mut self.0.options
9882        }
9883    }
9884
9885    /// The request builder for [EncryptionSpecService::list_locations][crate::client::EncryptionSpecService::list_locations] calls.
9886    ///
9887    /// # Example
9888    /// ```
9889    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::ListLocations;
9890    /// # async fn sample() -> gax::Result<()> {
9891    /// use gax::paginator::ItemPaginator;
9892    ///
9893    /// let builder = prepare_request_builder();
9894    /// let mut items = builder.by_item();
9895    /// while let Some(result) = items.next().await {
9896    ///   let item = result?;
9897    /// }
9898    /// # Ok(()) }
9899    ///
9900    /// fn prepare_request_builder() -> ListLocations {
9901    ///   # panic!();
9902    ///   // ... details omitted ...
9903    /// }
9904    /// ```
9905    #[derive(Clone, Debug)]
9906    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9907
9908    impl ListLocations {
9909        pub(crate) fn new(
9910            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9911        ) -> Self {
9912            Self(RequestBuilder::new(stub))
9913        }
9914
9915        /// Sets the full request, replacing any prior values.
9916        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9917            mut self,
9918            v: V,
9919        ) -> Self {
9920            self.0.request = v.into();
9921            self
9922        }
9923
9924        /// Sets all the options, replacing any prior values.
9925        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9926            self.0.options = v.into();
9927            self
9928        }
9929
9930        /// Sends the request.
9931        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9932            (*self.0.stub)
9933                .list_locations(self.0.request, self.0.options)
9934                .await
9935                .map(gax::response::Response::into_body)
9936        }
9937
9938        /// Streams each page in the collection.
9939        pub fn by_page(
9940            self,
9941        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9942        {
9943            use std::clone::Clone;
9944            let token = self.0.request.page_token.clone();
9945            let execute = move |token: String| {
9946                let mut builder = self.clone();
9947                builder.0.request = builder.0.request.set_page_token(token);
9948                builder.send()
9949            };
9950            gax::paginator::internal::new_paginator(token, execute)
9951        }
9952
9953        /// Streams each item in the collection.
9954        pub fn by_item(
9955            self,
9956        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9957        {
9958            use gax::paginator::Paginator;
9959            self.by_page().items()
9960        }
9961
9962        /// Sets the value of [name][location::model::ListLocationsRequest::name].
9963        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9964            self.0.request.name = v.into();
9965            self
9966        }
9967
9968        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
9969        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9970            self.0.request.filter = v.into();
9971            self
9972        }
9973
9974        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
9975        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9976            self.0.request.page_size = v.into();
9977            self
9978        }
9979
9980        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
9981        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9982            self.0.request.page_token = v.into();
9983            self
9984        }
9985    }
9986
9987    #[doc(hidden)]
9988    impl gax::options::internal::RequestBuilder for ListLocations {
9989        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9990            &mut self.0.options
9991        }
9992    }
9993
9994    /// The request builder for [EncryptionSpecService::get_location][crate::client::EncryptionSpecService::get_location] calls.
9995    ///
9996    /// # Example
9997    /// ```
9998    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetLocation;
9999    /// # async fn sample() -> gax::Result<()> {
10000    ///
10001    /// let builder = prepare_request_builder();
10002    /// let response = builder.send().await?;
10003    /// # Ok(()) }
10004    ///
10005    /// fn prepare_request_builder() -> GetLocation {
10006    ///   # panic!();
10007    ///   // ... details omitted ...
10008    /// }
10009    /// ```
10010    #[derive(Clone, Debug)]
10011    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10012
10013    impl GetLocation {
10014        pub(crate) fn new(
10015            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10016        ) -> Self {
10017            Self(RequestBuilder::new(stub))
10018        }
10019
10020        /// Sets the full request, replacing any prior values.
10021        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10022            self.0.request = v.into();
10023            self
10024        }
10025
10026        /// Sets all the options, replacing any prior values.
10027        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10028            self.0.options = v.into();
10029            self
10030        }
10031
10032        /// Sends the request.
10033        pub async fn send(self) -> Result<location::model::Location> {
10034            (*self.0.stub)
10035                .get_location(self.0.request, self.0.options)
10036                .await
10037                .map(gax::response::Response::into_body)
10038        }
10039
10040        /// Sets the value of [name][location::model::GetLocationRequest::name].
10041        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10042            self.0.request.name = v.into();
10043            self
10044        }
10045    }
10046
10047    #[doc(hidden)]
10048    impl gax::options::internal::RequestBuilder for GetLocation {
10049        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10050            &mut self.0.options
10051        }
10052    }
10053
10054    /// The request builder for [EncryptionSpecService::list_operations][crate::client::EncryptionSpecService::list_operations] calls.
10055    ///
10056    /// # Example
10057    /// ```
10058    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::ListOperations;
10059    /// # async fn sample() -> gax::Result<()> {
10060    /// use gax::paginator::ItemPaginator;
10061    ///
10062    /// let builder = prepare_request_builder();
10063    /// let mut items = builder.by_item();
10064    /// while let Some(result) = items.next().await {
10065    ///   let item = result?;
10066    /// }
10067    /// # Ok(()) }
10068    ///
10069    /// fn prepare_request_builder() -> ListOperations {
10070    ///   # panic!();
10071    ///   // ... details omitted ...
10072    /// }
10073    /// ```
10074    #[derive(Clone, Debug)]
10075    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10076
10077    impl ListOperations {
10078        pub(crate) fn new(
10079            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10080        ) -> Self {
10081            Self(RequestBuilder::new(stub))
10082        }
10083
10084        /// Sets the full request, replacing any prior values.
10085        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10086            mut self,
10087            v: V,
10088        ) -> Self {
10089            self.0.request = v.into();
10090            self
10091        }
10092
10093        /// Sets all the options, replacing any prior values.
10094        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10095            self.0.options = v.into();
10096            self
10097        }
10098
10099        /// Sends the request.
10100        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10101            (*self.0.stub)
10102                .list_operations(self.0.request, self.0.options)
10103                .await
10104                .map(gax::response::Response::into_body)
10105        }
10106
10107        /// Streams each page in the collection.
10108        pub fn by_page(
10109            self,
10110        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10111        {
10112            use std::clone::Clone;
10113            let token = self.0.request.page_token.clone();
10114            let execute = move |token: String| {
10115                let mut builder = self.clone();
10116                builder.0.request = builder.0.request.set_page_token(token);
10117                builder.send()
10118            };
10119            gax::paginator::internal::new_paginator(token, execute)
10120        }
10121
10122        /// Streams each item in the collection.
10123        pub fn by_item(
10124            self,
10125        ) -> impl gax::paginator::ItemPaginator<
10126            longrunning::model::ListOperationsResponse,
10127            gax::error::Error,
10128        > {
10129            use gax::paginator::Paginator;
10130            self.by_page().items()
10131        }
10132
10133        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
10134        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10135            self.0.request.name = v.into();
10136            self
10137        }
10138
10139        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
10140        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10141            self.0.request.filter = v.into();
10142            self
10143        }
10144
10145        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
10146        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10147            self.0.request.page_size = v.into();
10148            self
10149        }
10150
10151        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
10152        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10153            self.0.request.page_token = v.into();
10154            self
10155        }
10156
10157        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
10158        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10159            self.0.request.return_partial_success = v.into();
10160            self
10161        }
10162    }
10163
10164    #[doc(hidden)]
10165    impl gax::options::internal::RequestBuilder for ListOperations {
10166        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10167            &mut self.0.options
10168        }
10169    }
10170
10171    /// The request builder for [EncryptionSpecService::get_operation][crate::client::EncryptionSpecService::get_operation] calls.
10172    ///
10173    /// # Example
10174    /// ```
10175    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::GetOperation;
10176    /// # async fn sample() -> gax::Result<()> {
10177    ///
10178    /// let builder = prepare_request_builder();
10179    /// let response = builder.send().await?;
10180    /// # Ok(()) }
10181    ///
10182    /// fn prepare_request_builder() -> GetOperation {
10183    ///   # panic!();
10184    ///   // ... details omitted ...
10185    /// }
10186    /// ```
10187    #[derive(Clone, Debug)]
10188    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
10189
10190    impl GetOperation {
10191        pub(crate) fn new(
10192            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10193        ) -> Self {
10194            Self(RequestBuilder::new(stub))
10195        }
10196
10197        /// Sets the full request, replacing any prior values.
10198        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
10199            mut self,
10200            v: V,
10201        ) -> Self {
10202            self.0.request = v.into();
10203            self
10204        }
10205
10206        /// Sets all the options, replacing any prior values.
10207        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10208            self.0.options = v.into();
10209            self
10210        }
10211
10212        /// Sends the request.
10213        pub async fn send(self) -> Result<longrunning::model::Operation> {
10214            (*self.0.stub)
10215                .get_operation(self.0.request, self.0.options)
10216                .await
10217                .map(gax::response::Response::into_body)
10218        }
10219
10220        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
10221        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10222            self.0.request.name = v.into();
10223            self
10224        }
10225    }
10226
10227    #[doc(hidden)]
10228    impl gax::options::internal::RequestBuilder for GetOperation {
10229        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10230            &mut self.0.options
10231        }
10232    }
10233
10234    /// The request builder for [EncryptionSpecService::cancel_operation][crate::client::EncryptionSpecService::cancel_operation] calls.
10235    ///
10236    /// # Example
10237    /// ```
10238    /// # use google_cloud_dialogflow_v2::builder::encryption_spec_service::CancelOperation;
10239    /// # async fn sample() -> gax::Result<()> {
10240    ///
10241    /// let builder = prepare_request_builder();
10242    /// let response = builder.send().await?;
10243    /// # Ok(()) }
10244    ///
10245    /// fn prepare_request_builder() -> CancelOperation {
10246    ///   # panic!();
10247    ///   // ... details omitted ...
10248    /// }
10249    /// ```
10250    #[derive(Clone, Debug)]
10251    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
10252
10253    impl CancelOperation {
10254        pub(crate) fn new(
10255            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10256        ) -> Self {
10257            Self(RequestBuilder::new(stub))
10258        }
10259
10260        /// Sets the full request, replacing any prior values.
10261        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
10262            mut self,
10263            v: V,
10264        ) -> Self {
10265            self.0.request = v.into();
10266            self
10267        }
10268
10269        /// Sets all the options, replacing any prior values.
10270        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10271            self.0.options = v.into();
10272            self
10273        }
10274
10275        /// Sends the request.
10276        pub async fn send(self) -> Result<()> {
10277            (*self.0.stub)
10278                .cancel_operation(self.0.request, self.0.options)
10279                .await
10280                .map(gax::response::Response::into_body)
10281        }
10282
10283        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
10284        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10285            self.0.request.name = v.into();
10286            self
10287        }
10288    }
10289
10290    #[doc(hidden)]
10291    impl gax::options::internal::RequestBuilder for CancelOperation {
10292        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10293            &mut self.0.options
10294        }
10295    }
10296}
10297
10298#[cfg(feature = "entity-types")]
10299#[cfg_attr(docsrs, doc(cfg(feature = "entity-types")))]
10300pub mod entity_types {
10301    use crate::Result;
10302
10303    /// A builder for [EntityTypes][crate::client::EntityTypes].
10304    ///
10305    /// ```
10306    /// # async fn sample() -> gax::client_builder::Result<()> {
10307    /// # use google_cloud_dialogflow_v2::*;
10308    /// # use builder::entity_types::ClientBuilder;
10309    /// # use client::EntityTypes;
10310    /// let builder : ClientBuilder = EntityTypes::builder();
10311    /// let client = builder
10312    ///     .with_endpoint("https://dialogflow.googleapis.com")
10313    ///     .build().await?;
10314    /// # Ok(()) }
10315    /// ```
10316    pub type ClientBuilder =
10317        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10318
10319    pub(crate) mod client {
10320        use super::super::super::client::EntityTypes;
10321        pub struct Factory;
10322        impl gax::client_builder::internal::ClientFactory for Factory {
10323            type Client = EntityTypes;
10324            type Credentials = gaxi::options::Credentials;
10325            async fn build(
10326                self,
10327                config: gaxi::options::ClientConfig,
10328            ) -> gax::client_builder::Result<Self::Client> {
10329                Self::Client::new(config).await
10330            }
10331        }
10332    }
10333
10334    /// Common implementation for [crate::client::EntityTypes] request builders.
10335    #[derive(Clone, Debug)]
10336    pub(crate) struct RequestBuilder<R: std::default::Default> {
10337        stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10338        request: R,
10339        options: gax::options::RequestOptions,
10340    }
10341
10342    impl<R> RequestBuilder<R>
10343    where
10344        R: std::default::Default,
10345    {
10346        pub(crate) fn new(
10347            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10348        ) -> Self {
10349            Self {
10350                stub,
10351                request: R::default(),
10352                options: gax::options::RequestOptions::default(),
10353            }
10354        }
10355    }
10356
10357    /// The request builder for [EntityTypes::list_entity_types][crate::client::EntityTypes::list_entity_types] calls.
10358    ///
10359    /// # Example
10360    /// ```
10361    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListEntityTypes;
10362    /// # async fn sample() -> gax::Result<()> {
10363    /// use gax::paginator::ItemPaginator;
10364    ///
10365    /// let builder = prepare_request_builder();
10366    /// let mut items = builder.by_item();
10367    /// while let Some(result) = items.next().await {
10368    ///   let item = result?;
10369    /// }
10370    /// # Ok(()) }
10371    ///
10372    /// fn prepare_request_builder() -> ListEntityTypes {
10373    ///   # panic!();
10374    ///   // ... details omitted ...
10375    /// }
10376    /// ```
10377    #[derive(Clone, Debug)]
10378    pub struct ListEntityTypes(RequestBuilder<crate::model::ListEntityTypesRequest>);
10379
10380    impl ListEntityTypes {
10381        pub(crate) fn new(
10382            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10383        ) -> Self {
10384            Self(RequestBuilder::new(stub))
10385        }
10386
10387        /// Sets the full request, replacing any prior values.
10388        pub fn with_request<V: Into<crate::model::ListEntityTypesRequest>>(mut self, v: V) -> Self {
10389            self.0.request = v.into();
10390            self
10391        }
10392
10393        /// Sets all the options, replacing any prior values.
10394        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10395            self.0.options = v.into();
10396            self
10397        }
10398
10399        /// Sends the request.
10400        pub async fn send(self) -> Result<crate::model::ListEntityTypesResponse> {
10401            (*self.0.stub)
10402                .list_entity_types(self.0.request, self.0.options)
10403                .await
10404                .map(gax::response::Response::into_body)
10405        }
10406
10407        /// Streams each page in the collection.
10408        pub fn by_page(
10409            self,
10410        ) -> impl gax::paginator::Paginator<crate::model::ListEntityTypesResponse, gax::error::Error>
10411        {
10412            use std::clone::Clone;
10413            let token = self.0.request.page_token.clone();
10414            let execute = move |token: String| {
10415                let mut builder = self.clone();
10416                builder.0.request = builder.0.request.set_page_token(token);
10417                builder.send()
10418            };
10419            gax::paginator::internal::new_paginator(token, execute)
10420        }
10421
10422        /// Streams each item in the collection.
10423        pub fn by_item(
10424            self,
10425        ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntityTypesResponse, gax::error::Error>
10426        {
10427            use gax::paginator::Paginator;
10428            self.by_page().items()
10429        }
10430
10431        /// Sets the value of [parent][crate::model::ListEntityTypesRequest::parent].
10432        ///
10433        /// This is a **required** field for requests.
10434        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10435            self.0.request.parent = v.into();
10436            self
10437        }
10438
10439        /// Sets the value of [language_code][crate::model::ListEntityTypesRequest::language_code].
10440        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10441            self.0.request.language_code = v.into();
10442            self
10443        }
10444
10445        /// Sets the value of [page_size][crate::model::ListEntityTypesRequest::page_size].
10446        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10447            self.0.request.page_size = v.into();
10448            self
10449        }
10450
10451        /// Sets the value of [page_token][crate::model::ListEntityTypesRequest::page_token].
10452        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10453            self.0.request.page_token = v.into();
10454            self
10455        }
10456    }
10457
10458    #[doc(hidden)]
10459    impl gax::options::internal::RequestBuilder for ListEntityTypes {
10460        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10461            &mut self.0.options
10462        }
10463    }
10464
10465    /// The request builder for [EntityTypes::get_entity_type][crate::client::EntityTypes::get_entity_type] calls.
10466    ///
10467    /// # Example
10468    /// ```
10469    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetEntityType;
10470    /// # async fn sample() -> gax::Result<()> {
10471    ///
10472    /// let builder = prepare_request_builder();
10473    /// let response = builder.send().await?;
10474    /// # Ok(()) }
10475    ///
10476    /// fn prepare_request_builder() -> GetEntityType {
10477    ///   # panic!();
10478    ///   // ... details omitted ...
10479    /// }
10480    /// ```
10481    #[derive(Clone, Debug)]
10482    pub struct GetEntityType(RequestBuilder<crate::model::GetEntityTypeRequest>);
10483
10484    impl GetEntityType {
10485        pub(crate) fn new(
10486            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10487        ) -> Self {
10488            Self(RequestBuilder::new(stub))
10489        }
10490
10491        /// Sets the full request, replacing any prior values.
10492        pub fn with_request<V: Into<crate::model::GetEntityTypeRequest>>(mut self, v: V) -> Self {
10493            self.0.request = v.into();
10494            self
10495        }
10496
10497        /// Sets all the options, replacing any prior values.
10498        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10499            self.0.options = v.into();
10500            self
10501        }
10502
10503        /// Sends the request.
10504        pub async fn send(self) -> Result<crate::model::EntityType> {
10505            (*self.0.stub)
10506                .get_entity_type(self.0.request, self.0.options)
10507                .await
10508                .map(gax::response::Response::into_body)
10509        }
10510
10511        /// Sets the value of [name][crate::model::GetEntityTypeRequest::name].
10512        ///
10513        /// This is a **required** field for requests.
10514        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10515            self.0.request.name = v.into();
10516            self
10517        }
10518
10519        /// Sets the value of [language_code][crate::model::GetEntityTypeRequest::language_code].
10520        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10521            self.0.request.language_code = v.into();
10522            self
10523        }
10524    }
10525
10526    #[doc(hidden)]
10527    impl gax::options::internal::RequestBuilder for GetEntityType {
10528        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10529            &mut self.0.options
10530        }
10531    }
10532
10533    /// The request builder for [EntityTypes::create_entity_type][crate::client::EntityTypes::create_entity_type] calls.
10534    ///
10535    /// # Example
10536    /// ```
10537    /// # use google_cloud_dialogflow_v2::builder::entity_types::CreateEntityType;
10538    /// # async fn sample() -> gax::Result<()> {
10539    ///
10540    /// let builder = prepare_request_builder();
10541    /// let response = builder.send().await?;
10542    /// # Ok(()) }
10543    ///
10544    /// fn prepare_request_builder() -> CreateEntityType {
10545    ///   # panic!();
10546    ///   // ... details omitted ...
10547    /// }
10548    /// ```
10549    #[derive(Clone, Debug)]
10550    pub struct CreateEntityType(RequestBuilder<crate::model::CreateEntityTypeRequest>);
10551
10552    impl CreateEntityType {
10553        pub(crate) fn new(
10554            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10555        ) -> Self {
10556            Self(RequestBuilder::new(stub))
10557        }
10558
10559        /// Sets the full request, replacing any prior values.
10560        pub fn with_request<V: Into<crate::model::CreateEntityTypeRequest>>(
10561            mut self,
10562            v: V,
10563        ) -> Self {
10564            self.0.request = v.into();
10565            self
10566        }
10567
10568        /// Sets all the options, replacing any prior values.
10569        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10570            self.0.options = v.into();
10571            self
10572        }
10573
10574        /// Sends the request.
10575        pub async fn send(self) -> Result<crate::model::EntityType> {
10576            (*self.0.stub)
10577                .create_entity_type(self.0.request, self.0.options)
10578                .await
10579                .map(gax::response::Response::into_body)
10580        }
10581
10582        /// Sets the value of [parent][crate::model::CreateEntityTypeRequest::parent].
10583        ///
10584        /// This is a **required** field for requests.
10585        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10586            self.0.request.parent = v.into();
10587            self
10588        }
10589
10590        /// Sets the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10591        ///
10592        /// This is a **required** field for requests.
10593        pub fn set_entity_type<T>(mut self, v: T) -> Self
10594        where
10595            T: std::convert::Into<crate::model::EntityType>,
10596        {
10597            self.0.request.entity_type = std::option::Option::Some(v.into());
10598            self
10599        }
10600
10601        /// Sets or clears the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10602        ///
10603        /// This is a **required** field for requests.
10604        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
10605        where
10606            T: std::convert::Into<crate::model::EntityType>,
10607        {
10608            self.0.request.entity_type = v.map(|x| x.into());
10609            self
10610        }
10611
10612        /// Sets the value of [language_code][crate::model::CreateEntityTypeRequest::language_code].
10613        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10614            self.0.request.language_code = v.into();
10615            self
10616        }
10617    }
10618
10619    #[doc(hidden)]
10620    impl gax::options::internal::RequestBuilder for CreateEntityType {
10621        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10622            &mut self.0.options
10623        }
10624    }
10625
10626    /// The request builder for [EntityTypes::update_entity_type][crate::client::EntityTypes::update_entity_type] calls.
10627    ///
10628    /// # Example
10629    /// ```
10630    /// # use google_cloud_dialogflow_v2::builder::entity_types::UpdateEntityType;
10631    /// # async fn sample() -> gax::Result<()> {
10632    ///
10633    /// let builder = prepare_request_builder();
10634    /// let response = builder.send().await?;
10635    /// # Ok(()) }
10636    ///
10637    /// fn prepare_request_builder() -> UpdateEntityType {
10638    ///   # panic!();
10639    ///   // ... details omitted ...
10640    /// }
10641    /// ```
10642    #[derive(Clone, Debug)]
10643    pub struct UpdateEntityType(RequestBuilder<crate::model::UpdateEntityTypeRequest>);
10644
10645    impl UpdateEntityType {
10646        pub(crate) fn new(
10647            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10648        ) -> Self {
10649            Self(RequestBuilder::new(stub))
10650        }
10651
10652        /// Sets the full request, replacing any prior values.
10653        pub fn with_request<V: Into<crate::model::UpdateEntityTypeRequest>>(
10654            mut self,
10655            v: V,
10656        ) -> Self {
10657            self.0.request = v.into();
10658            self
10659        }
10660
10661        /// Sets all the options, replacing any prior values.
10662        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10663            self.0.options = v.into();
10664            self
10665        }
10666
10667        /// Sends the request.
10668        pub async fn send(self) -> Result<crate::model::EntityType> {
10669            (*self.0.stub)
10670                .update_entity_type(self.0.request, self.0.options)
10671                .await
10672                .map(gax::response::Response::into_body)
10673        }
10674
10675        /// Sets the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
10676        ///
10677        /// This is a **required** field for requests.
10678        pub fn set_entity_type<T>(mut self, v: T) -> Self
10679        where
10680            T: std::convert::Into<crate::model::EntityType>,
10681        {
10682            self.0.request.entity_type = std::option::Option::Some(v.into());
10683            self
10684        }
10685
10686        /// Sets or clears the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
10687        ///
10688        /// This is a **required** field for requests.
10689        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
10690        where
10691            T: std::convert::Into<crate::model::EntityType>,
10692        {
10693            self.0.request.entity_type = v.map(|x| x.into());
10694            self
10695        }
10696
10697        /// Sets the value of [language_code][crate::model::UpdateEntityTypeRequest::language_code].
10698        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10699            self.0.request.language_code = v.into();
10700            self
10701        }
10702
10703        /// Sets the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
10704        pub fn set_update_mask<T>(mut self, v: T) -> Self
10705        where
10706            T: std::convert::Into<wkt::FieldMask>,
10707        {
10708            self.0.request.update_mask = std::option::Option::Some(v.into());
10709            self
10710        }
10711
10712        /// Sets or clears the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
10713        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10714        where
10715            T: std::convert::Into<wkt::FieldMask>,
10716        {
10717            self.0.request.update_mask = v.map(|x| x.into());
10718            self
10719        }
10720    }
10721
10722    #[doc(hidden)]
10723    impl gax::options::internal::RequestBuilder for UpdateEntityType {
10724        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10725            &mut self.0.options
10726        }
10727    }
10728
10729    /// The request builder for [EntityTypes::delete_entity_type][crate::client::EntityTypes::delete_entity_type] calls.
10730    ///
10731    /// # Example
10732    /// ```
10733    /// # use google_cloud_dialogflow_v2::builder::entity_types::DeleteEntityType;
10734    /// # async fn sample() -> gax::Result<()> {
10735    ///
10736    /// let builder = prepare_request_builder();
10737    /// let response = builder.send().await?;
10738    /// # Ok(()) }
10739    ///
10740    /// fn prepare_request_builder() -> DeleteEntityType {
10741    ///   # panic!();
10742    ///   // ... details omitted ...
10743    /// }
10744    /// ```
10745    #[derive(Clone, Debug)]
10746    pub struct DeleteEntityType(RequestBuilder<crate::model::DeleteEntityTypeRequest>);
10747
10748    impl DeleteEntityType {
10749        pub(crate) fn new(
10750            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10751        ) -> Self {
10752            Self(RequestBuilder::new(stub))
10753        }
10754
10755        /// Sets the full request, replacing any prior values.
10756        pub fn with_request<V: Into<crate::model::DeleteEntityTypeRequest>>(
10757            mut self,
10758            v: V,
10759        ) -> Self {
10760            self.0.request = v.into();
10761            self
10762        }
10763
10764        /// Sets all the options, replacing any prior values.
10765        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10766            self.0.options = v.into();
10767            self
10768        }
10769
10770        /// Sends the request.
10771        pub async fn send(self) -> Result<()> {
10772            (*self.0.stub)
10773                .delete_entity_type(self.0.request, self.0.options)
10774                .await
10775                .map(gax::response::Response::into_body)
10776        }
10777
10778        /// Sets the value of [name][crate::model::DeleteEntityTypeRequest::name].
10779        ///
10780        /// This is a **required** field for requests.
10781        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10782            self.0.request.name = v.into();
10783            self
10784        }
10785    }
10786
10787    #[doc(hidden)]
10788    impl gax::options::internal::RequestBuilder for DeleteEntityType {
10789        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10790            &mut self.0.options
10791        }
10792    }
10793
10794    /// The request builder for [EntityTypes::batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types] calls.
10795    ///
10796    /// # Example
10797    /// ```
10798    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchUpdateEntityTypes;
10799    /// # async fn sample() -> gax::Result<()> {
10800    /// use lro::Poller;
10801    ///
10802    /// let builder = prepare_request_builder();
10803    /// let response = builder.poller().until_done().await?;
10804    /// # Ok(()) }
10805    ///
10806    /// fn prepare_request_builder() -> BatchUpdateEntityTypes {
10807    ///   # panic!();
10808    ///   // ... details omitted ...
10809    /// }
10810    /// ```
10811    #[derive(Clone, Debug)]
10812    pub struct BatchUpdateEntityTypes(RequestBuilder<crate::model::BatchUpdateEntityTypesRequest>);
10813
10814    impl BatchUpdateEntityTypes {
10815        pub(crate) fn new(
10816            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10817        ) -> Self {
10818            Self(RequestBuilder::new(stub))
10819        }
10820
10821        /// Sets the full request, replacing any prior values.
10822        pub fn with_request<V: Into<crate::model::BatchUpdateEntityTypesRequest>>(
10823            mut self,
10824            v: V,
10825        ) -> Self {
10826            self.0.request = v.into();
10827            self
10828        }
10829
10830        /// Sets all the options, replacing any prior values.
10831        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10832            self.0.options = v.into();
10833            self
10834        }
10835
10836        /// Sends the request.
10837        ///
10838        /// # Long running operations
10839        ///
10840        /// This starts, but does not poll, a longrunning operation. More information
10841        /// on [batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types].
10842        pub async fn send(self) -> Result<longrunning::model::Operation> {
10843            (*self.0.stub)
10844                .batch_update_entity_types(self.0.request, self.0.options)
10845                .await
10846                .map(gax::response::Response::into_body)
10847        }
10848
10849        /// Creates a [Poller][lro::Poller] to work with `batch_update_entity_types`.
10850        pub fn poller(
10851            self,
10852        ) -> impl lro::Poller<crate::model::BatchUpdateEntityTypesResponse, wkt::Struct> {
10853            type Operation =
10854                lro::internal::Operation<crate::model::BatchUpdateEntityTypesResponse, wkt::Struct>;
10855            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10856            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10857
10858            let stub = self.0.stub.clone();
10859            let mut options = self.0.options.clone();
10860            options.set_retry_policy(gax::retry_policy::NeverRetry);
10861            let query = move |name| {
10862                let stub = stub.clone();
10863                let options = options.clone();
10864                async {
10865                    let op = GetOperation::new(stub)
10866                        .set_name(name)
10867                        .with_options(options)
10868                        .send()
10869                        .await?;
10870                    Ok(Operation::new(op))
10871                }
10872            };
10873
10874            let start = move || async {
10875                let op = self.send().await?;
10876                Ok(Operation::new(op))
10877            };
10878
10879            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10880        }
10881
10882        /// Sets the value of [parent][crate::model::BatchUpdateEntityTypesRequest::parent].
10883        ///
10884        /// This is a **required** field for requests.
10885        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10886            self.0.request.parent = v.into();
10887            self
10888        }
10889
10890        /// Sets the value of [language_code][crate::model::BatchUpdateEntityTypesRequest::language_code].
10891        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10892            self.0.request.language_code = v.into();
10893            self
10894        }
10895
10896        /// Sets the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
10897        pub fn set_update_mask<T>(mut self, v: T) -> Self
10898        where
10899            T: std::convert::Into<wkt::FieldMask>,
10900        {
10901            self.0.request.update_mask = std::option::Option::Some(v.into());
10902            self
10903        }
10904
10905        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
10906        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10907        where
10908            T: std::convert::Into<wkt::FieldMask>,
10909        {
10910            self.0.request.update_mask = v.map(|x| x.into());
10911            self
10912        }
10913
10914        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch].
10915        ///
10916        /// Note that all the setters affecting `entity_type_batch` are
10917        /// mutually exclusive.
10918        pub fn set_entity_type_batch<
10919            T: Into<Option<crate::model::batch_update_entity_types_request::EntityTypeBatch>>,
10920        >(
10921            mut self,
10922            v: T,
10923        ) -> Self {
10924            self.0.request.entity_type_batch = v.into();
10925            self
10926        }
10927
10928        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
10929        /// to hold a `EntityTypeBatchUri`.
10930        ///
10931        /// Note that all the setters affecting `entity_type_batch` are
10932        /// mutually exclusive.
10933        pub fn set_entity_type_batch_uri<T: std::convert::Into<std::string::String>>(
10934            mut self,
10935            v: T,
10936        ) -> Self {
10937            self.0.request = self.0.request.set_entity_type_batch_uri(v);
10938            self
10939        }
10940
10941        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
10942        /// to hold a `EntityTypeBatchInline`.
10943        ///
10944        /// Note that all the setters affecting `entity_type_batch` are
10945        /// mutually exclusive.
10946        pub fn set_entity_type_batch_inline<
10947            T: std::convert::Into<std::boxed::Box<crate::model::EntityTypeBatch>>,
10948        >(
10949            mut self,
10950            v: T,
10951        ) -> Self {
10952            self.0.request = self.0.request.set_entity_type_batch_inline(v);
10953            self
10954        }
10955    }
10956
10957    #[doc(hidden)]
10958    impl gax::options::internal::RequestBuilder for BatchUpdateEntityTypes {
10959        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10960            &mut self.0.options
10961        }
10962    }
10963
10964    /// The request builder for [EntityTypes::batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types] calls.
10965    ///
10966    /// # Example
10967    /// ```
10968    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchDeleteEntityTypes;
10969    /// # async fn sample() -> gax::Result<()> {
10970    /// use lro::Poller;
10971    ///
10972    /// let builder = prepare_request_builder();
10973    /// let response = builder.poller().until_done().await?;
10974    /// # Ok(()) }
10975    ///
10976    /// fn prepare_request_builder() -> BatchDeleteEntityTypes {
10977    ///   # panic!();
10978    ///   // ... details omitted ...
10979    /// }
10980    /// ```
10981    #[derive(Clone, Debug)]
10982    pub struct BatchDeleteEntityTypes(RequestBuilder<crate::model::BatchDeleteEntityTypesRequest>);
10983
10984    impl BatchDeleteEntityTypes {
10985        pub(crate) fn new(
10986            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10987        ) -> Self {
10988            Self(RequestBuilder::new(stub))
10989        }
10990
10991        /// Sets the full request, replacing any prior values.
10992        pub fn with_request<V: Into<crate::model::BatchDeleteEntityTypesRequest>>(
10993            mut self,
10994            v: V,
10995        ) -> Self {
10996            self.0.request = v.into();
10997            self
10998        }
10999
11000        /// Sets all the options, replacing any prior values.
11001        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11002            self.0.options = v.into();
11003            self
11004        }
11005
11006        /// Sends the request.
11007        ///
11008        /// # Long running operations
11009        ///
11010        /// This starts, but does not poll, a longrunning operation. More information
11011        /// on [batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types].
11012        pub async fn send(self) -> Result<longrunning::model::Operation> {
11013            (*self.0.stub)
11014                .batch_delete_entity_types(self.0.request, self.0.options)
11015                .await
11016                .map(gax::response::Response::into_body)
11017        }
11018
11019        /// Creates a [Poller][lro::Poller] to work with `batch_delete_entity_types`.
11020        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
11021            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
11022            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11023            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11024
11025            let stub = self.0.stub.clone();
11026            let mut options = self.0.options.clone();
11027            options.set_retry_policy(gax::retry_policy::NeverRetry);
11028            let query = move |name| {
11029                let stub = stub.clone();
11030                let options = options.clone();
11031                async {
11032                    let op = GetOperation::new(stub)
11033                        .set_name(name)
11034                        .with_options(options)
11035                        .send()
11036                        .await?;
11037                    Ok(Operation::new(op))
11038                }
11039            };
11040
11041            let start = move || async {
11042                let op = self.send().await?;
11043                Ok(Operation::new(op))
11044            };
11045
11046            lro::internal::new_unit_response_poller(
11047                polling_error_policy,
11048                polling_backoff_policy,
11049                start,
11050                query,
11051            )
11052        }
11053
11054        /// Sets the value of [parent][crate::model::BatchDeleteEntityTypesRequest::parent].
11055        ///
11056        /// This is a **required** field for requests.
11057        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11058            self.0.request.parent = v.into();
11059            self
11060        }
11061
11062        /// Sets the value of [entity_type_names][crate::model::BatchDeleteEntityTypesRequest::entity_type_names].
11063        ///
11064        /// This is a **required** field for requests.
11065        pub fn set_entity_type_names<T, V>(mut self, v: T) -> Self
11066        where
11067            T: std::iter::IntoIterator<Item = V>,
11068            V: std::convert::Into<std::string::String>,
11069        {
11070            use std::iter::Iterator;
11071            self.0.request.entity_type_names = v.into_iter().map(|i| i.into()).collect();
11072            self
11073        }
11074    }
11075
11076    #[doc(hidden)]
11077    impl gax::options::internal::RequestBuilder for BatchDeleteEntityTypes {
11078        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11079            &mut self.0.options
11080        }
11081    }
11082
11083    /// The request builder for [EntityTypes::batch_create_entities][crate::client::EntityTypes::batch_create_entities] calls.
11084    ///
11085    /// # Example
11086    /// ```
11087    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchCreateEntities;
11088    /// # async fn sample() -> gax::Result<()> {
11089    /// use lro::Poller;
11090    ///
11091    /// let builder = prepare_request_builder();
11092    /// let response = builder.poller().until_done().await?;
11093    /// # Ok(()) }
11094    ///
11095    /// fn prepare_request_builder() -> BatchCreateEntities {
11096    ///   # panic!();
11097    ///   // ... details omitted ...
11098    /// }
11099    /// ```
11100    #[derive(Clone, Debug)]
11101    pub struct BatchCreateEntities(RequestBuilder<crate::model::BatchCreateEntitiesRequest>);
11102
11103    impl BatchCreateEntities {
11104        pub(crate) fn new(
11105            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11106        ) -> Self {
11107            Self(RequestBuilder::new(stub))
11108        }
11109
11110        /// Sets the full request, replacing any prior values.
11111        pub fn with_request<V: Into<crate::model::BatchCreateEntitiesRequest>>(
11112            mut self,
11113            v: V,
11114        ) -> Self {
11115            self.0.request = v.into();
11116            self
11117        }
11118
11119        /// Sets all the options, replacing any prior values.
11120        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11121            self.0.options = v.into();
11122            self
11123        }
11124
11125        /// Sends the request.
11126        ///
11127        /// # Long running operations
11128        ///
11129        /// This starts, but does not poll, a longrunning operation. More information
11130        /// on [batch_create_entities][crate::client::EntityTypes::batch_create_entities].
11131        pub async fn send(self) -> Result<longrunning::model::Operation> {
11132            (*self.0.stub)
11133                .batch_create_entities(self.0.request, self.0.options)
11134                .await
11135                .map(gax::response::Response::into_body)
11136        }
11137
11138        /// Creates a [Poller][lro::Poller] to work with `batch_create_entities`.
11139        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
11140            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
11141            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11142            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11143
11144            let stub = self.0.stub.clone();
11145            let mut options = self.0.options.clone();
11146            options.set_retry_policy(gax::retry_policy::NeverRetry);
11147            let query = move |name| {
11148                let stub = stub.clone();
11149                let options = options.clone();
11150                async {
11151                    let op = GetOperation::new(stub)
11152                        .set_name(name)
11153                        .with_options(options)
11154                        .send()
11155                        .await?;
11156                    Ok(Operation::new(op))
11157                }
11158            };
11159
11160            let start = move || async {
11161                let op = self.send().await?;
11162                Ok(Operation::new(op))
11163            };
11164
11165            lro::internal::new_unit_response_poller(
11166                polling_error_policy,
11167                polling_backoff_policy,
11168                start,
11169                query,
11170            )
11171        }
11172
11173        /// Sets the value of [parent][crate::model::BatchCreateEntitiesRequest::parent].
11174        ///
11175        /// This is a **required** field for requests.
11176        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11177            self.0.request.parent = v.into();
11178            self
11179        }
11180
11181        /// Sets the value of [entities][crate::model::BatchCreateEntitiesRequest::entities].
11182        ///
11183        /// This is a **required** field for requests.
11184        pub fn set_entities<T, V>(mut self, v: T) -> Self
11185        where
11186            T: std::iter::IntoIterator<Item = V>,
11187            V: std::convert::Into<crate::model::entity_type::Entity>,
11188        {
11189            use std::iter::Iterator;
11190            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11191            self
11192        }
11193
11194        /// Sets the value of [language_code][crate::model::BatchCreateEntitiesRequest::language_code].
11195        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11196            self.0.request.language_code = v.into();
11197            self
11198        }
11199    }
11200
11201    #[doc(hidden)]
11202    impl gax::options::internal::RequestBuilder for BatchCreateEntities {
11203        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11204            &mut self.0.options
11205        }
11206    }
11207
11208    /// The request builder for [EntityTypes::batch_update_entities][crate::client::EntityTypes::batch_update_entities] calls.
11209    ///
11210    /// # Example
11211    /// ```
11212    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchUpdateEntities;
11213    /// # async fn sample() -> gax::Result<()> {
11214    /// use lro::Poller;
11215    ///
11216    /// let builder = prepare_request_builder();
11217    /// let response = builder.poller().until_done().await?;
11218    /// # Ok(()) }
11219    ///
11220    /// fn prepare_request_builder() -> BatchUpdateEntities {
11221    ///   # panic!();
11222    ///   // ... details omitted ...
11223    /// }
11224    /// ```
11225    #[derive(Clone, Debug)]
11226    pub struct BatchUpdateEntities(RequestBuilder<crate::model::BatchUpdateEntitiesRequest>);
11227
11228    impl BatchUpdateEntities {
11229        pub(crate) fn new(
11230            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11231        ) -> Self {
11232            Self(RequestBuilder::new(stub))
11233        }
11234
11235        /// Sets the full request, replacing any prior values.
11236        pub fn with_request<V: Into<crate::model::BatchUpdateEntitiesRequest>>(
11237            mut self,
11238            v: V,
11239        ) -> Self {
11240            self.0.request = v.into();
11241            self
11242        }
11243
11244        /// Sets all the options, replacing any prior values.
11245        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11246            self.0.options = v.into();
11247            self
11248        }
11249
11250        /// Sends the request.
11251        ///
11252        /// # Long running operations
11253        ///
11254        /// This starts, but does not poll, a longrunning operation. More information
11255        /// on [batch_update_entities][crate::client::EntityTypes::batch_update_entities].
11256        pub async fn send(self) -> Result<longrunning::model::Operation> {
11257            (*self.0.stub)
11258                .batch_update_entities(self.0.request, self.0.options)
11259                .await
11260                .map(gax::response::Response::into_body)
11261        }
11262
11263        /// Creates a [Poller][lro::Poller] to work with `batch_update_entities`.
11264        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
11265            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
11266            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11267            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11268
11269            let stub = self.0.stub.clone();
11270            let mut options = self.0.options.clone();
11271            options.set_retry_policy(gax::retry_policy::NeverRetry);
11272            let query = move |name| {
11273                let stub = stub.clone();
11274                let options = options.clone();
11275                async {
11276                    let op = GetOperation::new(stub)
11277                        .set_name(name)
11278                        .with_options(options)
11279                        .send()
11280                        .await?;
11281                    Ok(Operation::new(op))
11282                }
11283            };
11284
11285            let start = move || async {
11286                let op = self.send().await?;
11287                Ok(Operation::new(op))
11288            };
11289
11290            lro::internal::new_unit_response_poller(
11291                polling_error_policy,
11292                polling_backoff_policy,
11293                start,
11294                query,
11295            )
11296        }
11297
11298        /// Sets the value of [parent][crate::model::BatchUpdateEntitiesRequest::parent].
11299        ///
11300        /// This is a **required** field for requests.
11301        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11302            self.0.request.parent = v.into();
11303            self
11304        }
11305
11306        /// Sets the value of [entities][crate::model::BatchUpdateEntitiesRequest::entities].
11307        ///
11308        /// This is a **required** field for requests.
11309        pub fn set_entities<T, V>(mut self, v: T) -> Self
11310        where
11311            T: std::iter::IntoIterator<Item = V>,
11312            V: std::convert::Into<crate::model::entity_type::Entity>,
11313        {
11314            use std::iter::Iterator;
11315            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11316            self
11317        }
11318
11319        /// Sets the value of [language_code][crate::model::BatchUpdateEntitiesRequest::language_code].
11320        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11321            self.0.request.language_code = v.into();
11322            self
11323        }
11324
11325        /// Sets the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11326        pub fn set_update_mask<T>(mut self, v: T) -> Self
11327        where
11328            T: std::convert::Into<wkt::FieldMask>,
11329        {
11330            self.0.request.update_mask = std::option::Option::Some(v.into());
11331            self
11332        }
11333
11334        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11335        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11336        where
11337            T: std::convert::Into<wkt::FieldMask>,
11338        {
11339            self.0.request.update_mask = v.map(|x| x.into());
11340            self
11341        }
11342    }
11343
11344    #[doc(hidden)]
11345    impl gax::options::internal::RequestBuilder for BatchUpdateEntities {
11346        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11347            &mut self.0.options
11348        }
11349    }
11350
11351    /// The request builder for [EntityTypes::batch_delete_entities][crate::client::EntityTypes::batch_delete_entities] calls.
11352    ///
11353    /// # Example
11354    /// ```
11355    /// # use google_cloud_dialogflow_v2::builder::entity_types::BatchDeleteEntities;
11356    /// # async fn sample() -> gax::Result<()> {
11357    /// use lro::Poller;
11358    ///
11359    /// let builder = prepare_request_builder();
11360    /// let response = builder.poller().until_done().await?;
11361    /// # Ok(()) }
11362    ///
11363    /// fn prepare_request_builder() -> BatchDeleteEntities {
11364    ///   # panic!();
11365    ///   // ... details omitted ...
11366    /// }
11367    /// ```
11368    #[derive(Clone, Debug)]
11369    pub struct BatchDeleteEntities(RequestBuilder<crate::model::BatchDeleteEntitiesRequest>);
11370
11371    impl BatchDeleteEntities {
11372        pub(crate) fn new(
11373            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11374        ) -> Self {
11375            Self(RequestBuilder::new(stub))
11376        }
11377
11378        /// Sets the full request, replacing any prior values.
11379        pub fn with_request<V: Into<crate::model::BatchDeleteEntitiesRequest>>(
11380            mut self,
11381            v: V,
11382        ) -> Self {
11383            self.0.request = v.into();
11384            self
11385        }
11386
11387        /// Sets all the options, replacing any prior values.
11388        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11389            self.0.options = v.into();
11390            self
11391        }
11392
11393        /// Sends the request.
11394        ///
11395        /// # Long running operations
11396        ///
11397        /// This starts, but does not poll, a longrunning operation. More information
11398        /// on [batch_delete_entities][crate::client::EntityTypes::batch_delete_entities].
11399        pub async fn send(self) -> Result<longrunning::model::Operation> {
11400            (*self.0.stub)
11401                .batch_delete_entities(self.0.request, self.0.options)
11402                .await
11403                .map(gax::response::Response::into_body)
11404        }
11405
11406        /// Creates a [Poller][lro::Poller] to work with `batch_delete_entities`.
11407        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
11408            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
11409            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11410            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11411
11412            let stub = self.0.stub.clone();
11413            let mut options = self.0.options.clone();
11414            options.set_retry_policy(gax::retry_policy::NeverRetry);
11415            let query = move |name| {
11416                let stub = stub.clone();
11417                let options = options.clone();
11418                async {
11419                    let op = GetOperation::new(stub)
11420                        .set_name(name)
11421                        .with_options(options)
11422                        .send()
11423                        .await?;
11424                    Ok(Operation::new(op))
11425                }
11426            };
11427
11428            let start = move || async {
11429                let op = self.send().await?;
11430                Ok(Operation::new(op))
11431            };
11432
11433            lro::internal::new_unit_response_poller(
11434                polling_error_policy,
11435                polling_backoff_policy,
11436                start,
11437                query,
11438            )
11439        }
11440
11441        /// Sets the value of [parent][crate::model::BatchDeleteEntitiesRequest::parent].
11442        ///
11443        /// This is a **required** field for requests.
11444        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11445            self.0.request.parent = v.into();
11446            self
11447        }
11448
11449        /// Sets the value of [entity_values][crate::model::BatchDeleteEntitiesRequest::entity_values].
11450        ///
11451        /// This is a **required** field for requests.
11452        pub fn set_entity_values<T, V>(mut self, v: T) -> Self
11453        where
11454            T: std::iter::IntoIterator<Item = V>,
11455            V: std::convert::Into<std::string::String>,
11456        {
11457            use std::iter::Iterator;
11458            self.0.request.entity_values = v.into_iter().map(|i| i.into()).collect();
11459            self
11460        }
11461
11462        /// Sets the value of [language_code][crate::model::BatchDeleteEntitiesRequest::language_code].
11463        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11464            self.0.request.language_code = v.into();
11465            self
11466        }
11467    }
11468
11469    #[doc(hidden)]
11470    impl gax::options::internal::RequestBuilder for BatchDeleteEntities {
11471        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11472            &mut self.0.options
11473        }
11474    }
11475
11476    /// The request builder for [EntityTypes::list_locations][crate::client::EntityTypes::list_locations] calls.
11477    ///
11478    /// # Example
11479    /// ```
11480    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListLocations;
11481    /// # async fn sample() -> gax::Result<()> {
11482    /// use gax::paginator::ItemPaginator;
11483    ///
11484    /// let builder = prepare_request_builder();
11485    /// let mut items = builder.by_item();
11486    /// while let Some(result) = items.next().await {
11487    ///   let item = result?;
11488    /// }
11489    /// # Ok(()) }
11490    ///
11491    /// fn prepare_request_builder() -> ListLocations {
11492    ///   # panic!();
11493    ///   // ... details omitted ...
11494    /// }
11495    /// ```
11496    #[derive(Clone, Debug)]
11497    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
11498
11499    impl ListLocations {
11500        pub(crate) fn new(
11501            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11502        ) -> Self {
11503            Self(RequestBuilder::new(stub))
11504        }
11505
11506        /// Sets the full request, replacing any prior values.
11507        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
11508            mut self,
11509            v: V,
11510        ) -> Self {
11511            self.0.request = v.into();
11512            self
11513        }
11514
11515        /// Sets all the options, replacing any prior values.
11516        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11517            self.0.options = v.into();
11518            self
11519        }
11520
11521        /// Sends the request.
11522        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
11523            (*self.0.stub)
11524                .list_locations(self.0.request, self.0.options)
11525                .await
11526                .map(gax::response::Response::into_body)
11527        }
11528
11529        /// Streams each page in the collection.
11530        pub fn by_page(
11531            self,
11532        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
11533        {
11534            use std::clone::Clone;
11535            let token = self.0.request.page_token.clone();
11536            let execute = move |token: String| {
11537                let mut builder = self.clone();
11538                builder.0.request = builder.0.request.set_page_token(token);
11539                builder.send()
11540            };
11541            gax::paginator::internal::new_paginator(token, execute)
11542        }
11543
11544        /// Streams each item in the collection.
11545        pub fn by_item(
11546            self,
11547        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
11548        {
11549            use gax::paginator::Paginator;
11550            self.by_page().items()
11551        }
11552
11553        /// Sets the value of [name][location::model::ListLocationsRequest::name].
11554        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11555            self.0.request.name = v.into();
11556            self
11557        }
11558
11559        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
11560        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11561            self.0.request.filter = v.into();
11562            self
11563        }
11564
11565        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
11566        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11567            self.0.request.page_size = v.into();
11568            self
11569        }
11570
11571        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
11572        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11573            self.0.request.page_token = v.into();
11574            self
11575        }
11576    }
11577
11578    #[doc(hidden)]
11579    impl gax::options::internal::RequestBuilder for ListLocations {
11580        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11581            &mut self.0.options
11582        }
11583    }
11584
11585    /// The request builder for [EntityTypes::get_location][crate::client::EntityTypes::get_location] calls.
11586    ///
11587    /// # Example
11588    /// ```
11589    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetLocation;
11590    /// # async fn sample() -> gax::Result<()> {
11591    ///
11592    /// let builder = prepare_request_builder();
11593    /// let response = builder.send().await?;
11594    /// # Ok(()) }
11595    ///
11596    /// fn prepare_request_builder() -> GetLocation {
11597    ///   # panic!();
11598    ///   // ... details omitted ...
11599    /// }
11600    /// ```
11601    #[derive(Clone, Debug)]
11602    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
11603
11604    impl GetLocation {
11605        pub(crate) fn new(
11606            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11607        ) -> Self {
11608            Self(RequestBuilder::new(stub))
11609        }
11610
11611        /// Sets the full request, replacing any prior values.
11612        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
11613            self.0.request = v.into();
11614            self
11615        }
11616
11617        /// Sets all the options, replacing any prior values.
11618        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11619            self.0.options = v.into();
11620            self
11621        }
11622
11623        /// Sends the request.
11624        pub async fn send(self) -> Result<location::model::Location> {
11625            (*self.0.stub)
11626                .get_location(self.0.request, self.0.options)
11627                .await
11628                .map(gax::response::Response::into_body)
11629        }
11630
11631        /// Sets the value of [name][location::model::GetLocationRequest::name].
11632        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11633            self.0.request.name = v.into();
11634            self
11635        }
11636    }
11637
11638    #[doc(hidden)]
11639    impl gax::options::internal::RequestBuilder for GetLocation {
11640        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11641            &mut self.0.options
11642        }
11643    }
11644
11645    /// The request builder for [EntityTypes::list_operations][crate::client::EntityTypes::list_operations] calls.
11646    ///
11647    /// # Example
11648    /// ```
11649    /// # use google_cloud_dialogflow_v2::builder::entity_types::ListOperations;
11650    /// # async fn sample() -> gax::Result<()> {
11651    /// use gax::paginator::ItemPaginator;
11652    ///
11653    /// let builder = prepare_request_builder();
11654    /// let mut items = builder.by_item();
11655    /// while let Some(result) = items.next().await {
11656    ///   let item = result?;
11657    /// }
11658    /// # Ok(()) }
11659    ///
11660    /// fn prepare_request_builder() -> ListOperations {
11661    ///   # panic!();
11662    ///   // ... details omitted ...
11663    /// }
11664    /// ```
11665    #[derive(Clone, Debug)]
11666    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
11667
11668    impl ListOperations {
11669        pub(crate) fn new(
11670            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11671        ) -> Self {
11672            Self(RequestBuilder::new(stub))
11673        }
11674
11675        /// Sets the full request, replacing any prior values.
11676        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
11677            mut self,
11678            v: V,
11679        ) -> Self {
11680            self.0.request = v.into();
11681            self
11682        }
11683
11684        /// Sets all the options, replacing any prior values.
11685        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11686            self.0.options = v.into();
11687            self
11688        }
11689
11690        /// Sends the request.
11691        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
11692            (*self.0.stub)
11693                .list_operations(self.0.request, self.0.options)
11694                .await
11695                .map(gax::response::Response::into_body)
11696        }
11697
11698        /// Streams each page in the collection.
11699        pub fn by_page(
11700            self,
11701        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
11702        {
11703            use std::clone::Clone;
11704            let token = self.0.request.page_token.clone();
11705            let execute = move |token: String| {
11706                let mut builder = self.clone();
11707                builder.0.request = builder.0.request.set_page_token(token);
11708                builder.send()
11709            };
11710            gax::paginator::internal::new_paginator(token, execute)
11711        }
11712
11713        /// Streams each item in the collection.
11714        pub fn by_item(
11715            self,
11716        ) -> impl gax::paginator::ItemPaginator<
11717            longrunning::model::ListOperationsResponse,
11718            gax::error::Error,
11719        > {
11720            use gax::paginator::Paginator;
11721            self.by_page().items()
11722        }
11723
11724        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
11725        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11726            self.0.request.name = v.into();
11727            self
11728        }
11729
11730        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
11731        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11732            self.0.request.filter = v.into();
11733            self
11734        }
11735
11736        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
11737        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11738            self.0.request.page_size = v.into();
11739            self
11740        }
11741
11742        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
11743        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11744            self.0.request.page_token = v.into();
11745            self
11746        }
11747
11748        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
11749        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11750            self.0.request.return_partial_success = v.into();
11751            self
11752        }
11753    }
11754
11755    #[doc(hidden)]
11756    impl gax::options::internal::RequestBuilder for ListOperations {
11757        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11758            &mut self.0.options
11759        }
11760    }
11761
11762    /// The request builder for [EntityTypes::get_operation][crate::client::EntityTypes::get_operation] calls.
11763    ///
11764    /// # Example
11765    /// ```
11766    /// # use google_cloud_dialogflow_v2::builder::entity_types::GetOperation;
11767    /// # async fn sample() -> gax::Result<()> {
11768    ///
11769    /// let builder = prepare_request_builder();
11770    /// let response = builder.send().await?;
11771    /// # Ok(()) }
11772    ///
11773    /// fn prepare_request_builder() -> GetOperation {
11774    ///   # panic!();
11775    ///   // ... details omitted ...
11776    /// }
11777    /// ```
11778    #[derive(Clone, Debug)]
11779    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11780
11781    impl GetOperation {
11782        pub(crate) fn new(
11783            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11784        ) -> Self {
11785            Self(RequestBuilder::new(stub))
11786        }
11787
11788        /// Sets the full request, replacing any prior values.
11789        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11790            mut self,
11791            v: V,
11792        ) -> Self {
11793            self.0.request = v.into();
11794            self
11795        }
11796
11797        /// Sets all the options, replacing any prior values.
11798        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11799            self.0.options = v.into();
11800            self
11801        }
11802
11803        /// Sends the request.
11804        pub async fn send(self) -> Result<longrunning::model::Operation> {
11805            (*self.0.stub)
11806                .get_operation(self.0.request, self.0.options)
11807                .await
11808                .map(gax::response::Response::into_body)
11809        }
11810
11811        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
11812        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11813            self.0.request.name = v.into();
11814            self
11815        }
11816    }
11817
11818    #[doc(hidden)]
11819    impl gax::options::internal::RequestBuilder for GetOperation {
11820        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11821            &mut self.0.options
11822        }
11823    }
11824
11825    /// The request builder for [EntityTypes::cancel_operation][crate::client::EntityTypes::cancel_operation] calls.
11826    ///
11827    /// # Example
11828    /// ```
11829    /// # use google_cloud_dialogflow_v2::builder::entity_types::CancelOperation;
11830    /// # async fn sample() -> gax::Result<()> {
11831    ///
11832    /// let builder = prepare_request_builder();
11833    /// let response = builder.send().await?;
11834    /// # Ok(()) }
11835    ///
11836    /// fn prepare_request_builder() -> CancelOperation {
11837    ///   # panic!();
11838    ///   // ... details omitted ...
11839    /// }
11840    /// ```
11841    #[derive(Clone, Debug)]
11842    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11843
11844    impl CancelOperation {
11845        pub(crate) fn new(
11846            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11847        ) -> Self {
11848            Self(RequestBuilder::new(stub))
11849        }
11850
11851        /// Sets the full request, replacing any prior values.
11852        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11853            mut self,
11854            v: V,
11855        ) -> Self {
11856            self.0.request = v.into();
11857            self
11858        }
11859
11860        /// Sets all the options, replacing any prior values.
11861        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11862            self.0.options = v.into();
11863            self
11864        }
11865
11866        /// Sends the request.
11867        pub async fn send(self) -> Result<()> {
11868            (*self.0.stub)
11869                .cancel_operation(self.0.request, self.0.options)
11870                .await
11871                .map(gax::response::Response::into_body)
11872        }
11873
11874        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
11875        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11876            self.0.request.name = v.into();
11877            self
11878        }
11879    }
11880
11881    #[doc(hidden)]
11882    impl gax::options::internal::RequestBuilder for CancelOperation {
11883        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11884            &mut self.0.options
11885        }
11886    }
11887}
11888
11889#[cfg(feature = "environments")]
11890#[cfg_attr(docsrs, doc(cfg(feature = "environments")))]
11891pub mod environments {
11892    use crate::Result;
11893
11894    /// A builder for [Environments][crate::client::Environments].
11895    ///
11896    /// ```
11897    /// # async fn sample() -> gax::client_builder::Result<()> {
11898    /// # use google_cloud_dialogflow_v2::*;
11899    /// # use builder::environments::ClientBuilder;
11900    /// # use client::Environments;
11901    /// let builder : ClientBuilder = Environments::builder();
11902    /// let client = builder
11903    ///     .with_endpoint("https://dialogflow.googleapis.com")
11904    ///     .build().await?;
11905    /// # Ok(()) }
11906    /// ```
11907    pub type ClientBuilder =
11908        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11909
11910    pub(crate) mod client {
11911        use super::super::super::client::Environments;
11912        pub struct Factory;
11913        impl gax::client_builder::internal::ClientFactory for Factory {
11914            type Client = Environments;
11915            type Credentials = gaxi::options::Credentials;
11916            async fn build(
11917                self,
11918                config: gaxi::options::ClientConfig,
11919            ) -> gax::client_builder::Result<Self::Client> {
11920                Self::Client::new(config).await
11921            }
11922        }
11923    }
11924
11925    /// Common implementation for [crate::client::Environments] request builders.
11926    #[derive(Clone, Debug)]
11927    pub(crate) struct RequestBuilder<R: std::default::Default> {
11928        stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
11929        request: R,
11930        options: gax::options::RequestOptions,
11931    }
11932
11933    impl<R> RequestBuilder<R>
11934    where
11935        R: std::default::Default,
11936    {
11937        pub(crate) fn new(
11938            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
11939        ) -> Self {
11940            Self {
11941                stub,
11942                request: R::default(),
11943                options: gax::options::RequestOptions::default(),
11944            }
11945        }
11946    }
11947
11948    /// The request builder for [Environments::list_environments][crate::client::Environments::list_environments] calls.
11949    ///
11950    /// # Example
11951    /// ```
11952    /// # use google_cloud_dialogflow_v2::builder::environments::ListEnvironments;
11953    /// # async fn sample() -> gax::Result<()> {
11954    /// use gax::paginator::ItemPaginator;
11955    ///
11956    /// let builder = prepare_request_builder();
11957    /// let mut items = builder.by_item();
11958    /// while let Some(result) = items.next().await {
11959    ///   let item = result?;
11960    /// }
11961    /// # Ok(()) }
11962    ///
11963    /// fn prepare_request_builder() -> ListEnvironments {
11964    ///   # panic!();
11965    ///   // ... details omitted ...
11966    /// }
11967    /// ```
11968    #[derive(Clone, Debug)]
11969    pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
11970
11971    impl ListEnvironments {
11972        pub(crate) fn new(
11973            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
11974        ) -> Self {
11975            Self(RequestBuilder::new(stub))
11976        }
11977
11978        /// Sets the full request, replacing any prior values.
11979        pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
11980            mut self,
11981            v: V,
11982        ) -> Self {
11983            self.0.request = v.into();
11984            self
11985        }
11986
11987        /// Sets all the options, replacing any prior values.
11988        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11989            self.0.options = v.into();
11990            self
11991        }
11992
11993        /// Sends the request.
11994        pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
11995            (*self.0.stub)
11996                .list_environments(self.0.request, self.0.options)
11997                .await
11998                .map(gax::response::Response::into_body)
11999        }
12000
12001        /// Streams each page in the collection.
12002        pub fn by_page(
12003            self,
12004        ) -> impl gax::paginator::Paginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
12005        {
12006            use std::clone::Clone;
12007            let token = self.0.request.page_token.clone();
12008            let execute = move |token: String| {
12009                let mut builder = self.clone();
12010                builder.0.request = builder.0.request.set_page_token(token);
12011                builder.send()
12012            };
12013            gax::paginator::internal::new_paginator(token, execute)
12014        }
12015
12016        /// Streams each item in the collection.
12017        pub fn by_item(
12018            self,
12019        ) -> impl gax::paginator::ItemPaginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
12020        {
12021            use gax::paginator::Paginator;
12022            self.by_page().items()
12023        }
12024
12025        /// Sets the value of [parent][crate::model::ListEnvironmentsRequest::parent].
12026        ///
12027        /// This is a **required** field for requests.
12028        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12029            self.0.request.parent = v.into();
12030            self
12031        }
12032
12033        /// Sets the value of [page_size][crate::model::ListEnvironmentsRequest::page_size].
12034        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12035            self.0.request.page_size = v.into();
12036            self
12037        }
12038
12039        /// Sets the value of [page_token][crate::model::ListEnvironmentsRequest::page_token].
12040        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12041            self.0.request.page_token = v.into();
12042            self
12043        }
12044    }
12045
12046    #[doc(hidden)]
12047    impl gax::options::internal::RequestBuilder for ListEnvironments {
12048        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12049            &mut self.0.options
12050        }
12051    }
12052
12053    /// The request builder for [Environments::get_environment][crate::client::Environments::get_environment] calls.
12054    ///
12055    /// # Example
12056    /// ```
12057    /// # use google_cloud_dialogflow_v2::builder::environments::GetEnvironment;
12058    /// # async fn sample() -> gax::Result<()> {
12059    ///
12060    /// let builder = prepare_request_builder();
12061    /// let response = builder.send().await?;
12062    /// # Ok(()) }
12063    ///
12064    /// fn prepare_request_builder() -> GetEnvironment {
12065    ///   # panic!();
12066    ///   // ... details omitted ...
12067    /// }
12068    /// ```
12069    #[derive(Clone, Debug)]
12070    pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
12071
12072    impl GetEnvironment {
12073        pub(crate) fn new(
12074            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12075        ) -> Self {
12076            Self(RequestBuilder::new(stub))
12077        }
12078
12079        /// Sets the full request, replacing any prior values.
12080        pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
12081            self.0.request = v.into();
12082            self
12083        }
12084
12085        /// Sets all the options, replacing any prior values.
12086        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12087            self.0.options = v.into();
12088            self
12089        }
12090
12091        /// Sends the request.
12092        pub async fn send(self) -> Result<crate::model::Environment> {
12093            (*self.0.stub)
12094                .get_environment(self.0.request, self.0.options)
12095                .await
12096                .map(gax::response::Response::into_body)
12097        }
12098
12099        /// Sets the value of [name][crate::model::GetEnvironmentRequest::name].
12100        ///
12101        /// This is a **required** field for requests.
12102        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12103            self.0.request.name = v.into();
12104            self
12105        }
12106    }
12107
12108    #[doc(hidden)]
12109    impl gax::options::internal::RequestBuilder for GetEnvironment {
12110        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12111            &mut self.0.options
12112        }
12113    }
12114
12115    /// The request builder for [Environments::create_environment][crate::client::Environments::create_environment] calls.
12116    ///
12117    /// # Example
12118    /// ```
12119    /// # use google_cloud_dialogflow_v2::builder::environments::CreateEnvironment;
12120    /// # async fn sample() -> gax::Result<()> {
12121    ///
12122    /// let builder = prepare_request_builder();
12123    /// let response = builder.send().await?;
12124    /// # Ok(()) }
12125    ///
12126    /// fn prepare_request_builder() -> CreateEnvironment {
12127    ///   # panic!();
12128    ///   // ... details omitted ...
12129    /// }
12130    /// ```
12131    #[derive(Clone, Debug)]
12132    pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
12133
12134    impl CreateEnvironment {
12135        pub(crate) fn new(
12136            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12137        ) -> Self {
12138            Self(RequestBuilder::new(stub))
12139        }
12140
12141        /// Sets the full request, replacing any prior values.
12142        pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
12143            mut self,
12144            v: V,
12145        ) -> Self {
12146            self.0.request = v.into();
12147            self
12148        }
12149
12150        /// Sets all the options, replacing any prior values.
12151        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12152            self.0.options = v.into();
12153            self
12154        }
12155
12156        /// Sends the request.
12157        pub async fn send(self) -> Result<crate::model::Environment> {
12158            (*self.0.stub)
12159                .create_environment(self.0.request, self.0.options)
12160                .await
12161                .map(gax::response::Response::into_body)
12162        }
12163
12164        /// Sets the value of [parent][crate::model::CreateEnvironmentRequest::parent].
12165        ///
12166        /// This is a **required** field for requests.
12167        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12168            self.0.request.parent = v.into();
12169            self
12170        }
12171
12172        /// Sets the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12173        ///
12174        /// This is a **required** field for requests.
12175        pub fn set_environment<T>(mut self, v: T) -> Self
12176        where
12177            T: std::convert::Into<crate::model::Environment>,
12178        {
12179            self.0.request.environment = std::option::Option::Some(v.into());
12180            self
12181        }
12182
12183        /// Sets or clears the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12184        ///
12185        /// This is a **required** field for requests.
12186        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12187        where
12188            T: std::convert::Into<crate::model::Environment>,
12189        {
12190            self.0.request.environment = v.map(|x| x.into());
12191            self
12192        }
12193
12194        /// Sets the value of [environment_id][crate::model::CreateEnvironmentRequest::environment_id].
12195        ///
12196        /// This is a **required** field for requests.
12197        pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12198            self.0.request.environment_id = v.into();
12199            self
12200        }
12201    }
12202
12203    #[doc(hidden)]
12204    impl gax::options::internal::RequestBuilder for CreateEnvironment {
12205        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12206            &mut self.0.options
12207        }
12208    }
12209
12210    /// The request builder for [Environments::update_environment][crate::client::Environments::update_environment] calls.
12211    ///
12212    /// # Example
12213    /// ```
12214    /// # use google_cloud_dialogflow_v2::builder::environments::UpdateEnvironment;
12215    /// # async fn sample() -> gax::Result<()> {
12216    ///
12217    /// let builder = prepare_request_builder();
12218    /// let response = builder.send().await?;
12219    /// # Ok(()) }
12220    ///
12221    /// fn prepare_request_builder() -> UpdateEnvironment {
12222    ///   # panic!();
12223    ///   // ... details omitted ...
12224    /// }
12225    /// ```
12226    #[derive(Clone, Debug)]
12227    pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
12228
12229    impl UpdateEnvironment {
12230        pub(crate) fn new(
12231            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12232        ) -> Self {
12233            Self(RequestBuilder::new(stub))
12234        }
12235
12236        /// Sets the full request, replacing any prior values.
12237        pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
12238            mut self,
12239            v: V,
12240        ) -> Self {
12241            self.0.request = v.into();
12242            self
12243        }
12244
12245        /// Sets all the options, replacing any prior values.
12246        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12247            self.0.options = v.into();
12248            self
12249        }
12250
12251        /// Sends the request.
12252        pub async fn send(self) -> Result<crate::model::Environment> {
12253            (*self.0.stub)
12254                .update_environment(self.0.request, self.0.options)
12255                .await
12256                .map(gax::response::Response::into_body)
12257        }
12258
12259        /// Sets the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12260        ///
12261        /// This is a **required** field for requests.
12262        pub fn set_environment<T>(mut self, v: T) -> Self
12263        where
12264            T: std::convert::Into<crate::model::Environment>,
12265        {
12266            self.0.request.environment = std::option::Option::Some(v.into());
12267            self
12268        }
12269
12270        /// Sets or clears the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12271        ///
12272        /// This is a **required** field for requests.
12273        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12274        where
12275            T: std::convert::Into<crate::model::Environment>,
12276        {
12277            self.0.request.environment = v.map(|x| x.into());
12278            self
12279        }
12280
12281        /// Sets the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12282        ///
12283        /// This is a **required** field for requests.
12284        pub fn set_update_mask<T>(mut self, v: T) -> Self
12285        where
12286            T: std::convert::Into<wkt::FieldMask>,
12287        {
12288            self.0.request.update_mask = std::option::Option::Some(v.into());
12289            self
12290        }
12291
12292        /// Sets or clears the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12293        ///
12294        /// This is a **required** field for requests.
12295        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12296        where
12297            T: std::convert::Into<wkt::FieldMask>,
12298        {
12299            self.0.request.update_mask = v.map(|x| x.into());
12300            self
12301        }
12302
12303        /// Sets the value of [allow_load_to_draft_and_discard_changes][crate::model::UpdateEnvironmentRequest::allow_load_to_draft_and_discard_changes].
12304        pub fn set_allow_load_to_draft_and_discard_changes<T: Into<bool>>(mut self, v: T) -> Self {
12305            self.0.request.allow_load_to_draft_and_discard_changes = v.into();
12306            self
12307        }
12308    }
12309
12310    #[doc(hidden)]
12311    impl gax::options::internal::RequestBuilder for UpdateEnvironment {
12312        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12313            &mut self.0.options
12314        }
12315    }
12316
12317    /// The request builder for [Environments::delete_environment][crate::client::Environments::delete_environment] calls.
12318    ///
12319    /// # Example
12320    /// ```
12321    /// # use google_cloud_dialogflow_v2::builder::environments::DeleteEnvironment;
12322    /// # async fn sample() -> gax::Result<()> {
12323    ///
12324    /// let builder = prepare_request_builder();
12325    /// let response = builder.send().await?;
12326    /// # Ok(()) }
12327    ///
12328    /// fn prepare_request_builder() -> DeleteEnvironment {
12329    ///   # panic!();
12330    ///   // ... details omitted ...
12331    /// }
12332    /// ```
12333    #[derive(Clone, Debug)]
12334    pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
12335
12336    impl DeleteEnvironment {
12337        pub(crate) fn new(
12338            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12339        ) -> Self {
12340            Self(RequestBuilder::new(stub))
12341        }
12342
12343        /// Sets the full request, replacing any prior values.
12344        pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
12345            mut self,
12346            v: V,
12347        ) -> Self {
12348            self.0.request = v.into();
12349            self
12350        }
12351
12352        /// Sets all the options, replacing any prior values.
12353        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12354            self.0.options = v.into();
12355            self
12356        }
12357
12358        /// Sends the request.
12359        pub async fn send(self) -> Result<()> {
12360            (*self.0.stub)
12361                .delete_environment(self.0.request, self.0.options)
12362                .await
12363                .map(gax::response::Response::into_body)
12364        }
12365
12366        /// Sets the value of [name][crate::model::DeleteEnvironmentRequest::name].
12367        ///
12368        /// This is a **required** field for requests.
12369        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12370            self.0.request.name = v.into();
12371            self
12372        }
12373    }
12374
12375    #[doc(hidden)]
12376    impl gax::options::internal::RequestBuilder for DeleteEnvironment {
12377        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12378            &mut self.0.options
12379        }
12380    }
12381
12382    /// The request builder for [Environments::get_environment_history][crate::client::Environments::get_environment_history] calls.
12383    ///
12384    /// # Example
12385    /// ```
12386    /// # use google_cloud_dialogflow_v2::builder::environments::GetEnvironmentHistory;
12387    /// # async fn sample() -> gax::Result<()> {
12388    /// use gax::paginator::ItemPaginator;
12389    ///
12390    /// let builder = prepare_request_builder();
12391    /// let mut items = builder.by_item();
12392    /// while let Some(result) = items.next().await {
12393    ///   let item = result?;
12394    /// }
12395    /// # Ok(()) }
12396    ///
12397    /// fn prepare_request_builder() -> GetEnvironmentHistory {
12398    ///   # panic!();
12399    ///   // ... details omitted ...
12400    /// }
12401    /// ```
12402    #[derive(Clone, Debug)]
12403    pub struct GetEnvironmentHistory(RequestBuilder<crate::model::GetEnvironmentHistoryRequest>);
12404
12405    impl GetEnvironmentHistory {
12406        pub(crate) fn new(
12407            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12408        ) -> Self {
12409            Self(RequestBuilder::new(stub))
12410        }
12411
12412        /// Sets the full request, replacing any prior values.
12413        pub fn with_request<V: Into<crate::model::GetEnvironmentHistoryRequest>>(
12414            mut self,
12415            v: V,
12416        ) -> Self {
12417            self.0.request = v.into();
12418            self
12419        }
12420
12421        /// Sets all the options, replacing any prior values.
12422        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12423            self.0.options = v.into();
12424            self
12425        }
12426
12427        /// Sends the request.
12428        pub async fn send(self) -> Result<crate::model::EnvironmentHistory> {
12429            (*self.0.stub)
12430                .get_environment_history(self.0.request, self.0.options)
12431                .await
12432                .map(gax::response::Response::into_body)
12433        }
12434
12435        /// Streams each page in the collection.
12436        pub fn by_page(
12437            self,
12438        ) -> impl gax::paginator::Paginator<crate::model::EnvironmentHistory, gax::error::Error>
12439        {
12440            use std::clone::Clone;
12441            let token = self.0.request.page_token.clone();
12442            let execute = move |token: String| {
12443                let mut builder = self.clone();
12444                builder.0.request = builder.0.request.set_page_token(token);
12445                builder.send()
12446            };
12447            gax::paginator::internal::new_paginator(token, execute)
12448        }
12449
12450        /// Streams each item in the collection.
12451        pub fn by_item(
12452            self,
12453        ) -> impl gax::paginator::ItemPaginator<crate::model::EnvironmentHistory, gax::error::Error>
12454        {
12455            use gax::paginator::Paginator;
12456            self.by_page().items()
12457        }
12458
12459        /// Sets the value of [parent][crate::model::GetEnvironmentHistoryRequest::parent].
12460        ///
12461        /// This is a **required** field for requests.
12462        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12463            self.0.request.parent = v.into();
12464            self
12465        }
12466
12467        /// Sets the value of [page_size][crate::model::GetEnvironmentHistoryRequest::page_size].
12468        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12469            self.0.request.page_size = v.into();
12470            self
12471        }
12472
12473        /// Sets the value of [page_token][crate::model::GetEnvironmentHistoryRequest::page_token].
12474        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12475            self.0.request.page_token = v.into();
12476            self
12477        }
12478    }
12479
12480    #[doc(hidden)]
12481    impl gax::options::internal::RequestBuilder for GetEnvironmentHistory {
12482        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12483            &mut self.0.options
12484        }
12485    }
12486
12487    /// The request builder for [Environments::list_locations][crate::client::Environments::list_locations] calls.
12488    ///
12489    /// # Example
12490    /// ```
12491    /// # use google_cloud_dialogflow_v2::builder::environments::ListLocations;
12492    /// # async fn sample() -> gax::Result<()> {
12493    /// use gax::paginator::ItemPaginator;
12494    ///
12495    /// let builder = prepare_request_builder();
12496    /// let mut items = builder.by_item();
12497    /// while let Some(result) = items.next().await {
12498    ///   let item = result?;
12499    /// }
12500    /// # Ok(()) }
12501    ///
12502    /// fn prepare_request_builder() -> ListLocations {
12503    ///   # panic!();
12504    ///   // ... details omitted ...
12505    /// }
12506    /// ```
12507    #[derive(Clone, Debug)]
12508    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
12509
12510    impl ListLocations {
12511        pub(crate) fn new(
12512            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12513        ) -> Self {
12514            Self(RequestBuilder::new(stub))
12515        }
12516
12517        /// Sets the full request, replacing any prior values.
12518        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
12519            mut self,
12520            v: V,
12521        ) -> Self {
12522            self.0.request = v.into();
12523            self
12524        }
12525
12526        /// Sets all the options, replacing any prior values.
12527        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12528            self.0.options = v.into();
12529            self
12530        }
12531
12532        /// Sends the request.
12533        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
12534            (*self.0.stub)
12535                .list_locations(self.0.request, self.0.options)
12536                .await
12537                .map(gax::response::Response::into_body)
12538        }
12539
12540        /// Streams each page in the collection.
12541        pub fn by_page(
12542            self,
12543        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
12544        {
12545            use std::clone::Clone;
12546            let token = self.0.request.page_token.clone();
12547            let execute = move |token: String| {
12548                let mut builder = self.clone();
12549                builder.0.request = builder.0.request.set_page_token(token);
12550                builder.send()
12551            };
12552            gax::paginator::internal::new_paginator(token, execute)
12553        }
12554
12555        /// Streams each item in the collection.
12556        pub fn by_item(
12557            self,
12558        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
12559        {
12560            use gax::paginator::Paginator;
12561            self.by_page().items()
12562        }
12563
12564        /// Sets the value of [name][location::model::ListLocationsRequest::name].
12565        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12566            self.0.request.name = v.into();
12567            self
12568        }
12569
12570        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
12571        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12572            self.0.request.filter = v.into();
12573            self
12574        }
12575
12576        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
12577        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12578            self.0.request.page_size = v.into();
12579            self
12580        }
12581
12582        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
12583        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12584            self.0.request.page_token = v.into();
12585            self
12586        }
12587    }
12588
12589    #[doc(hidden)]
12590    impl gax::options::internal::RequestBuilder for ListLocations {
12591        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12592            &mut self.0.options
12593        }
12594    }
12595
12596    /// The request builder for [Environments::get_location][crate::client::Environments::get_location] calls.
12597    ///
12598    /// # Example
12599    /// ```
12600    /// # use google_cloud_dialogflow_v2::builder::environments::GetLocation;
12601    /// # async fn sample() -> gax::Result<()> {
12602    ///
12603    /// let builder = prepare_request_builder();
12604    /// let response = builder.send().await?;
12605    /// # Ok(()) }
12606    ///
12607    /// fn prepare_request_builder() -> GetLocation {
12608    ///   # panic!();
12609    ///   // ... details omitted ...
12610    /// }
12611    /// ```
12612    #[derive(Clone, Debug)]
12613    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
12614
12615    impl GetLocation {
12616        pub(crate) fn new(
12617            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12618        ) -> Self {
12619            Self(RequestBuilder::new(stub))
12620        }
12621
12622        /// Sets the full request, replacing any prior values.
12623        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
12624            self.0.request = v.into();
12625            self
12626        }
12627
12628        /// Sets all the options, replacing any prior values.
12629        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12630            self.0.options = v.into();
12631            self
12632        }
12633
12634        /// Sends the request.
12635        pub async fn send(self) -> Result<location::model::Location> {
12636            (*self.0.stub)
12637                .get_location(self.0.request, self.0.options)
12638                .await
12639                .map(gax::response::Response::into_body)
12640        }
12641
12642        /// Sets the value of [name][location::model::GetLocationRequest::name].
12643        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12644            self.0.request.name = v.into();
12645            self
12646        }
12647    }
12648
12649    #[doc(hidden)]
12650    impl gax::options::internal::RequestBuilder for GetLocation {
12651        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12652            &mut self.0.options
12653        }
12654    }
12655
12656    /// The request builder for [Environments::list_operations][crate::client::Environments::list_operations] calls.
12657    ///
12658    /// # Example
12659    /// ```
12660    /// # use google_cloud_dialogflow_v2::builder::environments::ListOperations;
12661    /// # async fn sample() -> gax::Result<()> {
12662    /// use gax::paginator::ItemPaginator;
12663    ///
12664    /// let builder = prepare_request_builder();
12665    /// let mut items = builder.by_item();
12666    /// while let Some(result) = items.next().await {
12667    ///   let item = result?;
12668    /// }
12669    /// # Ok(()) }
12670    ///
12671    /// fn prepare_request_builder() -> ListOperations {
12672    ///   # panic!();
12673    ///   // ... details omitted ...
12674    /// }
12675    /// ```
12676    #[derive(Clone, Debug)]
12677    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
12678
12679    impl ListOperations {
12680        pub(crate) fn new(
12681            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12682        ) -> Self {
12683            Self(RequestBuilder::new(stub))
12684        }
12685
12686        /// Sets the full request, replacing any prior values.
12687        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
12688            mut self,
12689            v: V,
12690        ) -> Self {
12691            self.0.request = v.into();
12692            self
12693        }
12694
12695        /// Sets all the options, replacing any prior values.
12696        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12697            self.0.options = v.into();
12698            self
12699        }
12700
12701        /// Sends the request.
12702        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
12703            (*self.0.stub)
12704                .list_operations(self.0.request, self.0.options)
12705                .await
12706                .map(gax::response::Response::into_body)
12707        }
12708
12709        /// Streams each page in the collection.
12710        pub fn by_page(
12711            self,
12712        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
12713        {
12714            use std::clone::Clone;
12715            let token = self.0.request.page_token.clone();
12716            let execute = move |token: String| {
12717                let mut builder = self.clone();
12718                builder.0.request = builder.0.request.set_page_token(token);
12719                builder.send()
12720            };
12721            gax::paginator::internal::new_paginator(token, execute)
12722        }
12723
12724        /// Streams each item in the collection.
12725        pub fn by_item(
12726            self,
12727        ) -> impl gax::paginator::ItemPaginator<
12728            longrunning::model::ListOperationsResponse,
12729            gax::error::Error,
12730        > {
12731            use gax::paginator::Paginator;
12732            self.by_page().items()
12733        }
12734
12735        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
12736        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12737            self.0.request.name = v.into();
12738            self
12739        }
12740
12741        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
12742        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12743            self.0.request.filter = v.into();
12744            self
12745        }
12746
12747        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
12748        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12749            self.0.request.page_size = v.into();
12750            self
12751        }
12752
12753        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
12754        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12755            self.0.request.page_token = v.into();
12756            self
12757        }
12758
12759        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
12760        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
12761            self.0.request.return_partial_success = v.into();
12762            self
12763        }
12764    }
12765
12766    #[doc(hidden)]
12767    impl gax::options::internal::RequestBuilder for ListOperations {
12768        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12769            &mut self.0.options
12770        }
12771    }
12772
12773    /// The request builder for [Environments::get_operation][crate::client::Environments::get_operation] calls.
12774    ///
12775    /// # Example
12776    /// ```
12777    /// # use google_cloud_dialogflow_v2::builder::environments::GetOperation;
12778    /// # async fn sample() -> gax::Result<()> {
12779    ///
12780    /// let builder = prepare_request_builder();
12781    /// let response = builder.send().await?;
12782    /// # Ok(()) }
12783    ///
12784    /// fn prepare_request_builder() -> GetOperation {
12785    ///   # panic!();
12786    ///   // ... details omitted ...
12787    /// }
12788    /// ```
12789    #[derive(Clone, Debug)]
12790    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
12791
12792    impl GetOperation {
12793        pub(crate) fn new(
12794            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12795        ) -> Self {
12796            Self(RequestBuilder::new(stub))
12797        }
12798
12799        /// Sets the full request, replacing any prior values.
12800        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
12801            mut self,
12802            v: V,
12803        ) -> Self {
12804            self.0.request = v.into();
12805            self
12806        }
12807
12808        /// Sets all the options, replacing any prior values.
12809        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12810            self.0.options = v.into();
12811            self
12812        }
12813
12814        /// Sends the request.
12815        pub async fn send(self) -> Result<longrunning::model::Operation> {
12816            (*self.0.stub)
12817                .get_operation(self.0.request, self.0.options)
12818                .await
12819                .map(gax::response::Response::into_body)
12820        }
12821
12822        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
12823        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12824            self.0.request.name = v.into();
12825            self
12826        }
12827    }
12828
12829    #[doc(hidden)]
12830    impl gax::options::internal::RequestBuilder for GetOperation {
12831        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12832            &mut self.0.options
12833        }
12834    }
12835
12836    /// The request builder for [Environments::cancel_operation][crate::client::Environments::cancel_operation] calls.
12837    ///
12838    /// # Example
12839    /// ```
12840    /// # use google_cloud_dialogflow_v2::builder::environments::CancelOperation;
12841    /// # async fn sample() -> gax::Result<()> {
12842    ///
12843    /// let builder = prepare_request_builder();
12844    /// let response = builder.send().await?;
12845    /// # Ok(()) }
12846    ///
12847    /// fn prepare_request_builder() -> CancelOperation {
12848    ///   # panic!();
12849    ///   // ... details omitted ...
12850    /// }
12851    /// ```
12852    #[derive(Clone, Debug)]
12853    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
12854
12855    impl CancelOperation {
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<longrunning::model::CancelOperationRequest>>(
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<gax::options::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<()> {
12879            (*self.0.stub)
12880                .cancel_operation(self.0.request, self.0.options)
12881                .await
12882                .map(gax::response::Response::into_body)
12883        }
12884
12885        /// Sets the value of [name][longrunning::model::CancelOperationRequest::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 gax::options::internal::RequestBuilder for CancelOperation {
12894        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12895            &mut self.0.options
12896        }
12897    }
12898}
12899
12900#[cfg(feature = "fulfillments")]
12901#[cfg_attr(docsrs, doc(cfg(feature = "fulfillments")))]
12902pub mod fulfillments {
12903    use crate::Result;
12904
12905    /// A builder for [Fulfillments][crate::client::Fulfillments].
12906    ///
12907    /// ```
12908    /// # async fn sample() -> gax::client_builder::Result<()> {
12909    /// # use google_cloud_dialogflow_v2::*;
12910    /// # use builder::fulfillments::ClientBuilder;
12911    /// # use client::Fulfillments;
12912    /// let builder : ClientBuilder = Fulfillments::builder();
12913    /// let client = builder
12914    ///     .with_endpoint("https://dialogflow.googleapis.com")
12915    ///     .build().await?;
12916    /// # Ok(()) }
12917    /// ```
12918    pub type ClientBuilder =
12919        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12920
12921    pub(crate) mod client {
12922        use super::super::super::client::Fulfillments;
12923        pub struct Factory;
12924        impl gax::client_builder::internal::ClientFactory for Factory {
12925            type Client = Fulfillments;
12926            type Credentials = gaxi::options::Credentials;
12927            async fn build(
12928                self,
12929                config: gaxi::options::ClientConfig,
12930            ) -> gax::client_builder::Result<Self::Client> {
12931                Self::Client::new(config).await
12932            }
12933        }
12934    }
12935
12936    /// Common implementation for [crate::client::Fulfillments] request builders.
12937    #[derive(Clone, Debug)]
12938    pub(crate) struct RequestBuilder<R: std::default::Default> {
12939        stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
12940        request: R,
12941        options: gax::options::RequestOptions,
12942    }
12943
12944    impl<R> RequestBuilder<R>
12945    where
12946        R: std::default::Default,
12947    {
12948        pub(crate) fn new(
12949            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
12950        ) -> Self {
12951            Self {
12952                stub,
12953                request: R::default(),
12954                options: gax::options::RequestOptions::default(),
12955            }
12956        }
12957    }
12958
12959    /// The request builder for [Fulfillments::get_fulfillment][crate::client::Fulfillments::get_fulfillment] calls.
12960    ///
12961    /// # Example
12962    /// ```
12963    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetFulfillment;
12964    /// # async fn sample() -> gax::Result<()> {
12965    ///
12966    /// let builder = prepare_request_builder();
12967    /// let response = builder.send().await?;
12968    /// # Ok(()) }
12969    ///
12970    /// fn prepare_request_builder() -> GetFulfillment {
12971    ///   # panic!();
12972    ///   // ... details omitted ...
12973    /// }
12974    /// ```
12975    #[derive(Clone, Debug)]
12976    pub struct GetFulfillment(RequestBuilder<crate::model::GetFulfillmentRequest>);
12977
12978    impl GetFulfillment {
12979        pub(crate) fn new(
12980            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
12981        ) -> Self {
12982            Self(RequestBuilder::new(stub))
12983        }
12984
12985        /// Sets the full request, replacing any prior values.
12986        pub fn with_request<V: Into<crate::model::GetFulfillmentRequest>>(mut self, v: V) -> Self {
12987            self.0.request = v.into();
12988            self
12989        }
12990
12991        /// Sets all the options, replacing any prior values.
12992        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12993            self.0.options = v.into();
12994            self
12995        }
12996
12997        /// Sends the request.
12998        pub async fn send(self) -> Result<crate::model::Fulfillment> {
12999            (*self.0.stub)
13000                .get_fulfillment(self.0.request, self.0.options)
13001                .await
13002                .map(gax::response::Response::into_body)
13003        }
13004
13005        /// Sets the value of [name][crate::model::GetFulfillmentRequest::name].
13006        ///
13007        /// This is a **required** field for requests.
13008        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13009            self.0.request.name = v.into();
13010            self
13011        }
13012    }
13013
13014    #[doc(hidden)]
13015    impl gax::options::internal::RequestBuilder for GetFulfillment {
13016        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13017            &mut self.0.options
13018        }
13019    }
13020
13021    /// The request builder for [Fulfillments::update_fulfillment][crate::client::Fulfillments::update_fulfillment] calls.
13022    ///
13023    /// # Example
13024    /// ```
13025    /// # use google_cloud_dialogflow_v2::builder::fulfillments::UpdateFulfillment;
13026    /// # async fn sample() -> gax::Result<()> {
13027    ///
13028    /// let builder = prepare_request_builder();
13029    /// let response = builder.send().await?;
13030    /// # Ok(()) }
13031    ///
13032    /// fn prepare_request_builder() -> UpdateFulfillment {
13033    ///   # panic!();
13034    ///   // ... details omitted ...
13035    /// }
13036    /// ```
13037    #[derive(Clone, Debug)]
13038    pub struct UpdateFulfillment(RequestBuilder<crate::model::UpdateFulfillmentRequest>);
13039
13040    impl UpdateFulfillment {
13041        pub(crate) fn new(
13042            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13043        ) -> Self {
13044            Self(RequestBuilder::new(stub))
13045        }
13046
13047        /// Sets the full request, replacing any prior values.
13048        pub fn with_request<V: Into<crate::model::UpdateFulfillmentRequest>>(
13049            mut self,
13050            v: V,
13051        ) -> Self {
13052            self.0.request = v.into();
13053            self
13054        }
13055
13056        /// Sets all the options, replacing any prior values.
13057        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13058            self.0.options = v.into();
13059            self
13060        }
13061
13062        /// Sends the request.
13063        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13064            (*self.0.stub)
13065                .update_fulfillment(self.0.request, self.0.options)
13066                .await
13067                .map(gax::response::Response::into_body)
13068        }
13069
13070        /// Sets the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13071        ///
13072        /// This is a **required** field for requests.
13073        pub fn set_fulfillment<T>(mut self, v: T) -> Self
13074        where
13075            T: std::convert::Into<crate::model::Fulfillment>,
13076        {
13077            self.0.request.fulfillment = std::option::Option::Some(v.into());
13078            self
13079        }
13080
13081        /// Sets or clears the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13082        ///
13083        /// This is a **required** field for requests.
13084        pub fn set_or_clear_fulfillment<T>(mut self, v: std::option::Option<T>) -> Self
13085        where
13086            T: std::convert::Into<crate::model::Fulfillment>,
13087        {
13088            self.0.request.fulfillment = v.map(|x| x.into());
13089            self
13090        }
13091
13092        /// Sets the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13093        ///
13094        /// This is a **required** field for requests.
13095        pub fn set_update_mask<T>(mut self, v: T) -> Self
13096        where
13097            T: std::convert::Into<wkt::FieldMask>,
13098        {
13099            self.0.request.update_mask = std::option::Option::Some(v.into());
13100            self
13101        }
13102
13103        /// Sets or clears the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13104        ///
13105        /// This is a **required** field for requests.
13106        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13107        where
13108            T: std::convert::Into<wkt::FieldMask>,
13109        {
13110            self.0.request.update_mask = v.map(|x| x.into());
13111            self
13112        }
13113    }
13114
13115    #[doc(hidden)]
13116    impl gax::options::internal::RequestBuilder for UpdateFulfillment {
13117        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13118            &mut self.0.options
13119        }
13120    }
13121
13122    /// The request builder for [Fulfillments::list_locations][crate::client::Fulfillments::list_locations] calls.
13123    ///
13124    /// # Example
13125    /// ```
13126    /// # use google_cloud_dialogflow_v2::builder::fulfillments::ListLocations;
13127    /// # async fn sample() -> gax::Result<()> {
13128    /// use gax::paginator::ItemPaginator;
13129    ///
13130    /// let builder = prepare_request_builder();
13131    /// let mut items = builder.by_item();
13132    /// while let Some(result) = items.next().await {
13133    ///   let item = result?;
13134    /// }
13135    /// # Ok(()) }
13136    ///
13137    /// fn prepare_request_builder() -> ListLocations {
13138    ///   # panic!();
13139    ///   // ... details omitted ...
13140    /// }
13141    /// ```
13142    #[derive(Clone, Debug)]
13143    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
13144
13145    impl ListLocations {
13146        pub(crate) fn new(
13147            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13148        ) -> Self {
13149            Self(RequestBuilder::new(stub))
13150        }
13151
13152        /// Sets the full request, replacing any prior values.
13153        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
13154            mut self,
13155            v: V,
13156        ) -> Self {
13157            self.0.request = v.into();
13158            self
13159        }
13160
13161        /// Sets all the options, replacing any prior values.
13162        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13163            self.0.options = v.into();
13164            self
13165        }
13166
13167        /// Sends the request.
13168        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
13169            (*self.0.stub)
13170                .list_locations(self.0.request, self.0.options)
13171                .await
13172                .map(gax::response::Response::into_body)
13173        }
13174
13175        /// Streams each page in the collection.
13176        pub fn by_page(
13177            self,
13178        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
13179        {
13180            use std::clone::Clone;
13181            let token = self.0.request.page_token.clone();
13182            let execute = move |token: String| {
13183                let mut builder = self.clone();
13184                builder.0.request = builder.0.request.set_page_token(token);
13185                builder.send()
13186            };
13187            gax::paginator::internal::new_paginator(token, execute)
13188        }
13189
13190        /// Streams each item in the collection.
13191        pub fn by_item(
13192            self,
13193        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
13194        {
13195            use gax::paginator::Paginator;
13196            self.by_page().items()
13197        }
13198
13199        /// Sets the value of [name][location::model::ListLocationsRequest::name].
13200        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13201            self.0.request.name = v.into();
13202            self
13203        }
13204
13205        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
13206        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13207            self.0.request.filter = v.into();
13208            self
13209        }
13210
13211        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
13212        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13213            self.0.request.page_size = v.into();
13214            self
13215        }
13216
13217        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
13218        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13219            self.0.request.page_token = v.into();
13220            self
13221        }
13222    }
13223
13224    #[doc(hidden)]
13225    impl gax::options::internal::RequestBuilder for ListLocations {
13226        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13227            &mut self.0.options
13228        }
13229    }
13230
13231    /// The request builder for [Fulfillments::get_location][crate::client::Fulfillments::get_location] calls.
13232    ///
13233    /// # Example
13234    /// ```
13235    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetLocation;
13236    /// # async fn sample() -> gax::Result<()> {
13237    ///
13238    /// let builder = prepare_request_builder();
13239    /// let response = builder.send().await?;
13240    /// # Ok(()) }
13241    ///
13242    /// fn prepare_request_builder() -> GetLocation {
13243    ///   # panic!();
13244    ///   // ... details omitted ...
13245    /// }
13246    /// ```
13247    #[derive(Clone, Debug)]
13248    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
13249
13250    impl GetLocation {
13251        pub(crate) fn new(
13252            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13253        ) -> Self {
13254            Self(RequestBuilder::new(stub))
13255        }
13256
13257        /// Sets the full request, replacing any prior values.
13258        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
13259            self.0.request = v.into();
13260            self
13261        }
13262
13263        /// Sets all the options, replacing any prior values.
13264        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13265            self.0.options = v.into();
13266            self
13267        }
13268
13269        /// Sends the request.
13270        pub async fn send(self) -> Result<location::model::Location> {
13271            (*self.0.stub)
13272                .get_location(self.0.request, self.0.options)
13273                .await
13274                .map(gax::response::Response::into_body)
13275        }
13276
13277        /// Sets the value of [name][location::model::GetLocationRequest::name].
13278        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13279            self.0.request.name = v.into();
13280            self
13281        }
13282    }
13283
13284    #[doc(hidden)]
13285    impl gax::options::internal::RequestBuilder for GetLocation {
13286        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13287            &mut self.0.options
13288        }
13289    }
13290
13291    /// The request builder for [Fulfillments::list_operations][crate::client::Fulfillments::list_operations] calls.
13292    ///
13293    /// # Example
13294    /// ```
13295    /// # use google_cloud_dialogflow_v2::builder::fulfillments::ListOperations;
13296    /// # async fn sample() -> gax::Result<()> {
13297    /// use gax::paginator::ItemPaginator;
13298    ///
13299    /// let builder = prepare_request_builder();
13300    /// let mut items = builder.by_item();
13301    /// while let Some(result) = items.next().await {
13302    ///   let item = result?;
13303    /// }
13304    /// # Ok(()) }
13305    ///
13306    /// fn prepare_request_builder() -> ListOperations {
13307    ///   # panic!();
13308    ///   // ... details omitted ...
13309    /// }
13310    /// ```
13311    #[derive(Clone, Debug)]
13312    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
13313
13314    impl ListOperations {
13315        pub(crate) fn new(
13316            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13317        ) -> Self {
13318            Self(RequestBuilder::new(stub))
13319        }
13320
13321        /// Sets the full request, replacing any prior values.
13322        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
13323            mut self,
13324            v: V,
13325        ) -> Self {
13326            self.0.request = v.into();
13327            self
13328        }
13329
13330        /// Sets all the options, replacing any prior values.
13331        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13332            self.0.options = v.into();
13333            self
13334        }
13335
13336        /// Sends the request.
13337        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
13338            (*self.0.stub)
13339                .list_operations(self.0.request, self.0.options)
13340                .await
13341                .map(gax::response::Response::into_body)
13342        }
13343
13344        /// Streams each page in the collection.
13345        pub fn by_page(
13346            self,
13347        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
13348        {
13349            use std::clone::Clone;
13350            let token = self.0.request.page_token.clone();
13351            let execute = move |token: String| {
13352                let mut builder = self.clone();
13353                builder.0.request = builder.0.request.set_page_token(token);
13354                builder.send()
13355            };
13356            gax::paginator::internal::new_paginator(token, execute)
13357        }
13358
13359        /// Streams each item in the collection.
13360        pub fn by_item(
13361            self,
13362        ) -> impl gax::paginator::ItemPaginator<
13363            longrunning::model::ListOperationsResponse,
13364            gax::error::Error,
13365        > {
13366            use gax::paginator::Paginator;
13367            self.by_page().items()
13368        }
13369
13370        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
13371        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13372            self.0.request.name = v.into();
13373            self
13374        }
13375
13376        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
13377        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13378            self.0.request.filter = v.into();
13379            self
13380        }
13381
13382        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
13383        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13384            self.0.request.page_size = v.into();
13385            self
13386        }
13387
13388        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
13389        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13390            self.0.request.page_token = v.into();
13391            self
13392        }
13393
13394        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
13395        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13396            self.0.request.return_partial_success = v.into();
13397            self
13398        }
13399    }
13400
13401    #[doc(hidden)]
13402    impl gax::options::internal::RequestBuilder for ListOperations {
13403        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13404            &mut self.0.options
13405        }
13406    }
13407
13408    /// The request builder for [Fulfillments::get_operation][crate::client::Fulfillments::get_operation] calls.
13409    ///
13410    /// # Example
13411    /// ```
13412    /// # use google_cloud_dialogflow_v2::builder::fulfillments::GetOperation;
13413    /// # async fn sample() -> gax::Result<()> {
13414    ///
13415    /// let builder = prepare_request_builder();
13416    /// let response = builder.send().await?;
13417    /// # Ok(()) }
13418    ///
13419    /// fn prepare_request_builder() -> GetOperation {
13420    ///   # panic!();
13421    ///   // ... details omitted ...
13422    /// }
13423    /// ```
13424    #[derive(Clone, Debug)]
13425    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
13426
13427    impl GetOperation {
13428        pub(crate) fn new(
13429            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13430        ) -> Self {
13431            Self(RequestBuilder::new(stub))
13432        }
13433
13434        /// Sets the full request, replacing any prior values.
13435        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
13436            mut self,
13437            v: V,
13438        ) -> Self {
13439            self.0.request = v.into();
13440            self
13441        }
13442
13443        /// Sets all the options, replacing any prior values.
13444        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13445            self.0.options = v.into();
13446            self
13447        }
13448
13449        /// Sends the request.
13450        pub async fn send(self) -> Result<longrunning::model::Operation> {
13451            (*self.0.stub)
13452                .get_operation(self.0.request, self.0.options)
13453                .await
13454                .map(gax::response::Response::into_body)
13455        }
13456
13457        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
13458        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13459            self.0.request.name = v.into();
13460            self
13461        }
13462    }
13463
13464    #[doc(hidden)]
13465    impl gax::options::internal::RequestBuilder for GetOperation {
13466        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13467            &mut self.0.options
13468        }
13469    }
13470
13471    /// The request builder for [Fulfillments::cancel_operation][crate::client::Fulfillments::cancel_operation] calls.
13472    ///
13473    /// # Example
13474    /// ```
13475    /// # use google_cloud_dialogflow_v2::builder::fulfillments::CancelOperation;
13476    /// # async fn sample() -> gax::Result<()> {
13477    ///
13478    /// let builder = prepare_request_builder();
13479    /// let response = builder.send().await?;
13480    /// # Ok(()) }
13481    ///
13482    /// fn prepare_request_builder() -> CancelOperation {
13483    ///   # panic!();
13484    ///   // ... details omitted ...
13485    /// }
13486    /// ```
13487    #[derive(Clone, Debug)]
13488    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
13489
13490    impl CancelOperation {
13491        pub(crate) fn new(
13492            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13493        ) -> Self {
13494            Self(RequestBuilder::new(stub))
13495        }
13496
13497        /// Sets the full request, replacing any prior values.
13498        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
13499            mut self,
13500            v: V,
13501        ) -> Self {
13502            self.0.request = v.into();
13503            self
13504        }
13505
13506        /// Sets all the options, replacing any prior values.
13507        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13508            self.0.options = v.into();
13509            self
13510        }
13511
13512        /// Sends the request.
13513        pub async fn send(self) -> Result<()> {
13514            (*self.0.stub)
13515                .cancel_operation(self.0.request, self.0.options)
13516                .await
13517                .map(gax::response::Response::into_body)
13518        }
13519
13520        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
13521        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13522            self.0.request.name = v.into();
13523            self
13524        }
13525    }
13526
13527    #[doc(hidden)]
13528    impl gax::options::internal::RequestBuilder for CancelOperation {
13529        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13530            &mut self.0.options
13531        }
13532    }
13533}
13534
13535#[cfg(feature = "generators")]
13536#[cfg_attr(docsrs, doc(cfg(feature = "generators")))]
13537pub mod generators {
13538    use crate::Result;
13539
13540    /// A builder for [Generators][crate::client::Generators].
13541    ///
13542    /// ```
13543    /// # async fn sample() -> gax::client_builder::Result<()> {
13544    /// # use google_cloud_dialogflow_v2::*;
13545    /// # use builder::generators::ClientBuilder;
13546    /// # use client::Generators;
13547    /// let builder : ClientBuilder = Generators::builder();
13548    /// let client = builder
13549    ///     .with_endpoint("https://dialogflow.googleapis.com")
13550    ///     .build().await?;
13551    /// # Ok(()) }
13552    /// ```
13553    pub type ClientBuilder =
13554        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13555
13556    pub(crate) mod client {
13557        use super::super::super::client::Generators;
13558        pub struct Factory;
13559        impl gax::client_builder::internal::ClientFactory for Factory {
13560            type Client = Generators;
13561            type Credentials = gaxi::options::Credentials;
13562            async fn build(
13563                self,
13564                config: gaxi::options::ClientConfig,
13565            ) -> gax::client_builder::Result<Self::Client> {
13566                Self::Client::new(config).await
13567            }
13568        }
13569    }
13570
13571    /// Common implementation for [crate::client::Generators] request builders.
13572    #[derive(Clone, Debug)]
13573    pub(crate) struct RequestBuilder<R: std::default::Default> {
13574        stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13575        request: R,
13576        options: gax::options::RequestOptions,
13577    }
13578
13579    impl<R> RequestBuilder<R>
13580    where
13581        R: std::default::Default,
13582    {
13583        pub(crate) fn new(
13584            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13585        ) -> Self {
13586            Self {
13587                stub,
13588                request: R::default(),
13589                options: gax::options::RequestOptions::default(),
13590            }
13591        }
13592    }
13593
13594    /// The request builder for [Generators::create_generator][crate::client::Generators::create_generator] calls.
13595    ///
13596    /// # Example
13597    /// ```
13598    /// # use google_cloud_dialogflow_v2::builder::generators::CreateGenerator;
13599    /// # async fn sample() -> gax::Result<()> {
13600    ///
13601    /// let builder = prepare_request_builder();
13602    /// let response = builder.send().await?;
13603    /// # Ok(()) }
13604    ///
13605    /// fn prepare_request_builder() -> CreateGenerator {
13606    ///   # panic!();
13607    ///   // ... details omitted ...
13608    /// }
13609    /// ```
13610    #[derive(Clone, Debug)]
13611    pub struct CreateGenerator(RequestBuilder<crate::model::CreateGeneratorRequest>);
13612
13613    impl CreateGenerator {
13614        pub(crate) fn new(
13615            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13616        ) -> Self {
13617            Self(RequestBuilder::new(stub))
13618        }
13619
13620        /// Sets the full request, replacing any prior values.
13621        pub fn with_request<V: Into<crate::model::CreateGeneratorRequest>>(mut self, v: V) -> Self {
13622            self.0.request = v.into();
13623            self
13624        }
13625
13626        /// Sets all the options, replacing any prior values.
13627        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13628            self.0.options = v.into();
13629            self
13630        }
13631
13632        /// Sends the request.
13633        pub async fn send(self) -> Result<crate::model::Generator> {
13634            (*self.0.stub)
13635                .create_generator(self.0.request, self.0.options)
13636                .await
13637                .map(gax::response::Response::into_body)
13638        }
13639
13640        /// Sets the value of [parent][crate::model::CreateGeneratorRequest::parent].
13641        ///
13642        /// This is a **required** field for requests.
13643        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13644            self.0.request.parent = v.into();
13645            self
13646        }
13647
13648        /// Sets the value of [generator][crate::model::CreateGeneratorRequest::generator].
13649        ///
13650        /// This is a **required** field for requests.
13651        pub fn set_generator<T>(mut self, v: T) -> Self
13652        where
13653            T: std::convert::Into<crate::model::Generator>,
13654        {
13655            self.0.request.generator = std::option::Option::Some(v.into());
13656            self
13657        }
13658
13659        /// Sets or clears the value of [generator][crate::model::CreateGeneratorRequest::generator].
13660        ///
13661        /// This is a **required** field for requests.
13662        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
13663        where
13664            T: std::convert::Into<crate::model::Generator>,
13665        {
13666            self.0.request.generator = v.map(|x| x.into());
13667            self
13668        }
13669
13670        /// Sets the value of [generator_id][crate::model::CreateGeneratorRequest::generator_id].
13671        pub fn set_generator_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13672            self.0.request.generator_id = v.into();
13673            self
13674        }
13675    }
13676
13677    #[doc(hidden)]
13678    impl gax::options::internal::RequestBuilder for CreateGenerator {
13679        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13680            &mut self.0.options
13681        }
13682    }
13683
13684    /// The request builder for [Generators::get_generator][crate::client::Generators::get_generator] calls.
13685    ///
13686    /// # Example
13687    /// ```
13688    /// # use google_cloud_dialogflow_v2::builder::generators::GetGenerator;
13689    /// # async fn sample() -> gax::Result<()> {
13690    ///
13691    /// let builder = prepare_request_builder();
13692    /// let response = builder.send().await?;
13693    /// # Ok(()) }
13694    ///
13695    /// fn prepare_request_builder() -> GetGenerator {
13696    ///   # panic!();
13697    ///   // ... details omitted ...
13698    /// }
13699    /// ```
13700    #[derive(Clone, Debug)]
13701    pub struct GetGenerator(RequestBuilder<crate::model::GetGeneratorRequest>);
13702
13703    impl GetGenerator {
13704        pub(crate) fn new(
13705            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13706        ) -> Self {
13707            Self(RequestBuilder::new(stub))
13708        }
13709
13710        /// Sets the full request, replacing any prior values.
13711        pub fn with_request<V: Into<crate::model::GetGeneratorRequest>>(mut self, v: V) -> Self {
13712            self.0.request = v.into();
13713            self
13714        }
13715
13716        /// Sets all the options, replacing any prior values.
13717        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13718            self.0.options = v.into();
13719            self
13720        }
13721
13722        /// Sends the request.
13723        pub async fn send(self) -> Result<crate::model::Generator> {
13724            (*self.0.stub)
13725                .get_generator(self.0.request, self.0.options)
13726                .await
13727                .map(gax::response::Response::into_body)
13728        }
13729
13730        /// Sets the value of [name][crate::model::GetGeneratorRequest::name].
13731        ///
13732        /// This is a **required** field for requests.
13733        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13734            self.0.request.name = v.into();
13735            self
13736        }
13737    }
13738
13739    #[doc(hidden)]
13740    impl gax::options::internal::RequestBuilder for GetGenerator {
13741        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13742            &mut self.0.options
13743        }
13744    }
13745
13746    /// The request builder for [Generators::list_generators][crate::client::Generators::list_generators] calls.
13747    ///
13748    /// # Example
13749    /// ```
13750    /// # use google_cloud_dialogflow_v2::builder::generators::ListGenerators;
13751    /// # async fn sample() -> gax::Result<()> {
13752    /// use gax::paginator::ItemPaginator;
13753    ///
13754    /// let builder = prepare_request_builder();
13755    /// let mut items = builder.by_item();
13756    /// while let Some(result) = items.next().await {
13757    ///   let item = result?;
13758    /// }
13759    /// # Ok(()) }
13760    ///
13761    /// fn prepare_request_builder() -> ListGenerators {
13762    ///   # panic!();
13763    ///   // ... details omitted ...
13764    /// }
13765    /// ```
13766    #[derive(Clone, Debug)]
13767    pub struct ListGenerators(RequestBuilder<crate::model::ListGeneratorsRequest>);
13768
13769    impl ListGenerators {
13770        pub(crate) fn new(
13771            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13772        ) -> Self {
13773            Self(RequestBuilder::new(stub))
13774        }
13775
13776        /// Sets the full request, replacing any prior values.
13777        pub fn with_request<V: Into<crate::model::ListGeneratorsRequest>>(mut self, v: V) -> Self {
13778            self.0.request = v.into();
13779            self
13780        }
13781
13782        /// Sets all the options, replacing any prior values.
13783        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13784            self.0.options = v.into();
13785            self
13786        }
13787
13788        /// Sends the request.
13789        pub async fn send(self) -> Result<crate::model::ListGeneratorsResponse> {
13790            (*self.0.stub)
13791                .list_generators(self.0.request, self.0.options)
13792                .await
13793                .map(gax::response::Response::into_body)
13794        }
13795
13796        /// Streams each page in the collection.
13797        pub fn by_page(
13798            self,
13799        ) -> impl gax::paginator::Paginator<crate::model::ListGeneratorsResponse, gax::error::Error>
13800        {
13801            use std::clone::Clone;
13802            let token = self.0.request.page_token.clone();
13803            let execute = move |token: String| {
13804                let mut builder = self.clone();
13805                builder.0.request = builder.0.request.set_page_token(token);
13806                builder.send()
13807            };
13808            gax::paginator::internal::new_paginator(token, execute)
13809        }
13810
13811        /// Streams each item in the collection.
13812        pub fn by_item(
13813            self,
13814        ) -> impl gax::paginator::ItemPaginator<crate::model::ListGeneratorsResponse, gax::error::Error>
13815        {
13816            use gax::paginator::Paginator;
13817            self.by_page().items()
13818        }
13819
13820        /// Sets the value of [parent][crate::model::ListGeneratorsRequest::parent].
13821        ///
13822        /// This is a **required** field for requests.
13823        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13824            self.0.request.parent = v.into();
13825            self
13826        }
13827
13828        /// Sets the value of [page_size][crate::model::ListGeneratorsRequest::page_size].
13829        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13830            self.0.request.page_size = v.into();
13831            self
13832        }
13833
13834        /// Sets the value of [page_token][crate::model::ListGeneratorsRequest::page_token].
13835        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13836            self.0.request.page_token = v.into();
13837            self
13838        }
13839    }
13840
13841    #[doc(hidden)]
13842    impl gax::options::internal::RequestBuilder for ListGenerators {
13843        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13844            &mut self.0.options
13845        }
13846    }
13847
13848    /// The request builder for [Generators::delete_generator][crate::client::Generators::delete_generator] calls.
13849    ///
13850    /// # Example
13851    /// ```
13852    /// # use google_cloud_dialogflow_v2::builder::generators::DeleteGenerator;
13853    /// # async fn sample() -> gax::Result<()> {
13854    ///
13855    /// let builder = prepare_request_builder();
13856    /// let response = builder.send().await?;
13857    /// # Ok(()) }
13858    ///
13859    /// fn prepare_request_builder() -> DeleteGenerator {
13860    ///   # panic!();
13861    ///   // ... details omitted ...
13862    /// }
13863    /// ```
13864    #[derive(Clone, Debug)]
13865    pub struct DeleteGenerator(RequestBuilder<crate::model::DeleteGeneratorRequest>);
13866
13867    impl DeleteGenerator {
13868        pub(crate) fn new(
13869            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13870        ) -> Self {
13871            Self(RequestBuilder::new(stub))
13872        }
13873
13874        /// Sets the full request, replacing any prior values.
13875        pub fn with_request<V: Into<crate::model::DeleteGeneratorRequest>>(mut self, v: V) -> Self {
13876            self.0.request = v.into();
13877            self
13878        }
13879
13880        /// Sets all the options, replacing any prior values.
13881        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13882            self.0.options = v.into();
13883            self
13884        }
13885
13886        /// Sends the request.
13887        pub async fn send(self) -> Result<()> {
13888            (*self.0.stub)
13889                .delete_generator(self.0.request, self.0.options)
13890                .await
13891                .map(gax::response::Response::into_body)
13892        }
13893
13894        /// Sets the value of [name][crate::model::DeleteGeneratorRequest::name].
13895        ///
13896        /// This is a **required** field for requests.
13897        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13898            self.0.request.name = v.into();
13899            self
13900        }
13901    }
13902
13903    #[doc(hidden)]
13904    impl gax::options::internal::RequestBuilder for DeleteGenerator {
13905        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13906            &mut self.0.options
13907        }
13908    }
13909
13910    /// The request builder for [Generators::update_generator][crate::client::Generators::update_generator] calls.
13911    ///
13912    /// # Example
13913    /// ```
13914    /// # use google_cloud_dialogflow_v2::builder::generators::UpdateGenerator;
13915    /// # async fn sample() -> gax::Result<()> {
13916    ///
13917    /// let builder = prepare_request_builder();
13918    /// let response = builder.send().await?;
13919    /// # Ok(()) }
13920    ///
13921    /// fn prepare_request_builder() -> UpdateGenerator {
13922    ///   # panic!();
13923    ///   // ... details omitted ...
13924    /// }
13925    /// ```
13926    #[derive(Clone, Debug)]
13927    pub struct UpdateGenerator(RequestBuilder<crate::model::UpdateGeneratorRequest>);
13928
13929    impl UpdateGenerator {
13930        pub(crate) fn new(
13931            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13932        ) -> Self {
13933            Self(RequestBuilder::new(stub))
13934        }
13935
13936        /// Sets the full request, replacing any prior values.
13937        pub fn with_request<V: Into<crate::model::UpdateGeneratorRequest>>(mut self, v: V) -> Self {
13938            self.0.request = v.into();
13939            self
13940        }
13941
13942        /// Sets all the options, replacing any prior values.
13943        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13944            self.0.options = v.into();
13945            self
13946        }
13947
13948        /// Sends the request.
13949        pub async fn send(self) -> Result<crate::model::Generator> {
13950            (*self.0.stub)
13951                .update_generator(self.0.request, self.0.options)
13952                .await
13953                .map(gax::response::Response::into_body)
13954        }
13955
13956        /// Sets the value of [generator][crate::model::UpdateGeneratorRequest::generator].
13957        ///
13958        /// This is a **required** field for requests.
13959        pub fn set_generator<T>(mut self, v: T) -> Self
13960        where
13961            T: std::convert::Into<crate::model::Generator>,
13962        {
13963            self.0.request.generator = std::option::Option::Some(v.into());
13964            self
13965        }
13966
13967        /// Sets or clears the value of [generator][crate::model::UpdateGeneratorRequest::generator].
13968        ///
13969        /// This is a **required** field for requests.
13970        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
13971        where
13972            T: std::convert::Into<crate::model::Generator>,
13973        {
13974            self.0.request.generator = v.map(|x| x.into());
13975            self
13976        }
13977
13978        /// Sets the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
13979        pub fn set_update_mask<T>(mut self, v: T) -> Self
13980        where
13981            T: std::convert::Into<wkt::FieldMask>,
13982        {
13983            self.0.request.update_mask = std::option::Option::Some(v.into());
13984            self
13985        }
13986
13987        /// Sets or clears the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
13988        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13989        where
13990            T: std::convert::Into<wkt::FieldMask>,
13991        {
13992            self.0.request.update_mask = v.map(|x| x.into());
13993            self
13994        }
13995    }
13996
13997    #[doc(hidden)]
13998    impl gax::options::internal::RequestBuilder for UpdateGenerator {
13999        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14000            &mut self.0.options
14001        }
14002    }
14003
14004    /// The request builder for [Generators::list_locations][crate::client::Generators::list_locations] calls.
14005    ///
14006    /// # Example
14007    /// ```
14008    /// # use google_cloud_dialogflow_v2::builder::generators::ListLocations;
14009    /// # async fn sample() -> gax::Result<()> {
14010    /// use gax::paginator::ItemPaginator;
14011    ///
14012    /// let builder = prepare_request_builder();
14013    /// let mut items = builder.by_item();
14014    /// while let Some(result) = items.next().await {
14015    ///   let item = result?;
14016    /// }
14017    /// # Ok(()) }
14018    ///
14019    /// fn prepare_request_builder() -> ListLocations {
14020    ///   # panic!();
14021    ///   // ... details omitted ...
14022    /// }
14023    /// ```
14024    #[derive(Clone, Debug)]
14025    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
14026
14027    impl ListLocations {
14028        pub(crate) fn new(
14029            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14030        ) -> Self {
14031            Self(RequestBuilder::new(stub))
14032        }
14033
14034        /// Sets the full request, replacing any prior values.
14035        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
14036            mut self,
14037            v: V,
14038        ) -> Self {
14039            self.0.request = v.into();
14040            self
14041        }
14042
14043        /// Sets all the options, replacing any prior values.
14044        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14045            self.0.options = v.into();
14046            self
14047        }
14048
14049        /// Sends the request.
14050        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
14051            (*self.0.stub)
14052                .list_locations(self.0.request, self.0.options)
14053                .await
14054                .map(gax::response::Response::into_body)
14055        }
14056
14057        /// Streams each page in the collection.
14058        pub fn by_page(
14059            self,
14060        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
14061        {
14062            use std::clone::Clone;
14063            let token = self.0.request.page_token.clone();
14064            let execute = move |token: String| {
14065                let mut builder = self.clone();
14066                builder.0.request = builder.0.request.set_page_token(token);
14067                builder.send()
14068            };
14069            gax::paginator::internal::new_paginator(token, execute)
14070        }
14071
14072        /// Streams each item in the collection.
14073        pub fn by_item(
14074            self,
14075        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
14076        {
14077            use gax::paginator::Paginator;
14078            self.by_page().items()
14079        }
14080
14081        /// Sets the value of [name][location::model::ListLocationsRequest::name].
14082        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14083            self.0.request.name = v.into();
14084            self
14085        }
14086
14087        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
14088        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14089            self.0.request.filter = v.into();
14090            self
14091        }
14092
14093        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
14094        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14095            self.0.request.page_size = v.into();
14096            self
14097        }
14098
14099        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
14100        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14101            self.0.request.page_token = v.into();
14102            self
14103        }
14104    }
14105
14106    #[doc(hidden)]
14107    impl gax::options::internal::RequestBuilder for ListLocations {
14108        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14109            &mut self.0.options
14110        }
14111    }
14112
14113    /// The request builder for [Generators::get_location][crate::client::Generators::get_location] calls.
14114    ///
14115    /// # Example
14116    /// ```
14117    /// # use google_cloud_dialogflow_v2::builder::generators::GetLocation;
14118    /// # async fn sample() -> gax::Result<()> {
14119    ///
14120    /// let builder = prepare_request_builder();
14121    /// let response = builder.send().await?;
14122    /// # Ok(()) }
14123    ///
14124    /// fn prepare_request_builder() -> GetLocation {
14125    ///   # panic!();
14126    ///   // ... details omitted ...
14127    /// }
14128    /// ```
14129    #[derive(Clone, Debug)]
14130    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
14131
14132    impl GetLocation {
14133        pub(crate) fn new(
14134            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14135        ) -> Self {
14136            Self(RequestBuilder::new(stub))
14137        }
14138
14139        /// Sets the full request, replacing any prior values.
14140        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
14141            self.0.request = v.into();
14142            self
14143        }
14144
14145        /// Sets all the options, replacing any prior values.
14146        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14147            self.0.options = v.into();
14148            self
14149        }
14150
14151        /// Sends the request.
14152        pub async fn send(self) -> Result<location::model::Location> {
14153            (*self.0.stub)
14154                .get_location(self.0.request, self.0.options)
14155                .await
14156                .map(gax::response::Response::into_body)
14157        }
14158
14159        /// Sets the value of [name][location::model::GetLocationRequest::name].
14160        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14161            self.0.request.name = v.into();
14162            self
14163        }
14164    }
14165
14166    #[doc(hidden)]
14167    impl gax::options::internal::RequestBuilder for GetLocation {
14168        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14169            &mut self.0.options
14170        }
14171    }
14172
14173    /// The request builder for [Generators::list_operations][crate::client::Generators::list_operations] calls.
14174    ///
14175    /// # Example
14176    /// ```
14177    /// # use google_cloud_dialogflow_v2::builder::generators::ListOperations;
14178    /// # async fn sample() -> gax::Result<()> {
14179    /// use gax::paginator::ItemPaginator;
14180    ///
14181    /// let builder = prepare_request_builder();
14182    /// let mut items = builder.by_item();
14183    /// while let Some(result) = items.next().await {
14184    ///   let item = result?;
14185    /// }
14186    /// # Ok(()) }
14187    ///
14188    /// fn prepare_request_builder() -> ListOperations {
14189    ///   # panic!();
14190    ///   // ... details omitted ...
14191    /// }
14192    /// ```
14193    #[derive(Clone, Debug)]
14194    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
14195
14196    impl ListOperations {
14197        pub(crate) fn new(
14198            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14199        ) -> Self {
14200            Self(RequestBuilder::new(stub))
14201        }
14202
14203        /// Sets the full request, replacing any prior values.
14204        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
14205            mut self,
14206            v: V,
14207        ) -> Self {
14208            self.0.request = v.into();
14209            self
14210        }
14211
14212        /// Sets all the options, replacing any prior values.
14213        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14214            self.0.options = v.into();
14215            self
14216        }
14217
14218        /// Sends the request.
14219        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
14220            (*self.0.stub)
14221                .list_operations(self.0.request, self.0.options)
14222                .await
14223                .map(gax::response::Response::into_body)
14224        }
14225
14226        /// Streams each page in the collection.
14227        pub fn by_page(
14228            self,
14229        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
14230        {
14231            use std::clone::Clone;
14232            let token = self.0.request.page_token.clone();
14233            let execute = move |token: String| {
14234                let mut builder = self.clone();
14235                builder.0.request = builder.0.request.set_page_token(token);
14236                builder.send()
14237            };
14238            gax::paginator::internal::new_paginator(token, execute)
14239        }
14240
14241        /// Streams each item in the collection.
14242        pub fn by_item(
14243            self,
14244        ) -> impl gax::paginator::ItemPaginator<
14245            longrunning::model::ListOperationsResponse,
14246            gax::error::Error,
14247        > {
14248            use gax::paginator::Paginator;
14249            self.by_page().items()
14250        }
14251
14252        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
14253        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14254            self.0.request.name = v.into();
14255            self
14256        }
14257
14258        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
14259        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14260            self.0.request.filter = v.into();
14261            self
14262        }
14263
14264        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
14265        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14266            self.0.request.page_size = v.into();
14267            self
14268        }
14269
14270        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
14271        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14272            self.0.request.page_token = v.into();
14273            self
14274        }
14275
14276        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
14277        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14278            self.0.request.return_partial_success = v.into();
14279            self
14280        }
14281    }
14282
14283    #[doc(hidden)]
14284    impl gax::options::internal::RequestBuilder for ListOperations {
14285        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14286            &mut self.0.options
14287        }
14288    }
14289
14290    /// The request builder for [Generators::get_operation][crate::client::Generators::get_operation] calls.
14291    ///
14292    /// # Example
14293    /// ```
14294    /// # use google_cloud_dialogflow_v2::builder::generators::GetOperation;
14295    /// # async fn sample() -> gax::Result<()> {
14296    ///
14297    /// let builder = prepare_request_builder();
14298    /// let response = builder.send().await?;
14299    /// # Ok(()) }
14300    ///
14301    /// fn prepare_request_builder() -> GetOperation {
14302    ///   # panic!();
14303    ///   // ... details omitted ...
14304    /// }
14305    /// ```
14306    #[derive(Clone, Debug)]
14307    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
14308
14309    impl GetOperation {
14310        pub(crate) fn new(
14311            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14312        ) -> Self {
14313            Self(RequestBuilder::new(stub))
14314        }
14315
14316        /// Sets the full request, replacing any prior values.
14317        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
14318            mut self,
14319            v: V,
14320        ) -> Self {
14321            self.0.request = v.into();
14322            self
14323        }
14324
14325        /// Sets all the options, replacing any prior values.
14326        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14327            self.0.options = v.into();
14328            self
14329        }
14330
14331        /// Sends the request.
14332        pub async fn send(self) -> Result<longrunning::model::Operation> {
14333            (*self.0.stub)
14334                .get_operation(self.0.request, self.0.options)
14335                .await
14336                .map(gax::response::Response::into_body)
14337        }
14338
14339        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
14340        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14341            self.0.request.name = v.into();
14342            self
14343        }
14344    }
14345
14346    #[doc(hidden)]
14347    impl gax::options::internal::RequestBuilder for GetOperation {
14348        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14349            &mut self.0.options
14350        }
14351    }
14352
14353    /// The request builder for [Generators::cancel_operation][crate::client::Generators::cancel_operation] calls.
14354    ///
14355    /// # Example
14356    /// ```
14357    /// # use google_cloud_dialogflow_v2::builder::generators::CancelOperation;
14358    /// # async fn sample() -> gax::Result<()> {
14359    ///
14360    /// let builder = prepare_request_builder();
14361    /// let response = builder.send().await?;
14362    /// # Ok(()) }
14363    ///
14364    /// fn prepare_request_builder() -> CancelOperation {
14365    ///   # panic!();
14366    ///   // ... details omitted ...
14367    /// }
14368    /// ```
14369    #[derive(Clone, Debug)]
14370    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
14371
14372    impl CancelOperation {
14373        pub(crate) fn new(
14374            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14375        ) -> Self {
14376            Self(RequestBuilder::new(stub))
14377        }
14378
14379        /// Sets the full request, replacing any prior values.
14380        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
14381            mut self,
14382            v: V,
14383        ) -> Self {
14384            self.0.request = v.into();
14385            self
14386        }
14387
14388        /// Sets all the options, replacing any prior values.
14389        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14390            self.0.options = v.into();
14391            self
14392        }
14393
14394        /// Sends the request.
14395        pub async fn send(self) -> Result<()> {
14396            (*self.0.stub)
14397                .cancel_operation(self.0.request, self.0.options)
14398                .await
14399                .map(gax::response::Response::into_body)
14400        }
14401
14402        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
14403        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14404            self.0.request.name = v.into();
14405            self
14406        }
14407    }
14408
14409    #[doc(hidden)]
14410    impl gax::options::internal::RequestBuilder for CancelOperation {
14411        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14412            &mut self.0.options
14413        }
14414    }
14415}
14416
14417#[cfg(feature = "generator-evaluations")]
14418#[cfg_attr(docsrs, doc(cfg(feature = "generator-evaluations")))]
14419pub mod generator_evaluations {
14420    use crate::Result;
14421
14422    /// A builder for [GeneratorEvaluations][crate::client::GeneratorEvaluations].
14423    ///
14424    /// ```
14425    /// # async fn sample() -> gax::client_builder::Result<()> {
14426    /// # use google_cloud_dialogflow_v2::*;
14427    /// # use builder::generator_evaluations::ClientBuilder;
14428    /// # use client::GeneratorEvaluations;
14429    /// let builder : ClientBuilder = GeneratorEvaluations::builder();
14430    /// let client = builder
14431    ///     .with_endpoint("https://dialogflow.googleapis.com")
14432    ///     .build().await?;
14433    /// # Ok(()) }
14434    /// ```
14435    pub type ClientBuilder =
14436        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14437
14438    pub(crate) mod client {
14439        use super::super::super::client::GeneratorEvaluations;
14440        pub struct Factory;
14441        impl gax::client_builder::internal::ClientFactory for Factory {
14442            type Client = GeneratorEvaluations;
14443            type Credentials = gaxi::options::Credentials;
14444            async fn build(
14445                self,
14446                config: gaxi::options::ClientConfig,
14447            ) -> gax::client_builder::Result<Self::Client> {
14448                Self::Client::new(config).await
14449            }
14450        }
14451    }
14452
14453    /// Common implementation for [crate::client::GeneratorEvaluations] request builders.
14454    #[derive(Clone, Debug)]
14455    pub(crate) struct RequestBuilder<R: std::default::Default> {
14456        stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14457        request: R,
14458        options: gax::options::RequestOptions,
14459    }
14460
14461    impl<R> RequestBuilder<R>
14462    where
14463        R: std::default::Default,
14464    {
14465        pub(crate) fn new(
14466            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14467        ) -> Self {
14468            Self {
14469                stub,
14470                request: R::default(),
14471                options: gax::options::RequestOptions::default(),
14472            }
14473        }
14474    }
14475
14476    /// The request builder for [GeneratorEvaluations::create_generator_evaluation][crate::client::GeneratorEvaluations::create_generator_evaluation] calls.
14477    ///
14478    /// # Example
14479    /// ```
14480    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::CreateGeneratorEvaluation;
14481    /// # async fn sample() -> gax::Result<()> {
14482    /// use lro::Poller;
14483    ///
14484    /// let builder = prepare_request_builder();
14485    /// let response = builder.poller().until_done().await?;
14486    /// # Ok(()) }
14487    ///
14488    /// fn prepare_request_builder() -> CreateGeneratorEvaluation {
14489    ///   # panic!();
14490    ///   // ... details omitted ...
14491    /// }
14492    /// ```
14493    #[derive(Clone, Debug)]
14494    pub struct CreateGeneratorEvaluation(
14495        RequestBuilder<crate::model::CreateGeneratorEvaluationRequest>,
14496    );
14497
14498    impl CreateGeneratorEvaluation {
14499        pub(crate) fn new(
14500            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14501        ) -> Self {
14502            Self(RequestBuilder::new(stub))
14503        }
14504
14505        /// Sets the full request, replacing any prior values.
14506        pub fn with_request<V: Into<crate::model::CreateGeneratorEvaluationRequest>>(
14507            mut self,
14508            v: V,
14509        ) -> Self {
14510            self.0.request = v.into();
14511            self
14512        }
14513
14514        /// Sets all the options, replacing any prior values.
14515        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14516            self.0.options = v.into();
14517            self
14518        }
14519
14520        /// Sends the request.
14521        ///
14522        /// # Long running operations
14523        ///
14524        /// This starts, but does not poll, a longrunning operation. More information
14525        /// on [create_generator_evaluation][crate::client::GeneratorEvaluations::create_generator_evaluation].
14526        pub async fn send(self) -> Result<longrunning::model::Operation> {
14527            (*self.0.stub)
14528                .create_generator_evaluation(self.0.request, self.0.options)
14529                .await
14530                .map(gax::response::Response::into_body)
14531        }
14532
14533        /// Creates a [Poller][lro::Poller] to work with `create_generator_evaluation`.
14534        pub fn poller(
14535            self,
14536        ) -> impl lro::Poller<
14537            crate::model::GeneratorEvaluation,
14538            crate::model::GeneratorEvaluationOperationMetadata,
14539        > {
14540            type Operation = lro::internal::Operation<
14541                crate::model::GeneratorEvaluation,
14542                crate::model::GeneratorEvaluationOperationMetadata,
14543            >;
14544            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14545            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14546
14547            let stub = self.0.stub.clone();
14548            let mut options = self.0.options.clone();
14549            options.set_retry_policy(gax::retry_policy::NeverRetry);
14550            let query = move |name| {
14551                let stub = stub.clone();
14552                let options = options.clone();
14553                async {
14554                    let op = GetOperation::new(stub)
14555                        .set_name(name)
14556                        .with_options(options)
14557                        .send()
14558                        .await?;
14559                    Ok(Operation::new(op))
14560                }
14561            };
14562
14563            let start = move || async {
14564                let op = self.send().await?;
14565                Ok(Operation::new(op))
14566            };
14567
14568            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
14569        }
14570
14571        /// Sets the value of [parent][crate::model::CreateGeneratorEvaluationRequest::parent].
14572        ///
14573        /// This is a **required** field for requests.
14574        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14575            self.0.request.parent = v.into();
14576            self
14577        }
14578
14579        /// Sets the value of [generator_evaluation][crate::model::CreateGeneratorEvaluationRequest::generator_evaluation].
14580        ///
14581        /// This is a **required** field for requests.
14582        pub fn set_generator_evaluation<T>(mut self, v: T) -> Self
14583        where
14584            T: std::convert::Into<crate::model::GeneratorEvaluation>,
14585        {
14586            self.0.request.generator_evaluation = std::option::Option::Some(v.into());
14587            self
14588        }
14589
14590        /// Sets or clears the value of [generator_evaluation][crate::model::CreateGeneratorEvaluationRequest::generator_evaluation].
14591        ///
14592        /// This is a **required** field for requests.
14593        pub fn set_or_clear_generator_evaluation<T>(mut self, v: std::option::Option<T>) -> Self
14594        where
14595            T: std::convert::Into<crate::model::GeneratorEvaluation>,
14596        {
14597            self.0.request.generator_evaluation = v.map(|x| x.into());
14598            self
14599        }
14600    }
14601
14602    #[doc(hidden)]
14603    impl gax::options::internal::RequestBuilder for CreateGeneratorEvaluation {
14604        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14605            &mut self.0.options
14606        }
14607    }
14608
14609    /// The request builder for [GeneratorEvaluations::get_generator_evaluation][crate::client::GeneratorEvaluations::get_generator_evaluation] calls.
14610    ///
14611    /// # Example
14612    /// ```
14613    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetGeneratorEvaluation;
14614    /// # async fn sample() -> gax::Result<()> {
14615    ///
14616    /// let builder = prepare_request_builder();
14617    /// let response = builder.send().await?;
14618    /// # Ok(()) }
14619    ///
14620    /// fn prepare_request_builder() -> GetGeneratorEvaluation {
14621    ///   # panic!();
14622    ///   // ... details omitted ...
14623    /// }
14624    /// ```
14625    #[derive(Clone, Debug)]
14626    pub struct GetGeneratorEvaluation(RequestBuilder<crate::model::GetGeneratorEvaluationRequest>);
14627
14628    impl GetGeneratorEvaluation {
14629        pub(crate) fn new(
14630            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14631        ) -> Self {
14632            Self(RequestBuilder::new(stub))
14633        }
14634
14635        /// Sets the full request, replacing any prior values.
14636        pub fn with_request<V: Into<crate::model::GetGeneratorEvaluationRequest>>(
14637            mut self,
14638            v: V,
14639        ) -> Self {
14640            self.0.request = v.into();
14641            self
14642        }
14643
14644        /// Sets all the options, replacing any prior values.
14645        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14646            self.0.options = v.into();
14647            self
14648        }
14649
14650        /// Sends the request.
14651        pub async fn send(self) -> Result<crate::model::GeneratorEvaluation> {
14652            (*self.0.stub)
14653                .get_generator_evaluation(self.0.request, self.0.options)
14654                .await
14655                .map(gax::response::Response::into_body)
14656        }
14657
14658        /// Sets the value of [name][crate::model::GetGeneratorEvaluationRequest::name].
14659        ///
14660        /// This is a **required** field for requests.
14661        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14662            self.0.request.name = v.into();
14663            self
14664        }
14665    }
14666
14667    #[doc(hidden)]
14668    impl gax::options::internal::RequestBuilder for GetGeneratorEvaluation {
14669        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14670            &mut self.0.options
14671        }
14672    }
14673
14674    /// The request builder for [GeneratorEvaluations::list_generator_evaluations][crate::client::GeneratorEvaluations::list_generator_evaluations] calls.
14675    ///
14676    /// # Example
14677    /// ```
14678    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListGeneratorEvaluations;
14679    /// # async fn sample() -> gax::Result<()> {
14680    /// use gax::paginator::ItemPaginator;
14681    ///
14682    /// let builder = prepare_request_builder();
14683    /// let mut items = builder.by_item();
14684    /// while let Some(result) = items.next().await {
14685    ///   let item = result?;
14686    /// }
14687    /// # Ok(()) }
14688    ///
14689    /// fn prepare_request_builder() -> ListGeneratorEvaluations {
14690    ///   # panic!();
14691    ///   // ... details omitted ...
14692    /// }
14693    /// ```
14694    #[derive(Clone, Debug)]
14695    pub struct ListGeneratorEvaluations(
14696        RequestBuilder<crate::model::ListGeneratorEvaluationsRequest>,
14697    );
14698
14699    impl ListGeneratorEvaluations {
14700        pub(crate) fn new(
14701            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14702        ) -> Self {
14703            Self(RequestBuilder::new(stub))
14704        }
14705
14706        /// Sets the full request, replacing any prior values.
14707        pub fn with_request<V: Into<crate::model::ListGeneratorEvaluationsRequest>>(
14708            mut self,
14709            v: V,
14710        ) -> Self {
14711            self.0.request = v.into();
14712            self
14713        }
14714
14715        /// Sets all the options, replacing any prior values.
14716        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14717            self.0.options = v.into();
14718            self
14719        }
14720
14721        /// Sends the request.
14722        pub async fn send(self) -> Result<crate::model::ListGeneratorEvaluationsResponse> {
14723            (*self.0.stub)
14724                .list_generator_evaluations(self.0.request, self.0.options)
14725                .await
14726                .map(gax::response::Response::into_body)
14727        }
14728
14729        /// Streams each page in the collection.
14730        pub fn by_page(
14731            self,
14732        ) -> impl gax::paginator::Paginator<
14733            crate::model::ListGeneratorEvaluationsResponse,
14734            gax::error::Error,
14735        > {
14736            use std::clone::Clone;
14737            let token = self.0.request.page_token.clone();
14738            let execute = move |token: String| {
14739                let mut builder = self.clone();
14740                builder.0.request = builder.0.request.set_page_token(token);
14741                builder.send()
14742            };
14743            gax::paginator::internal::new_paginator(token, execute)
14744        }
14745
14746        /// Streams each item in the collection.
14747        pub fn by_item(
14748            self,
14749        ) -> impl gax::paginator::ItemPaginator<
14750            crate::model::ListGeneratorEvaluationsResponse,
14751            gax::error::Error,
14752        > {
14753            use gax::paginator::Paginator;
14754            self.by_page().items()
14755        }
14756
14757        /// Sets the value of [parent][crate::model::ListGeneratorEvaluationsRequest::parent].
14758        ///
14759        /// This is a **required** field for requests.
14760        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14761            self.0.request.parent = v.into();
14762            self
14763        }
14764
14765        /// Sets the value of [page_size][crate::model::ListGeneratorEvaluationsRequest::page_size].
14766        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14767            self.0.request.page_size = v.into();
14768            self
14769        }
14770
14771        /// Sets the value of [page_token][crate::model::ListGeneratorEvaluationsRequest::page_token].
14772        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14773            self.0.request.page_token = v.into();
14774            self
14775        }
14776    }
14777
14778    #[doc(hidden)]
14779    impl gax::options::internal::RequestBuilder for ListGeneratorEvaluations {
14780        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14781            &mut self.0.options
14782        }
14783    }
14784
14785    /// The request builder for [GeneratorEvaluations::delete_generator_evaluation][crate::client::GeneratorEvaluations::delete_generator_evaluation] calls.
14786    ///
14787    /// # Example
14788    /// ```
14789    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::DeleteGeneratorEvaluation;
14790    /// # async fn sample() -> gax::Result<()> {
14791    ///
14792    /// let builder = prepare_request_builder();
14793    /// let response = builder.send().await?;
14794    /// # Ok(()) }
14795    ///
14796    /// fn prepare_request_builder() -> DeleteGeneratorEvaluation {
14797    ///   # panic!();
14798    ///   // ... details omitted ...
14799    /// }
14800    /// ```
14801    #[derive(Clone, Debug)]
14802    pub struct DeleteGeneratorEvaluation(
14803        RequestBuilder<crate::model::DeleteGeneratorEvaluationRequest>,
14804    );
14805
14806    impl DeleteGeneratorEvaluation {
14807        pub(crate) fn new(
14808            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14809        ) -> Self {
14810            Self(RequestBuilder::new(stub))
14811        }
14812
14813        /// Sets the full request, replacing any prior values.
14814        pub fn with_request<V: Into<crate::model::DeleteGeneratorEvaluationRequest>>(
14815            mut self,
14816            v: V,
14817        ) -> Self {
14818            self.0.request = v.into();
14819            self
14820        }
14821
14822        /// Sets all the options, replacing any prior values.
14823        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14824            self.0.options = v.into();
14825            self
14826        }
14827
14828        /// Sends the request.
14829        pub async fn send(self) -> Result<()> {
14830            (*self.0.stub)
14831                .delete_generator_evaluation(self.0.request, self.0.options)
14832                .await
14833                .map(gax::response::Response::into_body)
14834        }
14835
14836        /// Sets the value of [name][crate::model::DeleteGeneratorEvaluationRequest::name].
14837        ///
14838        /// This is a **required** field for requests.
14839        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14840            self.0.request.name = v.into();
14841            self
14842        }
14843    }
14844
14845    #[doc(hidden)]
14846    impl gax::options::internal::RequestBuilder for DeleteGeneratorEvaluation {
14847        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14848            &mut self.0.options
14849        }
14850    }
14851
14852    /// The request builder for [GeneratorEvaluations::list_locations][crate::client::GeneratorEvaluations::list_locations] calls.
14853    ///
14854    /// # Example
14855    /// ```
14856    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListLocations;
14857    /// # async fn sample() -> gax::Result<()> {
14858    /// use gax::paginator::ItemPaginator;
14859    ///
14860    /// let builder = prepare_request_builder();
14861    /// let mut items = builder.by_item();
14862    /// while let Some(result) = items.next().await {
14863    ///   let item = result?;
14864    /// }
14865    /// # Ok(()) }
14866    ///
14867    /// fn prepare_request_builder() -> ListLocations {
14868    ///   # panic!();
14869    ///   // ... details omitted ...
14870    /// }
14871    /// ```
14872    #[derive(Clone, Debug)]
14873    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
14874
14875    impl ListLocations {
14876        pub(crate) fn new(
14877            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14878        ) -> Self {
14879            Self(RequestBuilder::new(stub))
14880        }
14881
14882        /// Sets the full request, replacing any prior values.
14883        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
14884            mut self,
14885            v: V,
14886        ) -> Self {
14887            self.0.request = v.into();
14888            self
14889        }
14890
14891        /// Sets all the options, replacing any prior values.
14892        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14893            self.0.options = v.into();
14894            self
14895        }
14896
14897        /// Sends the request.
14898        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
14899            (*self.0.stub)
14900                .list_locations(self.0.request, self.0.options)
14901                .await
14902                .map(gax::response::Response::into_body)
14903        }
14904
14905        /// Streams each page in the collection.
14906        pub fn by_page(
14907            self,
14908        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
14909        {
14910            use std::clone::Clone;
14911            let token = self.0.request.page_token.clone();
14912            let execute = move |token: String| {
14913                let mut builder = self.clone();
14914                builder.0.request = builder.0.request.set_page_token(token);
14915                builder.send()
14916            };
14917            gax::paginator::internal::new_paginator(token, execute)
14918        }
14919
14920        /// Streams each item in the collection.
14921        pub fn by_item(
14922            self,
14923        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
14924        {
14925            use gax::paginator::Paginator;
14926            self.by_page().items()
14927        }
14928
14929        /// Sets the value of [name][location::model::ListLocationsRequest::name].
14930        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14931            self.0.request.name = v.into();
14932            self
14933        }
14934
14935        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
14936        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14937            self.0.request.filter = v.into();
14938            self
14939        }
14940
14941        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
14942        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14943            self.0.request.page_size = v.into();
14944            self
14945        }
14946
14947        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
14948        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14949            self.0.request.page_token = v.into();
14950            self
14951        }
14952    }
14953
14954    #[doc(hidden)]
14955    impl gax::options::internal::RequestBuilder for ListLocations {
14956        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14957            &mut self.0.options
14958        }
14959    }
14960
14961    /// The request builder for [GeneratorEvaluations::get_location][crate::client::GeneratorEvaluations::get_location] calls.
14962    ///
14963    /// # Example
14964    /// ```
14965    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetLocation;
14966    /// # async fn sample() -> gax::Result<()> {
14967    ///
14968    /// let builder = prepare_request_builder();
14969    /// let response = builder.send().await?;
14970    /// # Ok(()) }
14971    ///
14972    /// fn prepare_request_builder() -> GetLocation {
14973    ///   # panic!();
14974    ///   // ... details omitted ...
14975    /// }
14976    /// ```
14977    #[derive(Clone, Debug)]
14978    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
14979
14980    impl GetLocation {
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<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
14989            self.0.request = v.into();
14990            self
14991        }
14992
14993        /// Sets all the options, replacing any prior values.
14994        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14995            self.0.options = v.into();
14996            self
14997        }
14998
14999        /// Sends the request.
15000        pub async fn send(self) -> Result<location::model::Location> {
15001            (*self.0.stub)
15002                .get_location(self.0.request, self.0.options)
15003                .await
15004                .map(gax::response::Response::into_body)
15005        }
15006
15007        /// Sets the value of [name][location::model::GetLocationRequest::name].
15008        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15009            self.0.request.name = v.into();
15010            self
15011        }
15012    }
15013
15014    #[doc(hidden)]
15015    impl gax::options::internal::RequestBuilder for GetLocation {
15016        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15017            &mut self.0.options
15018        }
15019    }
15020
15021    /// The request builder for [GeneratorEvaluations::list_operations][crate::client::GeneratorEvaluations::list_operations] calls.
15022    ///
15023    /// # Example
15024    /// ```
15025    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::ListOperations;
15026    /// # async fn sample() -> gax::Result<()> {
15027    /// use gax::paginator::ItemPaginator;
15028    ///
15029    /// let builder = prepare_request_builder();
15030    /// let mut items = builder.by_item();
15031    /// while let Some(result) = items.next().await {
15032    ///   let item = result?;
15033    /// }
15034    /// # Ok(()) }
15035    ///
15036    /// fn prepare_request_builder() -> ListOperations {
15037    ///   # panic!();
15038    ///   // ... details omitted ...
15039    /// }
15040    /// ```
15041    #[derive(Clone, Debug)]
15042    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
15043
15044    impl ListOperations {
15045        pub(crate) fn new(
15046            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15047        ) -> Self {
15048            Self(RequestBuilder::new(stub))
15049        }
15050
15051        /// Sets the full request, replacing any prior values.
15052        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
15053            mut self,
15054            v: V,
15055        ) -> Self {
15056            self.0.request = v.into();
15057            self
15058        }
15059
15060        /// Sets all the options, replacing any prior values.
15061        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15062            self.0.options = v.into();
15063            self
15064        }
15065
15066        /// Sends the request.
15067        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
15068            (*self.0.stub)
15069                .list_operations(self.0.request, self.0.options)
15070                .await
15071                .map(gax::response::Response::into_body)
15072        }
15073
15074        /// Streams each page in the collection.
15075        pub fn by_page(
15076            self,
15077        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
15078        {
15079            use std::clone::Clone;
15080            let token = self.0.request.page_token.clone();
15081            let execute = move |token: String| {
15082                let mut builder = self.clone();
15083                builder.0.request = builder.0.request.set_page_token(token);
15084                builder.send()
15085            };
15086            gax::paginator::internal::new_paginator(token, execute)
15087        }
15088
15089        /// Streams each item in the collection.
15090        pub fn by_item(
15091            self,
15092        ) -> impl gax::paginator::ItemPaginator<
15093            longrunning::model::ListOperationsResponse,
15094            gax::error::Error,
15095        > {
15096            use gax::paginator::Paginator;
15097            self.by_page().items()
15098        }
15099
15100        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
15101        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15102            self.0.request.name = v.into();
15103            self
15104        }
15105
15106        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
15107        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15108            self.0.request.filter = v.into();
15109            self
15110        }
15111
15112        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
15113        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15114            self.0.request.page_size = v.into();
15115            self
15116        }
15117
15118        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
15119        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15120            self.0.request.page_token = v.into();
15121            self
15122        }
15123
15124        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
15125        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15126            self.0.request.return_partial_success = v.into();
15127            self
15128        }
15129    }
15130
15131    #[doc(hidden)]
15132    impl gax::options::internal::RequestBuilder for ListOperations {
15133        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15134            &mut self.0.options
15135        }
15136    }
15137
15138    /// The request builder for [GeneratorEvaluations::get_operation][crate::client::GeneratorEvaluations::get_operation] calls.
15139    ///
15140    /// # Example
15141    /// ```
15142    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::GetOperation;
15143    /// # async fn sample() -> gax::Result<()> {
15144    ///
15145    /// let builder = prepare_request_builder();
15146    /// let response = builder.send().await?;
15147    /// # Ok(()) }
15148    ///
15149    /// fn prepare_request_builder() -> GetOperation {
15150    ///   # panic!();
15151    ///   // ... details omitted ...
15152    /// }
15153    /// ```
15154    #[derive(Clone, Debug)]
15155    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
15156
15157    impl GetOperation {
15158        pub(crate) fn new(
15159            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15160        ) -> Self {
15161            Self(RequestBuilder::new(stub))
15162        }
15163
15164        /// Sets the full request, replacing any prior values.
15165        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
15166            mut self,
15167            v: V,
15168        ) -> Self {
15169            self.0.request = v.into();
15170            self
15171        }
15172
15173        /// Sets all the options, replacing any prior values.
15174        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15175            self.0.options = v.into();
15176            self
15177        }
15178
15179        /// Sends the request.
15180        pub async fn send(self) -> Result<longrunning::model::Operation> {
15181            (*self.0.stub)
15182                .get_operation(self.0.request, self.0.options)
15183                .await
15184                .map(gax::response::Response::into_body)
15185        }
15186
15187        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
15188        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15189            self.0.request.name = v.into();
15190            self
15191        }
15192    }
15193
15194    #[doc(hidden)]
15195    impl gax::options::internal::RequestBuilder for GetOperation {
15196        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15197            &mut self.0.options
15198        }
15199    }
15200
15201    /// The request builder for [GeneratorEvaluations::cancel_operation][crate::client::GeneratorEvaluations::cancel_operation] calls.
15202    ///
15203    /// # Example
15204    /// ```
15205    /// # use google_cloud_dialogflow_v2::builder::generator_evaluations::CancelOperation;
15206    /// # async fn sample() -> gax::Result<()> {
15207    ///
15208    /// let builder = prepare_request_builder();
15209    /// let response = builder.send().await?;
15210    /// # Ok(()) }
15211    ///
15212    /// fn prepare_request_builder() -> CancelOperation {
15213    ///   # panic!();
15214    ///   // ... details omitted ...
15215    /// }
15216    /// ```
15217    #[derive(Clone, Debug)]
15218    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
15219
15220    impl CancelOperation {
15221        pub(crate) fn new(
15222            stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15223        ) -> Self {
15224            Self(RequestBuilder::new(stub))
15225        }
15226
15227        /// Sets the full request, replacing any prior values.
15228        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
15229            mut self,
15230            v: V,
15231        ) -> Self {
15232            self.0.request = v.into();
15233            self
15234        }
15235
15236        /// Sets all the options, replacing any prior values.
15237        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15238            self.0.options = v.into();
15239            self
15240        }
15241
15242        /// Sends the request.
15243        pub async fn send(self) -> Result<()> {
15244            (*self.0.stub)
15245                .cancel_operation(self.0.request, self.0.options)
15246                .await
15247                .map(gax::response::Response::into_body)
15248        }
15249
15250        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
15251        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15252            self.0.request.name = v.into();
15253            self
15254        }
15255    }
15256
15257    #[doc(hidden)]
15258    impl gax::options::internal::RequestBuilder for CancelOperation {
15259        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15260            &mut self.0.options
15261        }
15262    }
15263}
15264
15265#[cfg(feature = "intents")]
15266#[cfg_attr(docsrs, doc(cfg(feature = "intents")))]
15267pub mod intents {
15268    use crate::Result;
15269
15270    /// A builder for [Intents][crate::client::Intents].
15271    ///
15272    /// ```
15273    /// # async fn sample() -> gax::client_builder::Result<()> {
15274    /// # use google_cloud_dialogflow_v2::*;
15275    /// # use builder::intents::ClientBuilder;
15276    /// # use client::Intents;
15277    /// let builder : ClientBuilder = Intents::builder();
15278    /// let client = builder
15279    ///     .with_endpoint("https://dialogflow.googleapis.com")
15280    ///     .build().await?;
15281    /// # Ok(()) }
15282    /// ```
15283    pub type ClientBuilder =
15284        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15285
15286    pub(crate) mod client {
15287        use super::super::super::client::Intents;
15288        pub struct Factory;
15289        impl gax::client_builder::internal::ClientFactory for Factory {
15290            type Client = Intents;
15291            type Credentials = gaxi::options::Credentials;
15292            async fn build(
15293                self,
15294                config: gaxi::options::ClientConfig,
15295            ) -> gax::client_builder::Result<Self::Client> {
15296                Self::Client::new(config).await
15297            }
15298        }
15299    }
15300
15301    /// Common implementation for [crate::client::Intents] request builders.
15302    #[derive(Clone, Debug)]
15303    pub(crate) struct RequestBuilder<R: std::default::Default> {
15304        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>,
15305        request: R,
15306        options: gax::options::RequestOptions,
15307    }
15308
15309    impl<R> RequestBuilder<R>
15310    where
15311        R: std::default::Default,
15312    {
15313        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15314            Self {
15315                stub,
15316                request: R::default(),
15317                options: gax::options::RequestOptions::default(),
15318            }
15319        }
15320    }
15321
15322    /// The request builder for [Intents::list_intents][crate::client::Intents::list_intents] calls.
15323    ///
15324    /// # Example
15325    /// ```
15326    /// # use google_cloud_dialogflow_v2::builder::intents::ListIntents;
15327    /// # async fn sample() -> gax::Result<()> {
15328    /// use gax::paginator::ItemPaginator;
15329    ///
15330    /// let builder = prepare_request_builder();
15331    /// let mut items = builder.by_item();
15332    /// while let Some(result) = items.next().await {
15333    ///   let item = result?;
15334    /// }
15335    /// # Ok(()) }
15336    ///
15337    /// fn prepare_request_builder() -> ListIntents {
15338    ///   # panic!();
15339    ///   // ... details omitted ...
15340    /// }
15341    /// ```
15342    #[derive(Clone, Debug)]
15343    pub struct ListIntents(RequestBuilder<crate::model::ListIntentsRequest>);
15344
15345    impl ListIntents {
15346        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15347            Self(RequestBuilder::new(stub))
15348        }
15349
15350        /// Sets the full request, replacing any prior values.
15351        pub fn with_request<V: Into<crate::model::ListIntentsRequest>>(mut self, v: V) -> Self {
15352            self.0.request = v.into();
15353            self
15354        }
15355
15356        /// Sets all the options, replacing any prior values.
15357        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15358            self.0.options = v.into();
15359            self
15360        }
15361
15362        /// Sends the request.
15363        pub async fn send(self) -> Result<crate::model::ListIntentsResponse> {
15364            (*self.0.stub)
15365                .list_intents(self.0.request, self.0.options)
15366                .await
15367                .map(gax::response::Response::into_body)
15368        }
15369
15370        /// Streams each page in the collection.
15371        pub fn by_page(
15372            self,
15373        ) -> impl gax::paginator::Paginator<crate::model::ListIntentsResponse, gax::error::Error>
15374        {
15375            use std::clone::Clone;
15376            let token = self.0.request.page_token.clone();
15377            let execute = move |token: String| {
15378                let mut builder = self.clone();
15379                builder.0.request = builder.0.request.set_page_token(token);
15380                builder.send()
15381            };
15382            gax::paginator::internal::new_paginator(token, execute)
15383        }
15384
15385        /// Streams each item in the collection.
15386        pub fn by_item(
15387            self,
15388        ) -> impl gax::paginator::ItemPaginator<crate::model::ListIntentsResponse, gax::error::Error>
15389        {
15390            use gax::paginator::Paginator;
15391            self.by_page().items()
15392        }
15393
15394        /// Sets the value of [parent][crate::model::ListIntentsRequest::parent].
15395        ///
15396        /// This is a **required** field for requests.
15397        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15398            self.0.request.parent = v.into();
15399            self
15400        }
15401
15402        /// Sets the value of [language_code][crate::model::ListIntentsRequest::language_code].
15403        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15404            self.0.request.language_code = v.into();
15405            self
15406        }
15407
15408        /// Sets the value of [intent_view][crate::model::ListIntentsRequest::intent_view].
15409        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15410            self.0.request.intent_view = v.into();
15411            self
15412        }
15413
15414        /// Sets the value of [page_size][crate::model::ListIntentsRequest::page_size].
15415        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15416            self.0.request.page_size = v.into();
15417            self
15418        }
15419
15420        /// Sets the value of [page_token][crate::model::ListIntentsRequest::page_token].
15421        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15422            self.0.request.page_token = v.into();
15423            self
15424        }
15425    }
15426
15427    #[doc(hidden)]
15428    impl gax::options::internal::RequestBuilder for ListIntents {
15429        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15430            &mut self.0.options
15431        }
15432    }
15433
15434    /// The request builder for [Intents::get_intent][crate::client::Intents::get_intent] calls.
15435    ///
15436    /// # Example
15437    /// ```
15438    /// # use google_cloud_dialogflow_v2::builder::intents::GetIntent;
15439    /// # async fn sample() -> gax::Result<()> {
15440    ///
15441    /// let builder = prepare_request_builder();
15442    /// let response = builder.send().await?;
15443    /// # Ok(()) }
15444    ///
15445    /// fn prepare_request_builder() -> GetIntent {
15446    ///   # panic!();
15447    ///   // ... details omitted ...
15448    /// }
15449    /// ```
15450    #[derive(Clone, Debug)]
15451    pub struct GetIntent(RequestBuilder<crate::model::GetIntentRequest>);
15452
15453    impl GetIntent {
15454        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15455            Self(RequestBuilder::new(stub))
15456        }
15457
15458        /// Sets the full request, replacing any prior values.
15459        pub fn with_request<V: Into<crate::model::GetIntentRequest>>(mut self, v: V) -> Self {
15460            self.0.request = v.into();
15461            self
15462        }
15463
15464        /// Sets all the options, replacing any prior values.
15465        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15466            self.0.options = v.into();
15467            self
15468        }
15469
15470        /// Sends the request.
15471        pub async fn send(self) -> Result<crate::model::Intent> {
15472            (*self.0.stub)
15473                .get_intent(self.0.request, self.0.options)
15474                .await
15475                .map(gax::response::Response::into_body)
15476        }
15477
15478        /// Sets the value of [name][crate::model::GetIntentRequest::name].
15479        ///
15480        /// This is a **required** field for requests.
15481        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15482            self.0.request.name = v.into();
15483            self
15484        }
15485
15486        /// Sets the value of [language_code][crate::model::GetIntentRequest::language_code].
15487        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15488            self.0.request.language_code = v.into();
15489            self
15490        }
15491
15492        /// Sets the value of [intent_view][crate::model::GetIntentRequest::intent_view].
15493        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15494            self.0.request.intent_view = v.into();
15495            self
15496        }
15497    }
15498
15499    #[doc(hidden)]
15500    impl gax::options::internal::RequestBuilder for GetIntent {
15501        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15502            &mut self.0.options
15503        }
15504    }
15505
15506    /// The request builder for [Intents::create_intent][crate::client::Intents::create_intent] calls.
15507    ///
15508    /// # Example
15509    /// ```
15510    /// # use google_cloud_dialogflow_v2::builder::intents::CreateIntent;
15511    /// # async fn sample() -> gax::Result<()> {
15512    ///
15513    /// let builder = prepare_request_builder();
15514    /// let response = builder.send().await?;
15515    /// # Ok(()) }
15516    ///
15517    /// fn prepare_request_builder() -> CreateIntent {
15518    ///   # panic!();
15519    ///   // ... details omitted ...
15520    /// }
15521    /// ```
15522    #[derive(Clone, Debug)]
15523    pub struct CreateIntent(RequestBuilder<crate::model::CreateIntentRequest>);
15524
15525    impl CreateIntent {
15526        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15527            Self(RequestBuilder::new(stub))
15528        }
15529
15530        /// Sets the full request, replacing any prior values.
15531        pub fn with_request<V: Into<crate::model::CreateIntentRequest>>(mut self, v: V) -> Self {
15532            self.0.request = v.into();
15533            self
15534        }
15535
15536        /// Sets all the options, replacing any prior values.
15537        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15538            self.0.options = v.into();
15539            self
15540        }
15541
15542        /// Sends the request.
15543        pub async fn send(self) -> Result<crate::model::Intent> {
15544            (*self.0.stub)
15545                .create_intent(self.0.request, self.0.options)
15546                .await
15547                .map(gax::response::Response::into_body)
15548        }
15549
15550        /// Sets the value of [parent][crate::model::CreateIntentRequest::parent].
15551        ///
15552        /// This is a **required** field for requests.
15553        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15554            self.0.request.parent = v.into();
15555            self
15556        }
15557
15558        /// Sets the value of [intent][crate::model::CreateIntentRequest::intent].
15559        ///
15560        /// This is a **required** field for requests.
15561        pub fn set_intent<T>(mut self, v: T) -> Self
15562        where
15563            T: std::convert::Into<crate::model::Intent>,
15564        {
15565            self.0.request.intent = std::option::Option::Some(v.into());
15566            self
15567        }
15568
15569        /// Sets or clears the value of [intent][crate::model::CreateIntentRequest::intent].
15570        ///
15571        /// This is a **required** field for requests.
15572        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
15573        where
15574            T: std::convert::Into<crate::model::Intent>,
15575        {
15576            self.0.request.intent = v.map(|x| x.into());
15577            self
15578        }
15579
15580        /// Sets the value of [language_code][crate::model::CreateIntentRequest::language_code].
15581        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15582            self.0.request.language_code = v.into();
15583            self
15584        }
15585
15586        /// Sets the value of [intent_view][crate::model::CreateIntentRequest::intent_view].
15587        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15588            self.0.request.intent_view = v.into();
15589            self
15590        }
15591    }
15592
15593    #[doc(hidden)]
15594    impl gax::options::internal::RequestBuilder for CreateIntent {
15595        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15596            &mut self.0.options
15597        }
15598    }
15599
15600    /// The request builder for [Intents::update_intent][crate::client::Intents::update_intent] calls.
15601    ///
15602    /// # Example
15603    /// ```
15604    /// # use google_cloud_dialogflow_v2::builder::intents::UpdateIntent;
15605    /// # async fn sample() -> gax::Result<()> {
15606    ///
15607    /// let builder = prepare_request_builder();
15608    /// let response = builder.send().await?;
15609    /// # Ok(()) }
15610    ///
15611    /// fn prepare_request_builder() -> UpdateIntent {
15612    ///   # panic!();
15613    ///   // ... details omitted ...
15614    /// }
15615    /// ```
15616    #[derive(Clone, Debug)]
15617    pub struct UpdateIntent(RequestBuilder<crate::model::UpdateIntentRequest>);
15618
15619    impl UpdateIntent {
15620        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15621            Self(RequestBuilder::new(stub))
15622        }
15623
15624        /// Sets the full request, replacing any prior values.
15625        pub fn with_request<V: Into<crate::model::UpdateIntentRequest>>(mut self, v: V) -> Self {
15626            self.0.request = v.into();
15627            self
15628        }
15629
15630        /// Sets all the options, replacing any prior values.
15631        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15632            self.0.options = v.into();
15633            self
15634        }
15635
15636        /// Sends the request.
15637        pub async fn send(self) -> Result<crate::model::Intent> {
15638            (*self.0.stub)
15639                .update_intent(self.0.request, self.0.options)
15640                .await
15641                .map(gax::response::Response::into_body)
15642        }
15643
15644        /// Sets the value of [intent][crate::model::UpdateIntentRequest::intent].
15645        ///
15646        /// This is a **required** field for requests.
15647        pub fn set_intent<T>(mut self, v: T) -> Self
15648        where
15649            T: std::convert::Into<crate::model::Intent>,
15650        {
15651            self.0.request.intent = std::option::Option::Some(v.into());
15652            self
15653        }
15654
15655        /// Sets or clears the value of [intent][crate::model::UpdateIntentRequest::intent].
15656        ///
15657        /// This is a **required** field for requests.
15658        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
15659        where
15660            T: std::convert::Into<crate::model::Intent>,
15661        {
15662            self.0.request.intent = v.map(|x| x.into());
15663            self
15664        }
15665
15666        /// Sets the value of [language_code][crate::model::UpdateIntentRequest::language_code].
15667        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15668            self.0.request.language_code = v.into();
15669            self
15670        }
15671
15672        /// Sets the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
15673        pub fn set_update_mask<T>(mut self, v: T) -> Self
15674        where
15675            T: std::convert::Into<wkt::FieldMask>,
15676        {
15677            self.0.request.update_mask = std::option::Option::Some(v.into());
15678            self
15679        }
15680
15681        /// Sets or clears the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
15682        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15683        where
15684            T: std::convert::Into<wkt::FieldMask>,
15685        {
15686            self.0.request.update_mask = v.map(|x| x.into());
15687            self
15688        }
15689
15690        /// Sets the value of [intent_view][crate::model::UpdateIntentRequest::intent_view].
15691        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15692            self.0.request.intent_view = v.into();
15693            self
15694        }
15695    }
15696
15697    #[doc(hidden)]
15698    impl gax::options::internal::RequestBuilder for UpdateIntent {
15699        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15700            &mut self.0.options
15701        }
15702    }
15703
15704    /// The request builder for [Intents::delete_intent][crate::client::Intents::delete_intent] calls.
15705    ///
15706    /// # Example
15707    /// ```
15708    /// # use google_cloud_dialogflow_v2::builder::intents::DeleteIntent;
15709    /// # async fn sample() -> gax::Result<()> {
15710    ///
15711    /// let builder = prepare_request_builder();
15712    /// let response = builder.send().await?;
15713    /// # Ok(()) }
15714    ///
15715    /// fn prepare_request_builder() -> DeleteIntent {
15716    ///   # panic!();
15717    ///   // ... details omitted ...
15718    /// }
15719    /// ```
15720    #[derive(Clone, Debug)]
15721    pub struct DeleteIntent(RequestBuilder<crate::model::DeleteIntentRequest>);
15722
15723    impl DeleteIntent {
15724        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15725            Self(RequestBuilder::new(stub))
15726        }
15727
15728        /// Sets the full request, replacing any prior values.
15729        pub fn with_request<V: Into<crate::model::DeleteIntentRequest>>(mut self, v: V) -> Self {
15730            self.0.request = v.into();
15731            self
15732        }
15733
15734        /// Sets all the options, replacing any prior values.
15735        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15736            self.0.options = v.into();
15737            self
15738        }
15739
15740        /// Sends the request.
15741        pub async fn send(self) -> Result<()> {
15742            (*self.0.stub)
15743                .delete_intent(self.0.request, self.0.options)
15744                .await
15745                .map(gax::response::Response::into_body)
15746        }
15747
15748        /// Sets the value of [name][crate::model::DeleteIntentRequest::name].
15749        ///
15750        /// This is a **required** field for requests.
15751        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15752            self.0.request.name = v.into();
15753            self
15754        }
15755    }
15756
15757    #[doc(hidden)]
15758    impl gax::options::internal::RequestBuilder for DeleteIntent {
15759        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15760            &mut self.0.options
15761        }
15762    }
15763
15764    /// The request builder for [Intents::batch_update_intents][crate::client::Intents::batch_update_intents] calls.
15765    ///
15766    /// # Example
15767    /// ```
15768    /// # use google_cloud_dialogflow_v2::builder::intents::BatchUpdateIntents;
15769    /// # async fn sample() -> gax::Result<()> {
15770    /// use lro::Poller;
15771    ///
15772    /// let builder = prepare_request_builder();
15773    /// let response = builder.poller().until_done().await?;
15774    /// # Ok(()) }
15775    ///
15776    /// fn prepare_request_builder() -> BatchUpdateIntents {
15777    ///   # panic!();
15778    ///   // ... details omitted ...
15779    /// }
15780    /// ```
15781    #[derive(Clone, Debug)]
15782    pub struct BatchUpdateIntents(RequestBuilder<crate::model::BatchUpdateIntentsRequest>);
15783
15784    impl BatchUpdateIntents {
15785        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15786            Self(RequestBuilder::new(stub))
15787        }
15788
15789        /// Sets the full request, replacing any prior values.
15790        pub fn with_request<V: Into<crate::model::BatchUpdateIntentsRequest>>(
15791            mut self,
15792            v: V,
15793        ) -> Self {
15794            self.0.request = v.into();
15795            self
15796        }
15797
15798        /// Sets all the options, replacing any prior values.
15799        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15800            self.0.options = v.into();
15801            self
15802        }
15803
15804        /// Sends the request.
15805        ///
15806        /// # Long running operations
15807        ///
15808        /// This starts, but does not poll, a longrunning operation. More information
15809        /// on [batch_update_intents][crate::client::Intents::batch_update_intents].
15810        pub async fn send(self) -> Result<longrunning::model::Operation> {
15811            (*self.0.stub)
15812                .batch_update_intents(self.0.request, self.0.options)
15813                .await
15814                .map(gax::response::Response::into_body)
15815        }
15816
15817        /// Creates a [Poller][lro::Poller] to work with `batch_update_intents`.
15818        pub fn poller(
15819            self,
15820        ) -> impl lro::Poller<crate::model::BatchUpdateIntentsResponse, wkt::Struct> {
15821            type Operation =
15822                lro::internal::Operation<crate::model::BatchUpdateIntentsResponse, wkt::Struct>;
15823            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15824            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15825
15826            let stub = self.0.stub.clone();
15827            let mut options = self.0.options.clone();
15828            options.set_retry_policy(gax::retry_policy::NeverRetry);
15829            let query = move |name| {
15830                let stub = stub.clone();
15831                let options = options.clone();
15832                async {
15833                    let op = GetOperation::new(stub)
15834                        .set_name(name)
15835                        .with_options(options)
15836                        .send()
15837                        .await?;
15838                    Ok(Operation::new(op))
15839                }
15840            };
15841
15842            let start = move || async {
15843                let op = self.send().await?;
15844                Ok(Operation::new(op))
15845            };
15846
15847            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15848        }
15849
15850        /// Sets the value of [parent][crate::model::BatchUpdateIntentsRequest::parent].
15851        ///
15852        /// This is a **required** field for requests.
15853        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15854            self.0.request.parent = v.into();
15855            self
15856        }
15857
15858        /// Sets the value of [language_code][crate::model::BatchUpdateIntentsRequest::language_code].
15859        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15860            self.0.request.language_code = v.into();
15861            self
15862        }
15863
15864        /// Sets the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
15865        pub fn set_update_mask<T>(mut self, v: T) -> Self
15866        where
15867            T: std::convert::Into<wkt::FieldMask>,
15868        {
15869            self.0.request.update_mask = std::option::Option::Some(v.into());
15870            self
15871        }
15872
15873        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
15874        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15875        where
15876            T: std::convert::Into<wkt::FieldMask>,
15877        {
15878            self.0.request.update_mask = v.map(|x| x.into());
15879            self
15880        }
15881
15882        /// Sets the value of [intent_view][crate::model::BatchUpdateIntentsRequest::intent_view].
15883        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15884            self.0.request.intent_view = v.into();
15885            self
15886        }
15887
15888        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch].
15889        ///
15890        /// Note that all the setters affecting `intent_batch` are
15891        /// mutually exclusive.
15892        pub fn set_intent_batch<
15893            T: Into<Option<crate::model::batch_update_intents_request::IntentBatch>>,
15894        >(
15895            mut self,
15896            v: T,
15897        ) -> Self {
15898            self.0.request.intent_batch = v.into();
15899            self
15900        }
15901
15902        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
15903        /// to hold a `IntentBatchUri`.
15904        ///
15905        /// Note that all the setters affecting `intent_batch` are
15906        /// mutually exclusive.
15907        pub fn set_intent_batch_uri<T: std::convert::Into<std::string::String>>(
15908            mut self,
15909            v: T,
15910        ) -> Self {
15911            self.0.request = self.0.request.set_intent_batch_uri(v);
15912            self
15913        }
15914
15915        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
15916        /// to hold a `IntentBatchInline`.
15917        ///
15918        /// Note that all the setters affecting `intent_batch` are
15919        /// mutually exclusive.
15920        pub fn set_intent_batch_inline<
15921            T: std::convert::Into<std::boxed::Box<crate::model::IntentBatch>>,
15922        >(
15923            mut self,
15924            v: T,
15925        ) -> Self {
15926            self.0.request = self.0.request.set_intent_batch_inline(v);
15927            self
15928        }
15929    }
15930
15931    #[doc(hidden)]
15932    impl gax::options::internal::RequestBuilder for BatchUpdateIntents {
15933        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15934            &mut self.0.options
15935        }
15936    }
15937
15938    /// The request builder for [Intents::batch_delete_intents][crate::client::Intents::batch_delete_intents] calls.
15939    ///
15940    /// # Example
15941    /// ```
15942    /// # use google_cloud_dialogflow_v2::builder::intents::BatchDeleteIntents;
15943    /// # async fn sample() -> gax::Result<()> {
15944    /// use lro::Poller;
15945    ///
15946    /// let builder = prepare_request_builder();
15947    /// let response = builder.poller().until_done().await?;
15948    /// # Ok(()) }
15949    ///
15950    /// fn prepare_request_builder() -> BatchDeleteIntents {
15951    ///   # panic!();
15952    ///   // ... details omitted ...
15953    /// }
15954    /// ```
15955    #[derive(Clone, Debug)]
15956    pub struct BatchDeleteIntents(RequestBuilder<crate::model::BatchDeleteIntentsRequest>);
15957
15958    impl BatchDeleteIntents {
15959        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15960            Self(RequestBuilder::new(stub))
15961        }
15962
15963        /// Sets the full request, replacing any prior values.
15964        pub fn with_request<V: Into<crate::model::BatchDeleteIntentsRequest>>(
15965            mut self,
15966            v: V,
15967        ) -> Self {
15968            self.0.request = v.into();
15969            self
15970        }
15971
15972        /// Sets all the options, replacing any prior values.
15973        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15974            self.0.options = v.into();
15975            self
15976        }
15977
15978        /// Sends the request.
15979        ///
15980        /// # Long running operations
15981        ///
15982        /// This starts, but does not poll, a longrunning operation. More information
15983        /// on [batch_delete_intents][crate::client::Intents::batch_delete_intents].
15984        pub async fn send(self) -> Result<longrunning::model::Operation> {
15985            (*self.0.stub)
15986                .batch_delete_intents(self.0.request, self.0.options)
15987                .await
15988                .map(gax::response::Response::into_body)
15989        }
15990
15991        /// Creates a [Poller][lro::Poller] to work with `batch_delete_intents`.
15992        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
15993            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
15994            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15995            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15996
15997            let stub = self.0.stub.clone();
15998            let mut options = self.0.options.clone();
15999            options.set_retry_policy(gax::retry_policy::NeverRetry);
16000            let query = move |name| {
16001                let stub = stub.clone();
16002                let options = options.clone();
16003                async {
16004                    let op = GetOperation::new(stub)
16005                        .set_name(name)
16006                        .with_options(options)
16007                        .send()
16008                        .await?;
16009                    Ok(Operation::new(op))
16010                }
16011            };
16012
16013            let start = move || async {
16014                let op = self.send().await?;
16015                Ok(Operation::new(op))
16016            };
16017
16018            lro::internal::new_unit_response_poller(
16019                polling_error_policy,
16020                polling_backoff_policy,
16021                start,
16022                query,
16023            )
16024        }
16025
16026        /// Sets the value of [parent][crate::model::BatchDeleteIntentsRequest::parent].
16027        ///
16028        /// This is a **required** field for requests.
16029        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16030            self.0.request.parent = v.into();
16031            self
16032        }
16033
16034        /// Sets the value of [intents][crate::model::BatchDeleteIntentsRequest::intents].
16035        ///
16036        /// This is a **required** field for requests.
16037        pub fn set_intents<T, V>(mut self, v: T) -> Self
16038        where
16039            T: std::iter::IntoIterator<Item = V>,
16040            V: std::convert::Into<crate::model::Intent>,
16041        {
16042            use std::iter::Iterator;
16043            self.0.request.intents = v.into_iter().map(|i| i.into()).collect();
16044            self
16045        }
16046    }
16047
16048    #[doc(hidden)]
16049    impl gax::options::internal::RequestBuilder for BatchDeleteIntents {
16050        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16051            &mut self.0.options
16052        }
16053    }
16054
16055    /// The request builder for [Intents::list_locations][crate::client::Intents::list_locations] calls.
16056    ///
16057    /// # Example
16058    /// ```
16059    /// # use google_cloud_dialogflow_v2::builder::intents::ListLocations;
16060    /// # async fn sample() -> gax::Result<()> {
16061    /// use gax::paginator::ItemPaginator;
16062    ///
16063    /// let builder = prepare_request_builder();
16064    /// let mut items = builder.by_item();
16065    /// while let Some(result) = items.next().await {
16066    ///   let item = result?;
16067    /// }
16068    /// # Ok(()) }
16069    ///
16070    /// fn prepare_request_builder() -> ListLocations {
16071    ///   # panic!();
16072    ///   // ... details omitted ...
16073    /// }
16074    /// ```
16075    #[derive(Clone, Debug)]
16076    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
16077
16078    impl ListLocations {
16079        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16080            Self(RequestBuilder::new(stub))
16081        }
16082
16083        /// Sets the full request, replacing any prior values.
16084        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
16085            mut self,
16086            v: V,
16087        ) -> Self {
16088            self.0.request = v.into();
16089            self
16090        }
16091
16092        /// Sets all the options, replacing any prior values.
16093        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16094            self.0.options = v.into();
16095            self
16096        }
16097
16098        /// Sends the request.
16099        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
16100            (*self.0.stub)
16101                .list_locations(self.0.request, self.0.options)
16102                .await
16103                .map(gax::response::Response::into_body)
16104        }
16105
16106        /// Streams each page in the collection.
16107        pub fn by_page(
16108            self,
16109        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
16110        {
16111            use std::clone::Clone;
16112            let token = self.0.request.page_token.clone();
16113            let execute = move |token: String| {
16114                let mut builder = self.clone();
16115                builder.0.request = builder.0.request.set_page_token(token);
16116                builder.send()
16117            };
16118            gax::paginator::internal::new_paginator(token, execute)
16119        }
16120
16121        /// Streams each item in the collection.
16122        pub fn by_item(
16123            self,
16124        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
16125        {
16126            use gax::paginator::Paginator;
16127            self.by_page().items()
16128        }
16129
16130        /// Sets the value of [name][location::model::ListLocationsRequest::name].
16131        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16132            self.0.request.name = v.into();
16133            self
16134        }
16135
16136        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
16137        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16138            self.0.request.filter = v.into();
16139            self
16140        }
16141
16142        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
16143        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16144            self.0.request.page_size = v.into();
16145            self
16146        }
16147
16148        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
16149        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16150            self.0.request.page_token = v.into();
16151            self
16152        }
16153    }
16154
16155    #[doc(hidden)]
16156    impl gax::options::internal::RequestBuilder for ListLocations {
16157        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16158            &mut self.0.options
16159        }
16160    }
16161
16162    /// The request builder for [Intents::get_location][crate::client::Intents::get_location] calls.
16163    ///
16164    /// # Example
16165    /// ```
16166    /// # use google_cloud_dialogflow_v2::builder::intents::GetLocation;
16167    /// # async fn sample() -> gax::Result<()> {
16168    ///
16169    /// let builder = prepare_request_builder();
16170    /// let response = builder.send().await?;
16171    /// # Ok(()) }
16172    ///
16173    /// fn prepare_request_builder() -> GetLocation {
16174    ///   # panic!();
16175    ///   // ... details omitted ...
16176    /// }
16177    /// ```
16178    #[derive(Clone, Debug)]
16179    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
16180
16181    impl GetLocation {
16182        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16183            Self(RequestBuilder::new(stub))
16184        }
16185
16186        /// Sets the full request, replacing any prior values.
16187        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
16188            self.0.request = v.into();
16189            self
16190        }
16191
16192        /// Sets all the options, replacing any prior values.
16193        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16194            self.0.options = v.into();
16195            self
16196        }
16197
16198        /// Sends the request.
16199        pub async fn send(self) -> Result<location::model::Location> {
16200            (*self.0.stub)
16201                .get_location(self.0.request, self.0.options)
16202                .await
16203                .map(gax::response::Response::into_body)
16204        }
16205
16206        /// Sets the value of [name][location::model::GetLocationRequest::name].
16207        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16208            self.0.request.name = v.into();
16209            self
16210        }
16211    }
16212
16213    #[doc(hidden)]
16214    impl gax::options::internal::RequestBuilder for GetLocation {
16215        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16216            &mut self.0.options
16217        }
16218    }
16219
16220    /// The request builder for [Intents::list_operations][crate::client::Intents::list_operations] calls.
16221    ///
16222    /// # Example
16223    /// ```
16224    /// # use google_cloud_dialogflow_v2::builder::intents::ListOperations;
16225    /// # async fn sample() -> gax::Result<()> {
16226    /// use gax::paginator::ItemPaginator;
16227    ///
16228    /// let builder = prepare_request_builder();
16229    /// let mut items = builder.by_item();
16230    /// while let Some(result) = items.next().await {
16231    ///   let item = result?;
16232    /// }
16233    /// # Ok(()) }
16234    ///
16235    /// fn prepare_request_builder() -> ListOperations {
16236    ///   # panic!();
16237    ///   // ... details omitted ...
16238    /// }
16239    /// ```
16240    #[derive(Clone, Debug)]
16241    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
16242
16243    impl ListOperations {
16244        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16245            Self(RequestBuilder::new(stub))
16246        }
16247
16248        /// Sets the full request, replacing any prior values.
16249        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
16250            mut self,
16251            v: V,
16252        ) -> Self {
16253            self.0.request = v.into();
16254            self
16255        }
16256
16257        /// Sets all the options, replacing any prior values.
16258        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16259            self.0.options = v.into();
16260            self
16261        }
16262
16263        /// Sends the request.
16264        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
16265            (*self.0.stub)
16266                .list_operations(self.0.request, self.0.options)
16267                .await
16268                .map(gax::response::Response::into_body)
16269        }
16270
16271        /// Streams each page in the collection.
16272        pub fn by_page(
16273            self,
16274        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
16275        {
16276            use std::clone::Clone;
16277            let token = self.0.request.page_token.clone();
16278            let execute = move |token: String| {
16279                let mut builder = self.clone();
16280                builder.0.request = builder.0.request.set_page_token(token);
16281                builder.send()
16282            };
16283            gax::paginator::internal::new_paginator(token, execute)
16284        }
16285
16286        /// Streams each item in the collection.
16287        pub fn by_item(
16288            self,
16289        ) -> impl gax::paginator::ItemPaginator<
16290            longrunning::model::ListOperationsResponse,
16291            gax::error::Error,
16292        > {
16293            use gax::paginator::Paginator;
16294            self.by_page().items()
16295        }
16296
16297        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
16298        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16299            self.0.request.name = v.into();
16300            self
16301        }
16302
16303        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
16304        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16305            self.0.request.filter = v.into();
16306            self
16307        }
16308
16309        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
16310        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16311            self.0.request.page_size = v.into();
16312            self
16313        }
16314
16315        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
16316        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16317            self.0.request.page_token = v.into();
16318            self
16319        }
16320
16321        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
16322        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16323            self.0.request.return_partial_success = v.into();
16324            self
16325        }
16326    }
16327
16328    #[doc(hidden)]
16329    impl gax::options::internal::RequestBuilder for ListOperations {
16330        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16331            &mut self.0.options
16332        }
16333    }
16334
16335    /// The request builder for [Intents::get_operation][crate::client::Intents::get_operation] calls.
16336    ///
16337    /// # Example
16338    /// ```
16339    /// # use google_cloud_dialogflow_v2::builder::intents::GetOperation;
16340    /// # async fn sample() -> gax::Result<()> {
16341    ///
16342    /// let builder = prepare_request_builder();
16343    /// let response = builder.send().await?;
16344    /// # Ok(()) }
16345    ///
16346    /// fn prepare_request_builder() -> GetOperation {
16347    ///   # panic!();
16348    ///   // ... details omitted ...
16349    /// }
16350    /// ```
16351    #[derive(Clone, Debug)]
16352    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
16353
16354    impl GetOperation {
16355        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16356            Self(RequestBuilder::new(stub))
16357        }
16358
16359        /// Sets the full request, replacing any prior values.
16360        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
16361            mut self,
16362            v: V,
16363        ) -> Self {
16364            self.0.request = v.into();
16365            self
16366        }
16367
16368        /// Sets all the options, replacing any prior values.
16369        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16370            self.0.options = v.into();
16371            self
16372        }
16373
16374        /// Sends the request.
16375        pub async fn send(self) -> Result<longrunning::model::Operation> {
16376            (*self.0.stub)
16377                .get_operation(self.0.request, self.0.options)
16378                .await
16379                .map(gax::response::Response::into_body)
16380        }
16381
16382        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
16383        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16384            self.0.request.name = v.into();
16385            self
16386        }
16387    }
16388
16389    #[doc(hidden)]
16390    impl gax::options::internal::RequestBuilder for GetOperation {
16391        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16392            &mut self.0.options
16393        }
16394    }
16395
16396    /// The request builder for [Intents::cancel_operation][crate::client::Intents::cancel_operation] calls.
16397    ///
16398    /// # Example
16399    /// ```
16400    /// # use google_cloud_dialogflow_v2::builder::intents::CancelOperation;
16401    /// # async fn sample() -> gax::Result<()> {
16402    ///
16403    /// let builder = prepare_request_builder();
16404    /// let response = builder.send().await?;
16405    /// # Ok(()) }
16406    ///
16407    /// fn prepare_request_builder() -> CancelOperation {
16408    ///   # panic!();
16409    ///   // ... details omitted ...
16410    /// }
16411    /// ```
16412    #[derive(Clone, Debug)]
16413    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
16414
16415    impl CancelOperation {
16416        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16417            Self(RequestBuilder::new(stub))
16418        }
16419
16420        /// Sets the full request, replacing any prior values.
16421        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
16422            mut self,
16423            v: V,
16424        ) -> Self {
16425            self.0.request = v.into();
16426            self
16427        }
16428
16429        /// Sets all the options, replacing any prior values.
16430        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16431            self.0.options = v.into();
16432            self
16433        }
16434
16435        /// Sends the request.
16436        pub async fn send(self) -> Result<()> {
16437            (*self.0.stub)
16438                .cancel_operation(self.0.request, self.0.options)
16439                .await
16440                .map(gax::response::Response::into_body)
16441        }
16442
16443        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
16444        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16445            self.0.request.name = v.into();
16446            self
16447        }
16448    }
16449
16450    #[doc(hidden)]
16451    impl gax::options::internal::RequestBuilder for CancelOperation {
16452        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16453            &mut self.0.options
16454        }
16455    }
16456}
16457
16458#[cfg(feature = "knowledge-bases")]
16459#[cfg_attr(docsrs, doc(cfg(feature = "knowledge-bases")))]
16460pub mod knowledge_bases {
16461    use crate::Result;
16462
16463    /// A builder for [KnowledgeBases][crate::client::KnowledgeBases].
16464    ///
16465    /// ```
16466    /// # async fn sample() -> gax::client_builder::Result<()> {
16467    /// # use google_cloud_dialogflow_v2::*;
16468    /// # use builder::knowledge_bases::ClientBuilder;
16469    /// # use client::KnowledgeBases;
16470    /// let builder : ClientBuilder = KnowledgeBases::builder();
16471    /// let client = builder
16472    ///     .with_endpoint("https://dialogflow.googleapis.com")
16473    ///     .build().await?;
16474    /// # Ok(()) }
16475    /// ```
16476    pub type ClientBuilder =
16477        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16478
16479    pub(crate) mod client {
16480        use super::super::super::client::KnowledgeBases;
16481        pub struct Factory;
16482        impl gax::client_builder::internal::ClientFactory for Factory {
16483            type Client = KnowledgeBases;
16484            type Credentials = gaxi::options::Credentials;
16485            async fn build(
16486                self,
16487                config: gaxi::options::ClientConfig,
16488            ) -> gax::client_builder::Result<Self::Client> {
16489                Self::Client::new(config).await
16490            }
16491        }
16492    }
16493
16494    /// Common implementation for [crate::client::KnowledgeBases] request builders.
16495    #[derive(Clone, Debug)]
16496    pub(crate) struct RequestBuilder<R: std::default::Default> {
16497        stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16498        request: R,
16499        options: gax::options::RequestOptions,
16500    }
16501
16502    impl<R> RequestBuilder<R>
16503    where
16504        R: std::default::Default,
16505    {
16506        pub(crate) fn new(
16507            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16508        ) -> Self {
16509            Self {
16510                stub,
16511                request: R::default(),
16512                options: gax::options::RequestOptions::default(),
16513            }
16514        }
16515    }
16516
16517    /// The request builder for [KnowledgeBases::list_knowledge_bases][crate::client::KnowledgeBases::list_knowledge_bases] calls.
16518    ///
16519    /// # Example
16520    /// ```
16521    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListKnowledgeBases;
16522    /// # async fn sample() -> gax::Result<()> {
16523    /// use gax::paginator::ItemPaginator;
16524    ///
16525    /// let builder = prepare_request_builder();
16526    /// let mut items = builder.by_item();
16527    /// while let Some(result) = items.next().await {
16528    ///   let item = result?;
16529    /// }
16530    /// # Ok(()) }
16531    ///
16532    /// fn prepare_request_builder() -> ListKnowledgeBases {
16533    ///   # panic!();
16534    ///   // ... details omitted ...
16535    /// }
16536    /// ```
16537    #[derive(Clone, Debug)]
16538    pub struct ListKnowledgeBases(RequestBuilder<crate::model::ListKnowledgeBasesRequest>);
16539
16540    impl ListKnowledgeBases {
16541        pub(crate) fn new(
16542            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16543        ) -> Self {
16544            Self(RequestBuilder::new(stub))
16545        }
16546
16547        /// Sets the full request, replacing any prior values.
16548        pub fn with_request<V: Into<crate::model::ListKnowledgeBasesRequest>>(
16549            mut self,
16550            v: V,
16551        ) -> Self {
16552            self.0.request = v.into();
16553            self
16554        }
16555
16556        /// Sets all the options, replacing any prior values.
16557        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16558            self.0.options = v.into();
16559            self
16560        }
16561
16562        /// Sends the request.
16563        pub async fn send(self) -> Result<crate::model::ListKnowledgeBasesResponse> {
16564            (*self.0.stub)
16565                .list_knowledge_bases(self.0.request, self.0.options)
16566                .await
16567                .map(gax::response::Response::into_body)
16568        }
16569
16570        /// Streams each page in the collection.
16571        pub fn by_page(
16572            self,
16573        ) -> impl gax::paginator::Paginator<crate::model::ListKnowledgeBasesResponse, gax::error::Error>
16574        {
16575            use std::clone::Clone;
16576            let token = self.0.request.page_token.clone();
16577            let execute = move |token: String| {
16578                let mut builder = self.clone();
16579                builder.0.request = builder.0.request.set_page_token(token);
16580                builder.send()
16581            };
16582            gax::paginator::internal::new_paginator(token, execute)
16583        }
16584
16585        /// Streams each item in the collection.
16586        pub fn by_item(
16587            self,
16588        ) -> impl gax::paginator::ItemPaginator<
16589            crate::model::ListKnowledgeBasesResponse,
16590            gax::error::Error,
16591        > {
16592            use gax::paginator::Paginator;
16593            self.by_page().items()
16594        }
16595
16596        /// Sets the value of [parent][crate::model::ListKnowledgeBasesRequest::parent].
16597        ///
16598        /// This is a **required** field for requests.
16599        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16600            self.0.request.parent = v.into();
16601            self
16602        }
16603
16604        /// Sets the value of [page_size][crate::model::ListKnowledgeBasesRequest::page_size].
16605        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16606            self.0.request.page_size = v.into();
16607            self
16608        }
16609
16610        /// Sets the value of [page_token][crate::model::ListKnowledgeBasesRequest::page_token].
16611        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16612            self.0.request.page_token = v.into();
16613            self
16614        }
16615
16616        /// Sets the value of [filter][crate::model::ListKnowledgeBasesRequest::filter].
16617        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16618            self.0.request.filter = v.into();
16619            self
16620        }
16621    }
16622
16623    #[doc(hidden)]
16624    impl gax::options::internal::RequestBuilder for ListKnowledgeBases {
16625        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16626            &mut self.0.options
16627        }
16628    }
16629
16630    /// The request builder for [KnowledgeBases::get_knowledge_base][crate::client::KnowledgeBases::get_knowledge_base] calls.
16631    ///
16632    /// # Example
16633    /// ```
16634    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetKnowledgeBase;
16635    /// # async fn sample() -> gax::Result<()> {
16636    ///
16637    /// let builder = prepare_request_builder();
16638    /// let response = builder.send().await?;
16639    /// # Ok(()) }
16640    ///
16641    /// fn prepare_request_builder() -> GetKnowledgeBase {
16642    ///   # panic!();
16643    ///   // ... details omitted ...
16644    /// }
16645    /// ```
16646    #[derive(Clone, Debug)]
16647    pub struct GetKnowledgeBase(RequestBuilder<crate::model::GetKnowledgeBaseRequest>);
16648
16649    impl GetKnowledgeBase {
16650        pub(crate) fn new(
16651            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16652        ) -> Self {
16653            Self(RequestBuilder::new(stub))
16654        }
16655
16656        /// Sets the full request, replacing any prior values.
16657        pub fn with_request<V: Into<crate::model::GetKnowledgeBaseRequest>>(
16658            mut self,
16659            v: V,
16660        ) -> Self {
16661            self.0.request = v.into();
16662            self
16663        }
16664
16665        /// Sets all the options, replacing any prior values.
16666        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16667            self.0.options = v.into();
16668            self
16669        }
16670
16671        /// Sends the request.
16672        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
16673            (*self.0.stub)
16674                .get_knowledge_base(self.0.request, self.0.options)
16675                .await
16676                .map(gax::response::Response::into_body)
16677        }
16678
16679        /// Sets the value of [name][crate::model::GetKnowledgeBaseRequest::name].
16680        ///
16681        /// This is a **required** field for requests.
16682        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16683            self.0.request.name = v.into();
16684            self
16685        }
16686    }
16687
16688    #[doc(hidden)]
16689    impl gax::options::internal::RequestBuilder for GetKnowledgeBase {
16690        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16691            &mut self.0.options
16692        }
16693    }
16694
16695    /// The request builder for [KnowledgeBases::create_knowledge_base][crate::client::KnowledgeBases::create_knowledge_base] calls.
16696    ///
16697    /// # Example
16698    /// ```
16699    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::CreateKnowledgeBase;
16700    /// # async fn sample() -> gax::Result<()> {
16701    ///
16702    /// let builder = prepare_request_builder();
16703    /// let response = builder.send().await?;
16704    /// # Ok(()) }
16705    ///
16706    /// fn prepare_request_builder() -> CreateKnowledgeBase {
16707    ///   # panic!();
16708    ///   // ... details omitted ...
16709    /// }
16710    /// ```
16711    #[derive(Clone, Debug)]
16712    pub struct CreateKnowledgeBase(RequestBuilder<crate::model::CreateKnowledgeBaseRequest>);
16713
16714    impl CreateKnowledgeBase {
16715        pub(crate) fn new(
16716            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16717        ) -> Self {
16718            Self(RequestBuilder::new(stub))
16719        }
16720
16721        /// Sets the full request, replacing any prior values.
16722        pub fn with_request<V: Into<crate::model::CreateKnowledgeBaseRequest>>(
16723            mut self,
16724            v: V,
16725        ) -> Self {
16726            self.0.request = v.into();
16727            self
16728        }
16729
16730        /// Sets all the options, replacing any prior values.
16731        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16732            self.0.options = v.into();
16733            self
16734        }
16735
16736        /// Sends the request.
16737        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
16738            (*self.0.stub)
16739                .create_knowledge_base(self.0.request, self.0.options)
16740                .await
16741                .map(gax::response::Response::into_body)
16742        }
16743
16744        /// Sets the value of [parent][crate::model::CreateKnowledgeBaseRequest::parent].
16745        ///
16746        /// This is a **required** field for requests.
16747        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16748            self.0.request.parent = v.into();
16749            self
16750        }
16751
16752        /// Sets the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
16753        ///
16754        /// This is a **required** field for requests.
16755        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
16756        where
16757            T: std::convert::Into<crate::model::KnowledgeBase>,
16758        {
16759            self.0.request.knowledge_base = std::option::Option::Some(v.into());
16760            self
16761        }
16762
16763        /// Sets or clears the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
16764        ///
16765        /// This is a **required** field for requests.
16766        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
16767        where
16768            T: std::convert::Into<crate::model::KnowledgeBase>,
16769        {
16770            self.0.request.knowledge_base = v.map(|x| x.into());
16771            self
16772        }
16773    }
16774
16775    #[doc(hidden)]
16776    impl gax::options::internal::RequestBuilder for CreateKnowledgeBase {
16777        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16778            &mut self.0.options
16779        }
16780    }
16781
16782    /// The request builder for [KnowledgeBases::delete_knowledge_base][crate::client::KnowledgeBases::delete_knowledge_base] calls.
16783    ///
16784    /// # Example
16785    /// ```
16786    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::DeleteKnowledgeBase;
16787    /// # async fn sample() -> gax::Result<()> {
16788    ///
16789    /// let builder = prepare_request_builder();
16790    /// let response = builder.send().await?;
16791    /// # Ok(()) }
16792    ///
16793    /// fn prepare_request_builder() -> DeleteKnowledgeBase {
16794    ///   # panic!();
16795    ///   // ... details omitted ...
16796    /// }
16797    /// ```
16798    #[derive(Clone, Debug)]
16799    pub struct DeleteKnowledgeBase(RequestBuilder<crate::model::DeleteKnowledgeBaseRequest>);
16800
16801    impl DeleteKnowledgeBase {
16802        pub(crate) fn new(
16803            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16804        ) -> Self {
16805            Self(RequestBuilder::new(stub))
16806        }
16807
16808        /// Sets the full request, replacing any prior values.
16809        pub fn with_request<V: Into<crate::model::DeleteKnowledgeBaseRequest>>(
16810            mut self,
16811            v: V,
16812        ) -> Self {
16813            self.0.request = v.into();
16814            self
16815        }
16816
16817        /// Sets all the options, replacing any prior values.
16818        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16819            self.0.options = v.into();
16820            self
16821        }
16822
16823        /// Sends the request.
16824        pub async fn send(self) -> Result<()> {
16825            (*self.0.stub)
16826                .delete_knowledge_base(self.0.request, self.0.options)
16827                .await
16828                .map(gax::response::Response::into_body)
16829        }
16830
16831        /// Sets the value of [name][crate::model::DeleteKnowledgeBaseRequest::name].
16832        ///
16833        /// This is a **required** field for requests.
16834        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16835            self.0.request.name = v.into();
16836            self
16837        }
16838
16839        /// Sets the value of [force][crate::model::DeleteKnowledgeBaseRequest::force].
16840        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
16841            self.0.request.force = v.into();
16842            self
16843        }
16844    }
16845
16846    #[doc(hidden)]
16847    impl gax::options::internal::RequestBuilder for DeleteKnowledgeBase {
16848        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16849            &mut self.0.options
16850        }
16851    }
16852
16853    /// The request builder for [KnowledgeBases::update_knowledge_base][crate::client::KnowledgeBases::update_knowledge_base] calls.
16854    ///
16855    /// # Example
16856    /// ```
16857    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::UpdateKnowledgeBase;
16858    /// # async fn sample() -> gax::Result<()> {
16859    ///
16860    /// let builder = prepare_request_builder();
16861    /// let response = builder.send().await?;
16862    /// # Ok(()) }
16863    ///
16864    /// fn prepare_request_builder() -> UpdateKnowledgeBase {
16865    ///   # panic!();
16866    ///   // ... details omitted ...
16867    /// }
16868    /// ```
16869    #[derive(Clone, Debug)]
16870    pub struct UpdateKnowledgeBase(RequestBuilder<crate::model::UpdateKnowledgeBaseRequest>);
16871
16872    impl UpdateKnowledgeBase {
16873        pub(crate) fn new(
16874            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16875        ) -> Self {
16876            Self(RequestBuilder::new(stub))
16877        }
16878
16879        /// Sets the full request, replacing any prior values.
16880        pub fn with_request<V: Into<crate::model::UpdateKnowledgeBaseRequest>>(
16881            mut self,
16882            v: V,
16883        ) -> Self {
16884            self.0.request = v.into();
16885            self
16886        }
16887
16888        /// Sets all the options, replacing any prior values.
16889        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16890            self.0.options = v.into();
16891            self
16892        }
16893
16894        /// Sends the request.
16895        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
16896            (*self.0.stub)
16897                .update_knowledge_base(self.0.request, self.0.options)
16898                .await
16899                .map(gax::response::Response::into_body)
16900        }
16901
16902        /// Sets the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
16903        ///
16904        /// This is a **required** field for requests.
16905        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
16906        where
16907            T: std::convert::Into<crate::model::KnowledgeBase>,
16908        {
16909            self.0.request.knowledge_base = std::option::Option::Some(v.into());
16910            self
16911        }
16912
16913        /// Sets or clears the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
16914        ///
16915        /// This is a **required** field for requests.
16916        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
16917        where
16918            T: std::convert::Into<crate::model::KnowledgeBase>,
16919        {
16920            self.0.request.knowledge_base = v.map(|x| x.into());
16921            self
16922        }
16923
16924        /// Sets the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
16925        pub fn set_update_mask<T>(mut self, v: T) -> Self
16926        where
16927            T: std::convert::Into<wkt::FieldMask>,
16928        {
16929            self.0.request.update_mask = std::option::Option::Some(v.into());
16930            self
16931        }
16932
16933        /// Sets or clears the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
16934        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16935        where
16936            T: std::convert::Into<wkt::FieldMask>,
16937        {
16938            self.0.request.update_mask = v.map(|x| x.into());
16939            self
16940        }
16941    }
16942
16943    #[doc(hidden)]
16944    impl gax::options::internal::RequestBuilder for UpdateKnowledgeBase {
16945        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16946            &mut self.0.options
16947        }
16948    }
16949
16950    /// The request builder for [KnowledgeBases::list_locations][crate::client::KnowledgeBases::list_locations] calls.
16951    ///
16952    /// # Example
16953    /// ```
16954    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListLocations;
16955    /// # async fn sample() -> gax::Result<()> {
16956    /// use gax::paginator::ItemPaginator;
16957    ///
16958    /// let builder = prepare_request_builder();
16959    /// let mut items = builder.by_item();
16960    /// while let Some(result) = items.next().await {
16961    ///   let item = result?;
16962    /// }
16963    /// # Ok(()) }
16964    ///
16965    /// fn prepare_request_builder() -> ListLocations {
16966    ///   # panic!();
16967    ///   // ... details omitted ...
16968    /// }
16969    /// ```
16970    #[derive(Clone, Debug)]
16971    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
16972
16973    impl ListLocations {
16974        pub(crate) fn new(
16975            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16976        ) -> Self {
16977            Self(RequestBuilder::new(stub))
16978        }
16979
16980        /// Sets the full request, replacing any prior values.
16981        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
16982            mut self,
16983            v: V,
16984        ) -> Self {
16985            self.0.request = v.into();
16986            self
16987        }
16988
16989        /// Sets all the options, replacing any prior values.
16990        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16991            self.0.options = v.into();
16992            self
16993        }
16994
16995        /// Sends the request.
16996        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
16997            (*self.0.stub)
16998                .list_locations(self.0.request, self.0.options)
16999                .await
17000                .map(gax::response::Response::into_body)
17001        }
17002
17003        /// Streams each page in the collection.
17004        pub fn by_page(
17005            self,
17006        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
17007        {
17008            use std::clone::Clone;
17009            let token = self.0.request.page_token.clone();
17010            let execute = move |token: String| {
17011                let mut builder = self.clone();
17012                builder.0.request = builder.0.request.set_page_token(token);
17013                builder.send()
17014            };
17015            gax::paginator::internal::new_paginator(token, execute)
17016        }
17017
17018        /// Streams each item in the collection.
17019        pub fn by_item(
17020            self,
17021        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
17022        {
17023            use gax::paginator::Paginator;
17024            self.by_page().items()
17025        }
17026
17027        /// Sets the value of [name][location::model::ListLocationsRequest::name].
17028        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17029            self.0.request.name = v.into();
17030            self
17031        }
17032
17033        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
17034        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17035            self.0.request.filter = v.into();
17036            self
17037        }
17038
17039        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
17040        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17041            self.0.request.page_size = v.into();
17042            self
17043        }
17044
17045        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
17046        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17047            self.0.request.page_token = v.into();
17048            self
17049        }
17050    }
17051
17052    #[doc(hidden)]
17053    impl gax::options::internal::RequestBuilder for ListLocations {
17054        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17055            &mut self.0.options
17056        }
17057    }
17058
17059    /// The request builder for [KnowledgeBases::get_location][crate::client::KnowledgeBases::get_location] calls.
17060    ///
17061    /// # Example
17062    /// ```
17063    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetLocation;
17064    /// # async fn sample() -> gax::Result<()> {
17065    ///
17066    /// let builder = prepare_request_builder();
17067    /// let response = builder.send().await?;
17068    /// # Ok(()) }
17069    ///
17070    /// fn prepare_request_builder() -> GetLocation {
17071    ///   # panic!();
17072    ///   // ... details omitted ...
17073    /// }
17074    /// ```
17075    #[derive(Clone, Debug)]
17076    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
17077
17078    impl GetLocation {
17079        pub(crate) fn new(
17080            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17081        ) -> Self {
17082            Self(RequestBuilder::new(stub))
17083        }
17084
17085        /// Sets the full request, replacing any prior values.
17086        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
17087            self.0.request = v.into();
17088            self
17089        }
17090
17091        /// Sets all the options, replacing any prior values.
17092        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17093            self.0.options = v.into();
17094            self
17095        }
17096
17097        /// Sends the request.
17098        pub async fn send(self) -> Result<location::model::Location> {
17099            (*self.0.stub)
17100                .get_location(self.0.request, self.0.options)
17101                .await
17102                .map(gax::response::Response::into_body)
17103        }
17104
17105        /// Sets the value of [name][location::model::GetLocationRequest::name].
17106        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17107            self.0.request.name = v.into();
17108            self
17109        }
17110    }
17111
17112    #[doc(hidden)]
17113    impl gax::options::internal::RequestBuilder for GetLocation {
17114        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17115            &mut self.0.options
17116        }
17117    }
17118
17119    /// The request builder for [KnowledgeBases::list_operations][crate::client::KnowledgeBases::list_operations] calls.
17120    ///
17121    /// # Example
17122    /// ```
17123    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::ListOperations;
17124    /// # async fn sample() -> gax::Result<()> {
17125    /// use gax::paginator::ItemPaginator;
17126    ///
17127    /// let builder = prepare_request_builder();
17128    /// let mut items = builder.by_item();
17129    /// while let Some(result) = items.next().await {
17130    ///   let item = result?;
17131    /// }
17132    /// # Ok(()) }
17133    ///
17134    /// fn prepare_request_builder() -> ListOperations {
17135    ///   # panic!();
17136    ///   // ... details omitted ...
17137    /// }
17138    /// ```
17139    #[derive(Clone, Debug)]
17140    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
17141
17142    impl ListOperations {
17143        pub(crate) fn new(
17144            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17145        ) -> Self {
17146            Self(RequestBuilder::new(stub))
17147        }
17148
17149        /// Sets the full request, replacing any prior values.
17150        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
17151            mut self,
17152            v: V,
17153        ) -> Self {
17154            self.0.request = v.into();
17155            self
17156        }
17157
17158        /// Sets all the options, replacing any prior values.
17159        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17160            self.0.options = v.into();
17161            self
17162        }
17163
17164        /// Sends the request.
17165        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
17166            (*self.0.stub)
17167                .list_operations(self.0.request, self.0.options)
17168                .await
17169                .map(gax::response::Response::into_body)
17170        }
17171
17172        /// Streams each page in the collection.
17173        pub fn by_page(
17174            self,
17175        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
17176        {
17177            use std::clone::Clone;
17178            let token = self.0.request.page_token.clone();
17179            let execute = move |token: String| {
17180                let mut builder = self.clone();
17181                builder.0.request = builder.0.request.set_page_token(token);
17182                builder.send()
17183            };
17184            gax::paginator::internal::new_paginator(token, execute)
17185        }
17186
17187        /// Streams each item in the collection.
17188        pub fn by_item(
17189            self,
17190        ) -> impl gax::paginator::ItemPaginator<
17191            longrunning::model::ListOperationsResponse,
17192            gax::error::Error,
17193        > {
17194            use gax::paginator::Paginator;
17195            self.by_page().items()
17196        }
17197
17198        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
17199        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17200            self.0.request.name = v.into();
17201            self
17202        }
17203
17204        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
17205        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17206            self.0.request.filter = v.into();
17207            self
17208        }
17209
17210        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
17211        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17212            self.0.request.page_size = v.into();
17213            self
17214        }
17215
17216        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
17217        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17218            self.0.request.page_token = v.into();
17219            self
17220        }
17221
17222        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
17223        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17224            self.0.request.return_partial_success = v.into();
17225            self
17226        }
17227    }
17228
17229    #[doc(hidden)]
17230    impl gax::options::internal::RequestBuilder for ListOperations {
17231        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17232            &mut self.0.options
17233        }
17234    }
17235
17236    /// The request builder for [KnowledgeBases::get_operation][crate::client::KnowledgeBases::get_operation] calls.
17237    ///
17238    /// # Example
17239    /// ```
17240    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::GetOperation;
17241    /// # async fn sample() -> gax::Result<()> {
17242    ///
17243    /// let builder = prepare_request_builder();
17244    /// let response = builder.send().await?;
17245    /// # Ok(()) }
17246    ///
17247    /// fn prepare_request_builder() -> GetOperation {
17248    ///   # panic!();
17249    ///   // ... details omitted ...
17250    /// }
17251    /// ```
17252    #[derive(Clone, Debug)]
17253    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
17254
17255    impl GetOperation {
17256        pub(crate) fn new(
17257            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17258        ) -> Self {
17259            Self(RequestBuilder::new(stub))
17260        }
17261
17262        /// Sets the full request, replacing any prior values.
17263        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
17264            mut self,
17265            v: V,
17266        ) -> Self {
17267            self.0.request = v.into();
17268            self
17269        }
17270
17271        /// Sets all the options, replacing any prior values.
17272        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17273            self.0.options = v.into();
17274            self
17275        }
17276
17277        /// Sends the request.
17278        pub async fn send(self) -> Result<longrunning::model::Operation> {
17279            (*self.0.stub)
17280                .get_operation(self.0.request, self.0.options)
17281                .await
17282                .map(gax::response::Response::into_body)
17283        }
17284
17285        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
17286        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17287            self.0.request.name = v.into();
17288            self
17289        }
17290    }
17291
17292    #[doc(hidden)]
17293    impl gax::options::internal::RequestBuilder for GetOperation {
17294        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17295            &mut self.0.options
17296        }
17297    }
17298
17299    /// The request builder for [KnowledgeBases::cancel_operation][crate::client::KnowledgeBases::cancel_operation] calls.
17300    ///
17301    /// # Example
17302    /// ```
17303    /// # use google_cloud_dialogflow_v2::builder::knowledge_bases::CancelOperation;
17304    /// # async fn sample() -> gax::Result<()> {
17305    ///
17306    /// let builder = prepare_request_builder();
17307    /// let response = builder.send().await?;
17308    /// # Ok(()) }
17309    ///
17310    /// fn prepare_request_builder() -> CancelOperation {
17311    ///   # panic!();
17312    ///   // ... details omitted ...
17313    /// }
17314    /// ```
17315    #[derive(Clone, Debug)]
17316    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
17317
17318    impl CancelOperation {
17319        pub(crate) fn new(
17320            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17321        ) -> Self {
17322            Self(RequestBuilder::new(stub))
17323        }
17324
17325        /// Sets the full request, replacing any prior values.
17326        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
17327            mut self,
17328            v: V,
17329        ) -> Self {
17330            self.0.request = v.into();
17331            self
17332        }
17333
17334        /// Sets all the options, replacing any prior values.
17335        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17336            self.0.options = v.into();
17337            self
17338        }
17339
17340        /// Sends the request.
17341        pub async fn send(self) -> Result<()> {
17342            (*self.0.stub)
17343                .cancel_operation(self.0.request, self.0.options)
17344                .await
17345                .map(gax::response::Response::into_body)
17346        }
17347
17348        /// Sets the value of [name][longrunning::model::CancelOperationRequest::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
17355    #[doc(hidden)]
17356    impl gax::options::internal::RequestBuilder for CancelOperation {
17357        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17358            &mut self.0.options
17359        }
17360    }
17361}
17362
17363#[cfg(feature = "participants")]
17364#[cfg_attr(docsrs, doc(cfg(feature = "participants")))]
17365pub mod participants {
17366    use crate::Result;
17367
17368    /// A builder for [Participants][crate::client::Participants].
17369    ///
17370    /// ```
17371    /// # async fn sample() -> gax::client_builder::Result<()> {
17372    /// # use google_cloud_dialogflow_v2::*;
17373    /// # use builder::participants::ClientBuilder;
17374    /// # use client::Participants;
17375    /// let builder : ClientBuilder = Participants::builder();
17376    /// let client = builder
17377    ///     .with_endpoint("https://dialogflow.googleapis.com")
17378    ///     .build().await?;
17379    /// # Ok(()) }
17380    /// ```
17381    pub type ClientBuilder =
17382        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17383
17384    pub(crate) mod client {
17385        use super::super::super::client::Participants;
17386        pub struct Factory;
17387        impl gax::client_builder::internal::ClientFactory for Factory {
17388            type Client = Participants;
17389            type Credentials = gaxi::options::Credentials;
17390            async fn build(
17391                self,
17392                config: gaxi::options::ClientConfig,
17393            ) -> gax::client_builder::Result<Self::Client> {
17394                Self::Client::new(config).await
17395            }
17396        }
17397    }
17398
17399    /// Common implementation for [crate::client::Participants] request builders.
17400    #[derive(Clone, Debug)]
17401    pub(crate) struct RequestBuilder<R: std::default::Default> {
17402        stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17403        request: R,
17404        options: gax::options::RequestOptions,
17405    }
17406
17407    impl<R> RequestBuilder<R>
17408    where
17409        R: std::default::Default,
17410    {
17411        pub(crate) fn new(
17412            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17413        ) -> Self {
17414            Self {
17415                stub,
17416                request: R::default(),
17417                options: gax::options::RequestOptions::default(),
17418            }
17419        }
17420    }
17421
17422    /// The request builder for [Participants::create_participant][crate::client::Participants::create_participant] calls.
17423    ///
17424    /// # Example
17425    /// ```
17426    /// # use google_cloud_dialogflow_v2::builder::participants::CreateParticipant;
17427    /// # async fn sample() -> gax::Result<()> {
17428    ///
17429    /// let builder = prepare_request_builder();
17430    /// let response = builder.send().await?;
17431    /// # Ok(()) }
17432    ///
17433    /// fn prepare_request_builder() -> CreateParticipant {
17434    ///   # panic!();
17435    ///   // ... details omitted ...
17436    /// }
17437    /// ```
17438    #[derive(Clone, Debug)]
17439    pub struct CreateParticipant(RequestBuilder<crate::model::CreateParticipantRequest>);
17440
17441    impl CreateParticipant {
17442        pub(crate) fn new(
17443            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17444        ) -> Self {
17445            Self(RequestBuilder::new(stub))
17446        }
17447
17448        /// Sets the full request, replacing any prior values.
17449        pub fn with_request<V: Into<crate::model::CreateParticipantRequest>>(
17450            mut self,
17451            v: V,
17452        ) -> Self {
17453            self.0.request = v.into();
17454            self
17455        }
17456
17457        /// Sets all the options, replacing any prior values.
17458        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17459            self.0.options = v.into();
17460            self
17461        }
17462
17463        /// Sends the request.
17464        pub async fn send(self) -> Result<crate::model::Participant> {
17465            (*self.0.stub)
17466                .create_participant(self.0.request, self.0.options)
17467                .await
17468                .map(gax::response::Response::into_body)
17469        }
17470
17471        /// Sets the value of [parent][crate::model::CreateParticipantRequest::parent].
17472        ///
17473        /// This is a **required** field for requests.
17474        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17475            self.0.request.parent = v.into();
17476            self
17477        }
17478
17479        /// Sets the value of [participant][crate::model::CreateParticipantRequest::participant].
17480        ///
17481        /// This is a **required** field for requests.
17482        pub fn set_participant<T>(mut self, v: T) -> Self
17483        where
17484            T: std::convert::Into<crate::model::Participant>,
17485        {
17486            self.0.request.participant = std::option::Option::Some(v.into());
17487            self
17488        }
17489
17490        /// Sets or clears the value of [participant][crate::model::CreateParticipantRequest::participant].
17491        ///
17492        /// This is a **required** field for requests.
17493        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
17494        where
17495            T: std::convert::Into<crate::model::Participant>,
17496        {
17497            self.0.request.participant = v.map(|x| x.into());
17498            self
17499        }
17500    }
17501
17502    #[doc(hidden)]
17503    impl gax::options::internal::RequestBuilder for CreateParticipant {
17504        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17505            &mut self.0.options
17506        }
17507    }
17508
17509    /// The request builder for [Participants::get_participant][crate::client::Participants::get_participant] calls.
17510    ///
17511    /// # Example
17512    /// ```
17513    /// # use google_cloud_dialogflow_v2::builder::participants::GetParticipant;
17514    /// # async fn sample() -> gax::Result<()> {
17515    ///
17516    /// let builder = prepare_request_builder();
17517    /// let response = builder.send().await?;
17518    /// # Ok(()) }
17519    ///
17520    /// fn prepare_request_builder() -> GetParticipant {
17521    ///   # panic!();
17522    ///   // ... details omitted ...
17523    /// }
17524    /// ```
17525    #[derive(Clone, Debug)]
17526    pub struct GetParticipant(RequestBuilder<crate::model::GetParticipantRequest>);
17527
17528    impl GetParticipant {
17529        pub(crate) fn new(
17530            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17531        ) -> Self {
17532            Self(RequestBuilder::new(stub))
17533        }
17534
17535        /// Sets the full request, replacing any prior values.
17536        pub fn with_request<V: Into<crate::model::GetParticipantRequest>>(mut self, v: V) -> Self {
17537            self.0.request = v.into();
17538            self
17539        }
17540
17541        /// Sets all the options, replacing any prior values.
17542        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17543            self.0.options = v.into();
17544            self
17545        }
17546
17547        /// Sends the request.
17548        pub async fn send(self) -> Result<crate::model::Participant> {
17549            (*self.0.stub)
17550                .get_participant(self.0.request, self.0.options)
17551                .await
17552                .map(gax::response::Response::into_body)
17553        }
17554
17555        /// Sets the value of [name][crate::model::GetParticipantRequest::name].
17556        ///
17557        /// This is a **required** field for requests.
17558        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17559            self.0.request.name = v.into();
17560            self
17561        }
17562    }
17563
17564    #[doc(hidden)]
17565    impl gax::options::internal::RequestBuilder for GetParticipant {
17566        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17567            &mut self.0.options
17568        }
17569    }
17570
17571    /// The request builder for [Participants::list_participants][crate::client::Participants::list_participants] calls.
17572    ///
17573    /// # Example
17574    /// ```
17575    /// # use google_cloud_dialogflow_v2::builder::participants::ListParticipants;
17576    /// # async fn sample() -> gax::Result<()> {
17577    /// use gax::paginator::ItemPaginator;
17578    ///
17579    /// let builder = prepare_request_builder();
17580    /// let mut items = builder.by_item();
17581    /// while let Some(result) = items.next().await {
17582    ///   let item = result?;
17583    /// }
17584    /// # Ok(()) }
17585    ///
17586    /// fn prepare_request_builder() -> ListParticipants {
17587    ///   # panic!();
17588    ///   // ... details omitted ...
17589    /// }
17590    /// ```
17591    #[derive(Clone, Debug)]
17592    pub struct ListParticipants(RequestBuilder<crate::model::ListParticipantsRequest>);
17593
17594    impl ListParticipants {
17595        pub(crate) fn new(
17596            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17597        ) -> Self {
17598            Self(RequestBuilder::new(stub))
17599        }
17600
17601        /// Sets the full request, replacing any prior values.
17602        pub fn with_request<V: Into<crate::model::ListParticipantsRequest>>(
17603            mut self,
17604            v: V,
17605        ) -> Self {
17606            self.0.request = v.into();
17607            self
17608        }
17609
17610        /// Sets all the options, replacing any prior values.
17611        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17612            self.0.options = v.into();
17613            self
17614        }
17615
17616        /// Sends the request.
17617        pub async fn send(self) -> Result<crate::model::ListParticipantsResponse> {
17618            (*self.0.stub)
17619                .list_participants(self.0.request, self.0.options)
17620                .await
17621                .map(gax::response::Response::into_body)
17622        }
17623
17624        /// Streams each page in the collection.
17625        pub fn by_page(
17626            self,
17627        ) -> impl gax::paginator::Paginator<crate::model::ListParticipantsResponse, gax::error::Error>
17628        {
17629            use std::clone::Clone;
17630            let token = self.0.request.page_token.clone();
17631            let execute = move |token: String| {
17632                let mut builder = self.clone();
17633                builder.0.request = builder.0.request.set_page_token(token);
17634                builder.send()
17635            };
17636            gax::paginator::internal::new_paginator(token, execute)
17637        }
17638
17639        /// Streams each item in the collection.
17640        pub fn by_item(
17641            self,
17642        ) -> impl gax::paginator::ItemPaginator<crate::model::ListParticipantsResponse, gax::error::Error>
17643        {
17644            use gax::paginator::Paginator;
17645            self.by_page().items()
17646        }
17647
17648        /// Sets the value of [parent][crate::model::ListParticipantsRequest::parent].
17649        ///
17650        /// This is a **required** field for requests.
17651        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17652            self.0.request.parent = v.into();
17653            self
17654        }
17655
17656        /// Sets the value of [page_size][crate::model::ListParticipantsRequest::page_size].
17657        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17658            self.0.request.page_size = v.into();
17659            self
17660        }
17661
17662        /// Sets the value of [page_token][crate::model::ListParticipantsRequest::page_token].
17663        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17664            self.0.request.page_token = v.into();
17665            self
17666        }
17667    }
17668
17669    #[doc(hidden)]
17670    impl gax::options::internal::RequestBuilder for ListParticipants {
17671        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17672            &mut self.0.options
17673        }
17674    }
17675
17676    /// The request builder for [Participants::update_participant][crate::client::Participants::update_participant] calls.
17677    ///
17678    /// # Example
17679    /// ```
17680    /// # use google_cloud_dialogflow_v2::builder::participants::UpdateParticipant;
17681    /// # async fn sample() -> gax::Result<()> {
17682    ///
17683    /// let builder = prepare_request_builder();
17684    /// let response = builder.send().await?;
17685    /// # Ok(()) }
17686    ///
17687    /// fn prepare_request_builder() -> UpdateParticipant {
17688    ///   # panic!();
17689    ///   // ... details omitted ...
17690    /// }
17691    /// ```
17692    #[derive(Clone, Debug)]
17693    pub struct UpdateParticipant(RequestBuilder<crate::model::UpdateParticipantRequest>);
17694
17695    impl UpdateParticipant {
17696        pub(crate) fn new(
17697            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17698        ) -> Self {
17699            Self(RequestBuilder::new(stub))
17700        }
17701
17702        /// Sets the full request, replacing any prior values.
17703        pub fn with_request<V: Into<crate::model::UpdateParticipantRequest>>(
17704            mut self,
17705            v: V,
17706        ) -> Self {
17707            self.0.request = v.into();
17708            self
17709        }
17710
17711        /// Sets all the options, replacing any prior values.
17712        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17713            self.0.options = v.into();
17714            self
17715        }
17716
17717        /// Sends the request.
17718        pub async fn send(self) -> Result<crate::model::Participant> {
17719            (*self.0.stub)
17720                .update_participant(self.0.request, self.0.options)
17721                .await
17722                .map(gax::response::Response::into_body)
17723        }
17724
17725        /// Sets the value of [participant][crate::model::UpdateParticipantRequest::participant].
17726        ///
17727        /// This is a **required** field for requests.
17728        pub fn set_participant<T>(mut self, v: T) -> Self
17729        where
17730            T: std::convert::Into<crate::model::Participant>,
17731        {
17732            self.0.request.participant = std::option::Option::Some(v.into());
17733            self
17734        }
17735
17736        /// Sets or clears the value of [participant][crate::model::UpdateParticipantRequest::participant].
17737        ///
17738        /// This is a **required** field for requests.
17739        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
17740        where
17741            T: std::convert::Into<crate::model::Participant>,
17742        {
17743            self.0.request.participant = v.map(|x| x.into());
17744            self
17745        }
17746
17747        /// Sets the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
17748        ///
17749        /// This is a **required** field for requests.
17750        pub fn set_update_mask<T>(mut self, v: T) -> Self
17751        where
17752            T: std::convert::Into<wkt::FieldMask>,
17753        {
17754            self.0.request.update_mask = std::option::Option::Some(v.into());
17755            self
17756        }
17757
17758        /// Sets or clears the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
17759        ///
17760        /// This is a **required** field for requests.
17761        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17762        where
17763            T: std::convert::Into<wkt::FieldMask>,
17764        {
17765            self.0.request.update_mask = v.map(|x| x.into());
17766            self
17767        }
17768    }
17769
17770    #[doc(hidden)]
17771    impl gax::options::internal::RequestBuilder for UpdateParticipant {
17772        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17773            &mut self.0.options
17774        }
17775    }
17776
17777    /// The request builder for [Participants::analyze_content][crate::client::Participants::analyze_content] calls.
17778    ///
17779    /// # Example
17780    /// ```
17781    /// # use google_cloud_dialogflow_v2::builder::participants::AnalyzeContent;
17782    /// # async fn sample() -> gax::Result<()> {
17783    ///
17784    /// let builder = prepare_request_builder();
17785    /// let response = builder.send().await?;
17786    /// # Ok(()) }
17787    ///
17788    /// fn prepare_request_builder() -> AnalyzeContent {
17789    ///   # panic!();
17790    ///   // ... details omitted ...
17791    /// }
17792    /// ```
17793    #[derive(Clone, Debug)]
17794    pub struct AnalyzeContent(RequestBuilder<crate::model::AnalyzeContentRequest>);
17795
17796    impl AnalyzeContent {
17797        pub(crate) fn new(
17798            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17799        ) -> Self {
17800            Self(RequestBuilder::new(stub))
17801        }
17802
17803        /// Sets the full request, replacing any prior values.
17804        pub fn with_request<V: Into<crate::model::AnalyzeContentRequest>>(mut self, v: V) -> Self {
17805            self.0.request = v.into();
17806            self
17807        }
17808
17809        /// Sets all the options, replacing any prior values.
17810        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17811            self.0.options = v.into();
17812            self
17813        }
17814
17815        /// Sends the request.
17816        pub async fn send(self) -> Result<crate::model::AnalyzeContentResponse> {
17817            (*self.0.stub)
17818                .analyze_content(self.0.request, self.0.options)
17819                .await
17820                .map(gax::response::Response::into_body)
17821        }
17822
17823        /// Sets the value of [participant][crate::model::AnalyzeContentRequest::participant].
17824        ///
17825        /// This is a **required** field for requests.
17826        pub fn set_participant<T: Into<std::string::String>>(mut self, v: T) -> Self {
17827            self.0.request.participant = v.into();
17828            self
17829        }
17830
17831        /// Sets the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
17832        pub fn set_reply_audio_config<T>(mut self, v: T) -> Self
17833        where
17834            T: std::convert::Into<crate::model::OutputAudioConfig>,
17835        {
17836            self.0.request.reply_audio_config = std::option::Option::Some(v.into());
17837            self
17838        }
17839
17840        /// Sets or clears the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
17841        pub fn set_or_clear_reply_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
17842        where
17843            T: std::convert::Into<crate::model::OutputAudioConfig>,
17844        {
17845            self.0.request.reply_audio_config = v.map(|x| x.into());
17846            self
17847        }
17848
17849        /// Sets the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
17850        pub fn set_query_params<T>(mut self, v: T) -> Self
17851        where
17852            T: std::convert::Into<crate::model::QueryParameters>,
17853        {
17854            self.0.request.query_params = std::option::Option::Some(v.into());
17855            self
17856        }
17857
17858        /// Sets or clears the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
17859        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
17860        where
17861            T: std::convert::Into<crate::model::QueryParameters>,
17862        {
17863            self.0.request.query_params = v.map(|x| x.into());
17864            self
17865        }
17866
17867        /// Sets the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
17868        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
17869        where
17870            T: std::convert::Into<crate::model::AssistQueryParameters>,
17871        {
17872            self.0.request.assist_query_params = std::option::Option::Some(v.into());
17873            self
17874        }
17875
17876        /// Sets or clears the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
17877        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
17878        where
17879            T: std::convert::Into<crate::model::AssistQueryParameters>,
17880        {
17881            self.0.request.assist_query_params = v.map(|x| x.into());
17882            self
17883        }
17884
17885        /// Sets the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
17886        pub fn set_cx_parameters<T>(mut self, v: T) -> Self
17887        where
17888            T: std::convert::Into<wkt::Struct>,
17889        {
17890            self.0.request.cx_parameters = std::option::Option::Some(v.into());
17891            self
17892        }
17893
17894        /// Sets or clears the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
17895        pub fn set_or_clear_cx_parameters<T>(mut self, v: std::option::Option<T>) -> Self
17896        where
17897            T: std::convert::Into<wkt::Struct>,
17898        {
17899            self.0.request.cx_parameters = v.map(|x| x.into());
17900            self
17901        }
17902
17903        /// Sets the value of [request_id][crate::model::AnalyzeContentRequest::request_id].
17904        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17905            self.0.request.request_id = v.into();
17906            self
17907        }
17908
17909        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input].
17910        ///
17911        /// Note that all the setters affecting `input` are
17912        /// mutually exclusive.
17913        pub fn set_input<T: Into<Option<crate::model::analyze_content_request::Input>>>(
17914            mut self,
17915            v: T,
17916        ) -> Self {
17917            self.0.request.input = v.into();
17918            self
17919        }
17920
17921        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
17922        /// to hold a `TextInput`.
17923        ///
17924        /// Note that all the setters affecting `input` are
17925        /// mutually exclusive.
17926        pub fn set_text_input<T: std::convert::Into<std::boxed::Box<crate::model::TextInput>>>(
17927            mut self,
17928            v: T,
17929        ) -> Self {
17930            self.0.request = self.0.request.set_text_input(v);
17931            self
17932        }
17933
17934        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
17935        /// to hold a `AudioInput`.
17936        ///
17937        /// Note that all the setters affecting `input` are
17938        /// mutually exclusive.
17939        pub fn set_audio_input<T: std::convert::Into<std::boxed::Box<crate::model::AudioInput>>>(
17940            mut self,
17941            v: T,
17942        ) -> Self {
17943            self.0.request = self.0.request.set_audio_input(v);
17944            self
17945        }
17946
17947        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
17948        /// to hold a `EventInput`.
17949        ///
17950        /// Note that all the setters affecting `input` are
17951        /// mutually exclusive.
17952        pub fn set_event_input<T: std::convert::Into<std::boxed::Box<crate::model::EventInput>>>(
17953            mut self,
17954            v: T,
17955        ) -> Self {
17956            self.0.request = self.0.request.set_event_input(v);
17957            self
17958        }
17959
17960        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
17961        /// to hold a `SuggestionInput`.
17962        ///
17963        /// Note that all the setters affecting `input` are
17964        /// mutually exclusive.
17965        pub fn set_suggestion_input<
17966            T: std::convert::Into<std::boxed::Box<crate::model::SuggestionInput>>,
17967        >(
17968            mut self,
17969            v: T,
17970        ) -> Self {
17971            self.0.request = self.0.request.set_suggestion_input(v);
17972            self
17973        }
17974    }
17975
17976    #[doc(hidden)]
17977    impl gax::options::internal::RequestBuilder for AnalyzeContent {
17978        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17979            &mut self.0.options
17980        }
17981    }
17982
17983    /// The request builder for [Participants::suggest_articles][crate::client::Participants::suggest_articles] calls.
17984    ///
17985    /// # Example
17986    /// ```
17987    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestArticles;
17988    /// # async fn sample() -> gax::Result<()> {
17989    ///
17990    /// let builder = prepare_request_builder();
17991    /// let response = builder.send().await?;
17992    /// # Ok(()) }
17993    ///
17994    /// fn prepare_request_builder() -> SuggestArticles {
17995    ///   # panic!();
17996    ///   // ... details omitted ...
17997    /// }
17998    /// ```
17999    #[derive(Clone, Debug)]
18000    pub struct SuggestArticles(RequestBuilder<crate::model::SuggestArticlesRequest>);
18001
18002    impl SuggestArticles {
18003        pub(crate) fn new(
18004            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18005        ) -> Self {
18006            Self(RequestBuilder::new(stub))
18007        }
18008
18009        /// Sets the full request, replacing any prior values.
18010        pub fn with_request<V: Into<crate::model::SuggestArticlesRequest>>(mut self, v: V) -> Self {
18011            self.0.request = v.into();
18012            self
18013        }
18014
18015        /// Sets all the options, replacing any prior values.
18016        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18017            self.0.options = v.into();
18018            self
18019        }
18020
18021        /// Sends the request.
18022        pub async fn send(self) -> Result<crate::model::SuggestArticlesResponse> {
18023            (*self.0.stub)
18024                .suggest_articles(self.0.request, self.0.options)
18025                .await
18026                .map(gax::response::Response::into_body)
18027        }
18028
18029        /// Sets the value of [parent][crate::model::SuggestArticlesRequest::parent].
18030        ///
18031        /// This is a **required** field for requests.
18032        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18033            self.0.request.parent = v.into();
18034            self
18035        }
18036
18037        /// Sets the value of [latest_message][crate::model::SuggestArticlesRequest::latest_message].
18038        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18039            self.0.request.latest_message = v.into();
18040            self
18041        }
18042
18043        /// Sets the value of [context_size][crate::model::SuggestArticlesRequest::context_size].
18044        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18045            self.0.request.context_size = v.into();
18046            self
18047        }
18048
18049        /// Sets the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
18050        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18051        where
18052            T: std::convert::Into<crate::model::AssistQueryParameters>,
18053        {
18054            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18055            self
18056        }
18057
18058        /// Sets or clears the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
18059        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18060        where
18061            T: std::convert::Into<crate::model::AssistQueryParameters>,
18062        {
18063            self.0.request.assist_query_params = v.map(|x| x.into());
18064            self
18065        }
18066    }
18067
18068    #[doc(hidden)]
18069    impl gax::options::internal::RequestBuilder for SuggestArticles {
18070        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18071            &mut self.0.options
18072        }
18073    }
18074
18075    /// The request builder for [Participants::suggest_faq_answers][crate::client::Participants::suggest_faq_answers] calls.
18076    ///
18077    /// # Example
18078    /// ```
18079    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestFaqAnswers;
18080    /// # async fn sample() -> gax::Result<()> {
18081    ///
18082    /// let builder = prepare_request_builder();
18083    /// let response = builder.send().await?;
18084    /// # Ok(()) }
18085    ///
18086    /// fn prepare_request_builder() -> SuggestFaqAnswers {
18087    ///   # panic!();
18088    ///   // ... details omitted ...
18089    /// }
18090    /// ```
18091    #[derive(Clone, Debug)]
18092    pub struct SuggestFaqAnswers(RequestBuilder<crate::model::SuggestFaqAnswersRequest>);
18093
18094    impl SuggestFaqAnswers {
18095        pub(crate) fn new(
18096            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18097        ) -> Self {
18098            Self(RequestBuilder::new(stub))
18099        }
18100
18101        /// Sets the full request, replacing any prior values.
18102        pub fn with_request<V: Into<crate::model::SuggestFaqAnswersRequest>>(
18103            mut self,
18104            v: V,
18105        ) -> Self {
18106            self.0.request = v.into();
18107            self
18108        }
18109
18110        /// Sets all the options, replacing any prior values.
18111        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18112            self.0.options = v.into();
18113            self
18114        }
18115
18116        /// Sends the request.
18117        pub async fn send(self) -> Result<crate::model::SuggestFaqAnswersResponse> {
18118            (*self.0.stub)
18119                .suggest_faq_answers(self.0.request, self.0.options)
18120                .await
18121                .map(gax::response::Response::into_body)
18122        }
18123
18124        /// Sets the value of [parent][crate::model::SuggestFaqAnswersRequest::parent].
18125        ///
18126        /// This is a **required** field for requests.
18127        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18128            self.0.request.parent = v.into();
18129            self
18130        }
18131
18132        /// Sets the value of [latest_message][crate::model::SuggestFaqAnswersRequest::latest_message].
18133        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18134            self.0.request.latest_message = v.into();
18135            self
18136        }
18137
18138        /// Sets the value of [context_size][crate::model::SuggestFaqAnswersRequest::context_size].
18139        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18140            self.0.request.context_size = v.into();
18141            self
18142        }
18143
18144        /// Sets the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
18145        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18146        where
18147            T: std::convert::Into<crate::model::AssistQueryParameters>,
18148        {
18149            self.0.request.assist_query_params = std::option::Option::Some(v.into());
18150            self
18151        }
18152
18153        /// Sets or clears the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
18154        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18155        where
18156            T: std::convert::Into<crate::model::AssistQueryParameters>,
18157        {
18158            self.0.request.assist_query_params = v.map(|x| x.into());
18159            self
18160        }
18161    }
18162
18163    #[doc(hidden)]
18164    impl gax::options::internal::RequestBuilder for SuggestFaqAnswers {
18165        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18166            &mut self.0.options
18167        }
18168    }
18169
18170    /// The request builder for [Participants::suggest_smart_replies][crate::client::Participants::suggest_smart_replies] calls.
18171    ///
18172    /// # Example
18173    /// ```
18174    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestSmartReplies;
18175    /// # async fn sample() -> gax::Result<()> {
18176    ///
18177    /// let builder = prepare_request_builder();
18178    /// let response = builder.send().await?;
18179    /// # Ok(()) }
18180    ///
18181    /// fn prepare_request_builder() -> SuggestSmartReplies {
18182    ///   # panic!();
18183    ///   // ... details omitted ...
18184    /// }
18185    /// ```
18186    #[derive(Clone, Debug)]
18187    pub struct SuggestSmartReplies(RequestBuilder<crate::model::SuggestSmartRepliesRequest>);
18188
18189    impl SuggestSmartReplies {
18190        pub(crate) fn new(
18191            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18192        ) -> Self {
18193            Self(RequestBuilder::new(stub))
18194        }
18195
18196        /// Sets the full request, replacing any prior values.
18197        pub fn with_request<V: Into<crate::model::SuggestSmartRepliesRequest>>(
18198            mut self,
18199            v: V,
18200        ) -> Self {
18201            self.0.request = v.into();
18202            self
18203        }
18204
18205        /// Sets all the options, replacing any prior values.
18206        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18207            self.0.options = v.into();
18208            self
18209        }
18210
18211        /// Sends the request.
18212        pub async fn send(self) -> Result<crate::model::SuggestSmartRepliesResponse> {
18213            (*self.0.stub)
18214                .suggest_smart_replies(self.0.request, self.0.options)
18215                .await
18216                .map(gax::response::Response::into_body)
18217        }
18218
18219        /// Sets the value of [parent][crate::model::SuggestSmartRepliesRequest::parent].
18220        ///
18221        /// This is a **required** field for requests.
18222        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18223            self.0.request.parent = v.into();
18224            self
18225        }
18226
18227        /// Sets the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
18228        pub fn set_current_text_input<T>(mut self, v: T) -> Self
18229        where
18230            T: std::convert::Into<crate::model::TextInput>,
18231        {
18232            self.0.request.current_text_input = std::option::Option::Some(v.into());
18233            self
18234        }
18235
18236        /// Sets or clears the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
18237        pub fn set_or_clear_current_text_input<T>(mut self, v: std::option::Option<T>) -> Self
18238        where
18239            T: std::convert::Into<crate::model::TextInput>,
18240        {
18241            self.0.request.current_text_input = v.map(|x| x.into());
18242            self
18243        }
18244
18245        /// Sets the value of [latest_message][crate::model::SuggestSmartRepliesRequest::latest_message].
18246        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18247            self.0.request.latest_message = v.into();
18248            self
18249        }
18250
18251        /// Sets the value of [context_size][crate::model::SuggestSmartRepliesRequest::context_size].
18252        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18253            self.0.request.context_size = v.into();
18254            self
18255        }
18256    }
18257
18258    #[doc(hidden)]
18259    impl gax::options::internal::RequestBuilder for SuggestSmartReplies {
18260        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18261            &mut self.0.options
18262        }
18263    }
18264
18265    /// The request builder for [Participants::suggest_knowledge_assist][crate::client::Participants::suggest_knowledge_assist] calls.
18266    ///
18267    /// # Example
18268    /// ```
18269    /// # use google_cloud_dialogflow_v2::builder::participants::SuggestKnowledgeAssist;
18270    /// # async fn sample() -> gax::Result<()> {
18271    ///
18272    /// let builder = prepare_request_builder();
18273    /// let response = builder.send().await?;
18274    /// # Ok(()) }
18275    ///
18276    /// fn prepare_request_builder() -> SuggestKnowledgeAssist {
18277    ///   # panic!();
18278    ///   // ... details omitted ...
18279    /// }
18280    /// ```
18281    #[derive(Clone, Debug)]
18282    pub struct SuggestKnowledgeAssist(RequestBuilder<crate::model::SuggestKnowledgeAssistRequest>);
18283
18284    impl SuggestKnowledgeAssist {
18285        pub(crate) fn new(
18286            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18287        ) -> Self {
18288            Self(RequestBuilder::new(stub))
18289        }
18290
18291        /// Sets the full request, replacing any prior values.
18292        pub fn with_request<V: Into<crate::model::SuggestKnowledgeAssistRequest>>(
18293            mut self,
18294            v: V,
18295        ) -> Self {
18296            self.0.request = v.into();
18297            self
18298        }
18299
18300        /// Sets all the options, replacing any prior values.
18301        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18302            self.0.options = v.into();
18303            self
18304        }
18305
18306        /// Sends the request.
18307        pub async fn send(self) -> Result<crate::model::SuggestKnowledgeAssistResponse> {
18308            (*self.0.stub)
18309                .suggest_knowledge_assist(self.0.request, self.0.options)
18310                .await
18311                .map(gax::response::Response::into_body)
18312        }
18313
18314        /// Sets the value of [parent][crate::model::SuggestKnowledgeAssistRequest::parent].
18315        ///
18316        /// This is a **required** field for requests.
18317        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18318            self.0.request.parent = v.into();
18319            self
18320        }
18321
18322        /// Sets the value of [latest_message][crate::model::SuggestKnowledgeAssistRequest::latest_message].
18323        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18324            self.0.request.latest_message = v.into();
18325            self
18326        }
18327
18328        /// Sets the value of [context_size][crate::model::SuggestKnowledgeAssistRequest::context_size].
18329        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18330            self.0.request.context_size = v.into();
18331            self
18332        }
18333
18334        /// Sets the value of [previous_suggested_query][crate::model::SuggestKnowledgeAssistRequest::previous_suggested_query].
18335        pub fn set_previous_suggested_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
18336            self.0.request.previous_suggested_query = v.into();
18337            self
18338        }
18339    }
18340
18341    #[doc(hidden)]
18342    impl gax::options::internal::RequestBuilder for SuggestKnowledgeAssist {
18343        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18344            &mut self.0.options
18345        }
18346    }
18347
18348    /// The request builder for [Participants::list_locations][crate::client::Participants::list_locations] calls.
18349    ///
18350    /// # Example
18351    /// ```
18352    /// # use google_cloud_dialogflow_v2::builder::participants::ListLocations;
18353    /// # async fn sample() -> gax::Result<()> {
18354    /// use gax::paginator::ItemPaginator;
18355    ///
18356    /// let builder = prepare_request_builder();
18357    /// let mut items = builder.by_item();
18358    /// while let Some(result) = items.next().await {
18359    ///   let item = result?;
18360    /// }
18361    /// # Ok(()) }
18362    ///
18363    /// fn prepare_request_builder() -> ListLocations {
18364    ///   # panic!();
18365    ///   // ... details omitted ...
18366    /// }
18367    /// ```
18368    #[derive(Clone, Debug)]
18369    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
18370
18371    impl ListLocations {
18372        pub(crate) fn new(
18373            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18374        ) -> Self {
18375            Self(RequestBuilder::new(stub))
18376        }
18377
18378        /// Sets the full request, replacing any prior values.
18379        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
18380            mut self,
18381            v: V,
18382        ) -> Self {
18383            self.0.request = v.into();
18384            self
18385        }
18386
18387        /// Sets all the options, replacing any prior values.
18388        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18389            self.0.options = v.into();
18390            self
18391        }
18392
18393        /// Sends the request.
18394        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
18395            (*self.0.stub)
18396                .list_locations(self.0.request, self.0.options)
18397                .await
18398                .map(gax::response::Response::into_body)
18399        }
18400
18401        /// Streams each page in the collection.
18402        pub fn by_page(
18403            self,
18404        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
18405        {
18406            use std::clone::Clone;
18407            let token = self.0.request.page_token.clone();
18408            let execute = move |token: String| {
18409                let mut builder = self.clone();
18410                builder.0.request = builder.0.request.set_page_token(token);
18411                builder.send()
18412            };
18413            gax::paginator::internal::new_paginator(token, execute)
18414        }
18415
18416        /// Streams each item in the collection.
18417        pub fn by_item(
18418            self,
18419        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
18420        {
18421            use gax::paginator::Paginator;
18422            self.by_page().items()
18423        }
18424
18425        /// Sets the value of [name][location::model::ListLocationsRequest::name].
18426        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18427            self.0.request.name = v.into();
18428            self
18429        }
18430
18431        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
18432        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18433            self.0.request.filter = v.into();
18434            self
18435        }
18436
18437        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
18438        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18439            self.0.request.page_size = v.into();
18440            self
18441        }
18442
18443        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
18444        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18445            self.0.request.page_token = v.into();
18446            self
18447        }
18448    }
18449
18450    #[doc(hidden)]
18451    impl gax::options::internal::RequestBuilder for ListLocations {
18452        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18453            &mut self.0.options
18454        }
18455    }
18456
18457    /// The request builder for [Participants::get_location][crate::client::Participants::get_location] calls.
18458    ///
18459    /// # Example
18460    /// ```
18461    /// # use google_cloud_dialogflow_v2::builder::participants::GetLocation;
18462    /// # async fn sample() -> gax::Result<()> {
18463    ///
18464    /// let builder = prepare_request_builder();
18465    /// let response = builder.send().await?;
18466    /// # Ok(()) }
18467    ///
18468    /// fn prepare_request_builder() -> GetLocation {
18469    ///   # panic!();
18470    ///   // ... details omitted ...
18471    /// }
18472    /// ```
18473    #[derive(Clone, Debug)]
18474    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
18475
18476    impl GetLocation {
18477        pub(crate) fn new(
18478            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18479        ) -> Self {
18480            Self(RequestBuilder::new(stub))
18481        }
18482
18483        /// Sets the full request, replacing any prior values.
18484        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
18485            self.0.request = v.into();
18486            self
18487        }
18488
18489        /// Sets all the options, replacing any prior values.
18490        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18491            self.0.options = v.into();
18492            self
18493        }
18494
18495        /// Sends the request.
18496        pub async fn send(self) -> Result<location::model::Location> {
18497            (*self.0.stub)
18498                .get_location(self.0.request, self.0.options)
18499                .await
18500                .map(gax::response::Response::into_body)
18501        }
18502
18503        /// Sets the value of [name][location::model::GetLocationRequest::name].
18504        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18505            self.0.request.name = v.into();
18506            self
18507        }
18508    }
18509
18510    #[doc(hidden)]
18511    impl gax::options::internal::RequestBuilder for GetLocation {
18512        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18513            &mut self.0.options
18514        }
18515    }
18516
18517    /// The request builder for [Participants::list_operations][crate::client::Participants::list_operations] calls.
18518    ///
18519    /// # Example
18520    /// ```
18521    /// # use google_cloud_dialogflow_v2::builder::participants::ListOperations;
18522    /// # async fn sample() -> gax::Result<()> {
18523    /// use gax::paginator::ItemPaginator;
18524    ///
18525    /// let builder = prepare_request_builder();
18526    /// let mut items = builder.by_item();
18527    /// while let Some(result) = items.next().await {
18528    ///   let item = result?;
18529    /// }
18530    /// # Ok(()) }
18531    ///
18532    /// fn prepare_request_builder() -> ListOperations {
18533    ///   # panic!();
18534    ///   // ... details omitted ...
18535    /// }
18536    /// ```
18537    #[derive(Clone, Debug)]
18538    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
18539
18540    impl ListOperations {
18541        pub(crate) fn new(
18542            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18543        ) -> Self {
18544            Self(RequestBuilder::new(stub))
18545        }
18546
18547        /// Sets the full request, replacing any prior values.
18548        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
18549            mut self,
18550            v: V,
18551        ) -> Self {
18552            self.0.request = v.into();
18553            self
18554        }
18555
18556        /// Sets all the options, replacing any prior values.
18557        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18558            self.0.options = v.into();
18559            self
18560        }
18561
18562        /// Sends the request.
18563        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
18564            (*self.0.stub)
18565                .list_operations(self.0.request, self.0.options)
18566                .await
18567                .map(gax::response::Response::into_body)
18568        }
18569
18570        /// Streams each page in the collection.
18571        pub fn by_page(
18572            self,
18573        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
18574        {
18575            use std::clone::Clone;
18576            let token = self.0.request.page_token.clone();
18577            let execute = move |token: String| {
18578                let mut builder = self.clone();
18579                builder.0.request = builder.0.request.set_page_token(token);
18580                builder.send()
18581            };
18582            gax::paginator::internal::new_paginator(token, execute)
18583        }
18584
18585        /// Streams each item in the collection.
18586        pub fn by_item(
18587            self,
18588        ) -> impl gax::paginator::ItemPaginator<
18589            longrunning::model::ListOperationsResponse,
18590            gax::error::Error,
18591        > {
18592            use gax::paginator::Paginator;
18593            self.by_page().items()
18594        }
18595
18596        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
18597        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18598            self.0.request.name = v.into();
18599            self
18600        }
18601
18602        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
18603        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18604            self.0.request.filter = v.into();
18605            self
18606        }
18607
18608        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
18609        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18610            self.0.request.page_size = v.into();
18611            self
18612        }
18613
18614        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
18615        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18616            self.0.request.page_token = v.into();
18617            self
18618        }
18619
18620        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
18621        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
18622            self.0.request.return_partial_success = v.into();
18623            self
18624        }
18625    }
18626
18627    #[doc(hidden)]
18628    impl gax::options::internal::RequestBuilder for ListOperations {
18629        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18630            &mut self.0.options
18631        }
18632    }
18633
18634    /// The request builder for [Participants::get_operation][crate::client::Participants::get_operation] calls.
18635    ///
18636    /// # Example
18637    /// ```
18638    /// # use google_cloud_dialogflow_v2::builder::participants::GetOperation;
18639    /// # async fn sample() -> gax::Result<()> {
18640    ///
18641    /// let builder = prepare_request_builder();
18642    /// let response = builder.send().await?;
18643    /// # Ok(()) }
18644    ///
18645    /// fn prepare_request_builder() -> GetOperation {
18646    ///   # panic!();
18647    ///   // ... details omitted ...
18648    /// }
18649    /// ```
18650    #[derive(Clone, Debug)]
18651    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
18652
18653    impl GetOperation {
18654        pub(crate) fn new(
18655            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18656        ) -> Self {
18657            Self(RequestBuilder::new(stub))
18658        }
18659
18660        /// Sets the full request, replacing any prior values.
18661        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
18662            mut self,
18663            v: V,
18664        ) -> Self {
18665            self.0.request = v.into();
18666            self
18667        }
18668
18669        /// Sets all the options, replacing any prior values.
18670        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18671            self.0.options = v.into();
18672            self
18673        }
18674
18675        /// Sends the request.
18676        pub async fn send(self) -> Result<longrunning::model::Operation> {
18677            (*self.0.stub)
18678                .get_operation(self.0.request, self.0.options)
18679                .await
18680                .map(gax::response::Response::into_body)
18681        }
18682
18683        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
18684        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18685            self.0.request.name = v.into();
18686            self
18687        }
18688    }
18689
18690    #[doc(hidden)]
18691    impl gax::options::internal::RequestBuilder for GetOperation {
18692        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18693            &mut self.0.options
18694        }
18695    }
18696
18697    /// The request builder for [Participants::cancel_operation][crate::client::Participants::cancel_operation] calls.
18698    ///
18699    /// # Example
18700    /// ```
18701    /// # use google_cloud_dialogflow_v2::builder::participants::CancelOperation;
18702    /// # async fn sample() -> gax::Result<()> {
18703    ///
18704    /// let builder = prepare_request_builder();
18705    /// let response = builder.send().await?;
18706    /// # Ok(()) }
18707    ///
18708    /// fn prepare_request_builder() -> CancelOperation {
18709    ///   # panic!();
18710    ///   // ... details omitted ...
18711    /// }
18712    /// ```
18713    #[derive(Clone, Debug)]
18714    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
18715
18716    impl CancelOperation {
18717        pub(crate) fn new(
18718            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18719        ) -> Self {
18720            Self(RequestBuilder::new(stub))
18721        }
18722
18723        /// Sets the full request, replacing any prior values.
18724        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
18725            mut self,
18726            v: V,
18727        ) -> Self {
18728            self.0.request = v.into();
18729            self
18730        }
18731
18732        /// Sets all the options, replacing any prior values.
18733        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18734            self.0.options = v.into();
18735            self
18736        }
18737
18738        /// Sends the request.
18739        pub async fn send(self) -> Result<()> {
18740            (*self.0.stub)
18741                .cancel_operation(self.0.request, self.0.options)
18742                .await
18743                .map(gax::response::Response::into_body)
18744        }
18745
18746        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
18747        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18748            self.0.request.name = v.into();
18749            self
18750        }
18751    }
18752
18753    #[doc(hidden)]
18754    impl gax::options::internal::RequestBuilder for CancelOperation {
18755        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18756            &mut self.0.options
18757        }
18758    }
18759}
18760
18761#[cfg(feature = "sessions")]
18762#[cfg_attr(docsrs, doc(cfg(feature = "sessions")))]
18763pub mod sessions {
18764    use crate::Result;
18765
18766    /// A builder for [Sessions][crate::client::Sessions].
18767    ///
18768    /// ```
18769    /// # async fn sample() -> gax::client_builder::Result<()> {
18770    /// # use google_cloud_dialogflow_v2::*;
18771    /// # use builder::sessions::ClientBuilder;
18772    /// # use client::Sessions;
18773    /// let builder : ClientBuilder = Sessions::builder();
18774    /// let client = builder
18775    ///     .with_endpoint("https://dialogflow.googleapis.com")
18776    ///     .build().await?;
18777    /// # Ok(()) }
18778    /// ```
18779    pub type ClientBuilder =
18780        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
18781
18782    pub(crate) mod client {
18783        use super::super::super::client::Sessions;
18784        pub struct Factory;
18785        impl gax::client_builder::internal::ClientFactory for Factory {
18786            type Client = Sessions;
18787            type Credentials = gaxi::options::Credentials;
18788            async fn build(
18789                self,
18790                config: gaxi::options::ClientConfig,
18791            ) -> gax::client_builder::Result<Self::Client> {
18792                Self::Client::new(config).await
18793            }
18794        }
18795    }
18796
18797    /// Common implementation for [crate::client::Sessions] request builders.
18798    #[derive(Clone, Debug)]
18799    pub(crate) struct RequestBuilder<R: std::default::Default> {
18800        stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>,
18801        request: R,
18802        options: gax::options::RequestOptions,
18803    }
18804
18805    impl<R> RequestBuilder<R>
18806    where
18807        R: std::default::Default,
18808    {
18809        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18810            Self {
18811                stub,
18812                request: R::default(),
18813                options: gax::options::RequestOptions::default(),
18814            }
18815        }
18816    }
18817
18818    /// The request builder for [Sessions::detect_intent][crate::client::Sessions::detect_intent] calls.
18819    ///
18820    /// # Example
18821    /// ```
18822    /// # use google_cloud_dialogflow_v2::builder::sessions::DetectIntent;
18823    /// # async fn sample() -> gax::Result<()> {
18824    ///
18825    /// let builder = prepare_request_builder();
18826    /// let response = builder.send().await?;
18827    /// # Ok(()) }
18828    ///
18829    /// fn prepare_request_builder() -> DetectIntent {
18830    ///   # panic!();
18831    ///   // ... details omitted ...
18832    /// }
18833    /// ```
18834    #[derive(Clone, Debug)]
18835    pub struct DetectIntent(RequestBuilder<crate::model::DetectIntentRequest>);
18836
18837    impl DetectIntent {
18838        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18839            Self(RequestBuilder::new(stub))
18840        }
18841
18842        /// Sets the full request, replacing any prior values.
18843        pub fn with_request<V: Into<crate::model::DetectIntentRequest>>(mut self, v: V) -> Self {
18844            self.0.request = v.into();
18845            self
18846        }
18847
18848        /// Sets all the options, replacing any prior values.
18849        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18850            self.0.options = v.into();
18851            self
18852        }
18853
18854        /// Sends the request.
18855        pub async fn send(self) -> Result<crate::model::DetectIntentResponse> {
18856            (*self.0.stub)
18857                .detect_intent(self.0.request, self.0.options)
18858                .await
18859                .map(gax::response::Response::into_body)
18860        }
18861
18862        /// Sets the value of [session][crate::model::DetectIntentRequest::session].
18863        ///
18864        /// This is a **required** field for requests.
18865        pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
18866            self.0.request.session = v.into();
18867            self
18868        }
18869
18870        /// Sets the value of [query_params][crate::model::DetectIntentRequest::query_params].
18871        pub fn set_query_params<T>(mut self, v: T) -> Self
18872        where
18873            T: std::convert::Into<crate::model::QueryParameters>,
18874        {
18875            self.0.request.query_params = std::option::Option::Some(v.into());
18876            self
18877        }
18878
18879        /// Sets or clears the value of [query_params][crate::model::DetectIntentRequest::query_params].
18880        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18881        where
18882            T: std::convert::Into<crate::model::QueryParameters>,
18883        {
18884            self.0.request.query_params = v.map(|x| x.into());
18885            self
18886        }
18887
18888        /// Sets the value of [query_input][crate::model::DetectIntentRequest::query_input].
18889        ///
18890        /// This is a **required** field for requests.
18891        pub fn set_query_input<T>(mut self, v: T) -> Self
18892        where
18893            T: std::convert::Into<crate::model::QueryInput>,
18894        {
18895            self.0.request.query_input = std::option::Option::Some(v.into());
18896            self
18897        }
18898
18899        /// Sets or clears the value of [query_input][crate::model::DetectIntentRequest::query_input].
18900        ///
18901        /// This is a **required** field for requests.
18902        pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
18903        where
18904            T: std::convert::Into<crate::model::QueryInput>,
18905        {
18906            self.0.request.query_input = v.map(|x| x.into());
18907            self
18908        }
18909
18910        /// Sets the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
18911        pub fn set_output_audio_config<T>(mut self, v: T) -> Self
18912        where
18913            T: std::convert::Into<crate::model::OutputAudioConfig>,
18914        {
18915            self.0.request.output_audio_config = std::option::Option::Some(v.into());
18916            self
18917        }
18918
18919        /// Sets or clears the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
18920        pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
18921        where
18922            T: std::convert::Into<crate::model::OutputAudioConfig>,
18923        {
18924            self.0.request.output_audio_config = v.map(|x| x.into());
18925            self
18926        }
18927
18928        /// Sets the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
18929        pub fn set_output_audio_config_mask<T>(mut self, v: T) -> Self
18930        where
18931            T: std::convert::Into<wkt::FieldMask>,
18932        {
18933            self.0.request.output_audio_config_mask = std::option::Option::Some(v.into());
18934            self
18935        }
18936
18937        /// Sets or clears the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
18938        pub fn set_or_clear_output_audio_config_mask<T>(mut self, v: std::option::Option<T>) -> Self
18939        where
18940            T: std::convert::Into<wkt::FieldMask>,
18941        {
18942            self.0.request.output_audio_config_mask = v.map(|x| x.into());
18943            self
18944        }
18945
18946        /// Sets the value of [input_audio][crate::model::DetectIntentRequest::input_audio].
18947        pub fn set_input_audio<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
18948            self.0.request.input_audio = v.into();
18949            self
18950        }
18951    }
18952
18953    #[doc(hidden)]
18954    impl gax::options::internal::RequestBuilder for DetectIntent {
18955        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18956            &mut self.0.options
18957        }
18958    }
18959
18960    /// The request builder for [Sessions::list_locations][crate::client::Sessions::list_locations] calls.
18961    ///
18962    /// # Example
18963    /// ```
18964    /// # use google_cloud_dialogflow_v2::builder::sessions::ListLocations;
18965    /// # async fn sample() -> gax::Result<()> {
18966    /// use gax::paginator::ItemPaginator;
18967    ///
18968    /// let builder = prepare_request_builder();
18969    /// let mut items = builder.by_item();
18970    /// while let Some(result) = items.next().await {
18971    ///   let item = result?;
18972    /// }
18973    /// # Ok(()) }
18974    ///
18975    /// fn prepare_request_builder() -> ListLocations {
18976    ///   # panic!();
18977    ///   // ... details omitted ...
18978    /// }
18979    /// ```
18980    #[derive(Clone, Debug)]
18981    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
18982
18983    impl ListLocations {
18984        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18985            Self(RequestBuilder::new(stub))
18986        }
18987
18988        /// Sets the full request, replacing any prior values.
18989        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
18990            mut self,
18991            v: V,
18992        ) -> Self {
18993            self.0.request = v.into();
18994            self
18995        }
18996
18997        /// Sets all the options, replacing any prior values.
18998        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18999            self.0.options = v.into();
19000            self
19001        }
19002
19003        /// Sends the request.
19004        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
19005            (*self.0.stub)
19006                .list_locations(self.0.request, self.0.options)
19007                .await
19008                .map(gax::response::Response::into_body)
19009        }
19010
19011        /// Streams each page in the collection.
19012        pub fn by_page(
19013            self,
19014        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
19015        {
19016            use std::clone::Clone;
19017            let token = self.0.request.page_token.clone();
19018            let execute = move |token: String| {
19019                let mut builder = self.clone();
19020                builder.0.request = builder.0.request.set_page_token(token);
19021                builder.send()
19022            };
19023            gax::paginator::internal::new_paginator(token, execute)
19024        }
19025
19026        /// Streams each item in the collection.
19027        pub fn by_item(
19028            self,
19029        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
19030        {
19031            use gax::paginator::Paginator;
19032            self.by_page().items()
19033        }
19034
19035        /// Sets the value of [name][location::model::ListLocationsRequest::name].
19036        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19037            self.0.request.name = v.into();
19038            self
19039        }
19040
19041        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
19042        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19043            self.0.request.filter = v.into();
19044            self
19045        }
19046
19047        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
19048        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19049            self.0.request.page_size = v.into();
19050            self
19051        }
19052
19053        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
19054        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19055            self.0.request.page_token = v.into();
19056            self
19057        }
19058    }
19059
19060    #[doc(hidden)]
19061    impl gax::options::internal::RequestBuilder for ListLocations {
19062        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19063            &mut self.0.options
19064        }
19065    }
19066
19067    /// The request builder for [Sessions::get_location][crate::client::Sessions::get_location] calls.
19068    ///
19069    /// # Example
19070    /// ```
19071    /// # use google_cloud_dialogflow_v2::builder::sessions::GetLocation;
19072    /// # async fn sample() -> gax::Result<()> {
19073    ///
19074    /// let builder = prepare_request_builder();
19075    /// let response = builder.send().await?;
19076    /// # Ok(()) }
19077    ///
19078    /// fn prepare_request_builder() -> GetLocation {
19079    ///   # panic!();
19080    ///   // ... details omitted ...
19081    /// }
19082    /// ```
19083    #[derive(Clone, Debug)]
19084    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
19085
19086    impl GetLocation {
19087        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19088            Self(RequestBuilder::new(stub))
19089        }
19090
19091        /// Sets the full request, replacing any prior values.
19092        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
19093            self.0.request = v.into();
19094            self
19095        }
19096
19097        /// Sets all the options, replacing any prior values.
19098        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19099            self.0.options = v.into();
19100            self
19101        }
19102
19103        /// Sends the request.
19104        pub async fn send(self) -> Result<location::model::Location> {
19105            (*self.0.stub)
19106                .get_location(self.0.request, self.0.options)
19107                .await
19108                .map(gax::response::Response::into_body)
19109        }
19110
19111        /// Sets the value of [name][location::model::GetLocationRequest::name].
19112        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19113            self.0.request.name = v.into();
19114            self
19115        }
19116    }
19117
19118    #[doc(hidden)]
19119    impl gax::options::internal::RequestBuilder for GetLocation {
19120        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19121            &mut self.0.options
19122        }
19123    }
19124
19125    /// The request builder for [Sessions::list_operations][crate::client::Sessions::list_operations] calls.
19126    ///
19127    /// # Example
19128    /// ```
19129    /// # use google_cloud_dialogflow_v2::builder::sessions::ListOperations;
19130    /// # async fn sample() -> gax::Result<()> {
19131    /// use gax::paginator::ItemPaginator;
19132    ///
19133    /// let builder = prepare_request_builder();
19134    /// let mut items = builder.by_item();
19135    /// while let Some(result) = items.next().await {
19136    ///   let item = result?;
19137    /// }
19138    /// # Ok(()) }
19139    ///
19140    /// fn prepare_request_builder() -> ListOperations {
19141    ///   # panic!();
19142    ///   // ... details omitted ...
19143    /// }
19144    /// ```
19145    #[derive(Clone, Debug)]
19146    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
19147
19148    impl ListOperations {
19149        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19150            Self(RequestBuilder::new(stub))
19151        }
19152
19153        /// Sets the full request, replacing any prior values.
19154        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
19155            mut self,
19156            v: V,
19157        ) -> Self {
19158            self.0.request = v.into();
19159            self
19160        }
19161
19162        /// Sets all the options, replacing any prior values.
19163        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19164            self.0.options = v.into();
19165            self
19166        }
19167
19168        /// Sends the request.
19169        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
19170            (*self.0.stub)
19171                .list_operations(self.0.request, self.0.options)
19172                .await
19173                .map(gax::response::Response::into_body)
19174        }
19175
19176        /// Streams each page in the collection.
19177        pub fn by_page(
19178            self,
19179        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
19180        {
19181            use std::clone::Clone;
19182            let token = self.0.request.page_token.clone();
19183            let execute = move |token: String| {
19184                let mut builder = self.clone();
19185                builder.0.request = builder.0.request.set_page_token(token);
19186                builder.send()
19187            };
19188            gax::paginator::internal::new_paginator(token, execute)
19189        }
19190
19191        /// Streams each item in the collection.
19192        pub fn by_item(
19193            self,
19194        ) -> impl gax::paginator::ItemPaginator<
19195            longrunning::model::ListOperationsResponse,
19196            gax::error::Error,
19197        > {
19198            use gax::paginator::Paginator;
19199            self.by_page().items()
19200        }
19201
19202        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
19203        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19204            self.0.request.name = v.into();
19205            self
19206        }
19207
19208        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
19209        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19210            self.0.request.filter = v.into();
19211            self
19212        }
19213
19214        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
19215        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19216            self.0.request.page_size = v.into();
19217            self
19218        }
19219
19220        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
19221        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19222            self.0.request.page_token = v.into();
19223            self
19224        }
19225
19226        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
19227        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19228            self.0.request.return_partial_success = v.into();
19229            self
19230        }
19231    }
19232
19233    #[doc(hidden)]
19234    impl gax::options::internal::RequestBuilder for ListOperations {
19235        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19236            &mut self.0.options
19237        }
19238    }
19239
19240    /// The request builder for [Sessions::get_operation][crate::client::Sessions::get_operation] calls.
19241    ///
19242    /// # Example
19243    /// ```
19244    /// # use google_cloud_dialogflow_v2::builder::sessions::GetOperation;
19245    /// # async fn sample() -> gax::Result<()> {
19246    ///
19247    /// let builder = prepare_request_builder();
19248    /// let response = builder.send().await?;
19249    /// # Ok(()) }
19250    ///
19251    /// fn prepare_request_builder() -> GetOperation {
19252    ///   # panic!();
19253    ///   // ... details omitted ...
19254    /// }
19255    /// ```
19256    #[derive(Clone, Debug)]
19257    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
19258
19259    impl GetOperation {
19260        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19261            Self(RequestBuilder::new(stub))
19262        }
19263
19264        /// Sets the full request, replacing any prior values.
19265        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
19266            mut self,
19267            v: V,
19268        ) -> Self {
19269            self.0.request = v.into();
19270            self
19271        }
19272
19273        /// Sets all the options, replacing any prior values.
19274        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19275            self.0.options = v.into();
19276            self
19277        }
19278
19279        /// Sends the request.
19280        pub async fn send(self) -> Result<longrunning::model::Operation> {
19281            (*self.0.stub)
19282                .get_operation(self.0.request, self.0.options)
19283                .await
19284                .map(gax::response::Response::into_body)
19285        }
19286
19287        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
19288        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19289            self.0.request.name = v.into();
19290            self
19291        }
19292    }
19293
19294    #[doc(hidden)]
19295    impl gax::options::internal::RequestBuilder for GetOperation {
19296        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19297            &mut self.0.options
19298        }
19299    }
19300
19301    /// The request builder for [Sessions::cancel_operation][crate::client::Sessions::cancel_operation] calls.
19302    ///
19303    /// # Example
19304    /// ```
19305    /// # use google_cloud_dialogflow_v2::builder::sessions::CancelOperation;
19306    /// # async fn sample() -> gax::Result<()> {
19307    ///
19308    /// let builder = prepare_request_builder();
19309    /// let response = builder.send().await?;
19310    /// # Ok(()) }
19311    ///
19312    /// fn prepare_request_builder() -> CancelOperation {
19313    ///   # panic!();
19314    ///   // ... details omitted ...
19315    /// }
19316    /// ```
19317    #[derive(Clone, Debug)]
19318    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
19319
19320    impl CancelOperation {
19321        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19322            Self(RequestBuilder::new(stub))
19323        }
19324
19325        /// Sets the full request, replacing any prior values.
19326        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
19327            mut self,
19328            v: V,
19329        ) -> Self {
19330            self.0.request = v.into();
19331            self
19332        }
19333
19334        /// Sets all the options, replacing any prior values.
19335        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19336            self.0.options = v.into();
19337            self
19338        }
19339
19340        /// Sends the request.
19341        pub async fn send(self) -> Result<()> {
19342            (*self.0.stub)
19343                .cancel_operation(self.0.request, self.0.options)
19344                .await
19345                .map(gax::response::Response::into_body)
19346        }
19347
19348        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
19349        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19350            self.0.request.name = v.into();
19351            self
19352        }
19353    }
19354
19355    #[doc(hidden)]
19356    impl gax::options::internal::RequestBuilder for CancelOperation {
19357        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19358            &mut self.0.options
19359        }
19360    }
19361}
19362
19363#[cfg(feature = "session-entity-types")]
19364#[cfg_attr(docsrs, doc(cfg(feature = "session-entity-types")))]
19365pub mod session_entity_types {
19366    use crate::Result;
19367
19368    /// A builder for [SessionEntityTypes][crate::client::SessionEntityTypes].
19369    ///
19370    /// ```
19371    /// # async fn sample() -> gax::client_builder::Result<()> {
19372    /// # use google_cloud_dialogflow_v2::*;
19373    /// # use builder::session_entity_types::ClientBuilder;
19374    /// # use client::SessionEntityTypes;
19375    /// let builder : ClientBuilder = SessionEntityTypes::builder();
19376    /// let client = builder
19377    ///     .with_endpoint("https://dialogflow.googleapis.com")
19378    ///     .build().await?;
19379    /// # Ok(()) }
19380    /// ```
19381    pub type ClientBuilder =
19382        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19383
19384    pub(crate) mod client {
19385        use super::super::super::client::SessionEntityTypes;
19386        pub struct Factory;
19387        impl gax::client_builder::internal::ClientFactory for Factory {
19388            type Client = SessionEntityTypes;
19389            type Credentials = gaxi::options::Credentials;
19390            async fn build(
19391                self,
19392                config: gaxi::options::ClientConfig,
19393            ) -> gax::client_builder::Result<Self::Client> {
19394                Self::Client::new(config).await
19395            }
19396        }
19397    }
19398
19399    /// Common implementation for [crate::client::SessionEntityTypes] request builders.
19400    #[derive(Clone, Debug)]
19401    pub(crate) struct RequestBuilder<R: std::default::Default> {
19402        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19403        request: R,
19404        options: gax::options::RequestOptions,
19405    }
19406
19407    impl<R> RequestBuilder<R>
19408    where
19409        R: std::default::Default,
19410    {
19411        pub(crate) fn new(
19412            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19413        ) -> Self {
19414            Self {
19415                stub,
19416                request: R::default(),
19417                options: gax::options::RequestOptions::default(),
19418            }
19419        }
19420    }
19421
19422    /// The request builder for [SessionEntityTypes::list_session_entity_types][crate::client::SessionEntityTypes::list_session_entity_types] calls.
19423    ///
19424    /// # Example
19425    /// ```
19426    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListSessionEntityTypes;
19427    /// # async fn sample() -> gax::Result<()> {
19428    /// use gax::paginator::ItemPaginator;
19429    ///
19430    /// let builder = prepare_request_builder();
19431    /// let mut items = builder.by_item();
19432    /// while let Some(result) = items.next().await {
19433    ///   let item = result?;
19434    /// }
19435    /// # Ok(()) }
19436    ///
19437    /// fn prepare_request_builder() -> ListSessionEntityTypes {
19438    ///   # panic!();
19439    ///   // ... details omitted ...
19440    /// }
19441    /// ```
19442    #[derive(Clone, Debug)]
19443    pub struct ListSessionEntityTypes(RequestBuilder<crate::model::ListSessionEntityTypesRequest>);
19444
19445    impl ListSessionEntityTypes {
19446        pub(crate) fn new(
19447            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19448        ) -> Self {
19449            Self(RequestBuilder::new(stub))
19450        }
19451
19452        /// Sets the full request, replacing any prior values.
19453        pub fn with_request<V: Into<crate::model::ListSessionEntityTypesRequest>>(
19454            mut self,
19455            v: V,
19456        ) -> Self {
19457            self.0.request = v.into();
19458            self
19459        }
19460
19461        /// Sets all the options, replacing any prior values.
19462        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19463            self.0.options = v.into();
19464            self
19465        }
19466
19467        /// Sends the request.
19468        pub async fn send(self) -> Result<crate::model::ListSessionEntityTypesResponse> {
19469            (*self.0.stub)
19470                .list_session_entity_types(self.0.request, self.0.options)
19471                .await
19472                .map(gax::response::Response::into_body)
19473        }
19474
19475        /// Streams each page in the collection.
19476        pub fn by_page(
19477            self,
19478        ) -> impl gax::paginator::Paginator<
19479            crate::model::ListSessionEntityTypesResponse,
19480            gax::error::Error,
19481        > {
19482            use std::clone::Clone;
19483            let token = self.0.request.page_token.clone();
19484            let execute = move |token: String| {
19485                let mut builder = self.clone();
19486                builder.0.request = builder.0.request.set_page_token(token);
19487                builder.send()
19488            };
19489            gax::paginator::internal::new_paginator(token, execute)
19490        }
19491
19492        /// Streams each item in the collection.
19493        pub fn by_item(
19494            self,
19495        ) -> impl gax::paginator::ItemPaginator<
19496            crate::model::ListSessionEntityTypesResponse,
19497            gax::error::Error,
19498        > {
19499            use gax::paginator::Paginator;
19500            self.by_page().items()
19501        }
19502
19503        /// Sets the value of [parent][crate::model::ListSessionEntityTypesRequest::parent].
19504        ///
19505        /// This is a **required** field for requests.
19506        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19507            self.0.request.parent = v.into();
19508            self
19509        }
19510
19511        /// Sets the value of [page_size][crate::model::ListSessionEntityTypesRequest::page_size].
19512        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19513            self.0.request.page_size = v.into();
19514            self
19515        }
19516
19517        /// Sets the value of [page_token][crate::model::ListSessionEntityTypesRequest::page_token].
19518        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19519            self.0.request.page_token = v.into();
19520            self
19521        }
19522    }
19523
19524    #[doc(hidden)]
19525    impl gax::options::internal::RequestBuilder for ListSessionEntityTypes {
19526        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19527            &mut self.0.options
19528        }
19529    }
19530
19531    /// The request builder for [SessionEntityTypes::get_session_entity_type][crate::client::SessionEntityTypes::get_session_entity_type] calls.
19532    ///
19533    /// # Example
19534    /// ```
19535    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetSessionEntityType;
19536    /// # async fn sample() -> gax::Result<()> {
19537    ///
19538    /// let builder = prepare_request_builder();
19539    /// let response = builder.send().await?;
19540    /// # Ok(()) }
19541    ///
19542    /// fn prepare_request_builder() -> GetSessionEntityType {
19543    ///   # panic!();
19544    ///   // ... details omitted ...
19545    /// }
19546    /// ```
19547    #[derive(Clone, Debug)]
19548    pub struct GetSessionEntityType(RequestBuilder<crate::model::GetSessionEntityTypeRequest>);
19549
19550    impl GetSessionEntityType {
19551        pub(crate) fn new(
19552            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19553        ) -> Self {
19554            Self(RequestBuilder::new(stub))
19555        }
19556
19557        /// Sets the full request, replacing any prior values.
19558        pub fn with_request<V: Into<crate::model::GetSessionEntityTypeRequest>>(
19559            mut self,
19560            v: V,
19561        ) -> Self {
19562            self.0.request = v.into();
19563            self
19564        }
19565
19566        /// Sets all the options, replacing any prior values.
19567        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19568            self.0.options = v.into();
19569            self
19570        }
19571
19572        /// Sends the request.
19573        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
19574            (*self.0.stub)
19575                .get_session_entity_type(self.0.request, self.0.options)
19576                .await
19577                .map(gax::response::Response::into_body)
19578        }
19579
19580        /// Sets the value of [name][crate::model::GetSessionEntityTypeRequest::name].
19581        ///
19582        /// This is a **required** field for requests.
19583        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19584            self.0.request.name = v.into();
19585            self
19586        }
19587    }
19588
19589    #[doc(hidden)]
19590    impl gax::options::internal::RequestBuilder for GetSessionEntityType {
19591        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19592            &mut self.0.options
19593        }
19594    }
19595
19596    /// The request builder for [SessionEntityTypes::create_session_entity_type][crate::client::SessionEntityTypes::create_session_entity_type] calls.
19597    ///
19598    /// # Example
19599    /// ```
19600    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::CreateSessionEntityType;
19601    /// # async fn sample() -> gax::Result<()> {
19602    ///
19603    /// let builder = prepare_request_builder();
19604    /// let response = builder.send().await?;
19605    /// # Ok(()) }
19606    ///
19607    /// fn prepare_request_builder() -> CreateSessionEntityType {
19608    ///   # panic!();
19609    ///   // ... details omitted ...
19610    /// }
19611    /// ```
19612    #[derive(Clone, Debug)]
19613    pub struct CreateSessionEntityType(
19614        RequestBuilder<crate::model::CreateSessionEntityTypeRequest>,
19615    );
19616
19617    impl CreateSessionEntityType {
19618        pub(crate) fn new(
19619            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19620        ) -> Self {
19621            Self(RequestBuilder::new(stub))
19622        }
19623
19624        /// Sets the full request, replacing any prior values.
19625        pub fn with_request<V: Into<crate::model::CreateSessionEntityTypeRequest>>(
19626            mut self,
19627            v: V,
19628        ) -> Self {
19629            self.0.request = v.into();
19630            self
19631        }
19632
19633        /// Sets all the options, replacing any prior values.
19634        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19635            self.0.options = v.into();
19636            self
19637        }
19638
19639        /// Sends the request.
19640        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
19641            (*self.0.stub)
19642                .create_session_entity_type(self.0.request, self.0.options)
19643                .await
19644                .map(gax::response::Response::into_body)
19645        }
19646
19647        /// Sets the value of [parent][crate::model::CreateSessionEntityTypeRequest::parent].
19648        ///
19649        /// This is a **required** field for requests.
19650        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19651            self.0.request.parent = v.into();
19652            self
19653        }
19654
19655        /// Sets the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
19656        ///
19657        /// This is a **required** field for requests.
19658        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
19659        where
19660            T: std::convert::Into<crate::model::SessionEntityType>,
19661        {
19662            self.0.request.session_entity_type = std::option::Option::Some(v.into());
19663            self
19664        }
19665
19666        /// Sets or clears the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
19667        ///
19668        /// This is a **required** field for requests.
19669        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
19670        where
19671            T: std::convert::Into<crate::model::SessionEntityType>,
19672        {
19673            self.0.request.session_entity_type = v.map(|x| x.into());
19674            self
19675        }
19676    }
19677
19678    #[doc(hidden)]
19679    impl gax::options::internal::RequestBuilder for CreateSessionEntityType {
19680        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19681            &mut self.0.options
19682        }
19683    }
19684
19685    /// The request builder for [SessionEntityTypes::update_session_entity_type][crate::client::SessionEntityTypes::update_session_entity_type] calls.
19686    ///
19687    /// # Example
19688    /// ```
19689    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::UpdateSessionEntityType;
19690    /// # async fn sample() -> gax::Result<()> {
19691    ///
19692    /// let builder = prepare_request_builder();
19693    /// let response = builder.send().await?;
19694    /// # Ok(()) }
19695    ///
19696    /// fn prepare_request_builder() -> UpdateSessionEntityType {
19697    ///   # panic!();
19698    ///   // ... details omitted ...
19699    /// }
19700    /// ```
19701    #[derive(Clone, Debug)]
19702    pub struct UpdateSessionEntityType(
19703        RequestBuilder<crate::model::UpdateSessionEntityTypeRequest>,
19704    );
19705
19706    impl UpdateSessionEntityType {
19707        pub(crate) fn new(
19708            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19709        ) -> Self {
19710            Self(RequestBuilder::new(stub))
19711        }
19712
19713        /// Sets the full request, replacing any prior values.
19714        pub fn with_request<V: Into<crate::model::UpdateSessionEntityTypeRequest>>(
19715            mut self,
19716            v: V,
19717        ) -> Self {
19718            self.0.request = v.into();
19719            self
19720        }
19721
19722        /// Sets all the options, replacing any prior values.
19723        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19724            self.0.options = v.into();
19725            self
19726        }
19727
19728        /// Sends the request.
19729        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
19730            (*self.0.stub)
19731                .update_session_entity_type(self.0.request, self.0.options)
19732                .await
19733                .map(gax::response::Response::into_body)
19734        }
19735
19736        /// Sets the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
19737        ///
19738        /// This is a **required** field for requests.
19739        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
19740        where
19741            T: std::convert::Into<crate::model::SessionEntityType>,
19742        {
19743            self.0.request.session_entity_type = std::option::Option::Some(v.into());
19744            self
19745        }
19746
19747        /// Sets or clears the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
19748        ///
19749        /// This is a **required** field for requests.
19750        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
19751        where
19752            T: std::convert::Into<crate::model::SessionEntityType>,
19753        {
19754            self.0.request.session_entity_type = v.map(|x| x.into());
19755            self
19756        }
19757
19758        /// Sets the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
19759        pub fn set_update_mask<T>(mut self, v: T) -> Self
19760        where
19761            T: std::convert::Into<wkt::FieldMask>,
19762        {
19763            self.0.request.update_mask = std::option::Option::Some(v.into());
19764            self
19765        }
19766
19767        /// Sets or clears the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
19768        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19769        where
19770            T: std::convert::Into<wkt::FieldMask>,
19771        {
19772            self.0.request.update_mask = v.map(|x| x.into());
19773            self
19774        }
19775    }
19776
19777    #[doc(hidden)]
19778    impl gax::options::internal::RequestBuilder for UpdateSessionEntityType {
19779        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19780            &mut self.0.options
19781        }
19782    }
19783
19784    /// The request builder for [SessionEntityTypes::delete_session_entity_type][crate::client::SessionEntityTypes::delete_session_entity_type] calls.
19785    ///
19786    /// # Example
19787    /// ```
19788    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::DeleteSessionEntityType;
19789    /// # async fn sample() -> gax::Result<()> {
19790    ///
19791    /// let builder = prepare_request_builder();
19792    /// let response = builder.send().await?;
19793    /// # Ok(()) }
19794    ///
19795    /// fn prepare_request_builder() -> DeleteSessionEntityType {
19796    ///   # panic!();
19797    ///   // ... details omitted ...
19798    /// }
19799    /// ```
19800    #[derive(Clone, Debug)]
19801    pub struct DeleteSessionEntityType(
19802        RequestBuilder<crate::model::DeleteSessionEntityTypeRequest>,
19803    );
19804
19805    impl DeleteSessionEntityType {
19806        pub(crate) fn new(
19807            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19808        ) -> Self {
19809            Self(RequestBuilder::new(stub))
19810        }
19811
19812        /// Sets the full request, replacing any prior values.
19813        pub fn with_request<V: Into<crate::model::DeleteSessionEntityTypeRequest>>(
19814            mut self,
19815            v: V,
19816        ) -> Self {
19817            self.0.request = v.into();
19818            self
19819        }
19820
19821        /// Sets all the options, replacing any prior values.
19822        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19823            self.0.options = v.into();
19824            self
19825        }
19826
19827        /// Sends the request.
19828        pub async fn send(self) -> Result<()> {
19829            (*self.0.stub)
19830                .delete_session_entity_type(self.0.request, self.0.options)
19831                .await
19832                .map(gax::response::Response::into_body)
19833        }
19834
19835        /// Sets the value of [name][crate::model::DeleteSessionEntityTypeRequest::name].
19836        ///
19837        /// This is a **required** field for requests.
19838        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19839            self.0.request.name = v.into();
19840            self
19841        }
19842    }
19843
19844    #[doc(hidden)]
19845    impl gax::options::internal::RequestBuilder for DeleteSessionEntityType {
19846        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19847            &mut self.0.options
19848        }
19849    }
19850
19851    /// The request builder for [SessionEntityTypes::list_locations][crate::client::SessionEntityTypes::list_locations] calls.
19852    ///
19853    /// # Example
19854    /// ```
19855    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListLocations;
19856    /// # async fn sample() -> gax::Result<()> {
19857    /// use gax::paginator::ItemPaginator;
19858    ///
19859    /// let builder = prepare_request_builder();
19860    /// let mut items = builder.by_item();
19861    /// while let Some(result) = items.next().await {
19862    ///   let item = result?;
19863    /// }
19864    /// # Ok(()) }
19865    ///
19866    /// fn prepare_request_builder() -> ListLocations {
19867    ///   # panic!();
19868    ///   // ... details omitted ...
19869    /// }
19870    /// ```
19871    #[derive(Clone, Debug)]
19872    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
19873
19874    impl ListLocations {
19875        pub(crate) fn new(
19876            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19877        ) -> Self {
19878            Self(RequestBuilder::new(stub))
19879        }
19880
19881        /// Sets the full request, replacing any prior values.
19882        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
19883            mut self,
19884            v: V,
19885        ) -> Self {
19886            self.0.request = v.into();
19887            self
19888        }
19889
19890        /// Sets all the options, replacing any prior values.
19891        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19892            self.0.options = v.into();
19893            self
19894        }
19895
19896        /// Sends the request.
19897        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
19898            (*self.0.stub)
19899                .list_locations(self.0.request, self.0.options)
19900                .await
19901                .map(gax::response::Response::into_body)
19902        }
19903
19904        /// Streams each page in the collection.
19905        pub fn by_page(
19906            self,
19907        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
19908        {
19909            use std::clone::Clone;
19910            let token = self.0.request.page_token.clone();
19911            let execute = move |token: String| {
19912                let mut builder = self.clone();
19913                builder.0.request = builder.0.request.set_page_token(token);
19914                builder.send()
19915            };
19916            gax::paginator::internal::new_paginator(token, execute)
19917        }
19918
19919        /// Streams each item in the collection.
19920        pub fn by_item(
19921            self,
19922        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
19923        {
19924            use gax::paginator::Paginator;
19925            self.by_page().items()
19926        }
19927
19928        /// Sets the value of [name][location::model::ListLocationsRequest::name].
19929        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19930            self.0.request.name = v.into();
19931            self
19932        }
19933
19934        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
19935        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19936            self.0.request.filter = v.into();
19937            self
19938        }
19939
19940        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
19941        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19942            self.0.request.page_size = v.into();
19943            self
19944        }
19945
19946        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
19947        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19948            self.0.request.page_token = v.into();
19949            self
19950        }
19951    }
19952
19953    #[doc(hidden)]
19954    impl gax::options::internal::RequestBuilder for ListLocations {
19955        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19956            &mut self.0.options
19957        }
19958    }
19959
19960    /// The request builder for [SessionEntityTypes::get_location][crate::client::SessionEntityTypes::get_location] calls.
19961    ///
19962    /// # Example
19963    /// ```
19964    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetLocation;
19965    /// # async fn sample() -> gax::Result<()> {
19966    ///
19967    /// let builder = prepare_request_builder();
19968    /// let response = builder.send().await?;
19969    /// # Ok(()) }
19970    ///
19971    /// fn prepare_request_builder() -> GetLocation {
19972    ///   # panic!();
19973    ///   // ... details omitted ...
19974    /// }
19975    /// ```
19976    #[derive(Clone, Debug)]
19977    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
19978
19979    impl GetLocation {
19980        pub(crate) fn new(
19981            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19982        ) -> Self {
19983            Self(RequestBuilder::new(stub))
19984        }
19985
19986        /// Sets the full request, replacing any prior values.
19987        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
19988            self.0.request = v.into();
19989            self
19990        }
19991
19992        /// Sets all the options, replacing any prior values.
19993        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19994            self.0.options = v.into();
19995            self
19996        }
19997
19998        /// Sends the request.
19999        pub async fn send(self) -> Result<location::model::Location> {
20000            (*self.0.stub)
20001                .get_location(self.0.request, self.0.options)
20002                .await
20003                .map(gax::response::Response::into_body)
20004        }
20005
20006        /// Sets the value of [name][location::model::GetLocationRequest::name].
20007        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20008            self.0.request.name = v.into();
20009            self
20010        }
20011    }
20012
20013    #[doc(hidden)]
20014    impl gax::options::internal::RequestBuilder for GetLocation {
20015        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20016            &mut self.0.options
20017        }
20018    }
20019
20020    /// The request builder for [SessionEntityTypes::list_operations][crate::client::SessionEntityTypes::list_operations] calls.
20021    ///
20022    /// # Example
20023    /// ```
20024    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::ListOperations;
20025    /// # async fn sample() -> gax::Result<()> {
20026    /// use gax::paginator::ItemPaginator;
20027    ///
20028    /// let builder = prepare_request_builder();
20029    /// let mut items = builder.by_item();
20030    /// while let Some(result) = items.next().await {
20031    ///   let item = result?;
20032    /// }
20033    /// # Ok(()) }
20034    ///
20035    /// fn prepare_request_builder() -> ListOperations {
20036    ///   # panic!();
20037    ///   // ... details omitted ...
20038    /// }
20039    /// ```
20040    #[derive(Clone, Debug)]
20041    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
20042
20043    impl ListOperations {
20044        pub(crate) fn new(
20045            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20046        ) -> Self {
20047            Self(RequestBuilder::new(stub))
20048        }
20049
20050        /// Sets the full request, replacing any prior values.
20051        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
20052            mut self,
20053            v: V,
20054        ) -> Self {
20055            self.0.request = v.into();
20056            self
20057        }
20058
20059        /// Sets all the options, replacing any prior values.
20060        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20061            self.0.options = v.into();
20062            self
20063        }
20064
20065        /// Sends the request.
20066        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
20067            (*self.0.stub)
20068                .list_operations(self.0.request, self.0.options)
20069                .await
20070                .map(gax::response::Response::into_body)
20071        }
20072
20073        /// Streams each page in the collection.
20074        pub fn by_page(
20075            self,
20076        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
20077        {
20078            use std::clone::Clone;
20079            let token = self.0.request.page_token.clone();
20080            let execute = move |token: String| {
20081                let mut builder = self.clone();
20082                builder.0.request = builder.0.request.set_page_token(token);
20083                builder.send()
20084            };
20085            gax::paginator::internal::new_paginator(token, execute)
20086        }
20087
20088        /// Streams each item in the collection.
20089        pub fn by_item(
20090            self,
20091        ) -> impl gax::paginator::ItemPaginator<
20092            longrunning::model::ListOperationsResponse,
20093            gax::error::Error,
20094        > {
20095            use gax::paginator::Paginator;
20096            self.by_page().items()
20097        }
20098
20099        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
20100        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20101            self.0.request.name = v.into();
20102            self
20103        }
20104
20105        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
20106        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20107            self.0.request.filter = v.into();
20108            self
20109        }
20110
20111        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
20112        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20113            self.0.request.page_size = v.into();
20114            self
20115        }
20116
20117        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
20118        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20119            self.0.request.page_token = v.into();
20120            self
20121        }
20122
20123        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
20124        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20125            self.0.request.return_partial_success = v.into();
20126            self
20127        }
20128    }
20129
20130    #[doc(hidden)]
20131    impl gax::options::internal::RequestBuilder for ListOperations {
20132        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20133            &mut self.0.options
20134        }
20135    }
20136
20137    /// The request builder for [SessionEntityTypes::get_operation][crate::client::SessionEntityTypes::get_operation] calls.
20138    ///
20139    /// # Example
20140    /// ```
20141    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::GetOperation;
20142    /// # async fn sample() -> gax::Result<()> {
20143    ///
20144    /// let builder = prepare_request_builder();
20145    /// let response = builder.send().await?;
20146    /// # Ok(()) }
20147    ///
20148    /// fn prepare_request_builder() -> GetOperation {
20149    ///   # panic!();
20150    ///   // ... details omitted ...
20151    /// }
20152    /// ```
20153    #[derive(Clone, Debug)]
20154    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
20155
20156    impl GetOperation {
20157        pub(crate) fn new(
20158            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20159        ) -> Self {
20160            Self(RequestBuilder::new(stub))
20161        }
20162
20163        /// Sets the full request, replacing any prior values.
20164        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
20165            mut self,
20166            v: V,
20167        ) -> Self {
20168            self.0.request = v.into();
20169            self
20170        }
20171
20172        /// Sets all the options, replacing any prior values.
20173        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20174            self.0.options = v.into();
20175            self
20176        }
20177
20178        /// Sends the request.
20179        pub async fn send(self) -> Result<longrunning::model::Operation> {
20180            (*self.0.stub)
20181                .get_operation(self.0.request, self.0.options)
20182                .await
20183                .map(gax::response::Response::into_body)
20184        }
20185
20186        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
20187        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20188            self.0.request.name = v.into();
20189            self
20190        }
20191    }
20192
20193    #[doc(hidden)]
20194    impl gax::options::internal::RequestBuilder for GetOperation {
20195        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20196            &mut self.0.options
20197        }
20198    }
20199
20200    /// The request builder for [SessionEntityTypes::cancel_operation][crate::client::SessionEntityTypes::cancel_operation] calls.
20201    ///
20202    /// # Example
20203    /// ```
20204    /// # use google_cloud_dialogflow_v2::builder::session_entity_types::CancelOperation;
20205    /// # async fn sample() -> gax::Result<()> {
20206    ///
20207    /// let builder = prepare_request_builder();
20208    /// let response = builder.send().await?;
20209    /// # Ok(()) }
20210    ///
20211    /// fn prepare_request_builder() -> CancelOperation {
20212    ///   # panic!();
20213    ///   // ... details omitted ...
20214    /// }
20215    /// ```
20216    #[derive(Clone, Debug)]
20217    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
20218
20219    impl CancelOperation {
20220        pub(crate) fn new(
20221            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20222        ) -> Self {
20223            Self(RequestBuilder::new(stub))
20224        }
20225
20226        /// Sets the full request, replacing any prior values.
20227        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
20228            mut self,
20229            v: V,
20230        ) -> Self {
20231            self.0.request = v.into();
20232            self
20233        }
20234
20235        /// Sets all the options, replacing any prior values.
20236        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20237            self.0.options = v.into();
20238            self
20239        }
20240
20241        /// Sends the request.
20242        pub async fn send(self) -> Result<()> {
20243            (*self.0.stub)
20244                .cancel_operation(self.0.request, self.0.options)
20245                .await
20246                .map(gax::response::Response::into_body)
20247        }
20248
20249        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
20250        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20251            self.0.request.name = v.into();
20252            self
20253        }
20254    }
20255
20256    #[doc(hidden)]
20257    impl gax::options::internal::RequestBuilder for CancelOperation {
20258        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20259            &mut self.0.options
20260        }
20261    }
20262}
20263
20264#[cfg(feature = "sip-trunks")]
20265#[cfg_attr(docsrs, doc(cfg(feature = "sip-trunks")))]
20266pub mod sip_trunks {
20267    use crate::Result;
20268
20269    /// A builder for [SipTrunks][crate::client::SipTrunks].
20270    ///
20271    /// ```
20272    /// # async fn sample() -> gax::client_builder::Result<()> {
20273    /// # use google_cloud_dialogflow_v2::*;
20274    /// # use builder::sip_trunks::ClientBuilder;
20275    /// # use client::SipTrunks;
20276    /// let builder : ClientBuilder = SipTrunks::builder();
20277    /// let client = builder
20278    ///     .with_endpoint("https://dialogflow.googleapis.com")
20279    ///     .build().await?;
20280    /// # Ok(()) }
20281    /// ```
20282    pub type ClientBuilder =
20283        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20284
20285    pub(crate) mod client {
20286        use super::super::super::client::SipTrunks;
20287        pub struct Factory;
20288        impl gax::client_builder::internal::ClientFactory for Factory {
20289            type Client = SipTrunks;
20290            type Credentials = gaxi::options::Credentials;
20291            async fn build(
20292                self,
20293                config: gaxi::options::ClientConfig,
20294            ) -> gax::client_builder::Result<Self::Client> {
20295                Self::Client::new(config).await
20296            }
20297        }
20298    }
20299
20300    /// Common implementation for [crate::client::SipTrunks] request builders.
20301    #[derive(Clone, Debug)]
20302    pub(crate) struct RequestBuilder<R: std::default::Default> {
20303        stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20304        request: R,
20305        options: gax::options::RequestOptions,
20306    }
20307
20308    impl<R> RequestBuilder<R>
20309    where
20310        R: std::default::Default,
20311    {
20312        pub(crate) fn new(
20313            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20314        ) -> Self {
20315            Self {
20316                stub,
20317                request: R::default(),
20318                options: gax::options::RequestOptions::default(),
20319            }
20320        }
20321    }
20322
20323    /// The request builder for [SipTrunks::create_sip_trunk][crate::client::SipTrunks::create_sip_trunk] calls.
20324    ///
20325    /// # Example
20326    /// ```
20327    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::CreateSipTrunk;
20328    /// # async fn sample() -> gax::Result<()> {
20329    ///
20330    /// let builder = prepare_request_builder();
20331    /// let response = builder.send().await?;
20332    /// # Ok(()) }
20333    ///
20334    /// fn prepare_request_builder() -> CreateSipTrunk {
20335    ///   # panic!();
20336    ///   // ... details omitted ...
20337    /// }
20338    /// ```
20339    #[derive(Clone, Debug)]
20340    pub struct CreateSipTrunk(RequestBuilder<crate::model::CreateSipTrunkRequest>);
20341
20342    impl CreateSipTrunk {
20343        pub(crate) fn new(
20344            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20345        ) -> Self {
20346            Self(RequestBuilder::new(stub))
20347        }
20348
20349        /// Sets the full request, replacing any prior values.
20350        pub fn with_request<V: Into<crate::model::CreateSipTrunkRequest>>(mut self, v: V) -> Self {
20351            self.0.request = v.into();
20352            self
20353        }
20354
20355        /// Sets all the options, replacing any prior values.
20356        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20357            self.0.options = v.into();
20358            self
20359        }
20360
20361        /// Sends the request.
20362        pub async fn send(self) -> Result<crate::model::SipTrunk> {
20363            (*self.0.stub)
20364                .create_sip_trunk(self.0.request, self.0.options)
20365                .await
20366                .map(gax::response::Response::into_body)
20367        }
20368
20369        /// Sets the value of [parent][crate::model::CreateSipTrunkRequest::parent].
20370        ///
20371        /// This is a **required** field for requests.
20372        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20373            self.0.request.parent = v.into();
20374            self
20375        }
20376
20377        /// Sets the value of [sip_trunk][crate::model::CreateSipTrunkRequest::sip_trunk].
20378        ///
20379        /// This is a **required** field for requests.
20380        pub fn set_sip_trunk<T>(mut self, v: T) -> Self
20381        where
20382            T: std::convert::Into<crate::model::SipTrunk>,
20383        {
20384            self.0.request.sip_trunk = std::option::Option::Some(v.into());
20385            self
20386        }
20387
20388        /// Sets or clears the value of [sip_trunk][crate::model::CreateSipTrunkRequest::sip_trunk].
20389        ///
20390        /// This is a **required** field for requests.
20391        pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
20392        where
20393            T: std::convert::Into<crate::model::SipTrunk>,
20394        {
20395            self.0.request.sip_trunk = v.map(|x| x.into());
20396            self
20397        }
20398    }
20399
20400    #[doc(hidden)]
20401    impl gax::options::internal::RequestBuilder for CreateSipTrunk {
20402        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20403            &mut self.0.options
20404        }
20405    }
20406
20407    /// The request builder for [SipTrunks::delete_sip_trunk][crate::client::SipTrunks::delete_sip_trunk] calls.
20408    ///
20409    /// # Example
20410    /// ```
20411    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::DeleteSipTrunk;
20412    /// # async fn sample() -> gax::Result<()> {
20413    ///
20414    /// let builder = prepare_request_builder();
20415    /// let response = builder.send().await?;
20416    /// # Ok(()) }
20417    ///
20418    /// fn prepare_request_builder() -> DeleteSipTrunk {
20419    ///   # panic!();
20420    ///   // ... details omitted ...
20421    /// }
20422    /// ```
20423    #[derive(Clone, Debug)]
20424    pub struct DeleteSipTrunk(RequestBuilder<crate::model::DeleteSipTrunkRequest>);
20425
20426    impl DeleteSipTrunk {
20427        pub(crate) fn new(
20428            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20429        ) -> Self {
20430            Self(RequestBuilder::new(stub))
20431        }
20432
20433        /// Sets the full request, replacing any prior values.
20434        pub fn with_request<V: Into<crate::model::DeleteSipTrunkRequest>>(mut self, v: V) -> Self {
20435            self.0.request = v.into();
20436            self
20437        }
20438
20439        /// Sets all the options, replacing any prior values.
20440        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20441            self.0.options = v.into();
20442            self
20443        }
20444
20445        /// Sends the request.
20446        pub async fn send(self) -> Result<()> {
20447            (*self.0.stub)
20448                .delete_sip_trunk(self.0.request, self.0.options)
20449                .await
20450                .map(gax::response::Response::into_body)
20451        }
20452
20453        /// Sets the value of [name][crate::model::DeleteSipTrunkRequest::name].
20454        ///
20455        /// This is a **required** field for requests.
20456        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20457            self.0.request.name = v.into();
20458            self
20459        }
20460    }
20461
20462    #[doc(hidden)]
20463    impl gax::options::internal::RequestBuilder for DeleteSipTrunk {
20464        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20465            &mut self.0.options
20466        }
20467    }
20468
20469    /// The request builder for [SipTrunks::list_sip_trunks][crate::client::SipTrunks::list_sip_trunks] calls.
20470    ///
20471    /// # Example
20472    /// ```
20473    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListSipTrunks;
20474    /// # async fn sample() -> gax::Result<()> {
20475    /// use gax::paginator::ItemPaginator;
20476    ///
20477    /// let builder = prepare_request_builder();
20478    /// let mut items = builder.by_item();
20479    /// while let Some(result) = items.next().await {
20480    ///   let item = result?;
20481    /// }
20482    /// # Ok(()) }
20483    ///
20484    /// fn prepare_request_builder() -> ListSipTrunks {
20485    ///   # panic!();
20486    ///   // ... details omitted ...
20487    /// }
20488    /// ```
20489    #[derive(Clone, Debug)]
20490    pub struct ListSipTrunks(RequestBuilder<crate::model::ListSipTrunksRequest>);
20491
20492    impl ListSipTrunks {
20493        pub(crate) fn new(
20494            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20495        ) -> Self {
20496            Self(RequestBuilder::new(stub))
20497        }
20498
20499        /// Sets the full request, replacing any prior values.
20500        pub fn with_request<V: Into<crate::model::ListSipTrunksRequest>>(mut self, v: V) -> Self {
20501            self.0.request = v.into();
20502            self
20503        }
20504
20505        /// Sets all the options, replacing any prior values.
20506        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20507            self.0.options = v.into();
20508            self
20509        }
20510
20511        /// Sends the request.
20512        pub async fn send(self) -> Result<crate::model::ListSipTrunksResponse> {
20513            (*self.0.stub)
20514                .list_sip_trunks(self.0.request, self.0.options)
20515                .await
20516                .map(gax::response::Response::into_body)
20517        }
20518
20519        /// Streams each page in the collection.
20520        pub fn by_page(
20521            self,
20522        ) -> impl gax::paginator::Paginator<crate::model::ListSipTrunksResponse, gax::error::Error>
20523        {
20524            use std::clone::Clone;
20525            let token = self.0.request.page_token.clone();
20526            let execute = move |token: String| {
20527                let mut builder = self.clone();
20528                builder.0.request = builder.0.request.set_page_token(token);
20529                builder.send()
20530            };
20531            gax::paginator::internal::new_paginator(token, execute)
20532        }
20533
20534        /// Streams each item in the collection.
20535        pub fn by_item(
20536            self,
20537        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSipTrunksResponse, gax::error::Error>
20538        {
20539            use gax::paginator::Paginator;
20540            self.by_page().items()
20541        }
20542
20543        /// Sets the value of [parent][crate::model::ListSipTrunksRequest::parent].
20544        ///
20545        /// This is a **required** field for requests.
20546        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20547            self.0.request.parent = v.into();
20548            self
20549        }
20550
20551        /// Sets the value of [page_size][crate::model::ListSipTrunksRequest::page_size].
20552        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20553            self.0.request.page_size = v.into();
20554            self
20555        }
20556
20557        /// Sets the value of [page_token][crate::model::ListSipTrunksRequest::page_token].
20558        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20559            self.0.request.page_token = v.into();
20560            self
20561        }
20562    }
20563
20564    #[doc(hidden)]
20565    impl gax::options::internal::RequestBuilder for ListSipTrunks {
20566        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20567            &mut self.0.options
20568        }
20569    }
20570
20571    /// The request builder for [SipTrunks::get_sip_trunk][crate::client::SipTrunks::get_sip_trunk] calls.
20572    ///
20573    /// # Example
20574    /// ```
20575    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetSipTrunk;
20576    /// # async fn sample() -> gax::Result<()> {
20577    ///
20578    /// let builder = prepare_request_builder();
20579    /// let response = builder.send().await?;
20580    /// # Ok(()) }
20581    ///
20582    /// fn prepare_request_builder() -> GetSipTrunk {
20583    ///   # panic!();
20584    ///   // ... details omitted ...
20585    /// }
20586    /// ```
20587    #[derive(Clone, Debug)]
20588    pub struct GetSipTrunk(RequestBuilder<crate::model::GetSipTrunkRequest>);
20589
20590    impl GetSipTrunk {
20591        pub(crate) fn new(
20592            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20593        ) -> Self {
20594            Self(RequestBuilder::new(stub))
20595        }
20596
20597        /// Sets the full request, replacing any prior values.
20598        pub fn with_request<V: Into<crate::model::GetSipTrunkRequest>>(mut self, v: V) -> Self {
20599            self.0.request = v.into();
20600            self
20601        }
20602
20603        /// Sets all the options, replacing any prior values.
20604        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20605            self.0.options = v.into();
20606            self
20607        }
20608
20609        /// Sends the request.
20610        pub async fn send(self) -> Result<crate::model::SipTrunk> {
20611            (*self.0.stub)
20612                .get_sip_trunk(self.0.request, self.0.options)
20613                .await
20614                .map(gax::response::Response::into_body)
20615        }
20616
20617        /// Sets the value of [name][crate::model::GetSipTrunkRequest::name].
20618        ///
20619        /// This is a **required** field for requests.
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 gax::options::internal::RequestBuilder for GetSipTrunk {
20628        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20629            &mut self.0.options
20630        }
20631    }
20632
20633    /// The request builder for [SipTrunks::update_sip_trunk][crate::client::SipTrunks::update_sip_trunk] calls.
20634    ///
20635    /// # Example
20636    /// ```
20637    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::UpdateSipTrunk;
20638    /// # async fn sample() -> gax::Result<()> {
20639    ///
20640    /// let builder = prepare_request_builder();
20641    /// let response = builder.send().await?;
20642    /// # Ok(()) }
20643    ///
20644    /// fn prepare_request_builder() -> UpdateSipTrunk {
20645    ///   # panic!();
20646    ///   // ... details omitted ...
20647    /// }
20648    /// ```
20649    #[derive(Clone, Debug)]
20650    pub struct UpdateSipTrunk(RequestBuilder<crate::model::UpdateSipTrunkRequest>);
20651
20652    impl UpdateSipTrunk {
20653        pub(crate) fn new(
20654            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20655        ) -> Self {
20656            Self(RequestBuilder::new(stub))
20657        }
20658
20659        /// Sets the full request, replacing any prior values.
20660        pub fn with_request<V: Into<crate::model::UpdateSipTrunkRequest>>(mut self, v: V) -> Self {
20661            self.0.request = v.into();
20662            self
20663        }
20664
20665        /// Sets all the options, replacing any prior values.
20666        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20667            self.0.options = v.into();
20668            self
20669        }
20670
20671        /// Sends the request.
20672        pub async fn send(self) -> Result<crate::model::SipTrunk> {
20673            (*self.0.stub)
20674                .update_sip_trunk(self.0.request, self.0.options)
20675                .await
20676                .map(gax::response::Response::into_body)
20677        }
20678
20679        /// Sets the value of [sip_trunk][crate::model::UpdateSipTrunkRequest::sip_trunk].
20680        ///
20681        /// This is a **required** field for requests.
20682        pub fn set_sip_trunk<T>(mut self, v: T) -> Self
20683        where
20684            T: std::convert::Into<crate::model::SipTrunk>,
20685        {
20686            self.0.request.sip_trunk = std::option::Option::Some(v.into());
20687            self
20688        }
20689
20690        /// Sets or clears the value of [sip_trunk][crate::model::UpdateSipTrunkRequest::sip_trunk].
20691        ///
20692        /// This is a **required** field for requests.
20693        pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
20694        where
20695            T: std::convert::Into<crate::model::SipTrunk>,
20696        {
20697            self.0.request.sip_trunk = v.map(|x| x.into());
20698            self
20699        }
20700
20701        /// Sets the value of [update_mask][crate::model::UpdateSipTrunkRequest::update_mask].
20702        pub fn set_update_mask<T>(mut self, v: T) -> Self
20703        where
20704            T: std::convert::Into<wkt::FieldMask>,
20705        {
20706            self.0.request.update_mask = std::option::Option::Some(v.into());
20707            self
20708        }
20709
20710        /// Sets or clears the value of [update_mask][crate::model::UpdateSipTrunkRequest::update_mask].
20711        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20712        where
20713            T: std::convert::Into<wkt::FieldMask>,
20714        {
20715            self.0.request.update_mask = v.map(|x| x.into());
20716            self
20717        }
20718    }
20719
20720    #[doc(hidden)]
20721    impl gax::options::internal::RequestBuilder for UpdateSipTrunk {
20722        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20723            &mut self.0.options
20724        }
20725    }
20726
20727    /// The request builder for [SipTrunks::list_locations][crate::client::SipTrunks::list_locations] calls.
20728    ///
20729    /// # Example
20730    /// ```
20731    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListLocations;
20732    /// # async fn sample() -> gax::Result<()> {
20733    /// use gax::paginator::ItemPaginator;
20734    ///
20735    /// let builder = prepare_request_builder();
20736    /// let mut items = builder.by_item();
20737    /// while let Some(result) = items.next().await {
20738    ///   let item = result?;
20739    /// }
20740    /// # Ok(()) }
20741    ///
20742    /// fn prepare_request_builder() -> ListLocations {
20743    ///   # panic!();
20744    ///   // ... details omitted ...
20745    /// }
20746    /// ```
20747    #[derive(Clone, Debug)]
20748    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
20749
20750    impl ListLocations {
20751        pub(crate) fn new(
20752            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20753        ) -> Self {
20754            Self(RequestBuilder::new(stub))
20755        }
20756
20757        /// Sets the full request, replacing any prior values.
20758        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
20759            mut self,
20760            v: V,
20761        ) -> Self {
20762            self.0.request = v.into();
20763            self
20764        }
20765
20766        /// Sets all the options, replacing any prior values.
20767        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20768            self.0.options = v.into();
20769            self
20770        }
20771
20772        /// Sends the request.
20773        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
20774            (*self.0.stub)
20775                .list_locations(self.0.request, self.0.options)
20776                .await
20777                .map(gax::response::Response::into_body)
20778        }
20779
20780        /// Streams each page in the collection.
20781        pub fn by_page(
20782            self,
20783        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
20784        {
20785            use std::clone::Clone;
20786            let token = self.0.request.page_token.clone();
20787            let execute = move |token: String| {
20788                let mut builder = self.clone();
20789                builder.0.request = builder.0.request.set_page_token(token);
20790                builder.send()
20791            };
20792            gax::paginator::internal::new_paginator(token, execute)
20793        }
20794
20795        /// Streams each item in the collection.
20796        pub fn by_item(
20797            self,
20798        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
20799        {
20800            use gax::paginator::Paginator;
20801            self.by_page().items()
20802        }
20803
20804        /// Sets the value of [name][location::model::ListLocationsRequest::name].
20805        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20806            self.0.request.name = v.into();
20807            self
20808        }
20809
20810        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
20811        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20812            self.0.request.filter = v.into();
20813            self
20814        }
20815
20816        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
20817        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20818            self.0.request.page_size = v.into();
20819            self
20820        }
20821
20822        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
20823        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20824            self.0.request.page_token = v.into();
20825            self
20826        }
20827    }
20828
20829    #[doc(hidden)]
20830    impl gax::options::internal::RequestBuilder for ListLocations {
20831        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20832            &mut self.0.options
20833        }
20834    }
20835
20836    /// The request builder for [SipTrunks::get_location][crate::client::SipTrunks::get_location] calls.
20837    ///
20838    /// # Example
20839    /// ```
20840    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetLocation;
20841    /// # async fn sample() -> gax::Result<()> {
20842    ///
20843    /// let builder = prepare_request_builder();
20844    /// let response = builder.send().await?;
20845    /// # Ok(()) }
20846    ///
20847    /// fn prepare_request_builder() -> GetLocation {
20848    ///   # panic!();
20849    ///   // ... details omitted ...
20850    /// }
20851    /// ```
20852    #[derive(Clone, Debug)]
20853    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
20854
20855    impl GetLocation {
20856        pub(crate) fn new(
20857            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20858        ) -> Self {
20859            Self(RequestBuilder::new(stub))
20860        }
20861
20862        /// Sets the full request, replacing any prior values.
20863        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
20864            self.0.request = v.into();
20865            self
20866        }
20867
20868        /// Sets all the options, replacing any prior values.
20869        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20870            self.0.options = v.into();
20871            self
20872        }
20873
20874        /// Sends the request.
20875        pub async fn send(self) -> Result<location::model::Location> {
20876            (*self.0.stub)
20877                .get_location(self.0.request, self.0.options)
20878                .await
20879                .map(gax::response::Response::into_body)
20880        }
20881
20882        /// Sets the value of [name][location::model::GetLocationRequest::name].
20883        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20884            self.0.request.name = v.into();
20885            self
20886        }
20887    }
20888
20889    #[doc(hidden)]
20890    impl gax::options::internal::RequestBuilder for GetLocation {
20891        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20892            &mut self.0.options
20893        }
20894    }
20895
20896    /// The request builder for [SipTrunks::list_operations][crate::client::SipTrunks::list_operations] calls.
20897    ///
20898    /// # Example
20899    /// ```
20900    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::ListOperations;
20901    /// # async fn sample() -> gax::Result<()> {
20902    /// use gax::paginator::ItemPaginator;
20903    ///
20904    /// let builder = prepare_request_builder();
20905    /// let mut items = builder.by_item();
20906    /// while let Some(result) = items.next().await {
20907    ///   let item = result?;
20908    /// }
20909    /// # Ok(()) }
20910    ///
20911    /// fn prepare_request_builder() -> ListOperations {
20912    ///   # panic!();
20913    ///   // ... details omitted ...
20914    /// }
20915    /// ```
20916    #[derive(Clone, Debug)]
20917    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
20918
20919    impl ListOperations {
20920        pub(crate) fn new(
20921            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20922        ) -> Self {
20923            Self(RequestBuilder::new(stub))
20924        }
20925
20926        /// Sets the full request, replacing any prior values.
20927        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
20928            mut self,
20929            v: V,
20930        ) -> Self {
20931            self.0.request = v.into();
20932            self
20933        }
20934
20935        /// Sets all the options, replacing any prior values.
20936        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20937            self.0.options = v.into();
20938            self
20939        }
20940
20941        /// Sends the request.
20942        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
20943            (*self.0.stub)
20944                .list_operations(self.0.request, self.0.options)
20945                .await
20946                .map(gax::response::Response::into_body)
20947        }
20948
20949        /// Streams each page in the collection.
20950        pub fn by_page(
20951            self,
20952        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
20953        {
20954            use std::clone::Clone;
20955            let token = self.0.request.page_token.clone();
20956            let execute = move |token: String| {
20957                let mut builder = self.clone();
20958                builder.0.request = builder.0.request.set_page_token(token);
20959                builder.send()
20960            };
20961            gax::paginator::internal::new_paginator(token, execute)
20962        }
20963
20964        /// Streams each item in the collection.
20965        pub fn by_item(
20966            self,
20967        ) -> impl gax::paginator::ItemPaginator<
20968            longrunning::model::ListOperationsResponse,
20969            gax::error::Error,
20970        > {
20971            use gax::paginator::Paginator;
20972            self.by_page().items()
20973        }
20974
20975        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
20976        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20977            self.0.request.name = v.into();
20978            self
20979        }
20980
20981        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
20982        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20983            self.0.request.filter = v.into();
20984            self
20985        }
20986
20987        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
20988        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20989            self.0.request.page_size = v.into();
20990            self
20991        }
20992
20993        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
20994        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20995            self.0.request.page_token = v.into();
20996            self
20997        }
20998
20999        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
21000        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21001            self.0.request.return_partial_success = v.into();
21002            self
21003        }
21004    }
21005
21006    #[doc(hidden)]
21007    impl gax::options::internal::RequestBuilder for ListOperations {
21008        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21009            &mut self.0.options
21010        }
21011    }
21012
21013    /// The request builder for [SipTrunks::get_operation][crate::client::SipTrunks::get_operation] calls.
21014    ///
21015    /// # Example
21016    /// ```
21017    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::GetOperation;
21018    /// # async fn sample() -> gax::Result<()> {
21019    ///
21020    /// let builder = prepare_request_builder();
21021    /// let response = builder.send().await?;
21022    /// # Ok(()) }
21023    ///
21024    /// fn prepare_request_builder() -> GetOperation {
21025    ///   # panic!();
21026    ///   // ... details omitted ...
21027    /// }
21028    /// ```
21029    #[derive(Clone, Debug)]
21030    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
21031
21032    impl GetOperation {
21033        pub(crate) fn new(
21034            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21035        ) -> Self {
21036            Self(RequestBuilder::new(stub))
21037        }
21038
21039        /// Sets the full request, replacing any prior values.
21040        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
21041            mut self,
21042            v: V,
21043        ) -> Self {
21044            self.0.request = v.into();
21045            self
21046        }
21047
21048        /// Sets all the options, replacing any prior values.
21049        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21050            self.0.options = v.into();
21051            self
21052        }
21053
21054        /// Sends the request.
21055        pub async fn send(self) -> Result<longrunning::model::Operation> {
21056            (*self.0.stub)
21057                .get_operation(self.0.request, self.0.options)
21058                .await
21059                .map(gax::response::Response::into_body)
21060        }
21061
21062        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
21063        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21064            self.0.request.name = v.into();
21065            self
21066        }
21067    }
21068
21069    #[doc(hidden)]
21070    impl gax::options::internal::RequestBuilder for GetOperation {
21071        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21072            &mut self.0.options
21073        }
21074    }
21075
21076    /// The request builder for [SipTrunks::cancel_operation][crate::client::SipTrunks::cancel_operation] calls.
21077    ///
21078    /// # Example
21079    /// ```
21080    /// # use google_cloud_dialogflow_v2::builder::sip_trunks::CancelOperation;
21081    /// # async fn sample() -> gax::Result<()> {
21082    ///
21083    /// let builder = prepare_request_builder();
21084    /// let response = builder.send().await?;
21085    /// # Ok(()) }
21086    ///
21087    /// fn prepare_request_builder() -> CancelOperation {
21088    ///   # panic!();
21089    ///   // ... details omitted ...
21090    /// }
21091    /// ```
21092    #[derive(Clone, Debug)]
21093    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
21094
21095    impl CancelOperation {
21096        pub(crate) fn new(
21097            stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21098        ) -> Self {
21099            Self(RequestBuilder::new(stub))
21100        }
21101
21102        /// Sets the full request, replacing any prior values.
21103        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
21104            mut self,
21105            v: V,
21106        ) -> Self {
21107            self.0.request = v.into();
21108            self
21109        }
21110
21111        /// Sets all the options, replacing any prior values.
21112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21113            self.0.options = v.into();
21114            self
21115        }
21116
21117        /// Sends the request.
21118        pub async fn send(self) -> Result<()> {
21119            (*self.0.stub)
21120                .cancel_operation(self.0.request, self.0.options)
21121                .await
21122                .map(gax::response::Response::into_body)
21123        }
21124
21125        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
21126        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21127            self.0.request.name = v.into();
21128            self
21129        }
21130    }
21131
21132    #[doc(hidden)]
21133    impl gax::options::internal::RequestBuilder for CancelOperation {
21134        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21135            &mut self.0.options
21136        }
21137    }
21138}
21139
21140#[cfg(feature = "tools")]
21141#[cfg_attr(docsrs, doc(cfg(feature = "tools")))]
21142pub mod tools {
21143    use crate::Result;
21144
21145    /// A builder for [Tools][crate::client::Tools].
21146    ///
21147    /// ```
21148    /// # async fn sample() -> gax::client_builder::Result<()> {
21149    /// # use google_cloud_dialogflow_v2::*;
21150    /// # use builder::tools::ClientBuilder;
21151    /// # use client::Tools;
21152    /// let builder : ClientBuilder = Tools::builder();
21153    /// let client = builder
21154    ///     .with_endpoint("https://dialogflow.googleapis.com")
21155    ///     .build().await?;
21156    /// # Ok(()) }
21157    /// ```
21158    pub type ClientBuilder =
21159        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
21160
21161    pub(crate) mod client {
21162        use super::super::super::client::Tools;
21163        pub struct Factory;
21164        impl gax::client_builder::internal::ClientFactory for Factory {
21165            type Client = Tools;
21166            type Credentials = gaxi::options::Credentials;
21167            async fn build(
21168                self,
21169                config: gaxi::options::ClientConfig,
21170            ) -> gax::client_builder::Result<Self::Client> {
21171                Self::Client::new(config).await
21172            }
21173        }
21174    }
21175
21176    /// Common implementation for [crate::client::Tools] request builders.
21177    #[derive(Clone, Debug)]
21178    pub(crate) struct RequestBuilder<R: std::default::Default> {
21179        stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>,
21180        request: R,
21181        options: gax::options::RequestOptions,
21182    }
21183
21184    impl<R> RequestBuilder<R>
21185    where
21186        R: std::default::Default,
21187    {
21188        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21189            Self {
21190                stub,
21191                request: R::default(),
21192                options: gax::options::RequestOptions::default(),
21193            }
21194        }
21195    }
21196
21197    /// The request builder for [Tools::create_tool][crate::client::Tools::create_tool] calls.
21198    ///
21199    /// # Example
21200    /// ```
21201    /// # use google_cloud_dialogflow_v2::builder::tools::CreateTool;
21202    /// # async fn sample() -> gax::Result<()> {
21203    ///
21204    /// let builder = prepare_request_builder();
21205    /// let response = builder.send().await?;
21206    /// # Ok(()) }
21207    ///
21208    /// fn prepare_request_builder() -> CreateTool {
21209    ///   # panic!();
21210    ///   // ... details omitted ...
21211    /// }
21212    /// ```
21213    #[derive(Clone, Debug)]
21214    pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
21215
21216    impl CreateTool {
21217        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21218            Self(RequestBuilder::new(stub))
21219        }
21220
21221        /// Sets the full request, replacing any prior values.
21222        pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> Self {
21223            self.0.request = v.into();
21224            self
21225        }
21226
21227        /// Sets all the options, replacing any prior values.
21228        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21229            self.0.options = v.into();
21230            self
21231        }
21232
21233        /// Sends the request.
21234        pub async fn send(self) -> Result<crate::model::Tool> {
21235            (*self.0.stub)
21236                .create_tool(self.0.request, self.0.options)
21237                .await
21238                .map(gax::response::Response::into_body)
21239        }
21240
21241        /// Sets the value of [parent][crate::model::CreateToolRequest::parent].
21242        ///
21243        /// This is a **required** field for requests.
21244        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21245            self.0.request.parent = v.into();
21246            self
21247        }
21248
21249        /// Sets the value of [tool][crate::model::CreateToolRequest::tool].
21250        ///
21251        /// This is a **required** field for requests.
21252        pub fn set_tool<T>(mut self, v: T) -> Self
21253        where
21254            T: std::convert::Into<crate::model::Tool>,
21255        {
21256            self.0.request.tool = std::option::Option::Some(v.into());
21257            self
21258        }
21259
21260        /// Sets or clears the value of [tool][crate::model::CreateToolRequest::tool].
21261        ///
21262        /// This is a **required** field for requests.
21263        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
21264        where
21265            T: std::convert::Into<crate::model::Tool>,
21266        {
21267            self.0.request.tool = v.map(|x| x.into());
21268            self
21269        }
21270
21271        /// Sets the value of [tool_id][crate::model::CreateToolRequest::tool_id].
21272        pub fn set_tool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21273            self.0.request.tool_id = v.into();
21274            self
21275        }
21276    }
21277
21278    #[doc(hidden)]
21279    impl gax::options::internal::RequestBuilder for CreateTool {
21280        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21281            &mut self.0.options
21282        }
21283    }
21284
21285    /// The request builder for [Tools::get_tool][crate::client::Tools::get_tool] calls.
21286    ///
21287    /// # Example
21288    /// ```
21289    /// # use google_cloud_dialogflow_v2::builder::tools::GetTool;
21290    /// # async fn sample() -> gax::Result<()> {
21291    ///
21292    /// let builder = prepare_request_builder();
21293    /// let response = builder.send().await?;
21294    /// # Ok(()) }
21295    ///
21296    /// fn prepare_request_builder() -> GetTool {
21297    ///   # panic!();
21298    ///   // ... details omitted ...
21299    /// }
21300    /// ```
21301    #[derive(Clone, Debug)]
21302    pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
21303
21304    impl GetTool {
21305        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21306            Self(RequestBuilder::new(stub))
21307        }
21308
21309        /// Sets the full request, replacing any prior values.
21310        pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> 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<gax::options::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<crate::model::Tool> {
21323            (*self.0.stub)
21324                .get_tool(self.0.request, self.0.options)
21325                .await
21326                .map(gax::response::Response::into_body)
21327        }
21328
21329        /// Sets the value of [name][crate::model::GetToolRequest::name].
21330        ///
21331        /// This is a **required** field for requests.
21332        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21333            self.0.request.name = v.into();
21334            self
21335        }
21336    }
21337
21338    #[doc(hidden)]
21339    impl gax::options::internal::RequestBuilder for GetTool {
21340        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21341            &mut self.0.options
21342        }
21343    }
21344
21345    /// The request builder for [Tools::list_tools][crate::client::Tools::list_tools] calls.
21346    ///
21347    /// # Example
21348    /// ```
21349    /// # use google_cloud_dialogflow_v2::builder::tools::ListTools;
21350    /// # async fn sample() -> gax::Result<()> {
21351    /// use gax::paginator::ItemPaginator;
21352    ///
21353    /// let builder = prepare_request_builder();
21354    /// let mut items = builder.by_item();
21355    /// while let Some(result) = items.next().await {
21356    ///   let item = result?;
21357    /// }
21358    /// # Ok(()) }
21359    ///
21360    /// fn prepare_request_builder() -> ListTools {
21361    ///   # panic!();
21362    ///   // ... details omitted ...
21363    /// }
21364    /// ```
21365    #[derive(Clone, Debug)]
21366    pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
21367
21368    impl ListTools {
21369        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21370            Self(RequestBuilder::new(stub))
21371        }
21372
21373        /// Sets the full request, replacing any prior values.
21374        pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
21375            self.0.request = v.into();
21376            self
21377        }
21378
21379        /// Sets all the options, replacing any prior values.
21380        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21381            self.0.options = v.into();
21382            self
21383        }
21384
21385        /// Sends the request.
21386        pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
21387            (*self.0.stub)
21388                .list_tools(self.0.request, self.0.options)
21389                .await
21390                .map(gax::response::Response::into_body)
21391        }
21392
21393        /// Streams each page in the collection.
21394        pub fn by_page(
21395            self,
21396        ) -> impl gax::paginator::Paginator<crate::model::ListToolsResponse, gax::error::Error>
21397        {
21398            use std::clone::Clone;
21399            let token = self.0.request.page_token.clone();
21400            let execute = move |token: String| {
21401                let mut builder = self.clone();
21402                builder.0.request = builder.0.request.set_page_token(token);
21403                builder.send()
21404            };
21405            gax::paginator::internal::new_paginator(token, execute)
21406        }
21407
21408        /// Streams each item in the collection.
21409        pub fn by_item(
21410            self,
21411        ) -> impl gax::paginator::ItemPaginator<crate::model::ListToolsResponse, gax::error::Error>
21412        {
21413            use gax::paginator::Paginator;
21414            self.by_page().items()
21415        }
21416
21417        /// Sets the value of [parent][crate::model::ListToolsRequest::parent].
21418        ///
21419        /// This is a **required** field for requests.
21420        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21421            self.0.request.parent = v.into();
21422            self
21423        }
21424
21425        /// Sets the value of [page_size][crate::model::ListToolsRequest::page_size].
21426        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21427            self.0.request.page_size = v.into();
21428            self
21429        }
21430
21431        /// Sets the value of [page_token][crate::model::ListToolsRequest::page_token].
21432        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21433            self.0.request.page_token = v.into();
21434            self
21435        }
21436    }
21437
21438    #[doc(hidden)]
21439    impl gax::options::internal::RequestBuilder for ListTools {
21440        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21441            &mut self.0.options
21442        }
21443    }
21444
21445    /// The request builder for [Tools::delete_tool][crate::client::Tools::delete_tool] calls.
21446    ///
21447    /// # Example
21448    /// ```
21449    /// # use google_cloud_dialogflow_v2::builder::tools::DeleteTool;
21450    /// # async fn sample() -> gax::Result<()> {
21451    ///
21452    /// let builder = prepare_request_builder();
21453    /// let response = builder.send().await?;
21454    /// # Ok(()) }
21455    ///
21456    /// fn prepare_request_builder() -> DeleteTool {
21457    ///   # panic!();
21458    ///   // ... details omitted ...
21459    /// }
21460    /// ```
21461    #[derive(Clone, Debug)]
21462    pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
21463
21464    impl DeleteTool {
21465        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21466            Self(RequestBuilder::new(stub))
21467        }
21468
21469        /// Sets the full request, replacing any prior values.
21470        pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
21471            self.0.request = v.into();
21472            self
21473        }
21474
21475        /// Sets all the options, replacing any prior values.
21476        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21477            self.0.options = v.into();
21478            self
21479        }
21480
21481        /// Sends the request.
21482        pub async fn send(self) -> Result<()> {
21483            (*self.0.stub)
21484                .delete_tool(self.0.request, self.0.options)
21485                .await
21486                .map(gax::response::Response::into_body)
21487        }
21488
21489        /// Sets the value of [name][crate::model::DeleteToolRequest::name].
21490        ///
21491        /// This is a **required** field for requests.
21492        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21493            self.0.request.name = v.into();
21494            self
21495        }
21496    }
21497
21498    #[doc(hidden)]
21499    impl gax::options::internal::RequestBuilder for DeleteTool {
21500        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21501            &mut self.0.options
21502        }
21503    }
21504
21505    /// The request builder for [Tools::update_tool][crate::client::Tools::update_tool] calls.
21506    ///
21507    /// # Example
21508    /// ```
21509    /// # use google_cloud_dialogflow_v2::builder::tools::UpdateTool;
21510    /// # async fn sample() -> gax::Result<()> {
21511    ///
21512    /// let builder = prepare_request_builder();
21513    /// let response = builder.send().await?;
21514    /// # Ok(()) }
21515    ///
21516    /// fn prepare_request_builder() -> UpdateTool {
21517    ///   # panic!();
21518    ///   // ... details omitted ...
21519    /// }
21520    /// ```
21521    #[derive(Clone, Debug)]
21522    pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
21523
21524    impl UpdateTool {
21525        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21526            Self(RequestBuilder::new(stub))
21527        }
21528
21529        /// Sets the full request, replacing any prior values.
21530        pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
21531            self.0.request = v.into();
21532            self
21533        }
21534
21535        /// Sets all the options, replacing any prior values.
21536        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21537            self.0.options = v.into();
21538            self
21539        }
21540
21541        /// Sends the request.
21542        pub async fn send(self) -> Result<crate::model::Tool> {
21543            (*self.0.stub)
21544                .update_tool(self.0.request, self.0.options)
21545                .await
21546                .map(gax::response::Response::into_body)
21547        }
21548
21549        /// Sets the value of [tool][crate::model::UpdateToolRequest::tool].
21550        ///
21551        /// This is a **required** field for requests.
21552        pub fn set_tool<T>(mut self, v: T) -> Self
21553        where
21554            T: std::convert::Into<crate::model::Tool>,
21555        {
21556            self.0.request.tool = std::option::Option::Some(v.into());
21557            self
21558        }
21559
21560        /// Sets or clears the value of [tool][crate::model::UpdateToolRequest::tool].
21561        ///
21562        /// This is a **required** field for requests.
21563        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
21564        where
21565            T: std::convert::Into<crate::model::Tool>,
21566        {
21567            self.0.request.tool = v.map(|x| x.into());
21568            self
21569        }
21570
21571        /// Sets the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
21572        pub fn set_update_mask<T>(mut self, v: T) -> Self
21573        where
21574            T: std::convert::Into<wkt::FieldMask>,
21575        {
21576            self.0.request.update_mask = std::option::Option::Some(v.into());
21577            self
21578        }
21579
21580        /// Sets or clears the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
21581        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21582        where
21583            T: std::convert::Into<wkt::FieldMask>,
21584        {
21585            self.0.request.update_mask = v.map(|x| x.into());
21586            self
21587        }
21588    }
21589
21590    #[doc(hidden)]
21591    impl gax::options::internal::RequestBuilder for UpdateTool {
21592        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21593            &mut self.0.options
21594        }
21595    }
21596
21597    /// The request builder for [Tools::list_locations][crate::client::Tools::list_locations] calls.
21598    ///
21599    /// # Example
21600    /// ```
21601    /// # use google_cloud_dialogflow_v2::builder::tools::ListLocations;
21602    /// # async fn sample() -> gax::Result<()> {
21603    /// use gax::paginator::ItemPaginator;
21604    ///
21605    /// let builder = prepare_request_builder();
21606    /// let mut items = builder.by_item();
21607    /// while let Some(result) = items.next().await {
21608    ///   let item = result?;
21609    /// }
21610    /// # Ok(()) }
21611    ///
21612    /// fn prepare_request_builder() -> ListLocations {
21613    ///   # panic!();
21614    ///   // ... details omitted ...
21615    /// }
21616    /// ```
21617    #[derive(Clone, Debug)]
21618    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
21619
21620    impl ListLocations {
21621        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21622            Self(RequestBuilder::new(stub))
21623        }
21624
21625        /// Sets the full request, replacing any prior values.
21626        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
21627            mut self,
21628            v: V,
21629        ) -> Self {
21630            self.0.request = v.into();
21631            self
21632        }
21633
21634        /// Sets all the options, replacing any prior values.
21635        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21636            self.0.options = v.into();
21637            self
21638        }
21639
21640        /// Sends the request.
21641        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
21642            (*self.0.stub)
21643                .list_locations(self.0.request, self.0.options)
21644                .await
21645                .map(gax::response::Response::into_body)
21646        }
21647
21648        /// Streams each page in the collection.
21649        pub fn by_page(
21650            self,
21651        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
21652        {
21653            use std::clone::Clone;
21654            let token = self.0.request.page_token.clone();
21655            let execute = move |token: String| {
21656                let mut builder = self.clone();
21657                builder.0.request = builder.0.request.set_page_token(token);
21658                builder.send()
21659            };
21660            gax::paginator::internal::new_paginator(token, execute)
21661        }
21662
21663        /// Streams each item in the collection.
21664        pub fn by_item(
21665            self,
21666        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
21667        {
21668            use gax::paginator::Paginator;
21669            self.by_page().items()
21670        }
21671
21672        /// Sets the value of [name][location::model::ListLocationsRequest::name].
21673        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21674            self.0.request.name = v.into();
21675            self
21676        }
21677
21678        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
21679        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21680            self.0.request.filter = v.into();
21681            self
21682        }
21683
21684        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
21685        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21686            self.0.request.page_size = v.into();
21687            self
21688        }
21689
21690        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
21691        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21692            self.0.request.page_token = v.into();
21693            self
21694        }
21695    }
21696
21697    #[doc(hidden)]
21698    impl gax::options::internal::RequestBuilder for ListLocations {
21699        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21700            &mut self.0.options
21701        }
21702    }
21703
21704    /// The request builder for [Tools::get_location][crate::client::Tools::get_location] calls.
21705    ///
21706    /// # Example
21707    /// ```
21708    /// # use google_cloud_dialogflow_v2::builder::tools::GetLocation;
21709    /// # async fn sample() -> gax::Result<()> {
21710    ///
21711    /// let builder = prepare_request_builder();
21712    /// let response = builder.send().await?;
21713    /// # Ok(()) }
21714    ///
21715    /// fn prepare_request_builder() -> GetLocation {
21716    ///   # panic!();
21717    ///   // ... details omitted ...
21718    /// }
21719    /// ```
21720    #[derive(Clone, Debug)]
21721    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
21722
21723    impl GetLocation {
21724        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21725            Self(RequestBuilder::new(stub))
21726        }
21727
21728        /// Sets the full request, replacing any prior values.
21729        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
21730            self.0.request = v.into();
21731            self
21732        }
21733
21734        /// Sets all the options, replacing any prior values.
21735        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21736            self.0.options = v.into();
21737            self
21738        }
21739
21740        /// Sends the request.
21741        pub async fn send(self) -> Result<location::model::Location> {
21742            (*self.0.stub)
21743                .get_location(self.0.request, self.0.options)
21744                .await
21745                .map(gax::response::Response::into_body)
21746        }
21747
21748        /// Sets the value of [name][location::model::GetLocationRequest::name].
21749        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21750            self.0.request.name = v.into();
21751            self
21752        }
21753    }
21754
21755    #[doc(hidden)]
21756    impl gax::options::internal::RequestBuilder for GetLocation {
21757        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21758            &mut self.0.options
21759        }
21760    }
21761
21762    /// The request builder for [Tools::list_operations][crate::client::Tools::list_operations] calls.
21763    ///
21764    /// # Example
21765    /// ```
21766    /// # use google_cloud_dialogflow_v2::builder::tools::ListOperations;
21767    /// # async fn sample() -> gax::Result<()> {
21768    /// use gax::paginator::ItemPaginator;
21769    ///
21770    /// let builder = prepare_request_builder();
21771    /// let mut items = builder.by_item();
21772    /// while let Some(result) = items.next().await {
21773    ///   let item = result?;
21774    /// }
21775    /// # Ok(()) }
21776    ///
21777    /// fn prepare_request_builder() -> ListOperations {
21778    ///   # panic!();
21779    ///   // ... details omitted ...
21780    /// }
21781    /// ```
21782    #[derive(Clone, Debug)]
21783    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
21784
21785    impl ListOperations {
21786        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21787            Self(RequestBuilder::new(stub))
21788        }
21789
21790        /// Sets the full request, replacing any prior values.
21791        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
21792            mut self,
21793            v: V,
21794        ) -> Self {
21795            self.0.request = v.into();
21796            self
21797        }
21798
21799        /// Sets all the options, replacing any prior values.
21800        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21801            self.0.options = v.into();
21802            self
21803        }
21804
21805        /// Sends the request.
21806        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
21807            (*self.0.stub)
21808                .list_operations(self.0.request, self.0.options)
21809                .await
21810                .map(gax::response::Response::into_body)
21811        }
21812
21813        /// Streams each page in the collection.
21814        pub fn by_page(
21815            self,
21816        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
21817        {
21818            use std::clone::Clone;
21819            let token = self.0.request.page_token.clone();
21820            let execute = move |token: String| {
21821                let mut builder = self.clone();
21822                builder.0.request = builder.0.request.set_page_token(token);
21823                builder.send()
21824            };
21825            gax::paginator::internal::new_paginator(token, execute)
21826        }
21827
21828        /// Streams each item in the collection.
21829        pub fn by_item(
21830            self,
21831        ) -> impl gax::paginator::ItemPaginator<
21832            longrunning::model::ListOperationsResponse,
21833            gax::error::Error,
21834        > {
21835            use gax::paginator::Paginator;
21836            self.by_page().items()
21837        }
21838
21839        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
21840        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21841            self.0.request.name = v.into();
21842            self
21843        }
21844
21845        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
21846        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21847            self.0.request.filter = v.into();
21848            self
21849        }
21850
21851        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
21852        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21853            self.0.request.page_size = v.into();
21854            self
21855        }
21856
21857        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
21858        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21859            self.0.request.page_token = v.into();
21860            self
21861        }
21862
21863        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
21864        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21865            self.0.request.return_partial_success = v.into();
21866            self
21867        }
21868    }
21869
21870    #[doc(hidden)]
21871    impl gax::options::internal::RequestBuilder for ListOperations {
21872        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21873            &mut self.0.options
21874        }
21875    }
21876
21877    /// The request builder for [Tools::get_operation][crate::client::Tools::get_operation] calls.
21878    ///
21879    /// # Example
21880    /// ```
21881    /// # use google_cloud_dialogflow_v2::builder::tools::GetOperation;
21882    /// # async fn sample() -> gax::Result<()> {
21883    ///
21884    /// let builder = prepare_request_builder();
21885    /// let response = builder.send().await?;
21886    /// # Ok(()) }
21887    ///
21888    /// fn prepare_request_builder() -> GetOperation {
21889    ///   # panic!();
21890    ///   // ... details omitted ...
21891    /// }
21892    /// ```
21893    #[derive(Clone, Debug)]
21894    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
21895
21896    impl GetOperation {
21897        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21898            Self(RequestBuilder::new(stub))
21899        }
21900
21901        /// Sets the full request, replacing any prior values.
21902        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
21903            mut self,
21904            v: V,
21905        ) -> Self {
21906            self.0.request = v.into();
21907            self
21908        }
21909
21910        /// Sets all the options, replacing any prior values.
21911        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21912            self.0.options = v.into();
21913            self
21914        }
21915
21916        /// Sends the request.
21917        pub async fn send(self) -> Result<longrunning::model::Operation> {
21918            (*self.0.stub)
21919                .get_operation(self.0.request, self.0.options)
21920                .await
21921                .map(gax::response::Response::into_body)
21922        }
21923
21924        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
21925        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21926            self.0.request.name = v.into();
21927            self
21928        }
21929    }
21930
21931    #[doc(hidden)]
21932    impl gax::options::internal::RequestBuilder for GetOperation {
21933        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21934            &mut self.0.options
21935        }
21936    }
21937
21938    /// The request builder for [Tools::cancel_operation][crate::client::Tools::cancel_operation] calls.
21939    ///
21940    /// # Example
21941    /// ```
21942    /// # use google_cloud_dialogflow_v2::builder::tools::CancelOperation;
21943    /// # async fn sample() -> gax::Result<()> {
21944    ///
21945    /// let builder = prepare_request_builder();
21946    /// let response = builder.send().await?;
21947    /// # Ok(()) }
21948    ///
21949    /// fn prepare_request_builder() -> CancelOperation {
21950    ///   # panic!();
21951    ///   // ... details omitted ...
21952    /// }
21953    /// ```
21954    #[derive(Clone, Debug)]
21955    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
21956
21957    impl CancelOperation {
21958        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21959            Self(RequestBuilder::new(stub))
21960        }
21961
21962        /// Sets the full request, replacing any prior values.
21963        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
21964            mut self,
21965            v: V,
21966        ) -> Self {
21967            self.0.request = v.into();
21968            self
21969        }
21970
21971        /// Sets all the options, replacing any prior values.
21972        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
21973            self.0.options = v.into();
21974            self
21975        }
21976
21977        /// Sends the request.
21978        pub async fn send(self) -> Result<()> {
21979            (*self.0.stub)
21980                .cancel_operation(self.0.request, self.0.options)
21981                .await
21982                .map(gax::response::Response::into_body)
21983        }
21984
21985        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
21986        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21987            self.0.request.name = v.into();
21988            self
21989        }
21990    }
21991
21992    #[doc(hidden)]
21993    impl gax::options::internal::RequestBuilder for CancelOperation {
21994        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
21995            &mut self.0.options
21996        }
21997    }
21998}
21999
22000#[cfg(feature = "versions")]
22001#[cfg_attr(docsrs, doc(cfg(feature = "versions")))]
22002pub mod versions {
22003    use crate::Result;
22004
22005    /// A builder for [Versions][crate::client::Versions].
22006    ///
22007    /// ```
22008    /// # async fn sample() -> gax::client_builder::Result<()> {
22009    /// # use google_cloud_dialogflow_v2::*;
22010    /// # use builder::versions::ClientBuilder;
22011    /// # use client::Versions;
22012    /// let builder : ClientBuilder = Versions::builder();
22013    /// let client = builder
22014    ///     .with_endpoint("https://dialogflow.googleapis.com")
22015    ///     .build().await?;
22016    /// # Ok(()) }
22017    /// ```
22018    pub type ClientBuilder =
22019        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22020
22021    pub(crate) mod client {
22022        use super::super::super::client::Versions;
22023        pub struct Factory;
22024        impl gax::client_builder::internal::ClientFactory for Factory {
22025            type Client = Versions;
22026            type Credentials = gaxi::options::Credentials;
22027            async fn build(
22028                self,
22029                config: gaxi::options::ClientConfig,
22030            ) -> gax::client_builder::Result<Self::Client> {
22031                Self::Client::new(config).await
22032            }
22033        }
22034    }
22035
22036    /// Common implementation for [crate::client::Versions] request builders.
22037    #[derive(Clone, Debug)]
22038    pub(crate) struct RequestBuilder<R: std::default::Default> {
22039        stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
22040        request: R,
22041        options: gax::options::RequestOptions,
22042    }
22043
22044    impl<R> RequestBuilder<R>
22045    where
22046        R: std::default::Default,
22047    {
22048        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22049            Self {
22050                stub,
22051                request: R::default(),
22052                options: gax::options::RequestOptions::default(),
22053            }
22054        }
22055    }
22056
22057    /// The request builder for [Versions::list_versions][crate::client::Versions::list_versions] calls.
22058    ///
22059    /// # Example
22060    /// ```
22061    /// # use google_cloud_dialogflow_v2::builder::versions::ListVersions;
22062    /// # async fn sample() -> gax::Result<()> {
22063    /// use gax::paginator::ItemPaginator;
22064    ///
22065    /// let builder = prepare_request_builder();
22066    /// let mut items = builder.by_item();
22067    /// while let Some(result) = items.next().await {
22068    ///   let item = result?;
22069    /// }
22070    /// # Ok(()) }
22071    ///
22072    /// fn prepare_request_builder() -> ListVersions {
22073    ///   # panic!();
22074    ///   // ... details omitted ...
22075    /// }
22076    /// ```
22077    #[derive(Clone, Debug)]
22078    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
22079
22080    impl ListVersions {
22081        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22082            Self(RequestBuilder::new(stub))
22083        }
22084
22085        /// Sets the full request, replacing any prior values.
22086        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
22087            self.0.request = v.into();
22088            self
22089        }
22090
22091        /// Sets all the options, replacing any prior values.
22092        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22093            self.0.options = v.into();
22094            self
22095        }
22096
22097        /// Sends the request.
22098        pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
22099            (*self.0.stub)
22100                .list_versions(self.0.request, self.0.options)
22101                .await
22102                .map(gax::response::Response::into_body)
22103        }
22104
22105        /// Streams each page in the collection.
22106        pub fn by_page(
22107            self,
22108        ) -> impl gax::paginator::Paginator<crate::model::ListVersionsResponse, gax::error::Error>
22109        {
22110            use std::clone::Clone;
22111            let token = self.0.request.page_token.clone();
22112            let execute = move |token: String| {
22113                let mut builder = self.clone();
22114                builder.0.request = builder.0.request.set_page_token(token);
22115                builder.send()
22116            };
22117            gax::paginator::internal::new_paginator(token, execute)
22118        }
22119
22120        /// Streams each item in the collection.
22121        pub fn by_item(
22122            self,
22123        ) -> impl gax::paginator::ItemPaginator<crate::model::ListVersionsResponse, gax::error::Error>
22124        {
22125            use gax::paginator::Paginator;
22126            self.by_page().items()
22127        }
22128
22129        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
22130        ///
22131        /// This is a **required** field for requests.
22132        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22133            self.0.request.parent = v.into();
22134            self
22135        }
22136
22137        /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
22138        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22139            self.0.request.page_size = v.into();
22140            self
22141        }
22142
22143        /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
22144        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22145            self.0.request.page_token = v.into();
22146            self
22147        }
22148    }
22149
22150    #[doc(hidden)]
22151    impl gax::options::internal::RequestBuilder for ListVersions {
22152        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22153            &mut self.0.options
22154        }
22155    }
22156
22157    /// The request builder for [Versions::get_version][crate::client::Versions::get_version] calls.
22158    ///
22159    /// # Example
22160    /// ```
22161    /// # use google_cloud_dialogflow_v2::builder::versions::GetVersion;
22162    /// # async fn sample() -> gax::Result<()> {
22163    ///
22164    /// let builder = prepare_request_builder();
22165    /// let response = builder.send().await?;
22166    /// # Ok(()) }
22167    ///
22168    /// fn prepare_request_builder() -> GetVersion {
22169    ///   # panic!();
22170    ///   // ... details omitted ...
22171    /// }
22172    /// ```
22173    #[derive(Clone, Debug)]
22174    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
22175
22176    impl GetVersion {
22177        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22178            Self(RequestBuilder::new(stub))
22179        }
22180
22181        /// Sets the full request, replacing any prior values.
22182        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
22183            self.0.request = v.into();
22184            self
22185        }
22186
22187        /// Sets all the options, replacing any prior values.
22188        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22189            self.0.options = v.into();
22190            self
22191        }
22192
22193        /// Sends the request.
22194        pub async fn send(self) -> Result<crate::model::Version> {
22195            (*self.0.stub)
22196                .get_version(self.0.request, self.0.options)
22197                .await
22198                .map(gax::response::Response::into_body)
22199        }
22200
22201        /// Sets the value of [name][crate::model::GetVersionRequest::name].
22202        ///
22203        /// This is a **required** field for requests.
22204        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22205            self.0.request.name = v.into();
22206            self
22207        }
22208    }
22209
22210    #[doc(hidden)]
22211    impl gax::options::internal::RequestBuilder for GetVersion {
22212        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22213            &mut self.0.options
22214        }
22215    }
22216
22217    /// The request builder for [Versions::create_version][crate::client::Versions::create_version] calls.
22218    ///
22219    /// # Example
22220    /// ```
22221    /// # use google_cloud_dialogflow_v2::builder::versions::CreateVersion;
22222    /// # async fn sample() -> gax::Result<()> {
22223    ///
22224    /// let builder = prepare_request_builder();
22225    /// let response = builder.send().await?;
22226    /// # Ok(()) }
22227    ///
22228    /// fn prepare_request_builder() -> CreateVersion {
22229    ///   # panic!();
22230    ///   // ... details omitted ...
22231    /// }
22232    /// ```
22233    #[derive(Clone, Debug)]
22234    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
22235
22236    impl CreateVersion {
22237        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22238            Self(RequestBuilder::new(stub))
22239        }
22240
22241        /// Sets the full request, replacing any prior values.
22242        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
22243            self.0.request = v.into();
22244            self
22245        }
22246
22247        /// Sets all the options, replacing any prior values.
22248        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22249            self.0.options = v.into();
22250            self
22251        }
22252
22253        /// Sends the request.
22254        pub async fn send(self) -> Result<crate::model::Version> {
22255            (*self.0.stub)
22256                .create_version(self.0.request, self.0.options)
22257                .await
22258                .map(gax::response::Response::into_body)
22259        }
22260
22261        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
22262        ///
22263        /// This is a **required** field for requests.
22264        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22265            self.0.request.parent = v.into();
22266            self
22267        }
22268
22269        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
22270        ///
22271        /// This is a **required** field for requests.
22272        pub fn set_version<T>(mut self, v: T) -> Self
22273        where
22274            T: std::convert::Into<crate::model::Version>,
22275        {
22276            self.0.request.version = std::option::Option::Some(v.into());
22277            self
22278        }
22279
22280        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
22281        ///
22282        /// This is a **required** field for requests.
22283        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
22284        where
22285            T: std::convert::Into<crate::model::Version>,
22286        {
22287            self.0.request.version = v.map(|x| x.into());
22288            self
22289        }
22290    }
22291
22292    #[doc(hidden)]
22293    impl gax::options::internal::RequestBuilder for CreateVersion {
22294        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22295            &mut self.0.options
22296        }
22297    }
22298
22299    /// The request builder for [Versions::update_version][crate::client::Versions::update_version] calls.
22300    ///
22301    /// # Example
22302    /// ```
22303    /// # use google_cloud_dialogflow_v2::builder::versions::UpdateVersion;
22304    /// # async fn sample() -> gax::Result<()> {
22305    ///
22306    /// let builder = prepare_request_builder();
22307    /// let response = builder.send().await?;
22308    /// # Ok(()) }
22309    ///
22310    /// fn prepare_request_builder() -> UpdateVersion {
22311    ///   # panic!();
22312    ///   // ... details omitted ...
22313    /// }
22314    /// ```
22315    #[derive(Clone, Debug)]
22316    pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
22317
22318    impl UpdateVersion {
22319        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22320            Self(RequestBuilder::new(stub))
22321        }
22322
22323        /// Sets the full request, replacing any prior values.
22324        pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
22325            self.0.request = v.into();
22326            self
22327        }
22328
22329        /// Sets all the options, replacing any prior values.
22330        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22331            self.0.options = v.into();
22332            self
22333        }
22334
22335        /// Sends the request.
22336        pub async fn send(self) -> Result<crate::model::Version> {
22337            (*self.0.stub)
22338                .update_version(self.0.request, self.0.options)
22339                .await
22340                .map(gax::response::Response::into_body)
22341        }
22342
22343        /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
22344        ///
22345        /// This is a **required** field for requests.
22346        pub fn set_version<T>(mut self, v: T) -> Self
22347        where
22348            T: std::convert::Into<crate::model::Version>,
22349        {
22350            self.0.request.version = std::option::Option::Some(v.into());
22351            self
22352        }
22353
22354        /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
22355        ///
22356        /// This is a **required** field for requests.
22357        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
22358        where
22359            T: std::convert::Into<crate::model::Version>,
22360        {
22361            self.0.request.version = v.map(|x| x.into());
22362            self
22363        }
22364
22365        /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
22366        ///
22367        /// This is a **required** field for requests.
22368        pub fn set_update_mask<T>(mut self, v: T) -> Self
22369        where
22370            T: std::convert::Into<wkt::FieldMask>,
22371        {
22372            self.0.request.update_mask = std::option::Option::Some(v.into());
22373            self
22374        }
22375
22376        /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
22377        ///
22378        /// This is a **required** field for requests.
22379        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22380        where
22381            T: std::convert::Into<wkt::FieldMask>,
22382        {
22383            self.0.request.update_mask = v.map(|x| x.into());
22384            self
22385        }
22386    }
22387
22388    #[doc(hidden)]
22389    impl gax::options::internal::RequestBuilder for UpdateVersion {
22390        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22391            &mut self.0.options
22392        }
22393    }
22394
22395    /// The request builder for [Versions::delete_version][crate::client::Versions::delete_version] calls.
22396    ///
22397    /// # Example
22398    /// ```
22399    /// # use google_cloud_dialogflow_v2::builder::versions::DeleteVersion;
22400    /// # async fn sample() -> gax::Result<()> {
22401    ///
22402    /// let builder = prepare_request_builder();
22403    /// let response = builder.send().await?;
22404    /// # Ok(()) }
22405    ///
22406    /// fn prepare_request_builder() -> DeleteVersion {
22407    ///   # panic!();
22408    ///   // ... details omitted ...
22409    /// }
22410    /// ```
22411    #[derive(Clone, Debug)]
22412    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
22413
22414    impl DeleteVersion {
22415        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22416            Self(RequestBuilder::new(stub))
22417        }
22418
22419        /// Sets the full request, replacing any prior values.
22420        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
22421            self.0.request = v.into();
22422            self
22423        }
22424
22425        /// Sets all the options, replacing any prior values.
22426        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22427            self.0.options = v.into();
22428            self
22429        }
22430
22431        /// Sends the request.
22432        pub async fn send(self) -> Result<()> {
22433            (*self.0.stub)
22434                .delete_version(self.0.request, self.0.options)
22435                .await
22436                .map(gax::response::Response::into_body)
22437        }
22438
22439        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
22440        ///
22441        /// This is a **required** field for requests.
22442        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22443            self.0.request.name = v.into();
22444            self
22445        }
22446    }
22447
22448    #[doc(hidden)]
22449    impl gax::options::internal::RequestBuilder for DeleteVersion {
22450        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22451            &mut self.0.options
22452        }
22453    }
22454
22455    /// The request builder for [Versions::list_locations][crate::client::Versions::list_locations] calls.
22456    ///
22457    /// # Example
22458    /// ```
22459    /// # use google_cloud_dialogflow_v2::builder::versions::ListLocations;
22460    /// # async fn sample() -> gax::Result<()> {
22461    /// use gax::paginator::ItemPaginator;
22462    ///
22463    /// let builder = prepare_request_builder();
22464    /// let mut items = builder.by_item();
22465    /// while let Some(result) = items.next().await {
22466    ///   let item = result?;
22467    /// }
22468    /// # Ok(()) }
22469    ///
22470    /// fn prepare_request_builder() -> ListLocations {
22471    ///   # panic!();
22472    ///   // ... details omitted ...
22473    /// }
22474    /// ```
22475    #[derive(Clone, Debug)]
22476    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
22477
22478    impl ListLocations {
22479        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22480            Self(RequestBuilder::new(stub))
22481        }
22482
22483        /// Sets the full request, replacing any prior values.
22484        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
22485            mut self,
22486            v: V,
22487        ) -> Self {
22488            self.0.request = v.into();
22489            self
22490        }
22491
22492        /// Sets all the options, replacing any prior values.
22493        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22494            self.0.options = v.into();
22495            self
22496        }
22497
22498        /// Sends the request.
22499        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
22500            (*self.0.stub)
22501                .list_locations(self.0.request, self.0.options)
22502                .await
22503                .map(gax::response::Response::into_body)
22504        }
22505
22506        /// Streams each page in the collection.
22507        pub fn by_page(
22508            self,
22509        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
22510        {
22511            use std::clone::Clone;
22512            let token = self.0.request.page_token.clone();
22513            let execute = move |token: String| {
22514                let mut builder = self.clone();
22515                builder.0.request = builder.0.request.set_page_token(token);
22516                builder.send()
22517            };
22518            gax::paginator::internal::new_paginator(token, execute)
22519        }
22520
22521        /// Streams each item in the collection.
22522        pub fn by_item(
22523            self,
22524        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
22525        {
22526            use gax::paginator::Paginator;
22527            self.by_page().items()
22528        }
22529
22530        /// Sets the value of [name][location::model::ListLocationsRequest::name].
22531        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22532            self.0.request.name = v.into();
22533            self
22534        }
22535
22536        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
22537        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22538            self.0.request.filter = v.into();
22539            self
22540        }
22541
22542        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
22543        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22544            self.0.request.page_size = v.into();
22545            self
22546        }
22547
22548        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
22549        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22550            self.0.request.page_token = v.into();
22551            self
22552        }
22553    }
22554
22555    #[doc(hidden)]
22556    impl gax::options::internal::RequestBuilder for ListLocations {
22557        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22558            &mut self.0.options
22559        }
22560    }
22561
22562    /// The request builder for [Versions::get_location][crate::client::Versions::get_location] calls.
22563    ///
22564    /// # Example
22565    /// ```
22566    /// # use google_cloud_dialogflow_v2::builder::versions::GetLocation;
22567    /// # async fn sample() -> gax::Result<()> {
22568    ///
22569    /// let builder = prepare_request_builder();
22570    /// let response = builder.send().await?;
22571    /// # Ok(()) }
22572    ///
22573    /// fn prepare_request_builder() -> GetLocation {
22574    ///   # panic!();
22575    ///   // ... details omitted ...
22576    /// }
22577    /// ```
22578    #[derive(Clone, Debug)]
22579    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
22580
22581    impl GetLocation {
22582        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22583            Self(RequestBuilder::new(stub))
22584        }
22585
22586        /// Sets the full request, replacing any prior values.
22587        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
22588            self.0.request = v.into();
22589            self
22590        }
22591
22592        /// Sets all the options, replacing any prior values.
22593        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22594            self.0.options = v.into();
22595            self
22596        }
22597
22598        /// Sends the request.
22599        pub async fn send(self) -> Result<location::model::Location> {
22600            (*self.0.stub)
22601                .get_location(self.0.request, self.0.options)
22602                .await
22603                .map(gax::response::Response::into_body)
22604        }
22605
22606        /// Sets the value of [name][location::model::GetLocationRequest::name].
22607        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22608            self.0.request.name = v.into();
22609            self
22610        }
22611    }
22612
22613    #[doc(hidden)]
22614    impl gax::options::internal::RequestBuilder for GetLocation {
22615        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22616            &mut self.0.options
22617        }
22618    }
22619
22620    /// The request builder for [Versions::list_operations][crate::client::Versions::list_operations] calls.
22621    ///
22622    /// # Example
22623    /// ```
22624    /// # use google_cloud_dialogflow_v2::builder::versions::ListOperations;
22625    /// # async fn sample() -> gax::Result<()> {
22626    /// use gax::paginator::ItemPaginator;
22627    ///
22628    /// let builder = prepare_request_builder();
22629    /// let mut items = builder.by_item();
22630    /// while let Some(result) = items.next().await {
22631    ///   let item = result?;
22632    /// }
22633    /// # Ok(()) }
22634    ///
22635    /// fn prepare_request_builder() -> ListOperations {
22636    ///   # panic!();
22637    ///   // ... details omitted ...
22638    /// }
22639    /// ```
22640    #[derive(Clone, Debug)]
22641    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
22642
22643    impl ListOperations {
22644        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22645            Self(RequestBuilder::new(stub))
22646        }
22647
22648        /// Sets the full request, replacing any prior values.
22649        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
22650            mut self,
22651            v: V,
22652        ) -> Self {
22653            self.0.request = v.into();
22654            self
22655        }
22656
22657        /// Sets all the options, replacing any prior values.
22658        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22659            self.0.options = v.into();
22660            self
22661        }
22662
22663        /// Sends the request.
22664        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
22665            (*self.0.stub)
22666                .list_operations(self.0.request, self.0.options)
22667                .await
22668                .map(gax::response::Response::into_body)
22669        }
22670
22671        /// Streams each page in the collection.
22672        pub fn by_page(
22673            self,
22674        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
22675        {
22676            use std::clone::Clone;
22677            let token = self.0.request.page_token.clone();
22678            let execute = move |token: String| {
22679                let mut builder = self.clone();
22680                builder.0.request = builder.0.request.set_page_token(token);
22681                builder.send()
22682            };
22683            gax::paginator::internal::new_paginator(token, execute)
22684        }
22685
22686        /// Streams each item in the collection.
22687        pub fn by_item(
22688            self,
22689        ) -> impl gax::paginator::ItemPaginator<
22690            longrunning::model::ListOperationsResponse,
22691            gax::error::Error,
22692        > {
22693            use gax::paginator::Paginator;
22694            self.by_page().items()
22695        }
22696
22697        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
22698        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22699            self.0.request.name = v.into();
22700            self
22701        }
22702
22703        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
22704        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22705            self.0.request.filter = v.into();
22706            self
22707        }
22708
22709        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
22710        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22711            self.0.request.page_size = v.into();
22712            self
22713        }
22714
22715        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
22716        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22717            self.0.request.page_token = v.into();
22718            self
22719        }
22720
22721        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
22722        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22723            self.0.request.return_partial_success = v.into();
22724            self
22725        }
22726    }
22727
22728    #[doc(hidden)]
22729    impl gax::options::internal::RequestBuilder for ListOperations {
22730        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22731            &mut self.0.options
22732        }
22733    }
22734
22735    /// The request builder for [Versions::get_operation][crate::client::Versions::get_operation] calls.
22736    ///
22737    /// # Example
22738    /// ```
22739    /// # use google_cloud_dialogflow_v2::builder::versions::GetOperation;
22740    /// # async fn sample() -> gax::Result<()> {
22741    ///
22742    /// let builder = prepare_request_builder();
22743    /// let response = builder.send().await?;
22744    /// # Ok(()) }
22745    ///
22746    /// fn prepare_request_builder() -> GetOperation {
22747    ///   # panic!();
22748    ///   // ... details omitted ...
22749    /// }
22750    /// ```
22751    #[derive(Clone, Debug)]
22752    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
22753
22754    impl GetOperation {
22755        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22756            Self(RequestBuilder::new(stub))
22757        }
22758
22759        /// Sets the full request, replacing any prior values.
22760        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
22761            mut self,
22762            v: V,
22763        ) -> Self {
22764            self.0.request = v.into();
22765            self
22766        }
22767
22768        /// Sets all the options, replacing any prior values.
22769        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22770            self.0.options = v.into();
22771            self
22772        }
22773
22774        /// Sends the request.
22775        pub async fn send(self) -> Result<longrunning::model::Operation> {
22776            (*self.0.stub)
22777                .get_operation(self.0.request, self.0.options)
22778                .await
22779                .map(gax::response::Response::into_body)
22780        }
22781
22782        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
22783        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22784            self.0.request.name = v.into();
22785            self
22786        }
22787    }
22788
22789    #[doc(hidden)]
22790    impl gax::options::internal::RequestBuilder for GetOperation {
22791        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22792            &mut self.0.options
22793        }
22794    }
22795
22796    /// The request builder for [Versions::cancel_operation][crate::client::Versions::cancel_operation] calls.
22797    ///
22798    /// # Example
22799    /// ```
22800    /// # use google_cloud_dialogflow_v2::builder::versions::CancelOperation;
22801    /// # async fn sample() -> gax::Result<()> {
22802    ///
22803    /// let builder = prepare_request_builder();
22804    /// let response = builder.send().await?;
22805    /// # Ok(()) }
22806    ///
22807    /// fn prepare_request_builder() -> CancelOperation {
22808    ///   # panic!();
22809    ///   // ... details omitted ...
22810    /// }
22811    /// ```
22812    #[derive(Clone, Debug)]
22813    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
22814
22815    impl CancelOperation {
22816        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22817            Self(RequestBuilder::new(stub))
22818        }
22819
22820        /// Sets the full request, replacing any prior values.
22821        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
22822            mut self,
22823            v: V,
22824        ) -> Self {
22825            self.0.request = v.into();
22826            self
22827        }
22828
22829        /// Sets all the options, replacing any prior values.
22830        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
22831            self.0.options = v.into();
22832            self
22833        }
22834
22835        /// Sends the request.
22836        pub async fn send(self) -> Result<()> {
22837            (*self.0.stub)
22838                .cancel_operation(self.0.request, self.0.options)
22839                .await
22840                .map(gax::response::Response::into_body)
22841        }
22842
22843        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
22844        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22845            self.0.request.name = v.into();
22846            self
22847        }
22848    }
22849
22850    #[doc(hidden)]
22851    impl gax::options::internal::RequestBuilder for CancelOperation {
22852        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
22853            &mut self.0.options
22854        }
22855    }
22856}