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    /// # tokio_test::block_on(async {
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    /// # gax::client_builder::Result::<()>::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    /// ```no_run
78    /// # use google_cloud_dialogflow_v2::builder;
79    /// use builder::agents::GetAgent;
80    /// # tokio_test::block_on(async {
81    ///
82    /// let builder = prepare_request_builder();
83    /// let response = builder.send().await?;
84    /// # gax::Result::<()>::Ok(()) });
85    ///
86    /// fn prepare_request_builder() -> GetAgent {
87    ///   # panic!();
88    ///   // ... details omitted ...
89    /// }
90    /// ```
91    #[derive(Clone, Debug)]
92    pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
93
94    impl GetAgent {
95        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
96            Self(RequestBuilder::new(stub))
97        }
98
99        /// Sets the full request, replacing any prior values.
100        pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
101            self.0.request = v.into();
102            self
103        }
104
105        /// Sets all the options, replacing any prior values.
106        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
107            self.0.options = v.into();
108            self
109        }
110
111        /// Sends the request.
112        pub async fn send(self) -> Result<crate::model::Agent> {
113            (*self.0.stub)
114                .get_agent(self.0.request, self.0.options)
115                .await
116                .map(gax::response::Response::into_body)
117        }
118
119        /// Sets the value of [parent][crate::model::GetAgentRequest::parent].
120        ///
121        /// This is a **required** field for requests.
122        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
123            self.0.request.parent = v.into();
124            self
125        }
126    }
127
128    #[doc(hidden)]
129    impl gax::options::internal::RequestBuilder for GetAgent {
130        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
131            &mut self.0.options
132        }
133    }
134
135    /// The request builder for [Agents::set_agent][crate::client::Agents::set_agent] calls.
136    ///
137    /// # Example
138    /// ```no_run
139    /// # use google_cloud_dialogflow_v2::builder;
140    /// use builder::agents::SetAgent;
141    /// # tokio_test::block_on(async {
142    ///
143    /// let builder = prepare_request_builder();
144    /// let response = builder.send().await?;
145    /// # gax::Result::<()>::Ok(()) });
146    ///
147    /// fn prepare_request_builder() -> SetAgent {
148    ///   # panic!();
149    ///   // ... details omitted ...
150    /// }
151    /// ```
152    #[derive(Clone, Debug)]
153    pub struct SetAgent(RequestBuilder<crate::model::SetAgentRequest>);
154
155    impl SetAgent {
156        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
157            Self(RequestBuilder::new(stub))
158        }
159
160        /// Sets the full request, replacing any prior values.
161        pub fn with_request<V: Into<crate::model::SetAgentRequest>>(mut self, v: V) -> Self {
162            self.0.request = v.into();
163            self
164        }
165
166        /// Sets all the options, replacing any prior values.
167        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
168            self.0.options = v.into();
169            self
170        }
171
172        /// Sends the request.
173        pub async fn send(self) -> Result<crate::model::Agent> {
174            (*self.0.stub)
175                .set_agent(self.0.request, self.0.options)
176                .await
177                .map(gax::response::Response::into_body)
178        }
179
180        /// Sets the value of [agent][crate::model::SetAgentRequest::agent].
181        ///
182        /// This is a **required** field for requests.
183        pub fn set_agent<T>(mut self, v: T) -> Self
184        where
185            T: std::convert::Into<crate::model::Agent>,
186        {
187            self.0.request.agent = std::option::Option::Some(v.into());
188            self
189        }
190
191        /// Sets or clears the value of [agent][crate::model::SetAgentRequest::agent].
192        ///
193        /// This is a **required** field for requests.
194        pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
195        where
196            T: std::convert::Into<crate::model::Agent>,
197        {
198            self.0.request.agent = v.map(|x| x.into());
199            self
200        }
201
202        /// Sets the value of [update_mask][crate::model::SetAgentRequest::update_mask].
203        pub fn set_update_mask<T>(mut self, v: T) -> Self
204        where
205            T: std::convert::Into<wkt::FieldMask>,
206        {
207            self.0.request.update_mask = std::option::Option::Some(v.into());
208            self
209        }
210
211        /// Sets or clears the value of [update_mask][crate::model::SetAgentRequest::update_mask].
212        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
213        where
214            T: std::convert::Into<wkt::FieldMask>,
215        {
216            self.0.request.update_mask = v.map(|x| x.into());
217            self
218        }
219    }
220
221    #[doc(hidden)]
222    impl gax::options::internal::RequestBuilder for SetAgent {
223        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
224            &mut self.0.options
225        }
226    }
227
228    /// The request builder for [Agents::delete_agent][crate::client::Agents::delete_agent] calls.
229    ///
230    /// # Example
231    /// ```no_run
232    /// # use google_cloud_dialogflow_v2::builder;
233    /// use builder::agents::DeleteAgent;
234    /// # tokio_test::block_on(async {
235    ///
236    /// let builder = prepare_request_builder();
237    /// let response = builder.send().await?;
238    /// # gax::Result::<()>::Ok(()) });
239    ///
240    /// fn prepare_request_builder() -> DeleteAgent {
241    ///   # panic!();
242    ///   // ... details omitted ...
243    /// }
244    /// ```
245    #[derive(Clone, Debug)]
246    pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
247
248    impl DeleteAgent {
249        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
250            Self(RequestBuilder::new(stub))
251        }
252
253        /// Sets the full request, replacing any prior values.
254        pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
255            self.0.request = v.into();
256            self
257        }
258
259        /// Sets all the options, replacing any prior values.
260        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
261            self.0.options = v.into();
262            self
263        }
264
265        /// Sends the request.
266        pub async fn send(self) -> Result<()> {
267            (*self.0.stub)
268                .delete_agent(self.0.request, self.0.options)
269                .await
270                .map(gax::response::Response::into_body)
271        }
272
273        /// Sets the value of [parent][crate::model::DeleteAgentRequest::parent].
274        ///
275        /// This is a **required** field for requests.
276        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
277            self.0.request.parent = v.into();
278            self
279        }
280    }
281
282    #[doc(hidden)]
283    impl gax::options::internal::RequestBuilder for DeleteAgent {
284        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
285            &mut self.0.options
286        }
287    }
288
289    /// The request builder for [Agents::search_agents][crate::client::Agents::search_agents] calls.
290    ///
291    /// # Example
292    /// ```no_run
293    /// # use google_cloud_dialogflow_v2::builder;
294    /// use builder::agents::SearchAgents;
295    /// # tokio_test::block_on(async {
296    /// use gax::paginator::ItemPaginator;
297    ///
298    /// let builder = prepare_request_builder();
299    /// let mut items = builder.by_item();
300    /// while let Some(result) = items.next().await {
301    ///   let item = result?;
302    /// }
303    /// # gax::Result::<()>::Ok(()) });
304    ///
305    /// fn prepare_request_builder() -> SearchAgents {
306    ///   # panic!();
307    ///   // ... details omitted ...
308    /// }
309    /// ```
310    #[derive(Clone, Debug)]
311    pub struct SearchAgents(RequestBuilder<crate::model::SearchAgentsRequest>);
312
313    impl SearchAgents {
314        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
315            Self(RequestBuilder::new(stub))
316        }
317
318        /// Sets the full request, replacing any prior values.
319        pub fn with_request<V: Into<crate::model::SearchAgentsRequest>>(mut self, v: V) -> Self {
320            self.0.request = v.into();
321            self
322        }
323
324        /// Sets all the options, replacing any prior values.
325        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
326            self.0.options = v.into();
327            self
328        }
329
330        /// Sends the request.
331        pub async fn send(self) -> Result<crate::model::SearchAgentsResponse> {
332            (*self.0.stub)
333                .search_agents(self.0.request, self.0.options)
334                .await
335                .map(gax::response::Response::into_body)
336        }
337
338        /// Streams each page in the collection.
339        pub fn by_page(
340            self,
341        ) -> impl gax::paginator::Paginator<crate::model::SearchAgentsResponse, gax::error::Error>
342        {
343            use std::clone::Clone;
344            let token = self.0.request.page_token.clone();
345            let execute = move |token: String| {
346                let mut builder = self.clone();
347                builder.0.request = builder.0.request.set_page_token(token);
348                builder.send()
349            };
350            gax::paginator::internal::new_paginator(token, execute)
351        }
352
353        /// Streams each item in the collection.
354        pub fn by_item(
355            self,
356        ) -> impl gax::paginator::ItemPaginator<crate::model::SearchAgentsResponse, gax::error::Error>
357        {
358            use gax::paginator::Paginator;
359            self.by_page().items()
360        }
361
362        /// Sets the value of [parent][crate::model::SearchAgentsRequest::parent].
363        ///
364        /// This is a **required** field for requests.
365        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
366            self.0.request.parent = v.into();
367            self
368        }
369
370        /// Sets the value of [page_size][crate::model::SearchAgentsRequest::page_size].
371        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
372            self.0.request.page_size = v.into();
373            self
374        }
375
376        /// Sets the value of [page_token][crate::model::SearchAgentsRequest::page_token].
377        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
378            self.0.request.page_token = v.into();
379            self
380        }
381    }
382
383    #[doc(hidden)]
384    impl gax::options::internal::RequestBuilder for SearchAgents {
385        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
386            &mut self.0.options
387        }
388    }
389
390    /// The request builder for [Agents::train_agent][crate::client::Agents::train_agent] calls.
391    ///
392    /// # Example
393    /// ```no_run
394    /// # use google_cloud_dialogflow_v2::builder;
395    /// use builder::agents::TrainAgent;
396    /// # tokio_test::block_on(async {
397    /// use lro::Poller;
398    ///
399    /// let builder = prepare_request_builder();
400    /// let response = builder.poller().until_done().await?;
401    /// # gax::Result::<()>::Ok(()) });
402    ///
403    /// fn prepare_request_builder() -> TrainAgent {
404    ///   # panic!();
405    ///   // ... details omitted ...
406    /// }
407    /// ```
408    #[derive(Clone, Debug)]
409    pub struct TrainAgent(RequestBuilder<crate::model::TrainAgentRequest>);
410
411    impl TrainAgent {
412        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
413            Self(RequestBuilder::new(stub))
414        }
415
416        /// Sets the full request, replacing any prior values.
417        pub fn with_request<V: Into<crate::model::TrainAgentRequest>>(mut self, v: V) -> Self {
418            self.0.request = v.into();
419            self
420        }
421
422        /// Sets all the options, replacing any prior values.
423        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
424            self.0.options = v.into();
425            self
426        }
427
428        /// Sends the request.
429        ///
430        /// # Long running operations
431        ///
432        /// This starts, but does not poll, a longrunning operation. More information
433        /// on [train_agent][crate::client::Agents::train_agent].
434        pub async fn send(self) -> Result<longrunning::model::Operation> {
435            (*self.0.stub)
436                .train_agent(self.0.request, self.0.options)
437                .await
438                .map(gax::response::Response::into_body)
439        }
440
441        /// Creates a [Poller][lro::Poller] to work with `train_agent`.
442        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
443            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
444            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
445            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
446
447            let stub = self.0.stub.clone();
448            let mut options = self.0.options.clone();
449            options.set_retry_policy(gax::retry_policy::NeverRetry);
450            let query = move |name| {
451                let stub = stub.clone();
452                let options = options.clone();
453                async {
454                    let op = GetOperation::new(stub)
455                        .set_name(name)
456                        .with_options(options)
457                        .send()
458                        .await?;
459                    Ok(Operation::new(op))
460                }
461            };
462
463            let start = move || async {
464                let op = self.send().await?;
465                Ok(Operation::new(op))
466            };
467
468            lro::internal::new_unit_response_poller(
469                polling_error_policy,
470                polling_backoff_policy,
471                start,
472                query,
473            )
474        }
475
476        /// Sets the value of [parent][crate::model::TrainAgentRequest::parent].
477        ///
478        /// This is a **required** field for requests.
479        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
480            self.0.request.parent = v.into();
481            self
482        }
483    }
484
485    #[doc(hidden)]
486    impl gax::options::internal::RequestBuilder for TrainAgent {
487        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
488            &mut self.0.options
489        }
490    }
491
492    /// The request builder for [Agents::export_agent][crate::client::Agents::export_agent] calls.
493    ///
494    /// # Example
495    /// ```no_run
496    /// # use google_cloud_dialogflow_v2::builder;
497    /// use builder::agents::ExportAgent;
498    /// # tokio_test::block_on(async {
499    /// use lro::Poller;
500    ///
501    /// let builder = prepare_request_builder();
502    /// let response = builder.poller().until_done().await?;
503    /// # gax::Result::<()>::Ok(()) });
504    ///
505    /// fn prepare_request_builder() -> ExportAgent {
506    ///   # panic!();
507    ///   // ... details omitted ...
508    /// }
509    /// ```
510    #[derive(Clone, Debug)]
511    pub struct ExportAgent(RequestBuilder<crate::model::ExportAgentRequest>);
512
513    impl ExportAgent {
514        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
515            Self(RequestBuilder::new(stub))
516        }
517
518        /// Sets the full request, replacing any prior values.
519        pub fn with_request<V: Into<crate::model::ExportAgentRequest>>(mut self, v: V) -> Self {
520            self.0.request = v.into();
521            self
522        }
523
524        /// Sets all the options, replacing any prior values.
525        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
526            self.0.options = v.into();
527            self
528        }
529
530        /// Sends the request.
531        ///
532        /// # Long running operations
533        ///
534        /// This starts, but does not poll, a longrunning operation. More information
535        /// on [export_agent][crate::client::Agents::export_agent].
536        pub async fn send(self) -> Result<longrunning::model::Operation> {
537            (*self.0.stub)
538                .export_agent(self.0.request, self.0.options)
539                .await
540                .map(gax::response::Response::into_body)
541        }
542
543        /// Creates a [Poller][lro::Poller] to work with `export_agent`.
544        pub fn poller(self) -> impl lro::Poller<crate::model::ExportAgentResponse, wkt::Struct> {
545            type Operation =
546                lro::internal::Operation<crate::model::ExportAgentResponse, wkt::Struct>;
547            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
548            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
549
550            let stub = self.0.stub.clone();
551            let mut options = self.0.options.clone();
552            options.set_retry_policy(gax::retry_policy::NeverRetry);
553            let query = move |name| {
554                let stub = stub.clone();
555                let options = options.clone();
556                async {
557                    let op = GetOperation::new(stub)
558                        .set_name(name)
559                        .with_options(options)
560                        .send()
561                        .await?;
562                    Ok(Operation::new(op))
563                }
564            };
565
566            let start = move || async {
567                let op = self.send().await?;
568                Ok(Operation::new(op))
569            };
570
571            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
572        }
573
574        /// Sets the value of [parent][crate::model::ExportAgentRequest::parent].
575        ///
576        /// This is a **required** field for requests.
577        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
578            self.0.request.parent = v.into();
579            self
580        }
581
582        /// Sets the value of [agent_uri][crate::model::ExportAgentRequest::agent_uri].
583        ///
584        /// This is a **required** field for requests.
585        pub fn set_agent_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
586            self.0.request.agent_uri = v.into();
587            self
588        }
589    }
590
591    #[doc(hidden)]
592    impl gax::options::internal::RequestBuilder for ExportAgent {
593        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
594            &mut self.0.options
595        }
596    }
597
598    /// The request builder for [Agents::import_agent][crate::client::Agents::import_agent] calls.
599    ///
600    /// # Example
601    /// ```no_run
602    /// # use google_cloud_dialogflow_v2::builder;
603    /// use builder::agents::ImportAgent;
604    /// # tokio_test::block_on(async {
605    /// use lro::Poller;
606    ///
607    /// let builder = prepare_request_builder();
608    /// let response = builder.poller().until_done().await?;
609    /// # gax::Result::<()>::Ok(()) });
610    ///
611    /// fn prepare_request_builder() -> ImportAgent {
612    ///   # panic!();
613    ///   // ... details omitted ...
614    /// }
615    /// ```
616    #[derive(Clone, Debug)]
617    pub struct ImportAgent(RequestBuilder<crate::model::ImportAgentRequest>);
618
619    impl ImportAgent {
620        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
621            Self(RequestBuilder::new(stub))
622        }
623
624        /// Sets the full request, replacing any prior values.
625        pub fn with_request<V: Into<crate::model::ImportAgentRequest>>(mut self, v: V) -> Self {
626            self.0.request = v.into();
627            self
628        }
629
630        /// Sets all the options, replacing any prior values.
631        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
632            self.0.options = v.into();
633            self
634        }
635
636        /// Sends the request.
637        ///
638        /// # Long running operations
639        ///
640        /// This starts, but does not poll, a longrunning operation. More information
641        /// on [import_agent][crate::client::Agents::import_agent].
642        pub async fn send(self) -> Result<longrunning::model::Operation> {
643            (*self.0.stub)
644                .import_agent(self.0.request, self.0.options)
645                .await
646                .map(gax::response::Response::into_body)
647        }
648
649        /// Creates a [Poller][lro::Poller] to work with `import_agent`.
650        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
651            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
652            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
653            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
654
655            let stub = self.0.stub.clone();
656            let mut options = self.0.options.clone();
657            options.set_retry_policy(gax::retry_policy::NeverRetry);
658            let query = move |name| {
659                let stub = stub.clone();
660                let options = options.clone();
661                async {
662                    let op = GetOperation::new(stub)
663                        .set_name(name)
664                        .with_options(options)
665                        .send()
666                        .await?;
667                    Ok(Operation::new(op))
668                }
669            };
670
671            let start = move || async {
672                let op = self.send().await?;
673                Ok(Operation::new(op))
674            };
675
676            lro::internal::new_unit_response_poller(
677                polling_error_policy,
678                polling_backoff_policy,
679                start,
680                query,
681            )
682        }
683
684        /// Sets the value of [parent][crate::model::ImportAgentRequest::parent].
685        ///
686        /// This is a **required** field for requests.
687        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
688            self.0.request.parent = v.into();
689            self
690        }
691
692        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent].
693        ///
694        /// Note that all the setters affecting `agent` are
695        /// mutually exclusive.
696        pub fn set_agent<T: Into<Option<crate::model::import_agent_request::Agent>>>(
697            mut self,
698            v: T,
699        ) -> Self {
700            self.0.request.agent = v.into();
701            self
702        }
703
704        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
705        /// to hold a `AgentUri`.
706        ///
707        /// Note that all the setters affecting `agent` are
708        /// mutually exclusive.
709        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
710            self.0.request = self.0.request.set_agent_uri(v);
711            self
712        }
713
714        /// Sets the value of [agent][crate::model::ImportAgentRequest::agent]
715        /// to hold a `AgentContent`.
716        ///
717        /// Note that all the setters affecting `agent` are
718        /// mutually exclusive.
719        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
720            self.0.request = self.0.request.set_agent_content(v);
721            self
722        }
723    }
724
725    #[doc(hidden)]
726    impl gax::options::internal::RequestBuilder for ImportAgent {
727        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
728            &mut self.0.options
729        }
730    }
731
732    /// The request builder for [Agents::restore_agent][crate::client::Agents::restore_agent] calls.
733    ///
734    /// # Example
735    /// ```no_run
736    /// # use google_cloud_dialogflow_v2::builder;
737    /// use builder::agents::RestoreAgent;
738    /// # tokio_test::block_on(async {
739    /// use lro::Poller;
740    ///
741    /// let builder = prepare_request_builder();
742    /// let response = builder.poller().until_done().await?;
743    /// # gax::Result::<()>::Ok(()) });
744    ///
745    /// fn prepare_request_builder() -> RestoreAgent {
746    ///   # panic!();
747    ///   // ... details omitted ...
748    /// }
749    /// ```
750    #[derive(Clone, Debug)]
751    pub struct RestoreAgent(RequestBuilder<crate::model::RestoreAgentRequest>);
752
753    impl RestoreAgent {
754        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
755            Self(RequestBuilder::new(stub))
756        }
757
758        /// Sets the full request, replacing any prior values.
759        pub fn with_request<V: Into<crate::model::RestoreAgentRequest>>(mut self, v: V) -> Self {
760            self.0.request = v.into();
761            self
762        }
763
764        /// Sets all the options, replacing any prior values.
765        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
766            self.0.options = v.into();
767            self
768        }
769
770        /// Sends the request.
771        ///
772        /// # Long running operations
773        ///
774        /// This starts, but does not poll, a longrunning operation. More information
775        /// on [restore_agent][crate::client::Agents::restore_agent].
776        pub async fn send(self) -> Result<longrunning::model::Operation> {
777            (*self.0.stub)
778                .restore_agent(self.0.request, self.0.options)
779                .await
780                .map(gax::response::Response::into_body)
781        }
782
783        /// Creates a [Poller][lro::Poller] to work with `restore_agent`.
784        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
785            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
786            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
787            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
788
789            let stub = self.0.stub.clone();
790            let mut options = self.0.options.clone();
791            options.set_retry_policy(gax::retry_policy::NeverRetry);
792            let query = move |name| {
793                let stub = stub.clone();
794                let options = options.clone();
795                async {
796                    let op = GetOperation::new(stub)
797                        .set_name(name)
798                        .with_options(options)
799                        .send()
800                        .await?;
801                    Ok(Operation::new(op))
802                }
803            };
804
805            let start = move || async {
806                let op = self.send().await?;
807                Ok(Operation::new(op))
808            };
809
810            lro::internal::new_unit_response_poller(
811                polling_error_policy,
812                polling_backoff_policy,
813                start,
814                query,
815            )
816        }
817
818        /// Sets the value of [parent][crate::model::RestoreAgentRequest::parent].
819        ///
820        /// This is a **required** field for requests.
821        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
822            self.0.request.parent = v.into();
823            self
824        }
825
826        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent].
827        ///
828        /// Note that all the setters affecting `agent` are
829        /// mutually exclusive.
830        pub fn set_agent<T: Into<Option<crate::model::restore_agent_request::Agent>>>(
831            mut self,
832            v: T,
833        ) -> Self {
834            self.0.request.agent = v.into();
835            self
836        }
837
838        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
839        /// to hold a `AgentUri`.
840        ///
841        /// Note that all the setters affecting `agent` are
842        /// mutually exclusive.
843        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
844            self.0.request = self.0.request.set_agent_uri(v);
845            self
846        }
847
848        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
849        /// to hold a `AgentContent`.
850        ///
851        /// Note that all the setters affecting `agent` are
852        /// mutually exclusive.
853        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
854            self.0.request = self.0.request.set_agent_content(v);
855            self
856        }
857    }
858
859    #[doc(hidden)]
860    impl gax::options::internal::RequestBuilder for RestoreAgent {
861        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
862            &mut self.0.options
863        }
864    }
865
866    /// The request builder for [Agents::get_validation_result][crate::client::Agents::get_validation_result] calls.
867    ///
868    /// # Example
869    /// ```no_run
870    /// # use google_cloud_dialogflow_v2::builder;
871    /// use builder::agents::GetValidationResult;
872    /// # tokio_test::block_on(async {
873    ///
874    /// let builder = prepare_request_builder();
875    /// let response = builder.send().await?;
876    /// # gax::Result::<()>::Ok(()) });
877    ///
878    /// fn prepare_request_builder() -> GetValidationResult {
879    ///   # panic!();
880    ///   // ... details omitted ...
881    /// }
882    /// ```
883    #[derive(Clone, Debug)]
884    pub struct GetValidationResult(RequestBuilder<crate::model::GetValidationResultRequest>);
885
886    impl GetValidationResult {
887        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
888            Self(RequestBuilder::new(stub))
889        }
890
891        /// Sets the full request, replacing any prior values.
892        pub fn with_request<V: Into<crate::model::GetValidationResultRequest>>(
893            mut self,
894            v: V,
895        ) -> Self {
896            self.0.request = v.into();
897            self
898        }
899
900        /// Sets all the options, replacing any prior values.
901        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
902            self.0.options = v.into();
903            self
904        }
905
906        /// Sends the request.
907        pub async fn send(self) -> Result<crate::model::ValidationResult> {
908            (*self.0.stub)
909                .get_validation_result(self.0.request, self.0.options)
910                .await
911                .map(gax::response::Response::into_body)
912        }
913
914        /// Sets the value of [parent][crate::model::GetValidationResultRequest::parent].
915        ///
916        /// This is a **required** field for requests.
917        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
918            self.0.request.parent = v.into();
919            self
920        }
921
922        /// Sets the value of [language_code][crate::model::GetValidationResultRequest::language_code].
923        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
924            self.0.request.language_code = v.into();
925            self
926        }
927    }
928
929    #[doc(hidden)]
930    impl gax::options::internal::RequestBuilder for GetValidationResult {
931        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
932            &mut self.0.options
933        }
934    }
935
936    /// The request builder for [Agents::list_locations][crate::client::Agents::list_locations] calls.
937    ///
938    /// # Example
939    /// ```no_run
940    /// # use google_cloud_dialogflow_v2::builder;
941    /// use builder::agents::ListLocations;
942    /// # tokio_test::block_on(async {
943    /// use gax::paginator::ItemPaginator;
944    ///
945    /// let builder = prepare_request_builder();
946    /// let mut items = builder.by_item();
947    /// while let Some(result) = items.next().await {
948    ///   let item = result?;
949    /// }
950    /// # gax::Result::<()>::Ok(()) });
951    ///
952    /// fn prepare_request_builder() -> ListLocations {
953    ///   # panic!();
954    ///   // ... details omitted ...
955    /// }
956    /// ```
957    #[derive(Clone, Debug)]
958    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
959
960    impl ListLocations {
961        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
962            Self(RequestBuilder::new(stub))
963        }
964
965        /// Sets the full request, replacing any prior values.
966        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
967            mut self,
968            v: V,
969        ) -> Self {
970            self.0.request = v.into();
971            self
972        }
973
974        /// Sets all the options, replacing any prior values.
975        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
976            self.0.options = v.into();
977            self
978        }
979
980        /// Sends the request.
981        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
982            (*self.0.stub)
983                .list_locations(self.0.request, self.0.options)
984                .await
985                .map(gax::response::Response::into_body)
986        }
987
988        /// Streams each page in the collection.
989        pub fn by_page(
990            self,
991        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
992        {
993            use std::clone::Clone;
994            let token = self.0.request.page_token.clone();
995            let execute = move |token: String| {
996                let mut builder = self.clone();
997                builder.0.request = builder.0.request.set_page_token(token);
998                builder.send()
999            };
1000            gax::paginator::internal::new_paginator(token, execute)
1001        }
1002
1003        /// Streams each item in the collection.
1004        pub fn by_item(
1005            self,
1006        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1007        {
1008            use gax::paginator::Paginator;
1009            self.by_page().items()
1010        }
1011
1012        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1013        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1014            self.0.request.name = v.into();
1015            self
1016        }
1017
1018        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1019        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1020            self.0.request.filter = v.into();
1021            self
1022        }
1023
1024        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1025        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1026            self.0.request.page_size = v.into();
1027            self
1028        }
1029
1030        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1031        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032            self.0.request.page_token = v.into();
1033            self
1034        }
1035    }
1036
1037    #[doc(hidden)]
1038    impl gax::options::internal::RequestBuilder for ListLocations {
1039        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1040            &mut self.0.options
1041        }
1042    }
1043
1044    /// The request builder for [Agents::get_location][crate::client::Agents::get_location] calls.
1045    ///
1046    /// # Example
1047    /// ```no_run
1048    /// # use google_cloud_dialogflow_v2::builder;
1049    /// use builder::agents::GetLocation;
1050    /// # tokio_test::block_on(async {
1051    ///
1052    /// let builder = prepare_request_builder();
1053    /// let response = builder.send().await?;
1054    /// # gax::Result::<()>::Ok(()) });
1055    ///
1056    /// fn prepare_request_builder() -> GetLocation {
1057    ///   # panic!();
1058    ///   // ... details omitted ...
1059    /// }
1060    /// ```
1061    #[derive(Clone, Debug)]
1062    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1063
1064    impl GetLocation {
1065        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1066            Self(RequestBuilder::new(stub))
1067        }
1068
1069        /// Sets the full request, replacing any prior values.
1070        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1071            self.0.request = v.into();
1072            self
1073        }
1074
1075        /// Sets all the options, replacing any prior values.
1076        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1077            self.0.options = v.into();
1078            self
1079        }
1080
1081        /// Sends the request.
1082        pub async fn send(self) -> Result<location::model::Location> {
1083            (*self.0.stub)
1084                .get_location(self.0.request, self.0.options)
1085                .await
1086                .map(gax::response::Response::into_body)
1087        }
1088
1089        /// Sets the value of [name][location::model::GetLocationRequest::name].
1090        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1091            self.0.request.name = v.into();
1092            self
1093        }
1094    }
1095
1096    #[doc(hidden)]
1097    impl gax::options::internal::RequestBuilder for GetLocation {
1098        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1099            &mut self.0.options
1100        }
1101    }
1102
1103    /// The request builder for [Agents::list_operations][crate::client::Agents::list_operations] calls.
1104    ///
1105    /// # Example
1106    /// ```no_run
1107    /// # use google_cloud_dialogflow_v2::builder;
1108    /// use builder::agents::ListOperations;
1109    /// # tokio_test::block_on(async {
1110    /// use gax::paginator::ItemPaginator;
1111    ///
1112    /// let builder = prepare_request_builder();
1113    /// let mut items = builder.by_item();
1114    /// while let Some(result) = items.next().await {
1115    ///   let item = result?;
1116    /// }
1117    /// # gax::Result::<()>::Ok(()) });
1118    ///
1119    /// fn prepare_request_builder() -> ListOperations {
1120    ///   # panic!();
1121    ///   // ... details omitted ...
1122    /// }
1123    /// ```
1124    #[derive(Clone, Debug)]
1125    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1126
1127    impl ListOperations {
1128        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1129            Self(RequestBuilder::new(stub))
1130        }
1131
1132        /// Sets the full request, replacing any prior values.
1133        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1134            mut self,
1135            v: V,
1136        ) -> Self {
1137            self.0.request = v.into();
1138            self
1139        }
1140
1141        /// Sets all the options, replacing any prior values.
1142        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1143            self.0.options = v.into();
1144            self
1145        }
1146
1147        /// Sends the request.
1148        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1149            (*self.0.stub)
1150                .list_operations(self.0.request, self.0.options)
1151                .await
1152                .map(gax::response::Response::into_body)
1153        }
1154
1155        /// Streams each page in the collection.
1156        pub fn by_page(
1157            self,
1158        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1159        {
1160            use std::clone::Clone;
1161            let token = self.0.request.page_token.clone();
1162            let execute = move |token: String| {
1163                let mut builder = self.clone();
1164                builder.0.request = builder.0.request.set_page_token(token);
1165                builder.send()
1166            };
1167            gax::paginator::internal::new_paginator(token, execute)
1168        }
1169
1170        /// Streams each item in the collection.
1171        pub fn by_item(
1172            self,
1173        ) -> impl gax::paginator::ItemPaginator<
1174            longrunning::model::ListOperationsResponse,
1175            gax::error::Error,
1176        > {
1177            use gax::paginator::Paginator;
1178            self.by_page().items()
1179        }
1180
1181        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1182        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1183            self.0.request.name = v.into();
1184            self
1185        }
1186
1187        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1188        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1189            self.0.request.filter = v.into();
1190            self
1191        }
1192
1193        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1194        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1195            self.0.request.page_size = v.into();
1196            self
1197        }
1198
1199        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1200        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1201            self.0.request.page_token = v.into();
1202            self
1203        }
1204
1205        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1206        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1207            self.0.request.return_partial_success = v.into();
1208            self
1209        }
1210    }
1211
1212    #[doc(hidden)]
1213    impl gax::options::internal::RequestBuilder for ListOperations {
1214        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1215            &mut self.0.options
1216        }
1217    }
1218
1219    /// The request builder for [Agents::get_operation][crate::client::Agents::get_operation] calls.
1220    ///
1221    /// # Example
1222    /// ```no_run
1223    /// # use google_cloud_dialogflow_v2::builder;
1224    /// use builder::agents::GetOperation;
1225    /// # tokio_test::block_on(async {
1226    ///
1227    /// let builder = prepare_request_builder();
1228    /// let response = builder.send().await?;
1229    /// # gax::Result::<()>::Ok(()) });
1230    ///
1231    /// fn prepare_request_builder() -> GetOperation {
1232    ///   # panic!();
1233    ///   // ... details omitted ...
1234    /// }
1235    /// ```
1236    #[derive(Clone, Debug)]
1237    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1238
1239    impl GetOperation {
1240        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1241            Self(RequestBuilder::new(stub))
1242        }
1243
1244        /// Sets the full request, replacing any prior values.
1245        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1246            mut self,
1247            v: V,
1248        ) -> Self {
1249            self.0.request = v.into();
1250            self
1251        }
1252
1253        /// Sets all the options, replacing any prior values.
1254        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1255            self.0.options = v.into();
1256            self
1257        }
1258
1259        /// Sends the request.
1260        pub async fn send(self) -> Result<longrunning::model::Operation> {
1261            (*self.0.stub)
1262                .get_operation(self.0.request, self.0.options)
1263                .await
1264                .map(gax::response::Response::into_body)
1265        }
1266
1267        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1268        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1269            self.0.request.name = v.into();
1270            self
1271        }
1272    }
1273
1274    #[doc(hidden)]
1275    impl gax::options::internal::RequestBuilder for GetOperation {
1276        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1277            &mut self.0.options
1278        }
1279    }
1280
1281    /// The request builder for [Agents::cancel_operation][crate::client::Agents::cancel_operation] calls.
1282    ///
1283    /// # Example
1284    /// ```no_run
1285    /// # use google_cloud_dialogflow_v2::builder;
1286    /// use builder::agents::CancelOperation;
1287    /// # tokio_test::block_on(async {
1288    ///
1289    /// let builder = prepare_request_builder();
1290    /// let response = builder.send().await?;
1291    /// # gax::Result::<()>::Ok(()) });
1292    ///
1293    /// fn prepare_request_builder() -> CancelOperation {
1294    ///   # panic!();
1295    ///   // ... details omitted ...
1296    /// }
1297    /// ```
1298    #[derive(Clone, Debug)]
1299    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1300
1301    impl CancelOperation {
1302        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1303            Self(RequestBuilder::new(stub))
1304        }
1305
1306        /// Sets the full request, replacing any prior values.
1307        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1308            mut self,
1309            v: V,
1310        ) -> Self {
1311            self.0.request = v.into();
1312            self
1313        }
1314
1315        /// Sets all the options, replacing any prior values.
1316        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1317            self.0.options = v.into();
1318            self
1319        }
1320
1321        /// Sends the request.
1322        pub async fn send(self) -> Result<()> {
1323            (*self.0.stub)
1324                .cancel_operation(self.0.request, self.0.options)
1325                .await
1326                .map(gax::response::Response::into_body)
1327        }
1328
1329        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1330        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1331            self.0.request.name = v.into();
1332            self
1333        }
1334    }
1335
1336    #[doc(hidden)]
1337    impl gax::options::internal::RequestBuilder for CancelOperation {
1338        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1339            &mut self.0.options
1340        }
1341    }
1342}
1343
1344#[cfg(feature = "answer-records")]
1345#[cfg_attr(docsrs, doc(cfg(feature = "answer-records")))]
1346pub mod answer_records {
1347    use crate::Result;
1348
1349    /// A builder for [AnswerRecords][crate::client::AnswerRecords].
1350    ///
1351    /// ```
1352    /// # tokio_test::block_on(async {
1353    /// # use google_cloud_dialogflow_v2::*;
1354    /// # use builder::answer_records::ClientBuilder;
1355    /// # use client::AnswerRecords;
1356    /// let builder : ClientBuilder = AnswerRecords::builder();
1357    /// let client = builder
1358    ///     .with_endpoint("https://dialogflow.googleapis.com")
1359    ///     .build().await?;
1360    /// # gax::client_builder::Result::<()>::Ok(()) });
1361    /// ```
1362    pub type ClientBuilder =
1363        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1364
1365    pub(crate) mod client {
1366        use super::super::super::client::AnswerRecords;
1367        pub struct Factory;
1368        impl gax::client_builder::internal::ClientFactory for Factory {
1369            type Client = AnswerRecords;
1370            type Credentials = gaxi::options::Credentials;
1371            async fn build(
1372                self,
1373                config: gaxi::options::ClientConfig,
1374            ) -> gax::client_builder::Result<Self::Client> {
1375                Self::Client::new(config).await
1376            }
1377        }
1378    }
1379
1380    /// Common implementation for [crate::client::AnswerRecords] request builders.
1381    #[derive(Clone, Debug)]
1382    pub(crate) struct RequestBuilder<R: std::default::Default> {
1383        stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1384        request: R,
1385        options: gax::options::RequestOptions,
1386    }
1387
1388    impl<R> RequestBuilder<R>
1389    where
1390        R: std::default::Default,
1391    {
1392        pub(crate) fn new(
1393            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1394        ) -> Self {
1395            Self {
1396                stub,
1397                request: R::default(),
1398                options: gax::options::RequestOptions::default(),
1399            }
1400        }
1401    }
1402
1403    /// The request builder for [AnswerRecords::list_answer_records][crate::client::AnswerRecords::list_answer_records] calls.
1404    ///
1405    /// # Example
1406    /// ```no_run
1407    /// # use google_cloud_dialogflow_v2::builder;
1408    /// use builder::answer_records::ListAnswerRecords;
1409    /// # tokio_test::block_on(async {
1410    /// use gax::paginator::ItemPaginator;
1411    ///
1412    /// let builder = prepare_request_builder();
1413    /// let mut items = builder.by_item();
1414    /// while let Some(result) = items.next().await {
1415    ///   let item = result?;
1416    /// }
1417    /// # gax::Result::<()>::Ok(()) });
1418    ///
1419    /// fn prepare_request_builder() -> ListAnswerRecords {
1420    ///   # panic!();
1421    ///   // ... details omitted ...
1422    /// }
1423    /// ```
1424    #[derive(Clone, Debug)]
1425    pub struct ListAnswerRecords(RequestBuilder<crate::model::ListAnswerRecordsRequest>);
1426
1427    impl ListAnswerRecords {
1428        pub(crate) fn new(
1429            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1430        ) -> Self {
1431            Self(RequestBuilder::new(stub))
1432        }
1433
1434        /// Sets the full request, replacing any prior values.
1435        pub fn with_request<V: Into<crate::model::ListAnswerRecordsRequest>>(
1436            mut self,
1437            v: V,
1438        ) -> Self {
1439            self.0.request = v.into();
1440            self
1441        }
1442
1443        /// Sets all the options, replacing any prior values.
1444        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1445            self.0.options = v.into();
1446            self
1447        }
1448
1449        /// Sends the request.
1450        pub async fn send(self) -> Result<crate::model::ListAnswerRecordsResponse> {
1451            (*self.0.stub)
1452                .list_answer_records(self.0.request, self.0.options)
1453                .await
1454                .map(gax::response::Response::into_body)
1455        }
1456
1457        /// Streams each page in the collection.
1458        pub fn by_page(
1459            self,
1460        ) -> impl gax::paginator::Paginator<crate::model::ListAnswerRecordsResponse, gax::error::Error>
1461        {
1462            use std::clone::Clone;
1463            let token = self.0.request.page_token.clone();
1464            let execute = move |token: String| {
1465                let mut builder = self.clone();
1466                builder.0.request = builder.0.request.set_page_token(token);
1467                builder.send()
1468            };
1469            gax::paginator::internal::new_paginator(token, execute)
1470        }
1471
1472        /// Streams each item in the collection.
1473        pub fn by_item(
1474            self,
1475        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAnswerRecordsResponse, gax::error::Error>
1476        {
1477            use gax::paginator::Paginator;
1478            self.by_page().items()
1479        }
1480
1481        /// Sets the value of [parent][crate::model::ListAnswerRecordsRequest::parent].
1482        ///
1483        /// This is a **required** field for requests.
1484        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1485            self.0.request.parent = v.into();
1486            self
1487        }
1488
1489        /// Sets the value of [filter][crate::model::ListAnswerRecordsRequest::filter].
1490        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1491            self.0.request.filter = v.into();
1492            self
1493        }
1494
1495        /// Sets the value of [page_size][crate::model::ListAnswerRecordsRequest::page_size].
1496        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1497            self.0.request.page_size = v.into();
1498            self
1499        }
1500
1501        /// Sets the value of [page_token][crate::model::ListAnswerRecordsRequest::page_token].
1502        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1503            self.0.request.page_token = v.into();
1504            self
1505        }
1506    }
1507
1508    #[doc(hidden)]
1509    impl gax::options::internal::RequestBuilder for ListAnswerRecords {
1510        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1511            &mut self.0.options
1512        }
1513    }
1514
1515    /// The request builder for [AnswerRecords::update_answer_record][crate::client::AnswerRecords::update_answer_record] calls.
1516    ///
1517    /// # Example
1518    /// ```no_run
1519    /// # use google_cloud_dialogflow_v2::builder;
1520    /// use builder::answer_records::UpdateAnswerRecord;
1521    /// # tokio_test::block_on(async {
1522    ///
1523    /// let builder = prepare_request_builder();
1524    /// let response = builder.send().await?;
1525    /// # gax::Result::<()>::Ok(()) });
1526    ///
1527    /// fn prepare_request_builder() -> UpdateAnswerRecord {
1528    ///   # panic!();
1529    ///   // ... details omitted ...
1530    /// }
1531    /// ```
1532    #[derive(Clone, Debug)]
1533    pub struct UpdateAnswerRecord(RequestBuilder<crate::model::UpdateAnswerRecordRequest>);
1534
1535    impl UpdateAnswerRecord {
1536        pub(crate) fn new(
1537            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1538        ) -> Self {
1539            Self(RequestBuilder::new(stub))
1540        }
1541
1542        /// Sets the full request, replacing any prior values.
1543        pub fn with_request<V: Into<crate::model::UpdateAnswerRecordRequest>>(
1544            mut self,
1545            v: V,
1546        ) -> Self {
1547            self.0.request = v.into();
1548            self
1549        }
1550
1551        /// Sets all the options, replacing any prior values.
1552        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1553            self.0.options = v.into();
1554            self
1555        }
1556
1557        /// Sends the request.
1558        pub async fn send(self) -> Result<crate::model::AnswerRecord> {
1559            (*self.0.stub)
1560                .update_answer_record(self.0.request, self.0.options)
1561                .await
1562                .map(gax::response::Response::into_body)
1563        }
1564
1565        /// Sets the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1566        ///
1567        /// This is a **required** field for requests.
1568        pub fn set_answer_record<T>(mut self, v: T) -> Self
1569        where
1570            T: std::convert::Into<crate::model::AnswerRecord>,
1571        {
1572            self.0.request.answer_record = std::option::Option::Some(v.into());
1573            self
1574        }
1575
1576        /// Sets or clears the value of [answer_record][crate::model::UpdateAnswerRecordRequest::answer_record].
1577        ///
1578        /// This is a **required** field for requests.
1579        pub fn set_or_clear_answer_record<T>(mut self, v: std::option::Option<T>) -> Self
1580        where
1581            T: std::convert::Into<crate::model::AnswerRecord>,
1582        {
1583            self.0.request.answer_record = v.map(|x| x.into());
1584            self
1585        }
1586
1587        /// Sets the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1588        ///
1589        /// This is a **required** field for requests.
1590        pub fn set_update_mask<T>(mut self, v: T) -> Self
1591        where
1592            T: std::convert::Into<wkt::FieldMask>,
1593        {
1594            self.0.request.update_mask = std::option::Option::Some(v.into());
1595            self
1596        }
1597
1598        /// Sets or clears the value of [update_mask][crate::model::UpdateAnswerRecordRequest::update_mask].
1599        ///
1600        /// This is a **required** field for requests.
1601        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1602        where
1603            T: std::convert::Into<wkt::FieldMask>,
1604        {
1605            self.0.request.update_mask = v.map(|x| x.into());
1606            self
1607        }
1608    }
1609
1610    #[doc(hidden)]
1611    impl gax::options::internal::RequestBuilder for UpdateAnswerRecord {
1612        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1613            &mut self.0.options
1614        }
1615    }
1616
1617    /// The request builder for [AnswerRecords::list_locations][crate::client::AnswerRecords::list_locations] calls.
1618    ///
1619    /// # Example
1620    /// ```no_run
1621    /// # use google_cloud_dialogflow_v2::builder;
1622    /// use builder::answer_records::ListLocations;
1623    /// # tokio_test::block_on(async {
1624    /// use gax::paginator::ItemPaginator;
1625    ///
1626    /// let builder = prepare_request_builder();
1627    /// let mut items = builder.by_item();
1628    /// while let Some(result) = items.next().await {
1629    ///   let item = result?;
1630    /// }
1631    /// # gax::Result::<()>::Ok(()) });
1632    ///
1633    /// fn prepare_request_builder() -> ListLocations {
1634    ///   # panic!();
1635    ///   // ... details omitted ...
1636    /// }
1637    /// ```
1638    #[derive(Clone, Debug)]
1639    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1640
1641    impl ListLocations {
1642        pub(crate) fn new(
1643            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1644        ) -> Self {
1645            Self(RequestBuilder::new(stub))
1646        }
1647
1648        /// Sets the full request, replacing any prior values.
1649        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1650            mut self,
1651            v: V,
1652        ) -> Self {
1653            self.0.request = v.into();
1654            self
1655        }
1656
1657        /// Sets all the options, replacing any prior values.
1658        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1659            self.0.options = v.into();
1660            self
1661        }
1662
1663        /// Sends the request.
1664        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1665            (*self.0.stub)
1666                .list_locations(self.0.request, self.0.options)
1667                .await
1668                .map(gax::response::Response::into_body)
1669        }
1670
1671        /// Streams each page in the collection.
1672        pub fn by_page(
1673            self,
1674        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1675        {
1676            use std::clone::Clone;
1677            let token = self.0.request.page_token.clone();
1678            let execute = move |token: String| {
1679                let mut builder = self.clone();
1680                builder.0.request = builder.0.request.set_page_token(token);
1681                builder.send()
1682            };
1683            gax::paginator::internal::new_paginator(token, execute)
1684        }
1685
1686        /// Streams each item in the collection.
1687        pub fn by_item(
1688            self,
1689        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1690        {
1691            use gax::paginator::Paginator;
1692            self.by_page().items()
1693        }
1694
1695        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1696        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1697            self.0.request.name = v.into();
1698            self
1699        }
1700
1701        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1702        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1703            self.0.request.filter = v.into();
1704            self
1705        }
1706
1707        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1708        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1709            self.0.request.page_size = v.into();
1710            self
1711        }
1712
1713        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1714        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1715            self.0.request.page_token = v.into();
1716            self
1717        }
1718    }
1719
1720    #[doc(hidden)]
1721    impl gax::options::internal::RequestBuilder for ListLocations {
1722        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1723            &mut self.0.options
1724        }
1725    }
1726
1727    /// The request builder for [AnswerRecords::get_location][crate::client::AnswerRecords::get_location] calls.
1728    ///
1729    /// # Example
1730    /// ```no_run
1731    /// # use google_cloud_dialogflow_v2::builder;
1732    /// use builder::answer_records::GetLocation;
1733    /// # tokio_test::block_on(async {
1734    ///
1735    /// let builder = prepare_request_builder();
1736    /// let response = builder.send().await?;
1737    /// # gax::Result::<()>::Ok(()) });
1738    ///
1739    /// fn prepare_request_builder() -> GetLocation {
1740    ///   # panic!();
1741    ///   // ... details omitted ...
1742    /// }
1743    /// ```
1744    #[derive(Clone, Debug)]
1745    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1746
1747    impl GetLocation {
1748        pub(crate) fn new(
1749            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1750        ) -> Self {
1751            Self(RequestBuilder::new(stub))
1752        }
1753
1754        /// Sets the full request, replacing any prior values.
1755        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1756            self.0.request = v.into();
1757            self
1758        }
1759
1760        /// Sets all the options, replacing any prior values.
1761        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1762            self.0.options = v.into();
1763            self
1764        }
1765
1766        /// Sends the request.
1767        pub async fn send(self) -> Result<location::model::Location> {
1768            (*self.0.stub)
1769                .get_location(self.0.request, self.0.options)
1770                .await
1771                .map(gax::response::Response::into_body)
1772        }
1773
1774        /// Sets the value of [name][location::model::GetLocationRequest::name].
1775        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1776            self.0.request.name = v.into();
1777            self
1778        }
1779    }
1780
1781    #[doc(hidden)]
1782    impl gax::options::internal::RequestBuilder for GetLocation {
1783        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1784            &mut self.0.options
1785        }
1786    }
1787
1788    /// The request builder for [AnswerRecords::list_operations][crate::client::AnswerRecords::list_operations] calls.
1789    ///
1790    /// # Example
1791    /// ```no_run
1792    /// # use google_cloud_dialogflow_v2::builder;
1793    /// use builder::answer_records::ListOperations;
1794    /// # tokio_test::block_on(async {
1795    /// use gax::paginator::ItemPaginator;
1796    ///
1797    /// let builder = prepare_request_builder();
1798    /// let mut items = builder.by_item();
1799    /// while let Some(result) = items.next().await {
1800    ///   let item = result?;
1801    /// }
1802    /// # gax::Result::<()>::Ok(()) });
1803    ///
1804    /// fn prepare_request_builder() -> ListOperations {
1805    ///   # panic!();
1806    ///   // ... details omitted ...
1807    /// }
1808    /// ```
1809    #[derive(Clone, Debug)]
1810    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1811
1812    impl ListOperations {
1813        pub(crate) fn new(
1814            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1815        ) -> Self {
1816            Self(RequestBuilder::new(stub))
1817        }
1818
1819        /// Sets the full request, replacing any prior values.
1820        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1821            mut self,
1822            v: V,
1823        ) -> Self {
1824            self.0.request = v.into();
1825            self
1826        }
1827
1828        /// Sets all the options, replacing any prior values.
1829        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1830            self.0.options = v.into();
1831            self
1832        }
1833
1834        /// Sends the request.
1835        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1836            (*self.0.stub)
1837                .list_operations(self.0.request, self.0.options)
1838                .await
1839                .map(gax::response::Response::into_body)
1840        }
1841
1842        /// Streams each page in the collection.
1843        pub fn by_page(
1844            self,
1845        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1846        {
1847            use std::clone::Clone;
1848            let token = self.0.request.page_token.clone();
1849            let execute = move |token: String| {
1850                let mut builder = self.clone();
1851                builder.0.request = builder.0.request.set_page_token(token);
1852                builder.send()
1853            };
1854            gax::paginator::internal::new_paginator(token, execute)
1855        }
1856
1857        /// Streams each item in the collection.
1858        pub fn by_item(
1859            self,
1860        ) -> impl gax::paginator::ItemPaginator<
1861            longrunning::model::ListOperationsResponse,
1862            gax::error::Error,
1863        > {
1864            use gax::paginator::Paginator;
1865            self.by_page().items()
1866        }
1867
1868        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1869        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1870            self.0.request.name = v.into();
1871            self
1872        }
1873
1874        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1875        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1876            self.0.request.filter = v.into();
1877            self
1878        }
1879
1880        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1881        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1882            self.0.request.page_size = v.into();
1883            self
1884        }
1885
1886        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1887        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1888            self.0.request.page_token = v.into();
1889            self
1890        }
1891
1892        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1893        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1894            self.0.request.return_partial_success = v.into();
1895            self
1896        }
1897    }
1898
1899    #[doc(hidden)]
1900    impl gax::options::internal::RequestBuilder for ListOperations {
1901        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1902            &mut self.0.options
1903        }
1904    }
1905
1906    /// The request builder for [AnswerRecords::get_operation][crate::client::AnswerRecords::get_operation] calls.
1907    ///
1908    /// # Example
1909    /// ```no_run
1910    /// # use google_cloud_dialogflow_v2::builder;
1911    /// use builder::answer_records::GetOperation;
1912    /// # tokio_test::block_on(async {
1913    ///
1914    /// let builder = prepare_request_builder();
1915    /// let response = builder.send().await?;
1916    /// # gax::Result::<()>::Ok(()) });
1917    ///
1918    /// fn prepare_request_builder() -> GetOperation {
1919    ///   # panic!();
1920    ///   // ... details omitted ...
1921    /// }
1922    /// ```
1923    #[derive(Clone, Debug)]
1924    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1925
1926    impl GetOperation {
1927        pub(crate) fn new(
1928            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1929        ) -> Self {
1930            Self(RequestBuilder::new(stub))
1931        }
1932
1933        /// Sets the full request, replacing any prior values.
1934        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1935            mut self,
1936            v: V,
1937        ) -> Self {
1938            self.0.request = v.into();
1939            self
1940        }
1941
1942        /// Sets all the options, replacing any prior values.
1943        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1944            self.0.options = v.into();
1945            self
1946        }
1947
1948        /// Sends the request.
1949        pub async fn send(self) -> Result<longrunning::model::Operation> {
1950            (*self.0.stub)
1951                .get_operation(self.0.request, self.0.options)
1952                .await
1953                .map(gax::response::Response::into_body)
1954        }
1955
1956        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1957        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1958            self.0.request.name = v.into();
1959            self
1960        }
1961    }
1962
1963    #[doc(hidden)]
1964    impl gax::options::internal::RequestBuilder for GetOperation {
1965        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1966            &mut self.0.options
1967        }
1968    }
1969
1970    /// The request builder for [AnswerRecords::cancel_operation][crate::client::AnswerRecords::cancel_operation] calls.
1971    ///
1972    /// # Example
1973    /// ```no_run
1974    /// # use google_cloud_dialogflow_v2::builder;
1975    /// use builder::answer_records::CancelOperation;
1976    /// # tokio_test::block_on(async {
1977    ///
1978    /// let builder = prepare_request_builder();
1979    /// let response = builder.send().await?;
1980    /// # gax::Result::<()>::Ok(()) });
1981    ///
1982    /// fn prepare_request_builder() -> CancelOperation {
1983    ///   # panic!();
1984    ///   // ... details omitted ...
1985    /// }
1986    /// ```
1987    #[derive(Clone, Debug)]
1988    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1989
1990    impl CancelOperation {
1991        pub(crate) fn new(
1992            stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1993        ) -> Self {
1994            Self(RequestBuilder::new(stub))
1995        }
1996
1997        /// Sets the full request, replacing any prior values.
1998        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1999            mut self,
2000            v: V,
2001        ) -> Self {
2002            self.0.request = v.into();
2003            self
2004        }
2005
2006        /// Sets all the options, replacing any prior values.
2007        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2008            self.0.options = v.into();
2009            self
2010        }
2011
2012        /// Sends the request.
2013        pub async fn send(self) -> Result<()> {
2014            (*self.0.stub)
2015                .cancel_operation(self.0.request, self.0.options)
2016                .await
2017                .map(gax::response::Response::into_body)
2018        }
2019
2020        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2021        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2022            self.0.request.name = v.into();
2023            self
2024        }
2025    }
2026
2027    #[doc(hidden)]
2028    impl gax::options::internal::RequestBuilder for CancelOperation {
2029        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2030            &mut self.0.options
2031        }
2032    }
2033}
2034
2035#[cfg(feature = "contexts")]
2036#[cfg_attr(docsrs, doc(cfg(feature = "contexts")))]
2037pub mod contexts {
2038    use crate::Result;
2039
2040    /// A builder for [Contexts][crate::client::Contexts].
2041    ///
2042    /// ```
2043    /// # tokio_test::block_on(async {
2044    /// # use google_cloud_dialogflow_v2::*;
2045    /// # use builder::contexts::ClientBuilder;
2046    /// # use client::Contexts;
2047    /// let builder : ClientBuilder = Contexts::builder();
2048    /// let client = builder
2049    ///     .with_endpoint("https://dialogflow.googleapis.com")
2050    ///     .build().await?;
2051    /// # gax::client_builder::Result::<()>::Ok(()) });
2052    /// ```
2053    pub type ClientBuilder =
2054        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2055
2056    pub(crate) mod client {
2057        use super::super::super::client::Contexts;
2058        pub struct Factory;
2059        impl gax::client_builder::internal::ClientFactory for Factory {
2060            type Client = Contexts;
2061            type Credentials = gaxi::options::Credentials;
2062            async fn build(
2063                self,
2064                config: gaxi::options::ClientConfig,
2065            ) -> gax::client_builder::Result<Self::Client> {
2066                Self::Client::new(config).await
2067            }
2068        }
2069    }
2070
2071    /// Common implementation for [crate::client::Contexts] request builders.
2072    #[derive(Clone, Debug)]
2073    pub(crate) struct RequestBuilder<R: std::default::Default> {
2074        stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>,
2075        request: R,
2076        options: gax::options::RequestOptions,
2077    }
2078
2079    impl<R> RequestBuilder<R>
2080    where
2081        R: std::default::Default,
2082    {
2083        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2084            Self {
2085                stub,
2086                request: R::default(),
2087                options: gax::options::RequestOptions::default(),
2088            }
2089        }
2090    }
2091
2092    /// The request builder for [Contexts::list_contexts][crate::client::Contexts::list_contexts] calls.
2093    ///
2094    /// # Example
2095    /// ```no_run
2096    /// # use google_cloud_dialogflow_v2::builder;
2097    /// use builder::contexts::ListContexts;
2098    /// # tokio_test::block_on(async {
2099    /// use gax::paginator::ItemPaginator;
2100    ///
2101    /// let builder = prepare_request_builder();
2102    /// let mut items = builder.by_item();
2103    /// while let Some(result) = items.next().await {
2104    ///   let item = result?;
2105    /// }
2106    /// # gax::Result::<()>::Ok(()) });
2107    ///
2108    /// fn prepare_request_builder() -> ListContexts {
2109    ///   # panic!();
2110    ///   // ... details omitted ...
2111    /// }
2112    /// ```
2113    #[derive(Clone, Debug)]
2114    pub struct ListContexts(RequestBuilder<crate::model::ListContextsRequest>);
2115
2116    impl ListContexts {
2117        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2118            Self(RequestBuilder::new(stub))
2119        }
2120
2121        /// Sets the full request, replacing any prior values.
2122        pub fn with_request<V: Into<crate::model::ListContextsRequest>>(mut self, v: V) -> Self {
2123            self.0.request = v.into();
2124            self
2125        }
2126
2127        /// Sets all the options, replacing any prior values.
2128        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2129            self.0.options = v.into();
2130            self
2131        }
2132
2133        /// Sends the request.
2134        pub async fn send(self) -> Result<crate::model::ListContextsResponse> {
2135            (*self.0.stub)
2136                .list_contexts(self.0.request, self.0.options)
2137                .await
2138                .map(gax::response::Response::into_body)
2139        }
2140
2141        /// Streams each page in the collection.
2142        pub fn by_page(
2143            self,
2144        ) -> impl gax::paginator::Paginator<crate::model::ListContextsResponse, gax::error::Error>
2145        {
2146            use std::clone::Clone;
2147            let token = self.0.request.page_token.clone();
2148            let execute = move |token: String| {
2149                let mut builder = self.clone();
2150                builder.0.request = builder.0.request.set_page_token(token);
2151                builder.send()
2152            };
2153            gax::paginator::internal::new_paginator(token, execute)
2154        }
2155
2156        /// Streams each item in the collection.
2157        pub fn by_item(
2158            self,
2159        ) -> impl gax::paginator::ItemPaginator<crate::model::ListContextsResponse, gax::error::Error>
2160        {
2161            use gax::paginator::Paginator;
2162            self.by_page().items()
2163        }
2164
2165        /// Sets the value of [parent][crate::model::ListContextsRequest::parent].
2166        ///
2167        /// This is a **required** field for requests.
2168        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2169            self.0.request.parent = v.into();
2170            self
2171        }
2172
2173        /// Sets the value of [page_size][crate::model::ListContextsRequest::page_size].
2174        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2175            self.0.request.page_size = v.into();
2176            self
2177        }
2178
2179        /// Sets the value of [page_token][crate::model::ListContextsRequest::page_token].
2180        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2181            self.0.request.page_token = v.into();
2182            self
2183        }
2184    }
2185
2186    #[doc(hidden)]
2187    impl gax::options::internal::RequestBuilder for ListContexts {
2188        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2189            &mut self.0.options
2190        }
2191    }
2192
2193    /// The request builder for [Contexts::get_context][crate::client::Contexts::get_context] calls.
2194    ///
2195    /// # Example
2196    /// ```no_run
2197    /// # use google_cloud_dialogflow_v2::builder;
2198    /// use builder::contexts::GetContext;
2199    /// # tokio_test::block_on(async {
2200    ///
2201    /// let builder = prepare_request_builder();
2202    /// let response = builder.send().await?;
2203    /// # gax::Result::<()>::Ok(()) });
2204    ///
2205    /// fn prepare_request_builder() -> GetContext {
2206    ///   # panic!();
2207    ///   // ... details omitted ...
2208    /// }
2209    /// ```
2210    #[derive(Clone, Debug)]
2211    pub struct GetContext(RequestBuilder<crate::model::GetContextRequest>);
2212
2213    impl GetContext {
2214        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2215            Self(RequestBuilder::new(stub))
2216        }
2217
2218        /// Sets the full request, replacing any prior values.
2219        pub fn with_request<V: Into<crate::model::GetContextRequest>>(mut self, v: V) -> Self {
2220            self.0.request = v.into();
2221            self
2222        }
2223
2224        /// Sets all the options, replacing any prior values.
2225        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2226            self.0.options = v.into();
2227            self
2228        }
2229
2230        /// Sends the request.
2231        pub async fn send(self) -> Result<crate::model::Context> {
2232            (*self.0.stub)
2233                .get_context(self.0.request, self.0.options)
2234                .await
2235                .map(gax::response::Response::into_body)
2236        }
2237
2238        /// Sets the value of [name][crate::model::GetContextRequest::name].
2239        ///
2240        /// This is a **required** field for requests.
2241        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2242            self.0.request.name = v.into();
2243            self
2244        }
2245    }
2246
2247    #[doc(hidden)]
2248    impl gax::options::internal::RequestBuilder for GetContext {
2249        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2250            &mut self.0.options
2251        }
2252    }
2253
2254    /// The request builder for [Contexts::create_context][crate::client::Contexts::create_context] calls.
2255    ///
2256    /// # Example
2257    /// ```no_run
2258    /// # use google_cloud_dialogflow_v2::builder;
2259    /// use builder::contexts::CreateContext;
2260    /// # tokio_test::block_on(async {
2261    ///
2262    /// let builder = prepare_request_builder();
2263    /// let response = builder.send().await?;
2264    /// # gax::Result::<()>::Ok(()) });
2265    ///
2266    /// fn prepare_request_builder() -> CreateContext {
2267    ///   # panic!();
2268    ///   // ... details omitted ...
2269    /// }
2270    /// ```
2271    #[derive(Clone, Debug)]
2272    pub struct CreateContext(RequestBuilder<crate::model::CreateContextRequest>);
2273
2274    impl CreateContext {
2275        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2276            Self(RequestBuilder::new(stub))
2277        }
2278
2279        /// Sets the full request, replacing any prior values.
2280        pub fn with_request<V: Into<crate::model::CreateContextRequest>>(mut self, v: V) -> Self {
2281            self.0.request = v.into();
2282            self
2283        }
2284
2285        /// Sets all the options, replacing any prior values.
2286        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2287            self.0.options = v.into();
2288            self
2289        }
2290
2291        /// Sends the request.
2292        pub async fn send(self) -> Result<crate::model::Context> {
2293            (*self.0.stub)
2294                .create_context(self.0.request, self.0.options)
2295                .await
2296                .map(gax::response::Response::into_body)
2297        }
2298
2299        /// Sets the value of [parent][crate::model::CreateContextRequest::parent].
2300        ///
2301        /// This is a **required** field for requests.
2302        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2303            self.0.request.parent = v.into();
2304            self
2305        }
2306
2307        /// Sets the value of [context][crate::model::CreateContextRequest::context].
2308        ///
2309        /// This is a **required** field for requests.
2310        pub fn set_context<T>(mut self, v: T) -> Self
2311        where
2312            T: std::convert::Into<crate::model::Context>,
2313        {
2314            self.0.request.context = std::option::Option::Some(v.into());
2315            self
2316        }
2317
2318        /// Sets or clears the value of [context][crate::model::CreateContextRequest::context].
2319        ///
2320        /// This is a **required** field for requests.
2321        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2322        where
2323            T: std::convert::Into<crate::model::Context>,
2324        {
2325            self.0.request.context = v.map(|x| x.into());
2326            self
2327        }
2328    }
2329
2330    #[doc(hidden)]
2331    impl gax::options::internal::RequestBuilder for CreateContext {
2332        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2333            &mut self.0.options
2334        }
2335    }
2336
2337    /// The request builder for [Contexts::update_context][crate::client::Contexts::update_context] calls.
2338    ///
2339    /// # Example
2340    /// ```no_run
2341    /// # use google_cloud_dialogflow_v2::builder;
2342    /// use builder::contexts::UpdateContext;
2343    /// # tokio_test::block_on(async {
2344    ///
2345    /// let builder = prepare_request_builder();
2346    /// let response = builder.send().await?;
2347    /// # gax::Result::<()>::Ok(()) });
2348    ///
2349    /// fn prepare_request_builder() -> UpdateContext {
2350    ///   # panic!();
2351    ///   // ... details omitted ...
2352    /// }
2353    /// ```
2354    #[derive(Clone, Debug)]
2355    pub struct UpdateContext(RequestBuilder<crate::model::UpdateContextRequest>);
2356
2357    impl UpdateContext {
2358        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2359            Self(RequestBuilder::new(stub))
2360        }
2361
2362        /// Sets the full request, replacing any prior values.
2363        pub fn with_request<V: Into<crate::model::UpdateContextRequest>>(mut self, v: V) -> Self {
2364            self.0.request = v.into();
2365            self
2366        }
2367
2368        /// Sets all the options, replacing any prior values.
2369        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2370            self.0.options = v.into();
2371            self
2372        }
2373
2374        /// Sends the request.
2375        pub async fn send(self) -> Result<crate::model::Context> {
2376            (*self.0.stub)
2377                .update_context(self.0.request, self.0.options)
2378                .await
2379                .map(gax::response::Response::into_body)
2380        }
2381
2382        /// Sets the value of [context][crate::model::UpdateContextRequest::context].
2383        ///
2384        /// This is a **required** field for requests.
2385        pub fn set_context<T>(mut self, v: T) -> Self
2386        where
2387            T: std::convert::Into<crate::model::Context>,
2388        {
2389            self.0.request.context = std::option::Option::Some(v.into());
2390            self
2391        }
2392
2393        /// Sets or clears the value of [context][crate::model::UpdateContextRequest::context].
2394        ///
2395        /// This is a **required** field for requests.
2396        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2397        where
2398            T: std::convert::Into<crate::model::Context>,
2399        {
2400            self.0.request.context = v.map(|x| x.into());
2401            self
2402        }
2403
2404        /// Sets the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2405        pub fn set_update_mask<T>(mut self, v: T) -> Self
2406        where
2407            T: std::convert::Into<wkt::FieldMask>,
2408        {
2409            self.0.request.update_mask = std::option::Option::Some(v.into());
2410            self
2411        }
2412
2413        /// Sets or clears the value of [update_mask][crate::model::UpdateContextRequest::update_mask].
2414        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2415        where
2416            T: std::convert::Into<wkt::FieldMask>,
2417        {
2418            self.0.request.update_mask = v.map(|x| x.into());
2419            self
2420        }
2421    }
2422
2423    #[doc(hidden)]
2424    impl gax::options::internal::RequestBuilder for UpdateContext {
2425        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2426            &mut self.0.options
2427        }
2428    }
2429
2430    /// The request builder for [Contexts::delete_context][crate::client::Contexts::delete_context] calls.
2431    ///
2432    /// # Example
2433    /// ```no_run
2434    /// # use google_cloud_dialogflow_v2::builder;
2435    /// use builder::contexts::DeleteContext;
2436    /// # tokio_test::block_on(async {
2437    ///
2438    /// let builder = prepare_request_builder();
2439    /// let response = builder.send().await?;
2440    /// # gax::Result::<()>::Ok(()) });
2441    ///
2442    /// fn prepare_request_builder() -> DeleteContext {
2443    ///   # panic!();
2444    ///   // ... details omitted ...
2445    /// }
2446    /// ```
2447    #[derive(Clone, Debug)]
2448    pub struct DeleteContext(RequestBuilder<crate::model::DeleteContextRequest>);
2449
2450    impl DeleteContext {
2451        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2452            Self(RequestBuilder::new(stub))
2453        }
2454
2455        /// Sets the full request, replacing any prior values.
2456        pub fn with_request<V: Into<crate::model::DeleteContextRequest>>(mut self, v: V) -> Self {
2457            self.0.request = v.into();
2458            self
2459        }
2460
2461        /// Sets all the options, replacing any prior values.
2462        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2463            self.0.options = v.into();
2464            self
2465        }
2466
2467        /// Sends the request.
2468        pub async fn send(self) -> Result<()> {
2469            (*self.0.stub)
2470                .delete_context(self.0.request, self.0.options)
2471                .await
2472                .map(gax::response::Response::into_body)
2473        }
2474
2475        /// Sets the value of [name][crate::model::DeleteContextRequest::name].
2476        ///
2477        /// This is a **required** field for requests.
2478        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2479            self.0.request.name = v.into();
2480            self
2481        }
2482    }
2483
2484    #[doc(hidden)]
2485    impl gax::options::internal::RequestBuilder for DeleteContext {
2486        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2487            &mut self.0.options
2488        }
2489    }
2490
2491    /// The request builder for [Contexts::delete_all_contexts][crate::client::Contexts::delete_all_contexts] calls.
2492    ///
2493    /// # Example
2494    /// ```no_run
2495    /// # use google_cloud_dialogflow_v2::builder;
2496    /// use builder::contexts::DeleteAllContexts;
2497    /// # tokio_test::block_on(async {
2498    ///
2499    /// let builder = prepare_request_builder();
2500    /// let response = builder.send().await?;
2501    /// # gax::Result::<()>::Ok(()) });
2502    ///
2503    /// fn prepare_request_builder() -> DeleteAllContexts {
2504    ///   # panic!();
2505    ///   // ... details omitted ...
2506    /// }
2507    /// ```
2508    #[derive(Clone, Debug)]
2509    pub struct DeleteAllContexts(RequestBuilder<crate::model::DeleteAllContextsRequest>);
2510
2511    impl DeleteAllContexts {
2512        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2513            Self(RequestBuilder::new(stub))
2514        }
2515
2516        /// Sets the full request, replacing any prior values.
2517        pub fn with_request<V: Into<crate::model::DeleteAllContextsRequest>>(
2518            mut self,
2519            v: V,
2520        ) -> Self {
2521            self.0.request = v.into();
2522            self
2523        }
2524
2525        /// Sets all the options, replacing any prior values.
2526        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2527            self.0.options = v.into();
2528            self
2529        }
2530
2531        /// Sends the request.
2532        pub async fn send(self) -> Result<()> {
2533            (*self.0.stub)
2534                .delete_all_contexts(self.0.request, self.0.options)
2535                .await
2536                .map(gax::response::Response::into_body)
2537        }
2538
2539        /// Sets the value of [parent][crate::model::DeleteAllContextsRequest::parent].
2540        ///
2541        /// This is a **required** field for requests.
2542        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2543            self.0.request.parent = v.into();
2544            self
2545        }
2546    }
2547
2548    #[doc(hidden)]
2549    impl gax::options::internal::RequestBuilder for DeleteAllContexts {
2550        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2551            &mut self.0.options
2552        }
2553    }
2554
2555    /// The request builder for [Contexts::list_locations][crate::client::Contexts::list_locations] calls.
2556    ///
2557    /// # Example
2558    /// ```no_run
2559    /// # use google_cloud_dialogflow_v2::builder;
2560    /// use builder::contexts::ListLocations;
2561    /// # tokio_test::block_on(async {
2562    /// use gax::paginator::ItemPaginator;
2563    ///
2564    /// let builder = prepare_request_builder();
2565    /// let mut items = builder.by_item();
2566    /// while let Some(result) = items.next().await {
2567    ///   let item = result?;
2568    /// }
2569    /// # gax::Result::<()>::Ok(()) });
2570    ///
2571    /// fn prepare_request_builder() -> ListLocations {
2572    ///   # panic!();
2573    ///   // ... details omitted ...
2574    /// }
2575    /// ```
2576    #[derive(Clone, Debug)]
2577    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2578
2579    impl ListLocations {
2580        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2581            Self(RequestBuilder::new(stub))
2582        }
2583
2584        /// Sets the full request, replacing any prior values.
2585        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2586            mut self,
2587            v: V,
2588        ) -> Self {
2589            self.0.request = v.into();
2590            self
2591        }
2592
2593        /// Sets all the options, replacing any prior values.
2594        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2595            self.0.options = v.into();
2596            self
2597        }
2598
2599        /// Sends the request.
2600        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2601            (*self.0.stub)
2602                .list_locations(self.0.request, self.0.options)
2603                .await
2604                .map(gax::response::Response::into_body)
2605        }
2606
2607        /// Streams each page in the collection.
2608        pub fn by_page(
2609            self,
2610        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2611        {
2612            use std::clone::Clone;
2613            let token = self.0.request.page_token.clone();
2614            let execute = move |token: String| {
2615                let mut builder = self.clone();
2616                builder.0.request = builder.0.request.set_page_token(token);
2617                builder.send()
2618            };
2619            gax::paginator::internal::new_paginator(token, execute)
2620        }
2621
2622        /// Streams each item in the collection.
2623        pub fn by_item(
2624            self,
2625        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2626        {
2627            use gax::paginator::Paginator;
2628            self.by_page().items()
2629        }
2630
2631        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2632        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2633            self.0.request.name = v.into();
2634            self
2635        }
2636
2637        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2638        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2639            self.0.request.filter = v.into();
2640            self
2641        }
2642
2643        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2644        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2645            self.0.request.page_size = v.into();
2646            self
2647        }
2648
2649        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2650        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2651            self.0.request.page_token = v.into();
2652            self
2653        }
2654    }
2655
2656    #[doc(hidden)]
2657    impl gax::options::internal::RequestBuilder for ListLocations {
2658        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2659            &mut self.0.options
2660        }
2661    }
2662
2663    /// The request builder for [Contexts::get_location][crate::client::Contexts::get_location] calls.
2664    ///
2665    /// # Example
2666    /// ```no_run
2667    /// # use google_cloud_dialogflow_v2::builder;
2668    /// use builder::contexts::GetLocation;
2669    /// # tokio_test::block_on(async {
2670    ///
2671    /// let builder = prepare_request_builder();
2672    /// let response = builder.send().await?;
2673    /// # gax::Result::<()>::Ok(()) });
2674    ///
2675    /// fn prepare_request_builder() -> GetLocation {
2676    ///   # panic!();
2677    ///   // ... details omitted ...
2678    /// }
2679    /// ```
2680    #[derive(Clone, Debug)]
2681    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2682
2683    impl GetLocation {
2684        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2685            Self(RequestBuilder::new(stub))
2686        }
2687
2688        /// Sets the full request, replacing any prior values.
2689        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2690            self.0.request = v.into();
2691            self
2692        }
2693
2694        /// Sets all the options, replacing any prior values.
2695        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2696            self.0.options = v.into();
2697            self
2698        }
2699
2700        /// Sends the request.
2701        pub async fn send(self) -> Result<location::model::Location> {
2702            (*self.0.stub)
2703                .get_location(self.0.request, self.0.options)
2704                .await
2705                .map(gax::response::Response::into_body)
2706        }
2707
2708        /// Sets the value of [name][location::model::GetLocationRequest::name].
2709        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2710            self.0.request.name = v.into();
2711            self
2712        }
2713    }
2714
2715    #[doc(hidden)]
2716    impl gax::options::internal::RequestBuilder for GetLocation {
2717        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2718            &mut self.0.options
2719        }
2720    }
2721
2722    /// The request builder for [Contexts::list_operations][crate::client::Contexts::list_operations] calls.
2723    ///
2724    /// # Example
2725    /// ```no_run
2726    /// # use google_cloud_dialogflow_v2::builder;
2727    /// use builder::contexts::ListOperations;
2728    /// # tokio_test::block_on(async {
2729    /// use gax::paginator::ItemPaginator;
2730    ///
2731    /// let builder = prepare_request_builder();
2732    /// let mut items = builder.by_item();
2733    /// while let Some(result) = items.next().await {
2734    ///   let item = result?;
2735    /// }
2736    /// # gax::Result::<()>::Ok(()) });
2737    ///
2738    /// fn prepare_request_builder() -> ListOperations {
2739    ///   # panic!();
2740    ///   // ... details omitted ...
2741    /// }
2742    /// ```
2743    #[derive(Clone, Debug)]
2744    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2745
2746    impl ListOperations {
2747        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2748            Self(RequestBuilder::new(stub))
2749        }
2750
2751        /// Sets the full request, replacing any prior values.
2752        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2753            mut self,
2754            v: V,
2755        ) -> Self {
2756            self.0.request = v.into();
2757            self
2758        }
2759
2760        /// Sets all the options, replacing any prior values.
2761        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2762            self.0.options = v.into();
2763            self
2764        }
2765
2766        /// Sends the request.
2767        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2768            (*self.0.stub)
2769                .list_operations(self.0.request, self.0.options)
2770                .await
2771                .map(gax::response::Response::into_body)
2772        }
2773
2774        /// Streams each page in the collection.
2775        pub fn by_page(
2776            self,
2777        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2778        {
2779            use std::clone::Clone;
2780            let token = self.0.request.page_token.clone();
2781            let execute = move |token: String| {
2782                let mut builder = self.clone();
2783                builder.0.request = builder.0.request.set_page_token(token);
2784                builder.send()
2785            };
2786            gax::paginator::internal::new_paginator(token, execute)
2787        }
2788
2789        /// Streams each item in the collection.
2790        pub fn by_item(
2791            self,
2792        ) -> impl gax::paginator::ItemPaginator<
2793            longrunning::model::ListOperationsResponse,
2794            gax::error::Error,
2795        > {
2796            use gax::paginator::Paginator;
2797            self.by_page().items()
2798        }
2799
2800        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2801        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2802            self.0.request.name = v.into();
2803            self
2804        }
2805
2806        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2807        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2808            self.0.request.filter = v.into();
2809            self
2810        }
2811
2812        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2813        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2814            self.0.request.page_size = v.into();
2815            self
2816        }
2817
2818        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2819        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2820            self.0.request.page_token = v.into();
2821            self
2822        }
2823
2824        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
2825        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2826            self.0.request.return_partial_success = v.into();
2827            self
2828        }
2829    }
2830
2831    #[doc(hidden)]
2832    impl gax::options::internal::RequestBuilder for ListOperations {
2833        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2834            &mut self.0.options
2835        }
2836    }
2837
2838    /// The request builder for [Contexts::get_operation][crate::client::Contexts::get_operation] calls.
2839    ///
2840    /// # Example
2841    /// ```no_run
2842    /// # use google_cloud_dialogflow_v2::builder;
2843    /// use builder::contexts::GetOperation;
2844    /// # tokio_test::block_on(async {
2845    ///
2846    /// let builder = prepare_request_builder();
2847    /// let response = builder.send().await?;
2848    /// # gax::Result::<()>::Ok(()) });
2849    ///
2850    /// fn prepare_request_builder() -> GetOperation {
2851    ///   # panic!();
2852    ///   // ... details omitted ...
2853    /// }
2854    /// ```
2855    #[derive(Clone, Debug)]
2856    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2857
2858    impl GetOperation {
2859        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2860            Self(RequestBuilder::new(stub))
2861        }
2862
2863        /// Sets the full request, replacing any prior values.
2864        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2865            mut self,
2866            v: V,
2867        ) -> Self {
2868            self.0.request = v.into();
2869            self
2870        }
2871
2872        /// Sets all the options, replacing any prior values.
2873        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2874            self.0.options = v.into();
2875            self
2876        }
2877
2878        /// Sends the request.
2879        pub async fn send(self) -> Result<longrunning::model::Operation> {
2880            (*self.0.stub)
2881                .get_operation(self.0.request, self.0.options)
2882                .await
2883                .map(gax::response::Response::into_body)
2884        }
2885
2886        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2887        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2888            self.0.request.name = v.into();
2889            self
2890        }
2891    }
2892
2893    #[doc(hidden)]
2894    impl gax::options::internal::RequestBuilder for GetOperation {
2895        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2896            &mut self.0.options
2897        }
2898    }
2899
2900    /// The request builder for [Contexts::cancel_operation][crate::client::Contexts::cancel_operation] calls.
2901    ///
2902    /// # Example
2903    /// ```no_run
2904    /// # use google_cloud_dialogflow_v2::builder;
2905    /// use builder::contexts::CancelOperation;
2906    /// # tokio_test::block_on(async {
2907    ///
2908    /// let builder = prepare_request_builder();
2909    /// let response = builder.send().await?;
2910    /// # gax::Result::<()>::Ok(()) });
2911    ///
2912    /// fn prepare_request_builder() -> CancelOperation {
2913    ///   # panic!();
2914    ///   // ... details omitted ...
2915    /// }
2916    /// ```
2917    #[derive(Clone, Debug)]
2918    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2919
2920    impl CancelOperation {
2921        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2922            Self(RequestBuilder::new(stub))
2923        }
2924
2925        /// Sets the full request, replacing any prior values.
2926        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2927            mut self,
2928            v: V,
2929        ) -> Self {
2930            self.0.request = v.into();
2931            self
2932        }
2933
2934        /// Sets all the options, replacing any prior values.
2935        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2936            self.0.options = v.into();
2937            self
2938        }
2939
2940        /// Sends the request.
2941        pub async fn send(self) -> Result<()> {
2942            (*self.0.stub)
2943                .cancel_operation(self.0.request, self.0.options)
2944                .await
2945                .map(gax::response::Response::into_body)
2946        }
2947
2948        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2949        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2950            self.0.request.name = v.into();
2951            self
2952        }
2953    }
2954
2955    #[doc(hidden)]
2956    impl gax::options::internal::RequestBuilder for CancelOperation {
2957        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2958            &mut self.0.options
2959        }
2960    }
2961}
2962
2963#[cfg(feature = "conversations")]
2964#[cfg_attr(docsrs, doc(cfg(feature = "conversations")))]
2965pub mod conversations {
2966    use crate::Result;
2967
2968    /// A builder for [Conversations][crate::client::Conversations].
2969    ///
2970    /// ```
2971    /// # tokio_test::block_on(async {
2972    /// # use google_cloud_dialogflow_v2::*;
2973    /// # use builder::conversations::ClientBuilder;
2974    /// # use client::Conversations;
2975    /// let builder : ClientBuilder = Conversations::builder();
2976    /// let client = builder
2977    ///     .with_endpoint("https://dialogflow.googleapis.com")
2978    ///     .build().await?;
2979    /// # gax::client_builder::Result::<()>::Ok(()) });
2980    /// ```
2981    pub type ClientBuilder =
2982        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2983
2984    pub(crate) mod client {
2985        use super::super::super::client::Conversations;
2986        pub struct Factory;
2987        impl gax::client_builder::internal::ClientFactory for Factory {
2988            type Client = Conversations;
2989            type Credentials = gaxi::options::Credentials;
2990            async fn build(
2991                self,
2992                config: gaxi::options::ClientConfig,
2993            ) -> gax::client_builder::Result<Self::Client> {
2994                Self::Client::new(config).await
2995            }
2996        }
2997    }
2998
2999    /// Common implementation for [crate::client::Conversations] request builders.
3000    #[derive(Clone, Debug)]
3001    pub(crate) struct RequestBuilder<R: std::default::Default> {
3002        stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3003        request: R,
3004        options: gax::options::RequestOptions,
3005    }
3006
3007    impl<R> RequestBuilder<R>
3008    where
3009        R: std::default::Default,
3010    {
3011        pub(crate) fn new(
3012            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3013        ) -> Self {
3014            Self {
3015                stub,
3016                request: R::default(),
3017                options: gax::options::RequestOptions::default(),
3018            }
3019        }
3020    }
3021
3022    /// The request builder for [Conversations::create_conversation][crate::client::Conversations::create_conversation] calls.
3023    ///
3024    /// # Example
3025    /// ```no_run
3026    /// # use google_cloud_dialogflow_v2::builder;
3027    /// use builder::conversations::CreateConversation;
3028    /// # tokio_test::block_on(async {
3029    ///
3030    /// let builder = prepare_request_builder();
3031    /// let response = builder.send().await?;
3032    /// # gax::Result::<()>::Ok(()) });
3033    ///
3034    /// fn prepare_request_builder() -> CreateConversation {
3035    ///   # panic!();
3036    ///   // ... details omitted ...
3037    /// }
3038    /// ```
3039    #[derive(Clone, Debug)]
3040    pub struct CreateConversation(RequestBuilder<crate::model::CreateConversationRequest>);
3041
3042    impl CreateConversation {
3043        pub(crate) fn new(
3044            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3045        ) -> Self {
3046            Self(RequestBuilder::new(stub))
3047        }
3048
3049        /// Sets the full request, replacing any prior values.
3050        pub fn with_request<V: Into<crate::model::CreateConversationRequest>>(
3051            mut self,
3052            v: V,
3053        ) -> Self {
3054            self.0.request = v.into();
3055            self
3056        }
3057
3058        /// Sets all the options, replacing any prior values.
3059        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3060            self.0.options = v.into();
3061            self
3062        }
3063
3064        /// Sends the request.
3065        pub async fn send(self) -> Result<crate::model::Conversation> {
3066            (*self.0.stub)
3067                .create_conversation(self.0.request, self.0.options)
3068                .await
3069                .map(gax::response::Response::into_body)
3070        }
3071
3072        /// Sets the value of [parent][crate::model::CreateConversationRequest::parent].
3073        ///
3074        /// This is a **required** field for requests.
3075        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3076            self.0.request.parent = v.into();
3077            self
3078        }
3079
3080        /// Sets the value of [conversation][crate::model::CreateConversationRequest::conversation].
3081        ///
3082        /// This is a **required** field for requests.
3083        pub fn set_conversation<T>(mut self, v: T) -> Self
3084        where
3085            T: std::convert::Into<crate::model::Conversation>,
3086        {
3087            self.0.request.conversation = std::option::Option::Some(v.into());
3088            self
3089        }
3090
3091        /// Sets or clears the value of [conversation][crate::model::CreateConversationRequest::conversation].
3092        ///
3093        /// This is a **required** field for requests.
3094        pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3095        where
3096            T: std::convert::Into<crate::model::Conversation>,
3097        {
3098            self.0.request.conversation = v.map(|x| x.into());
3099            self
3100        }
3101
3102        /// Sets the value of [conversation_id][crate::model::CreateConversationRequest::conversation_id].
3103        pub fn set_conversation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3104            self.0.request.conversation_id = v.into();
3105            self
3106        }
3107    }
3108
3109    #[doc(hidden)]
3110    impl gax::options::internal::RequestBuilder for CreateConversation {
3111        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3112            &mut self.0.options
3113        }
3114    }
3115
3116    /// The request builder for [Conversations::list_conversations][crate::client::Conversations::list_conversations] calls.
3117    ///
3118    /// # Example
3119    /// ```no_run
3120    /// # use google_cloud_dialogflow_v2::builder;
3121    /// use builder::conversations::ListConversations;
3122    /// # tokio_test::block_on(async {
3123    /// use gax::paginator::ItemPaginator;
3124    ///
3125    /// let builder = prepare_request_builder();
3126    /// let mut items = builder.by_item();
3127    /// while let Some(result) = items.next().await {
3128    ///   let item = result?;
3129    /// }
3130    /// # gax::Result::<()>::Ok(()) });
3131    ///
3132    /// fn prepare_request_builder() -> ListConversations {
3133    ///   # panic!();
3134    ///   // ... details omitted ...
3135    /// }
3136    /// ```
3137    #[derive(Clone, Debug)]
3138    pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);
3139
3140    impl ListConversations {
3141        pub(crate) fn new(
3142            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3143        ) -> Self {
3144            Self(RequestBuilder::new(stub))
3145        }
3146
3147        /// Sets the full request, replacing any prior values.
3148        pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
3149            mut self,
3150            v: V,
3151        ) -> Self {
3152            self.0.request = v.into();
3153            self
3154        }
3155
3156        /// Sets all the options, replacing any prior values.
3157        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3158            self.0.options = v.into();
3159            self
3160        }
3161
3162        /// Sends the request.
3163        pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
3164            (*self.0.stub)
3165                .list_conversations(self.0.request, self.0.options)
3166                .await
3167                .map(gax::response::Response::into_body)
3168        }
3169
3170        /// Streams each page in the collection.
3171        pub fn by_page(
3172            self,
3173        ) -> impl gax::paginator::Paginator<crate::model::ListConversationsResponse, gax::error::Error>
3174        {
3175            use std::clone::Clone;
3176            let token = self.0.request.page_token.clone();
3177            let execute = move |token: String| {
3178                let mut builder = self.clone();
3179                builder.0.request = builder.0.request.set_page_token(token);
3180                builder.send()
3181            };
3182            gax::paginator::internal::new_paginator(token, execute)
3183        }
3184
3185        /// Streams each item in the collection.
3186        pub fn by_item(
3187            self,
3188        ) -> impl gax::paginator::ItemPaginator<crate::model::ListConversationsResponse, gax::error::Error>
3189        {
3190            use gax::paginator::Paginator;
3191            self.by_page().items()
3192        }
3193
3194        /// Sets the value of [parent][crate::model::ListConversationsRequest::parent].
3195        ///
3196        /// This is a **required** field for requests.
3197        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3198            self.0.request.parent = v.into();
3199            self
3200        }
3201
3202        /// Sets the value of [page_size][crate::model::ListConversationsRequest::page_size].
3203        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3204            self.0.request.page_size = v.into();
3205            self
3206        }
3207
3208        /// Sets the value of [page_token][crate::model::ListConversationsRequest::page_token].
3209        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3210            self.0.request.page_token = v.into();
3211            self
3212        }
3213
3214        /// Sets the value of [filter][crate::model::ListConversationsRequest::filter].
3215        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3216            self.0.request.filter = v.into();
3217            self
3218        }
3219    }
3220
3221    #[doc(hidden)]
3222    impl gax::options::internal::RequestBuilder for ListConversations {
3223        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3224            &mut self.0.options
3225        }
3226    }
3227
3228    /// The request builder for [Conversations::get_conversation][crate::client::Conversations::get_conversation] calls.
3229    ///
3230    /// # Example
3231    /// ```no_run
3232    /// # use google_cloud_dialogflow_v2::builder;
3233    /// use builder::conversations::GetConversation;
3234    /// # tokio_test::block_on(async {
3235    ///
3236    /// let builder = prepare_request_builder();
3237    /// let response = builder.send().await?;
3238    /// # gax::Result::<()>::Ok(()) });
3239    ///
3240    /// fn prepare_request_builder() -> GetConversation {
3241    ///   # panic!();
3242    ///   // ... details omitted ...
3243    /// }
3244    /// ```
3245    #[derive(Clone, Debug)]
3246    pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);
3247
3248    impl GetConversation {
3249        pub(crate) fn new(
3250            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3251        ) -> Self {
3252            Self(RequestBuilder::new(stub))
3253        }
3254
3255        /// Sets the full request, replacing any prior values.
3256        pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
3257            self.0.request = v.into();
3258            self
3259        }
3260
3261        /// Sets all the options, replacing any prior values.
3262        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3263            self.0.options = v.into();
3264            self
3265        }
3266
3267        /// Sends the request.
3268        pub async fn send(self) -> Result<crate::model::Conversation> {
3269            (*self.0.stub)
3270                .get_conversation(self.0.request, self.0.options)
3271                .await
3272                .map(gax::response::Response::into_body)
3273        }
3274
3275        /// Sets the value of [name][crate::model::GetConversationRequest::name].
3276        ///
3277        /// This is a **required** field for requests.
3278        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3279            self.0.request.name = v.into();
3280            self
3281        }
3282    }
3283
3284    #[doc(hidden)]
3285    impl gax::options::internal::RequestBuilder for GetConversation {
3286        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3287            &mut self.0.options
3288        }
3289    }
3290
3291    /// The request builder for [Conversations::complete_conversation][crate::client::Conversations::complete_conversation] calls.
3292    ///
3293    /// # Example
3294    /// ```no_run
3295    /// # use google_cloud_dialogflow_v2::builder;
3296    /// use builder::conversations::CompleteConversation;
3297    /// # tokio_test::block_on(async {
3298    ///
3299    /// let builder = prepare_request_builder();
3300    /// let response = builder.send().await?;
3301    /// # gax::Result::<()>::Ok(()) });
3302    ///
3303    /// fn prepare_request_builder() -> CompleteConversation {
3304    ///   # panic!();
3305    ///   // ... details omitted ...
3306    /// }
3307    /// ```
3308    #[derive(Clone, Debug)]
3309    pub struct CompleteConversation(RequestBuilder<crate::model::CompleteConversationRequest>);
3310
3311    impl CompleteConversation {
3312        pub(crate) fn new(
3313            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3314        ) -> Self {
3315            Self(RequestBuilder::new(stub))
3316        }
3317
3318        /// Sets the full request, replacing any prior values.
3319        pub fn with_request<V: Into<crate::model::CompleteConversationRequest>>(
3320            mut self,
3321            v: V,
3322        ) -> Self {
3323            self.0.request = v.into();
3324            self
3325        }
3326
3327        /// Sets all the options, replacing any prior values.
3328        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3329            self.0.options = v.into();
3330            self
3331        }
3332
3333        /// Sends the request.
3334        pub async fn send(self) -> Result<crate::model::Conversation> {
3335            (*self.0.stub)
3336                .complete_conversation(self.0.request, self.0.options)
3337                .await
3338                .map(gax::response::Response::into_body)
3339        }
3340
3341        /// Sets the value of [name][crate::model::CompleteConversationRequest::name].
3342        ///
3343        /// This is a **required** field for requests.
3344        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3345            self.0.request.name = v.into();
3346            self
3347        }
3348    }
3349
3350    #[doc(hidden)]
3351    impl gax::options::internal::RequestBuilder for CompleteConversation {
3352        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3353            &mut self.0.options
3354        }
3355    }
3356
3357    /// The request builder for [Conversations::ingest_context_references][crate::client::Conversations::ingest_context_references] calls.
3358    ///
3359    /// # Example
3360    /// ```no_run
3361    /// # use google_cloud_dialogflow_v2::builder;
3362    /// use builder::conversations::IngestContextReferences;
3363    /// # tokio_test::block_on(async {
3364    ///
3365    /// let builder = prepare_request_builder();
3366    /// let response = builder.send().await?;
3367    /// # gax::Result::<()>::Ok(()) });
3368    ///
3369    /// fn prepare_request_builder() -> IngestContextReferences {
3370    ///   # panic!();
3371    ///   // ... details omitted ...
3372    /// }
3373    /// ```
3374    #[derive(Clone, Debug)]
3375    pub struct IngestContextReferences(
3376        RequestBuilder<crate::model::IngestContextReferencesRequest>,
3377    );
3378
3379    impl IngestContextReferences {
3380        pub(crate) fn new(
3381            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3382        ) -> Self {
3383            Self(RequestBuilder::new(stub))
3384        }
3385
3386        /// Sets the full request, replacing any prior values.
3387        pub fn with_request<V: Into<crate::model::IngestContextReferencesRequest>>(
3388            mut self,
3389            v: V,
3390        ) -> Self {
3391            self.0.request = v.into();
3392            self
3393        }
3394
3395        /// Sets all the options, replacing any prior values.
3396        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3397            self.0.options = v.into();
3398            self
3399        }
3400
3401        /// Sends the request.
3402        pub async fn send(self) -> Result<crate::model::IngestContextReferencesResponse> {
3403            (*self.0.stub)
3404                .ingest_context_references(self.0.request, self.0.options)
3405                .await
3406                .map(gax::response::Response::into_body)
3407        }
3408
3409        /// Sets the value of [conversation][crate::model::IngestContextReferencesRequest::conversation].
3410        ///
3411        /// This is a **required** field for requests.
3412        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3413            self.0.request.conversation = v.into();
3414            self
3415        }
3416
3417        /// Sets the value of [context_references][crate::model::IngestContextReferencesRequest::context_references].
3418        ///
3419        /// This is a **required** field for requests.
3420        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3421        where
3422            T: std::iter::IntoIterator<Item = (K, V)>,
3423            K: std::convert::Into<std::string::String>,
3424            V: std::convert::Into<crate::model::conversation::ContextReference>,
3425        {
3426            self.0.request.context_references =
3427                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3428            self
3429        }
3430    }
3431
3432    #[doc(hidden)]
3433    impl gax::options::internal::RequestBuilder for IngestContextReferences {
3434        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3435            &mut self.0.options
3436        }
3437    }
3438
3439    /// The request builder for [Conversations::list_messages][crate::client::Conversations::list_messages] calls.
3440    ///
3441    /// # Example
3442    /// ```no_run
3443    /// # use google_cloud_dialogflow_v2::builder;
3444    /// use builder::conversations::ListMessages;
3445    /// # tokio_test::block_on(async {
3446    /// use gax::paginator::ItemPaginator;
3447    ///
3448    /// let builder = prepare_request_builder();
3449    /// let mut items = builder.by_item();
3450    /// while let Some(result) = items.next().await {
3451    ///   let item = result?;
3452    /// }
3453    /// # gax::Result::<()>::Ok(()) });
3454    ///
3455    /// fn prepare_request_builder() -> ListMessages {
3456    ///   # panic!();
3457    ///   // ... details omitted ...
3458    /// }
3459    /// ```
3460    #[derive(Clone, Debug)]
3461    pub struct ListMessages(RequestBuilder<crate::model::ListMessagesRequest>);
3462
3463    impl ListMessages {
3464        pub(crate) fn new(
3465            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3466        ) -> Self {
3467            Self(RequestBuilder::new(stub))
3468        }
3469
3470        /// Sets the full request, replacing any prior values.
3471        pub fn with_request<V: Into<crate::model::ListMessagesRequest>>(mut self, v: V) -> Self {
3472            self.0.request = v.into();
3473            self
3474        }
3475
3476        /// Sets all the options, replacing any prior values.
3477        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3478            self.0.options = v.into();
3479            self
3480        }
3481
3482        /// Sends the request.
3483        pub async fn send(self) -> Result<crate::model::ListMessagesResponse> {
3484            (*self.0.stub)
3485                .list_messages(self.0.request, self.0.options)
3486                .await
3487                .map(gax::response::Response::into_body)
3488        }
3489
3490        /// Streams each page in the collection.
3491        pub fn by_page(
3492            self,
3493        ) -> impl gax::paginator::Paginator<crate::model::ListMessagesResponse, gax::error::Error>
3494        {
3495            use std::clone::Clone;
3496            let token = self.0.request.page_token.clone();
3497            let execute = move |token: String| {
3498                let mut builder = self.clone();
3499                builder.0.request = builder.0.request.set_page_token(token);
3500                builder.send()
3501            };
3502            gax::paginator::internal::new_paginator(token, execute)
3503        }
3504
3505        /// Streams each item in the collection.
3506        pub fn by_item(
3507            self,
3508        ) -> impl gax::paginator::ItemPaginator<crate::model::ListMessagesResponse, gax::error::Error>
3509        {
3510            use gax::paginator::Paginator;
3511            self.by_page().items()
3512        }
3513
3514        /// Sets the value of [parent][crate::model::ListMessagesRequest::parent].
3515        ///
3516        /// This is a **required** field for requests.
3517        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3518            self.0.request.parent = v.into();
3519            self
3520        }
3521
3522        /// Sets the value of [filter][crate::model::ListMessagesRequest::filter].
3523        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3524            self.0.request.filter = v.into();
3525            self
3526        }
3527
3528        /// Sets the value of [page_size][crate::model::ListMessagesRequest::page_size].
3529        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3530            self.0.request.page_size = v.into();
3531            self
3532        }
3533
3534        /// Sets the value of [page_token][crate::model::ListMessagesRequest::page_token].
3535        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3536            self.0.request.page_token = v.into();
3537            self
3538        }
3539    }
3540
3541    #[doc(hidden)]
3542    impl gax::options::internal::RequestBuilder for ListMessages {
3543        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3544            &mut self.0.options
3545        }
3546    }
3547
3548    /// The request builder for [Conversations::suggest_conversation_summary][crate::client::Conversations::suggest_conversation_summary] calls.
3549    ///
3550    /// # Example
3551    /// ```no_run
3552    /// # use google_cloud_dialogflow_v2::builder;
3553    /// use builder::conversations::SuggestConversationSummary;
3554    /// # tokio_test::block_on(async {
3555    ///
3556    /// let builder = prepare_request_builder();
3557    /// let response = builder.send().await?;
3558    /// # gax::Result::<()>::Ok(()) });
3559    ///
3560    /// fn prepare_request_builder() -> SuggestConversationSummary {
3561    ///   # panic!();
3562    ///   // ... details omitted ...
3563    /// }
3564    /// ```
3565    #[derive(Clone, Debug)]
3566    pub struct SuggestConversationSummary(
3567        RequestBuilder<crate::model::SuggestConversationSummaryRequest>,
3568    );
3569
3570    impl SuggestConversationSummary {
3571        pub(crate) fn new(
3572            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3573        ) -> Self {
3574            Self(RequestBuilder::new(stub))
3575        }
3576
3577        /// Sets the full request, replacing any prior values.
3578        pub fn with_request<V: Into<crate::model::SuggestConversationSummaryRequest>>(
3579            mut self,
3580            v: V,
3581        ) -> Self {
3582            self.0.request = v.into();
3583            self
3584        }
3585
3586        /// Sets all the options, replacing any prior values.
3587        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3588            self.0.options = v.into();
3589            self
3590        }
3591
3592        /// Sends the request.
3593        pub async fn send(self) -> Result<crate::model::SuggestConversationSummaryResponse> {
3594            (*self.0.stub)
3595                .suggest_conversation_summary(self.0.request, self.0.options)
3596                .await
3597                .map(gax::response::Response::into_body)
3598        }
3599
3600        /// Sets the value of [conversation][crate::model::SuggestConversationSummaryRequest::conversation].
3601        ///
3602        /// This is a **required** field for requests.
3603        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3604            self.0.request.conversation = v.into();
3605            self
3606        }
3607
3608        /// Sets the value of [latest_message][crate::model::SuggestConversationSummaryRequest::latest_message].
3609        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3610            self.0.request.latest_message = v.into();
3611            self
3612        }
3613
3614        /// Sets the value of [context_size][crate::model::SuggestConversationSummaryRequest::context_size].
3615        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3616            self.0.request.context_size = v.into();
3617            self
3618        }
3619
3620        /// Sets the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3621        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
3622        where
3623            T: std::convert::Into<crate::model::AssistQueryParameters>,
3624        {
3625            self.0.request.assist_query_params = std::option::Option::Some(v.into());
3626            self
3627        }
3628
3629        /// Sets or clears the value of [assist_query_params][crate::model::SuggestConversationSummaryRequest::assist_query_params].
3630        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
3631        where
3632            T: std::convert::Into<crate::model::AssistQueryParameters>,
3633        {
3634            self.0.request.assist_query_params = v.map(|x| x.into());
3635            self
3636        }
3637    }
3638
3639    #[doc(hidden)]
3640    impl gax::options::internal::RequestBuilder for SuggestConversationSummary {
3641        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3642            &mut self.0.options
3643        }
3644    }
3645
3646    /// The request builder for [Conversations::generate_stateless_summary][crate::client::Conversations::generate_stateless_summary] calls.
3647    ///
3648    /// # Example
3649    /// ```no_run
3650    /// # use google_cloud_dialogflow_v2::builder;
3651    /// use builder::conversations::GenerateStatelessSummary;
3652    /// # tokio_test::block_on(async {
3653    ///
3654    /// let builder = prepare_request_builder();
3655    /// let response = builder.send().await?;
3656    /// # gax::Result::<()>::Ok(()) });
3657    ///
3658    /// fn prepare_request_builder() -> GenerateStatelessSummary {
3659    ///   # panic!();
3660    ///   // ... details omitted ...
3661    /// }
3662    /// ```
3663    #[derive(Clone, Debug)]
3664    pub struct GenerateStatelessSummary(
3665        RequestBuilder<crate::model::GenerateStatelessSummaryRequest>,
3666    );
3667
3668    impl GenerateStatelessSummary {
3669        pub(crate) fn new(
3670            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3671        ) -> Self {
3672            Self(RequestBuilder::new(stub))
3673        }
3674
3675        /// Sets the full request, replacing any prior values.
3676        pub fn with_request<V: Into<crate::model::GenerateStatelessSummaryRequest>>(
3677            mut self,
3678            v: V,
3679        ) -> Self {
3680            self.0.request = v.into();
3681            self
3682        }
3683
3684        /// Sets all the options, replacing any prior values.
3685        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3686            self.0.options = v.into();
3687            self
3688        }
3689
3690        /// Sends the request.
3691        pub async fn send(self) -> Result<crate::model::GenerateStatelessSummaryResponse> {
3692            (*self.0.stub)
3693                .generate_stateless_summary(self.0.request, self.0.options)
3694                .await
3695                .map(gax::response::Response::into_body)
3696        }
3697
3698        /// Sets the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3699        ///
3700        /// This is a **required** field for requests.
3701        pub fn set_stateless_conversation<T>(mut self, v: T) -> Self
3702        where
3703            T: std::convert::Into<
3704                    crate::model::generate_stateless_summary_request::MinimalConversation,
3705                >,
3706        {
3707            self.0.request.stateless_conversation = std::option::Option::Some(v.into());
3708            self
3709        }
3710
3711        /// Sets or clears the value of [stateless_conversation][crate::model::GenerateStatelessSummaryRequest::stateless_conversation].
3712        ///
3713        /// This is a **required** field for requests.
3714        pub fn set_or_clear_stateless_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3715        where
3716            T: std::convert::Into<
3717                    crate::model::generate_stateless_summary_request::MinimalConversation,
3718                >,
3719        {
3720            self.0.request.stateless_conversation = v.map(|x| x.into());
3721            self
3722        }
3723
3724        /// Sets the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3725        ///
3726        /// This is a **required** field for requests.
3727        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
3728        where
3729            T: std::convert::Into<crate::model::ConversationProfile>,
3730        {
3731            self.0.request.conversation_profile = std::option::Option::Some(v.into());
3732            self
3733        }
3734
3735        /// Sets or clears the value of [conversation_profile][crate::model::GenerateStatelessSummaryRequest::conversation_profile].
3736        ///
3737        /// This is a **required** field for requests.
3738        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
3739        where
3740            T: std::convert::Into<crate::model::ConversationProfile>,
3741        {
3742            self.0.request.conversation_profile = v.map(|x| x.into());
3743            self
3744        }
3745
3746        /// Sets the value of [latest_message][crate::model::GenerateStatelessSummaryRequest::latest_message].
3747        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3748            self.0.request.latest_message = v.into();
3749            self
3750        }
3751
3752        /// Sets the value of [max_context_size][crate::model::GenerateStatelessSummaryRequest::max_context_size].
3753        pub fn set_max_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3754            self.0.request.max_context_size = v.into();
3755            self
3756        }
3757    }
3758
3759    #[doc(hidden)]
3760    impl gax::options::internal::RequestBuilder for GenerateStatelessSummary {
3761        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3762            &mut self.0.options
3763        }
3764    }
3765
3766    /// The request builder for [Conversations::generate_stateless_suggestion][crate::client::Conversations::generate_stateless_suggestion] calls.
3767    ///
3768    /// # Example
3769    /// ```no_run
3770    /// # use google_cloud_dialogflow_v2::builder;
3771    /// use builder::conversations::GenerateStatelessSuggestion;
3772    /// # tokio_test::block_on(async {
3773    ///
3774    /// let builder = prepare_request_builder();
3775    /// let response = builder.send().await?;
3776    /// # gax::Result::<()>::Ok(()) });
3777    ///
3778    /// fn prepare_request_builder() -> GenerateStatelessSuggestion {
3779    ///   # panic!();
3780    ///   // ... details omitted ...
3781    /// }
3782    /// ```
3783    #[derive(Clone, Debug)]
3784    pub struct GenerateStatelessSuggestion(
3785        RequestBuilder<crate::model::GenerateStatelessSuggestionRequest>,
3786    );
3787
3788    impl GenerateStatelessSuggestion {
3789        pub(crate) fn new(
3790            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3791        ) -> Self {
3792            Self(RequestBuilder::new(stub))
3793        }
3794
3795        /// Sets the full request, replacing any prior values.
3796        pub fn with_request<V: Into<crate::model::GenerateStatelessSuggestionRequest>>(
3797            mut self,
3798            v: V,
3799        ) -> Self {
3800            self.0.request = v.into();
3801            self
3802        }
3803
3804        /// Sets all the options, replacing any prior values.
3805        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3806            self.0.options = v.into();
3807            self
3808        }
3809
3810        /// Sends the request.
3811        pub async fn send(self) -> Result<crate::model::GenerateStatelessSuggestionResponse> {
3812            (*self.0.stub)
3813                .generate_stateless_suggestion(self.0.request, self.0.options)
3814                .await
3815                .map(gax::response::Response::into_body)
3816        }
3817
3818        /// Sets the value of [parent][crate::model::GenerateStatelessSuggestionRequest::parent].
3819        ///
3820        /// This is a **required** field for requests.
3821        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822            self.0.request.parent = v.into();
3823            self
3824        }
3825
3826        /// Sets the value of [context_references][crate::model::GenerateStatelessSuggestionRequest::context_references].
3827        pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3828        where
3829            T: std::iter::IntoIterator<Item = (K, V)>,
3830            K: std::convert::Into<std::string::String>,
3831            V: std::convert::Into<crate::model::conversation::ContextReference>,
3832        {
3833            self.0.request.context_references =
3834                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3835            self
3836        }
3837
3838        /// Sets the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3839        pub fn set_conversation_context<T>(mut self, v: T) -> Self
3840        where
3841            T: std::convert::Into<crate::model::ConversationContext>,
3842        {
3843            self.0.request.conversation_context = std::option::Option::Some(v.into());
3844            self
3845        }
3846
3847        /// Sets or clears the value of [conversation_context][crate::model::GenerateStatelessSuggestionRequest::conversation_context].
3848        pub fn set_or_clear_conversation_context<T>(mut self, v: std::option::Option<T>) -> Self
3849        where
3850            T: std::convert::Into<crate::model::ConversationContext>,
3851        {
3852            self.0.request.conversation_context = v.map(|x| x.into());
3853            self
3854        }
3855
3856        /// Sets the value of [trigger_events][crate::model::GenerateStatelessSuggestionRequest::trigger_events].
3857        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
3858        where
3859            T: std::iter::IntoIterator<Item = V>,
3860            V: std::convert::Into<crate::model::TriggerEvent>,
3861        {
3862            use std::iter::Iterator;
3863            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
3864            self
3865        }
3866
3867        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource].
3868        ///
3869        /// Note that all the setters affecting `generator_resource` are
3870        /// mutually exclusive.
3871        pub fn set_generator_resource<
3872            T: Into<Option<crate::model::generate_stateless_suggestion_request::GeneratorResource>>,
3873        >(
3874            mut self,
3875            v: T,
3876        ) -> Self {
3877            self.0.request.generator_resource = v.into();
3878            self
3879        }
3880
3881        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3882        /// to hold a `Generator`.
3883        ///
3884        /// Note that all the setters affecting `generator_resource` are
3885        /// mutually exclusive.
3886        pub fn set_generator<T: std::convert::Into<std::boxed::Box<crate::model::Generator>>>(
3887            mut self,
3888            v: T,
3889        ) -> Self {
3890            self.0.request = self.0.request.set_generator(v);
3891            self
3892        }
3893
3894        /// Sets the value of [generator_resource][crate::model::GenerateStatelessSuggestionRequest::generator_resource]
3895        /// to hold a `GeneratorName`.
3896        ///
3897        /// Note that all the setters affecting `generator_resource` are
3898        /// mutually exclusive.
3899        pub fn set_generator_name<T: std::convert::Into<std::string::String>>(
3900            mut self,
3901            v: T,
3902        ) -> Self {
3903            self.0.request = self.0.request.set_generator_name(v);
3904            self
3905        }
3906    }
3907
3908    #[doc(hidden)]
3909    impl gax::options::internal::RequestBuilder for GenerateStatelessSuggestion {
3910        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3911            &mut self.0.options
3912        }
3913    }
3914
3915    /// The request builder for [Conversations::search_knowledge][crate::client::Conversations::search_knowledge] calls.
3916    ///
3917    /// # Example
3918    /// ```no_run
3919    /// # use google_cloud_dialogflow_v2::builder;
3920    /// use builder::conversations::SearchKnowledge;
3921    /// # tokio_test::block_on(async {
3922    ///
3923    /// let builder = prepare_request_builder();
3924    /// let response = builder.send().await?;
3925    /// # gax::Result::<()>::Ok(()) });
3926    ///
3927    /// fn prepare_request_builder() -> SearchKnowledge {
3928    ///   # panic!();
3929    ///   // ... details omitted ...
3930    /// }
3931    /// ```
3932    #[derive(Clone, Debug)]
3933    pub struct SearchKnowledge(RequestBuilder<crate::model::SearchKnowledgeRequest>);
3934
3935    impl SearchKnowledge {
3936        pub(crate) fn new(
3937            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3938        ) -> Self {
3939            Self(RequestBuilder::new(stub))
3940        }
3941
3942        /// Sets the full request, replacing any prior values.
3943        pub fn with_request<V: Into<crate::model::SearchKnowledgeRequest>>(mut self, v: V) -> Self {
3944            self.0.request = v.into();
3945            self
3946        }
3947
3948        /// Sets all the options, replacing any prior values.
3949        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3950            self.0.options = v.into();
3951            self
3952        }
3953
3954        /// Sends the request.
3955        pub async fn send(self) -> Result<crate::model::SearchKnowledgeResponse> {
3956            (*self.0.stub)
3957                .search_knowledge(self.0.request, self.0.options)
3958                .await
3959                .map(gax::response::Response::into_body)
3960        }
3961
3962        /// Sets the value of [parent][crate::model::SearchKnowledgeRequest::parent].
3963        ///
3964        /// This is a **required** field for requests.
3965        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3966            self.0.request.parent = v.into();
3967            self
3968        }
3969
3970        /// Sets the value of [query][crate::model::SearchKnowledgeRequest::query].
3971        ///
3972        /// This is a **required** field for requests.
3973        pub fn set_query<T>(mut self, v: T) -> Self
3974        where
3975            T: std::convert::Into<crate::model::TextInput>,
3976        {
3977            self.0.request.query = std::option::Option::Some(v.into());
3978            self
3979        }
3980
3981        /// Sets or clears the value of [query][crate::model::SearchKnowledgeRequest::query].
3982        ///
3983        /// This is a **required** field for requests.
3984        pub fn set_or_clear_query<T>(mut self, v: std::option::Option<T>) -> Self
3985        where
3986            T: std::convert::Into<crate::model::TextInput>,
3987        {
3988            self.0.request.query = v.map(|x| x.into());
3989            self
3990        }
3991
3992        /// Sets the value of [conversation_profile][crate::model::SearchKnowledgeRequest::conversation_profile].
3993        ///
3994        /// This is a **required** field for requests.
3995        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
3996            self.0.request.conversation_profile = v.into();
3997            self
3998        }
3999
4000        /// Sets the value of [session_id][crate::model::SearchKnowledgeRequest::session_id].
4001        ///
4002        /// This is a **required** field for requests.
4003        pub fn set_session_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4004            self.0.request.session_id = v.into();
4005            self
4006        }
4007
4008        /// Sets the value of [conversation][crate::model::SearchKnowledgeRequest::conversation].
4009        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4010            self.0.request.conversation = v.into();
4011            self
4012        }
4013
4014        /// Sets the value of [latest_message][crate::model::SearchKnowledgeRequest::latest_message].
4015        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4016            self.0.request.latest_message = v.into();
4017            self
4018        }
4019
4020        /// Sets the value of [query_source][crate::model::SearchKnowledgeRequest::query_source].
4021        pub fn set_query_source<T: Into<crate::model::search_knowledge_request::QuerySource>>(
4022            mut self,
4023            v: T,
4024        ) -> Self {
4025            self.0.request.query_source = v.into();
4026            self
4027        }
4028
4029        /// Sets the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4030        pub fn set_end_user_metadata<T>(mut self, v: T) -> Self
4031        where
4032            T: std::convert::Into<wkt::Struct>,
4033        {
4034            self.0.request.end_user_metadata = std::option::Option::Some(v.into());
4035            self
4036        }
4037
4038        /// Sets or clears the value of [end_user_metadata][crate::model::SearchKnowledgeRequest::end_user_metadata].
4039        pub fn set_or_clear_end_user_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4040        where
4041            T: std::convert::Into<wkt::Struct>,
4042        {
4043            self.0.request.end_user_metadata = v.map(|x| x.into());
4044            self
4045        }
4046
4047        /// Sets the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4048        pub fn set_search_config<T>(mut self, v: T) -> Self
4049        where
4050            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4051        {
4052            self.0.request.search_config = std::option::Option::Some(v.into());
4053            self
4054        }
4055
4056        /// Sets or clears the value of [search_config][crate::model::SearchKnowledgeRequest::search_config].
4057        pub fn set_or_clear_search_config<T>(mut self, v: std::option::Option<T>) -> Self
4058        where
4059            T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4060        {
4061            self.0.request.search_config = v.map(|x| x.into());
4062            self
4063        }
4064
4065        /// Sets the value of [exact_search][crate::model::SearchKnowledgeRequest::exact_search].
4066        pub fn set_exact_search<T: Into<bool>>(mut self, v: T) -> Self {
4067            self.0.request.exact_search = v.into();
4068            self
4069        }
4070    }
4071
4072    #[doc(hidden)]
4073    impl gax::options::internal::RequestBuilder for SearchKnowledge {
4074        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4075            &mut self.0.options
4076        }
4077    }
4078
4079    /// The request builder for [Conversations::generate_suggestions][crate::client::Conversations::generate_suggestions] calls.
4080    ///
4081    /// # Example
4082    /// ```no_run
4083    /// # use google_cloud_dialogflow_v2::builder;
4084    /// use builder::conversations::GenerateSuggestions;
4085    /// # tokio_test::block_on(async {
4086    ///
4087    /// let builder = prepare_request_builder();
4088    /// let response = builder.send().await?;
4089    /// # gax::Result::<()>::Ok(()) });
4090    ///
4091    /// fn prepare_request_builder() -> GenerateSuggestions {
4092    ///   # panic!();
4093    ///   // ... details omitted ...
4094    /// }
4095    /// ```
4096    #[derive(Clone, Debug)]
4097    pub struct GenerateSuggestions(RequestBuilder<crate::model::GenerateSuggestionsRequest>);
4098
4099    impl GenerateSuggestions {
4100        pub(crate) fn new(
4101            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4102        ) -> Self {
4103            Self(RequestBuilder::new(stub))
4104        }
4105
4106        /// Sets the full request, replacing any prior values.
4107        pub fn with_request<V: Into<crate::model::GenerateSuggestionsRequest>>(
4108            mut self,
4109            v: V,
4110        ) -> Self {
4111            self.0.request = v.into();
4112            self
4113        }
4114
4115        /// Sets all the options, replacing any prior values.
4116        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4117            self.0.options = v.into();
4118            self
4119        }
4120
4121        /// Sends the request.
4122        pub async fn send(self) -> Result<crate::model::GenerateSuggestionsResponse> {
4123            (*self.0.stub)
4124                .generate_suggestions(self.0.request, self.0.options)
4125                .await
4126                .map(gax::response::Response::into_body)
4127        }
4128
4129        /// Sets the value of [conversation][crate::model::GenerateSuggestionsRequest::conversation].
4130        ///
4131        /// This is a **required** field for requests.
4132        pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4133            self.0.request.conversation = v.into();
4134            self
4135        }
4136
4137        /// Sets the value of [latest_message][crate::model::GenerateSuggestionsRequest::latest_message].
4138        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4139            self.0.request.latest_message = v.into();
4140            self
4141        }
4142
4143        /// Sets the value of [trigger_events][crate::model::GenerateSuggestionsRequest::trigger_events].
4144        pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
4145        where
4146            T: std::iter::IntoIterator<Item = V>,
4147            V: std::convert::Into<crate::model::TriggerEvent>,
4148        {
4149            use std::iter::Iterator;
4150            self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
4151            self
4152        }
4153    }
4154
4155    #[doc(hidden)]
4156    impl gax::options::internal::RequestBuilder for GenerateSuggestions {
4157        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4158            &mut self.0.options
4159        }
4160    }
4161
4162    /// The request builder for [Conversations::list_locations][crate::client::Conversations::list_locations] calls.
4163    ///
4164    /// # Example
4165    /// ```no_run
4166    /// # use google_cloud_dialogflow_v2::builder;
4167    /// use builder::conversations::ListLocations;
4168    /// # tokio_test::block_on(async {
4169    /// use gax::paginator::ItemPaginator;
4170    ///
4171    /// let builder = prepare_request_builder();
4172    /// let mut items = builder.by_item();
4173    /// while let Some(result) = items.next().await {
4174    ///   let item = result?;
4175    /// }
4176    /// # gax::Result::<()>::Ok(()) });
4177    ///
4178    /// fn prepare_request_builder() -> ListLocations {
4179    ///   # panic!();
4180    ///   // ... details omitted ...
4181    /// }
4182    /// ```
4183    #[derive(Clone, Debug)]
4184    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4185
4186    impl ListLocations {
4187        pub(crate) fn new(
4188            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4189        ) -> Self {
4190            Self(RequestBuilder::new(stub))
4191        }
4192
4193        /// Sets the full request, replacing any prior values.
4194        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4195            mut self,
4196            v: V,
4197        ) -> Self {
4198            self.0.request = v.into();
4199            self
4200        }
4201
4202        /// Sets all the options, replacing any prior values.
4203        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4204            self.0.options = v.into();
4205            self
4206        }
4207
4208        /// Sends the request.
4209        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4210            (*self.0.stub)
4211                .list_locations(self.0.request, self.0.options)
4212                .await
4213                .map(gax::response::Response::into_body)
4214        }
4215
4216        /// Streams each page in the collection.
4217        pub fn by_page(
4218            self,
4219        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4220        {
4221            use std::clone::Clone;
4222            let token = self.0.request.page_token.clone();
4223            let execute = move |token: String| {
4224                let mut builder = self.clone();
4225                builder.0.request = builder.0.request.set_page_token(token);
4226                builder.send()
4227            };
4228            gax::paginator::internal::new_paginator(token, execute)
4229        }
4230
4231        /// Streams each item in the collection.
4232        pub fn by_item(
4233            self,
4234        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4235        {
4236            use gax::paginator::Paginator;
4237            self.by_page().items()
4238        }
4239
4240        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4241        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4242            self.0.request.name = v.into();
4243            self
4244        }
4245
4246        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4247        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4248            self.0.request.filter = v.into();
4249            self
4250        }
4251
4252        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4253        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4254            self.0.request.page_size = v.into();
4255            self
4256        }
4257
4258        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
4259        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4260            self.0.request.page_token = v.into();
4261            self
4262        }
4263    }
4264
4265    #[doc(hidden)]
4266    impl gax::options::internal::RequestBuilder for ListLocations {
4267        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4268            &mut self.0.options
4269        }
4270    }
4271
4272    /// The request builder for [Conversations::get_location][crate::client::Conversations::get_location] calls.
4273    ///
4274    /// # Example
4275    /// ```no_run
4276    /// # use google_cloud_dialogflow_v2::builder;
4277    /// use builder::conversations::GetLocation;
4278    /// # tokio_test::block_on(async {
4279    ///
4280    /// let builder = prepare_request_builder();
4281    /// let response = builder.send().await?;
4282    /// # gax::Result::<()>::Ok(()) });
4283    ///
4284    /// fn prepare_request_builder() -> GetLocation {
4285    ///   # panic!();
4286    ///   // ... details omitted ...
4287    /// }
4288    /// ```
4289    #[derive(Clone, Debug)]
4290    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4291
4292    impl GetLocation {
4293        pub(crate) fn new(
4294            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4295        ) -> Self {
4296            Self(RequestBuilder::new(stub))
4297        }
4298
4299        /// Sets the full request, replacing any prior values.
4300        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4301            self.0.request = v.into();
4302            self
4303        }
4304
4305        /// Sets all the options, replacing any prior values.
4306        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4307            self.0.options = v.into();
4308            self
4309        }
4310
4311        /// Sends the request.
4312        pub async fn send(self) -> Result<location::model::Location> {
4313            (*self.0.stub)
4314                .get_location(self.0.request, self.0.options)
4315                .await
4316                .map(gax::response::Response::into_body)
4317        }
4318
4319        /// Sets the value of [name][location::model::GetLocationRequest::name].
4320        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4321            self.0.request.name = v.into();
4322            self
4323        }
4324    }
4325
4326    #[doc(hidden)]
4327    impl gax::options::internal::RequestBuilder for GetLocation {
4328        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4329            &mut self.0.options
4330        }
4331    }
4332
4333    /// The request builder for [Conversations::list_operations][crate::client::Conversations::list_operations] calls.
4334    ///
4335    /// # Example
4336    /// ```no_run
4337    /// # use google_cloud_dialogflow_v2::builder;
4338    /// use builder::conversations::ListOperations;
4339    /// # tokio_test::block_on(async {
4340    /// use gax::paginator::ItemPaginator;
4341    ///
4342    /// let builder = prepare_request_builder();
4343    /// let mut items = builder.by_item();
4344    /// while let Some(result) = items.next().await {
4345    ///   let item = result?;
4346    /// }
4347    /// # gax::Result::<()>::Ok(()) });
4348    ///
4349    /// fn prepare_request_builder() -> ListOperations {
4350    ///   # panic!();
4351    ///   // ... details omitted ...
4352    /// }
4353    /// ```
4354    #[derive(Clone, Debug)]
4355    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4356
4357    impl ListOperations {
4358        pub(crate) fn new(
4359            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4360        ) -> Self {
4361            Self(RequestBuilder::new(stub))
4362        }
4363
4364        /// Sets the full request, replacing any prior values.
4365        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4366            mut self,
4367            v: V,
4368        ) -> Self {
4369            self.0.request = v.into();
4370            self
4371        }
4372
4373        /// Sets all the options, replacing any prior values.
4374        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4375            self.0.options = v.into();
4376            self
4377        }
4378
4379        /// Sends the request.
4380        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4381            (*self.0.stub)
4382                .list_operations(self.0.request, self.0.options)
4383                .await
4384                .map(gax::response::Response::into_body)
4385        }
4386
4387        /// Streams each page in the collection.
4388        pub fn by_page(
4389            self,
4390        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4391        {
4392            use std::clone::Clone;
4393            let token = self.0.request.page_token.clone();
4394            let execute = move |token: String| {
4395                let mut builder = self.clone();
4396                builder.0.request = builder.0.request.set_page_token(token);
4397                builder.send()
4398            };
4399            gax::paginator::internal::new_paginator(token, execute)
4400        }
4401
4402        /// Streams each item in the collection.
4403        pub fn by_item(
4404            self,
4405        ) -> impl gax::paginator::ItemPaginator<
4406            longrunning::model::ListOperationsResponse,
4407            gax::error::Error,
4408        > {
4409            use gax::paginator::Paginator;
4410            self.by_page().items()
4411        }
4412
4413        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4414        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4415            self.0.request.name = v.into();
4416            self
4417        }
4418
4419        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4420        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4421            self.0.request.filter = v.into();
4422            self
4423        }
4424
4425        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4426        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4427            self.0.request.page_size = v.into();
4428            self
4429        }
4430
4431        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4432        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4433            self.0.request.page_token = v.into();
4434            self
4435        }
4436
4437        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
4438        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4439            self.0.request.return_partial_success = v.into();
4440            self
4441        }
4442    }
4443
4444    #[doc(hidden)]
4445    impl gax::options::internal::RequestBuilder for ListOperations {
4446        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4447            &mut self.0.options
4448        }
4449    }
4450
4451    /// The request builder for [Conversations::get_operation][crate::client::Conversations::get_operation] calls.
4452    ///
4453    /// # Example
4454    /// ```no_run
4455    /// # use google_cloud_dialogflow_v2::builder;
4456    /// use builder::conversations::GetOperation;
4457    /// # tokio_test::block_on(async {
4458    ///
4459    /// let builder = prepare_request_builder();
4460    /// let response = builder.send().await?;
4461    /// # gax::Result::<()>::Ok(()) });
4462    ///
4463    /// fn prepare_request_builder() -> GetOperation {
4464    ///   # panic!();
4465    ///   // ... details omitted ...
4466    /// }
4467    /// ```
4468    #[derive(Clone, Debug)]
4469    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4470
4471    impl GetOperation {
4472        pub(crate) fn new(
4473            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4474        ) -> Self {
4475            Self(RequestBuilder::new(stub))
4476        }
4477
4478        /// Sets the full request, replacing any prior values.
4479        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4480            mut self,
4481            v: V,
4482        ) -> Self {
4483            self.0.request = v.into();
4484            self
4485        }
4486
4487        /// Sets all the options, replacing any prior values.
4488        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4489            self.0.options = v.into();
4490            self
4491        }
4492
4493        /// Sends the request.
4494        pub async fn send(self) -> Result<longrunning::model::Operation> {
4495            (*self.0.stub)
4496                .get_operation(self.0.request, self.0.options)
4497                .await
4498                .map(gax::response::Response::into_body)
4499        }
4500
4501        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
4502        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4503            self.0.request.name = v.into();
4504            self
4505        }
4506    }
4507
4508    #[doc(hidden)]
4509    impl gax::options::internal::RequestBuilder for GetOperation {
4510        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4511            &mut self.0.options
4512        }
4513    }
4514
4515    /// The request builder for [Conversations::cancel_operation][crate::client::Conversations::cancel_operation] calls.
4516    ///
4517    /// # Example
4518    /// ```no_run
4519    /// # use google_cloud_dialogflow_v2::builder;
4520    /// use builder::conversations::CancelOperation;
4521    /// # tokio_test::block_on(async {
4522    ///
4523    /// let builder = prepare_request_builder();
4524    /// let response = builder.send().await?;
4525    /// # gax::Result::<()>::Ok(()) });
4526    ///
4527    /// fn prepare_request_builder() -> CancelOperation {
4528    ///   # panic!();
4529    ///   // ... details omitted ...
4530    /// }
4531    /// ```
4532    #[derive(Clone, Debug)]
4533    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4534
4535    impl CancelOperation {
4536        pub(crate) fn new(
4537            stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4538        ) -> Self {
4539            Self(RequestBuilder::new(stub))
4540        }
4541
4542        /// Sets the full request, replacing any prior values.
4543        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4544            mut self,
4545            v: V,
4546        ) -> Self {
4547            self.0.request = v.into();
4548            self
4549        }
4550
4551        /// Sets all the options, replacing any prior values.
4552        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4553            self.0.options = v.into();
4554            self
4555        }
4556
4557        /// Sends the request.
4558        pub async fn send(self) -> Result<()> {
4559            (*self.0.stub)
4560                .cancel_operation(self.0.request, self.0.options)
4561                .await
4562                .map(gax::response::Response::into_body)
4563        }
4564
4565        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
4566        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4567            self.0.request.name = v.into();
4568            self
4569        }
4570    }
4571
4572    #[doc(hidden)]
4573    impl gax::options::internal::RequestBuilder for CancelOperation {
4574        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4575            &mut self.0.options
4576        }
4577    }
4578}
4579
4580#[cfg(feature = "conversation-datasets")]
4581#[cfg_attr(docsrs, doc(cfg(feature = "conversation-datasets")))]
4582pub mod conversation_datasets {
4583    use crate::Result;
4584
4585    /// A builder for [ConversationDatasets][crate::client::ConversationDatasets].
4586    ///
4587    /// ```
4588    /// # tokio_test::block_on(async {
4589    /// # use google_cloud_dialogflow_v2::*;
4590    /// # use builder::conversation_datasets::ClientBuilder;
4591    /// # use client::ConversationDatasets;
4592    /// let builder : ClientBuilder = ConversationDatasets::builder();
4593    /// let client = builder
4594    ///     .with_endpoint("https://dialogflow.googleapis.com")
4595    ///     .build().await?;
4596    /// # gax::client_builder::Result::<()>::Ok(()) });
4597    /// ```
4598    pub type ClientBuilder =
4599        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4600
4601    pub(crate) mod client {
4602        use super::super::super::client::ConversationDatasets;
4603        pub struct Factory;
4604        impl gax::client_builder::internal::ClientFactory for Factory {
4605            type Client = ConversationDatasets;
4606            type Credentials = gaxi::options::Credentials;
4607            async fn build(
4608                self,
4609                config: gaxi::options::ClientConfig,
4610            ) -> gax::client_builder::Result<Self::Client> {
4611                Self::Client::new(config).await
4612            }
4613        }
4614    }
4615
4616    /// Common implementation for [crate::client::ConversationDatasets] request builders.
4617    #[derive(Clone, Debug)]
4618    pub(crate) struct RequestBuilder<R: std::default::Default> {
4619        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4620        request: R,
4621        options: gax::options::RequestOptions,
4622    }
4623
4624    impl<R> RequestBuilder<R>
4625    where
4626        R: std::default::Default,
4627    {
4628        pub(crate) fn new(
4629            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4630        ) -> Self {
4631            Self {
4632                stub,
4633                request: R::default(),
4634                options: gax::options::RequestOptions::default(),
4635            }
4636        }
4637    }
4638
4639    /// The request builder for [ConversationDatasets::create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset] calls.
4640    ///
4641    /// # Example
4642    /// ```no_run
4643    /// # use google_cloud_dialogflow_v2::builder;
4644    /// use builder::conversation_datasets::CreateConversationDataset;
4645    /// # tokio_test::block_on(async {
4646    /// use lro::Poller;
4647    ///
4648    /// let builder = prepare_request_builder();
4649    /// let response = builder.poller().until_done().await?;
4650    /// # gax::Result::<()>::Ok(()) });
4651    ///
4652    /// fn prepare_request_builder() -> CreateConversationDataset {
4653    ///   # panic!();
4654    ///   // ... details omitted ...
4655    /// }
4656    /// ```
4657    #[derive(Clone, Debug)]
4658    pub struct CreateConversationDataset(
4659        RequestBuilder<crate::model::CreateConversationDatasetRequest>,
4660    );
4661
4662    impl CreateConversationDataset {
4663        pub(crate) fn new(
4664            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4665        ) -> Self {
4666            Self(RequestBuilder::new(stub))
4667        }
4668
4669        /// Sets the full request, replacing any prior values.
4670        pub fn with_request<V: Into<crate::model::CreateConversationDatasetRequest>>(
4671            mut self,
4672            v: V,
4673        ) -> Self {
4674            self.0.request = v.into();
4675            self
4676        }
4677
4678        /// Sets all the options, replacing any prior values.
4679        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4680            self.0.options = v.into();
4681            self
4682        }
4683
4684        /// Sends the request.
4685        ///
4686        /// # Long running operations
4687        ///
4688        /// This starts, but does not poll, a longrunning operation. More information
4689        /// on [create_conversation_dataset][crate::client::ConversationDatasets::create_conversation_dataset].
4690        pub async fn send(self) -> Result<longrunning::model::Operation> {
4691            (*self.0.stub)
4692                .create_conversation_dataset(self.0.request, self.0.options)
4693                .await
4694                .map(gax::response::Response::into_body)
4695        }
4696
4697        /// Creates a [Poller][lro::Poller] to work with `create_conversation_dataset`.
4698        pub fn poller(
4699            self,
4700        ) -> impl lro::Poller<
4701            crate::model::ConversationDataset,
4702            crate::model::CreateConversationDatasetOperationMetadata,
4703        > {
4704            type Operation = lro::internal::Operation<
4705                crate::model::ConversationDataset,
4706                crate::model::CreateConversationDatasetOperationMetadata,
4707            >;
4708            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4709            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4710
4711            let stub = self.0.stub.clone();
4712            let mut options = self.0.options.clone();
4713            options.set_retry_policy(gax::retry_policy::NeverRetry);
4714            let query = move |name| {
4715                let stub = stub.clone();
4716                let options = options.clone();
4717                async {
4718                    let op = GetOperation::new(stub)
4719                        .set_name(name)
4720                        .with_options(options)
4721                        .send()
4722                        .await?;
4723                    Ok(Operation::new(op))
4724                }
4725            };
4726
4727            let start = move || async {
4728                let op = self.send().await?;
4729                Ok(Operation::new(op))
4730            };
4731
4732            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4733        }
4734
4735        /// Sets the value of [parent][crate::model::CreateConversationDatasetRequest::parent].
4736        ///
4737        /// This is a **required** field for requests.
4738        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4739            self.0.request.parent = v.into();
4740            self
4741        }
4742
4743        /// Sets the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4744        ///
4745        /// This is a **required** field for requests.
4746        pub fn set_conversation_dataset<T>(mut self, v: T) -> Self
4747        where
4748            T: std::convert::Into<crate::model::ConversationDataset>,
4749        {
4750            self.0.request.conversation_dataset = std::option::Option::Some(v.into());
4751            self
4752        }
4753
4754        /// Sets or clears the value of [conversation_dataset][crate::model::CreateConversationDatasetRequest::conversation_dataset].
4755        ///
4756        /// This is a **required** field for requests.
4757        pub fn set_or_clear_conversation_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4758        where
4759            T: std::convert::Into<crate::model::ConversationDataset>,
4760        {
4761            self.0.request.conversation_dataset = v.map(|x| x.into());
4762            self
4763        }
4764    }
4765
4766    #[doc(hidden)]
4767    impl gax::options::internal::RequestBuilder for CreateConversationDataset {
4768        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4769            &mut self.0.options
4770        }
4771    }
4772
4773    /// The request builder for [ConversationDatasets::get_conversation_dataset][crate::client::ConversationDatasets::get_conversation_dataset] calls.
4774    ///
4775    /// # Example
4776    /// ```no_run
4777    /// # use google_cloud_dialogflow_v2::builder;
4778    /// use builder::conversation_datasets::GetConversationDataset;
4779    /// # tokio_test::block_on(async {
4780    ///
4781    /// let builder = prepare_request_builder();
4782    /// let response = builder.send().await?;
4783    /// # gax::Result::<()>::Ok(()) });
4784    ///
4785    /// fn prepare_request_builder() -> GetConversationDataset {
4786    ///   # panic!();
4787    ///   // ... details omitted ...
4788    /// }
4789    /// ```
4790    #[derive(Clone, Debug)]
4791    pub struct GetConversationDataset(RequestBuilder<crate::model::GetConversationDatasetRequest>);
4792
4793    impl GetConversationDataset {
4794        pub(crate) fn new(
4795            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4796        ) -> Self {
4797            Self(RequestBuilder::new(stub))
4798        }
4799
4800        /// Sets the full request, replacing any prior values.
4801        pub fn with_request<V: Into<crate::model::GetConversationDatasetRequest>>(
4802            mut self,
4803            v: V,
4804        ) -> Self {
4805            self.0.request = v.into();
4806            self
4807        }
4808
4809        /// Sets all the options, replacing any prior values.
4810        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4811            self.0.options = v.into();
4812            self
4813        }
4814
4815        /// Sends the request.
4816        pub async fn send(self) -> Result<crate::model::ConversationDataset> {
4817            (*self.0.stub)
4818                .get_conversation_dataset(self.0.request, self.0.options)
4819                .await
4820                .map(gax::response::Response::into_body)
4821        }
4822
4823        /// Sets the value of [name][crate::model::GetConversationDatasetRequest::name].
4824        ///
4825        /// This is a **required** field for requests.
4826        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4827            self.0.request.name = v.into();
4828            self
4829        }
4830    }
4831
4832    #[doc(hidden)]
4833    impl gax::options::internal::RequestBuilder for GetConversationDataset {
4834        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4835            &mut self.0.options
4836        }
4837    }
4838
4839    /// The request builder for [ConversationDatasets::list_conversation_datasets][crate::client::ConversationDatasets::list_conversation_datasets] calls.
4840    ///
4841    /// # Example
4842    /// ```no_run
4843    /// # use google_cloud_dialogflow_v2::builder;
4844    /// use builder::conversation_datasets::ListConversationDatasets;
4845    /// # tokio_test::block_on(async {
4846    /// use gax::paginator::ItemPaginator;
4847    ///
4848    /// let builder = prepare_request_builder();
4849    /// let mut items = builder.by_item();
4850    /// while let Some(result) = items.next().await {
4851    ///   let item = result?;
4852    /// }
4853    /// # gax::Result::<()>::Ok(()) });
4854    ///
4855    /// fn prepare_request_builder() -> ListConversationDatasets {
4856    ///   # panic!();
4857    ///   // ... details omitted ...
4858    /// }
4859    /// ```
4860    #[derive(Clone, Debug)]
4861    pub struct ListConversationDatasets(
4862        RequestBuilder<crate::model::ListConversationDatasetsRequest>,
4863    );
4864
4865    impl ListConversationDatasets {
4866        pub(crate) fn new(
4867            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4868        ) -> Self {
4869            Self(RequestBuilder::new(stub))
4870        }
4871
4872        /// Sets the full request, replacing any prior values.
4873        pub fn with_request<V: Into<crate::model::ListConversationDatasetsRequest>>(
4874            mut self,
4875            v: V,
4876        ) -> Self {
4877            self.0.request = v.into();
4878            self
4879        }
4880
4881        /// Sets all the options, replacing any prior values.
4882        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4883            self.0.options = v.into();
4884            self
4885        }
4886
4887        /// Sends the request.
4888        pub async fn send(self) -> Result<crate::model::ListConversationDatasetsResponse> {
4889            (*self.0.stub)
4890                .list_conversation_datasets(self.0.request, self.0.options)
4891                .await
4892                .map(gax::response::Response::into_body)
4893        }
4894
4895        /// Streams each page in the collection.
4896        pub fn by_page(
4897            self,
4898        ) -> impl gax::paginator::Paginator<
4899            crate::model::ListConversationDatasetsResponse,
4900            gax::error::Error,
4901        > {
4902            use std::clone::Clone;
4903            let token = self.0.request.page_token.clone();
4904            let execute = move |token: String| {
4905                let mut builder = self.clone();
4906                builder.0.request = builder.0.request.set_page_token(token);
4907                builder.send()
4908            };
4909            gax::paginator::internal::new_paginator(token, execute)
4910        }
4911
4912        /// Streams each item in the collection.
4913        pub fn by_item(
4914            self,
4915        ) -> impl gax::paginator::ItemPaginator<
4916            crate::model::ListConversationDatasetsResponse,
4917            gax::error::Error,
4918        > {
4919            use gax::paginator::Paginator;
4920            self.by_page().items()
4921        }
4922
4923        /// Sets the value of [parent][crate::model::ListConversationDatasetsRequest::parent].
4924        ///
4925        /// This is a **required** field for requests.
4926        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4927            self.0.request.parent = v.into();
4928            self
4929        }
4930
4931        /// Sets the value of [page_size][crate::model::ListConversationDatasetsRequest::page_size].
4932        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4933            self.0.request.page_size = v.into();
4934            self
4935        }
4936
4937        /// Sets the value of [page_token][crate::model::ListConversationDatasetsRequest::page_token].
4938        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4939            self.0.request.page_token = v.into();
4940            self
4941        }
4942    }
4943
4944    #[doc(hidden)]
4945    impl gax::options::internal::RequestBuilder for ListConversationDatasets {
4946        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4947            &mut self.0.options
4948        }
4949    }
4950
4951    /// The request builder for [ConversationDatasets::delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset] calls.
4952    ///
4953    /// # Example
4954    /// ```no_run
4955    /// # use google_cloud_dialogflow_v2::builder;
4956    /// use builder::conversation_datasets::DeleteConversationDataset;
4957    /// # tokio_test::block_on(async {
4958    /// use lro::Poller;
4959    ///
4960    /// let builder = prepare_request_builder();
4961    /// let response = builder.poller().until_done().await?;
4962    /// # gax::Result::<()>::Ok(()) });
4963    ///
4964    /// fn prepare_request_builder() -> DeleteConversationDataset {
4965    ///   # panic!();
4966    ///   // ... details omitted ...
4967    /// }
4968    /// ```
4969    #[derive(Clone, Debug)]
4970    pub struct DeleteConversationDataset(
4971        RequestBuilder<crate::model::DeleteConversationDatasetRequest>,
4972    );
4973
4974    impl DeleteConversationDataset {
4975        pub(crate) fn new(
4976            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4977        ) -> Self {
4978            Self(RequestBuilder::new(stub))
4979        }
4980
4981        /// Sets the full request, replacing any prior values.
4982        pub fn with_request<V: Into<crate::model::DeleteConversationDatasetRequest>>(
4983            mut self,
4984            v: V,
4985        ) -> Self {
4986            self.0.request = v.into();
4987            self
4988        }
4989
4990        /// Sets all the options, replacing any prior values.
4991        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4992            self.0.options = v.into();
4993            self
4994        }
4995
4996        /// Sends the request.
4997        ///
4998        /// # Long running operations
4999        ///
5000        /// This starts, but does not poll, a longrunning operation. More information
5001        /// on [delete_conversation_dataset][crate::client::ConversationDatasets::delete_conversation_dataset].
5002        pub async fn send(self) -> Result<longrunning::model::Operation> {
5003            (*self.0.stub)
5004                .delete_conversation_dataset(self.0.request, self.0.options)
5005                .await
5006                .map(gax::response::Response::into_body)
5007        }
5008
5009        /// Creates a [Poller][lro::Poller] to work with `delete_conversation_dataset`.
5010        pub fn poller(
5011            self,
5012        ) -> impl lro::Poller<(), crate::model::DeleteConversationDatasetOperationMetadata>
5013        {
5014            type Operation = lro::internal::Operation<
5015                wkt::Empty,
5016                crate::model::DeleteConversationDatasetOperationMetadata,
5017            >;
5018            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5019            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5020
5021            let stub = self.0.stub.clone();
5022            let mut options = self.0.options.clone();
5023            options.set_retry_policy(gax::retry_policy::NeverRetry);
5024            let query = move |name| {
5025                let stub = stub.clone();
5026                let options = options.clone();
5027                async {
5028                    let op = GetOperation::new(stub)
5029                        .set_name(name)
5030                        .with_options(options)
5031                        .send()
5032                        .await?;
5033                    Ok(Operation::new(op))
5034                }
5035            };
5036
5037            let start = move || async {
5038                let op = self.send().await?;
5039                Ok(Operation::new(op))
5040            };
5041
5042            lro::internal::new_unit_response_poller(
5043                polling_error_policy,
5044                polling_backoff_policy,
5045                start,
5046                query,
5047            )
5048        }
5049
5050        /// Sets the value of [name][crate::model::DeleteConversationDatasetRequest::name].
5051        ///
5052        /// This is a **required** field for requests.
5053        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5054            self.0.request.name = v.into();
5055            self
5056        }
5057    }
5058
5059    #[doc(hidden)]
5060    impl gax::options::internal::RequestBuilder for DeleteConversationDataset {
5061        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5062            &mut self.0.options
5063        }
5064    }
5065
5066    /// The request builder for [ConversationDatasets::import_conversation_data][crate::client::ConversationDatasets::import_conversation_data] calls.
5067    ///
5068    /// # Example
5069    /// ```no_run
5070    /// # use google_cloud_dialogflow_v2::builder;
5071    /// use builder::conversation_datasets::ImportConversationData;
5072    /// # tokio_test::block_on(async {
5073    /// use lro::Poller;
5074    ///
5075    /// let builder = prepare_request_builder();
5076    /// let response = builder.poller().until_done().await?;
5077    /// # gax::Result::<()>::Ok(()) });
5078    ///
5079    /// fn prepare_request_builder() -> ImportConversationData {
5080    ///   # panic!();
5081    ///   // ... details omitted ...
5082    /// }
5083    /// ```
5084    #[derive(Clone, Debug)]
5085    pub struct ImportConversationData(RequestBuilder<crate::model::ImportConversationDataRequest>);
5086
5087    impl ImportConversationData {
5088        pub(crate) fn new(
5089            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5090        ) -> Self {
5091            Self(RequestBuilder::new(stub))
5092        }
5093
5094        /// Sets the full request, replacing any prior values.
5095        pub fn with_request<V: Into<crate::model::ImportConversationDataRequest>>(
5096            mut self,
5097            v: V,
5098        ) -> Self {
5099            self.0.request = v.into();
5100            self
5101        }
5102
5103        /// Sets all the options, replacing any prior values.
5104        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5105            self.0.options = v.into();
5106            self
5107        }
5108
5109        /// Sends the request.
5110        ///
5111        /// # Long running operations
5112        ///
5113        /// This starts, but does not poll, a longrunning operation. More information
5114        /// on [import_conversation_data][crate::client::ConversationDatasets::import_conversation_data].
5115        pub async fn send(self) -> Result<longrunning::model::Operation> {
5116            (*self.0.stub)
5117                .import_conversation_data(self.0.request, self.0.options)
5118                .await
5119                .map(gax::response::Response::into_body)
5120        }
5121
5122        /// Creates a [Poller][lro::Poller] to work with `import_conversation_data`.
5123        pub fn poller(
5124            self,
5125        ) -> impl lro::Poller<
5126            crate::model::ImportConversationDataOperationResponse,
5127            crate::model::ImportConversationDataOperationMetadata,
5128        > {
5129            type Operation = lro::internal::Operation<
5130                crate::model::ImportConversationDataOperationResponse,
5131                crate::model::ImportConversationDataOperationMetadata,
5132            >;
5133            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5134            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5135
5136            let stub = self.0.stub.clone();
5137            let mut options = self.0.options.clone();
5138            options.set_retry_policy(gax::retry_policy::NeverRetry);
5139            let query = move |name| {
5140                let stub = stub.clone();
5141                let options = options.clone();
5142                async {
5143                    let op = GetOperation::new(stub)
5144                        .set_name(name)
5145                        .with_options(options)
5146                        .send()
5147                        .await?;
5148                    Ok(Operation::new(op))
5149                }
5150            };
5151
5152            let start = move || async {
5153                let op = self.send().await?;
5154                Ok(Operation::new(op))
5155            };
5156
5157            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5158        }
5159
5160        /// Sets the value of [name][crate::model::ImportConversationDataRequest::name].
5161        ///
5162        /// This is a **required** field for requests.
5163        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5164            self.0.request.name = v.into();
5165            self
5166        }
5167
5168        /// Sets the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5169        ///
5170        /// This is a **required** field for requests.
5171        pub fn set_input_config<T>(mut self, v: T) -> Self
5172        where
5173            T: std::convert::Into<crate::model::InputConfig>,
5174        {
5175            self.0.request.input_config = std::option::Option::Some(v.into());
5176            self
5177        }
5178
5179        /// Sets or clears the value of [input_config][crate::model::ImportConversationDataRequest::input_config].
5180        ///
5181        /// This is a **required** field for requests.
5182        pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5183        where
5184            T: std::convert::Into<crate::model::InputConfig>,
5185        {
5186            self.0.request.input_config = v.map(|x| x.into());
5187            self
5188        }
5189    }
5190
5191    #[doc(hidden)]
5192    impl gax::options::internal::RequestBuilder for ImportConversationData {
5193        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5194            &mut self.0.options
5195        }
5196    }
5197
5198    /// The request builder for [ConversationDatasets::list_locations][crate::client::ConversationDatasets::list_locations] calls.
5199    ///
5200    /// # Example
5201    /// ```no_run
5202    /// # use google_cloud_dialogflow_v2::builder;
5203    /// use builder::conversation_datasets::ListLocations;
5204    /// # tokio_test::block_on(async {
5205    /// use gax::paginator::ItemPaginator;
5206    ///
5207    /// let builder = prepare_request_builder();
5208    /// let mut items = builder.by_item();
5209    /// while let Some(result) = items.next().await {
5210    ///   let item = result?;
5211    /// }
5212    /// # gax::Result::<()>::Ok(()) });
5213    ///
5214    /// fn prepare_request_builder() -> ListLocations {
5215    ///   # panic!();
5216    ///   // ... details omitted ...
5217    /// }
5218    /// ```
5219    #[derive(Clone, Debug)]
5220    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5221
5222    impl ListLocations {
5223        pub(crate) fn new(
5224            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5225        ) -> Self {
5226            Self(RequestBuilder::new(stub))
5227        }
5228
5229        /// Sets the full request, replacing any prior values.
5230        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5231            mut self,
5232            v: V,
5233        ) -> Self {
5234            self.0.request = v.into();
5235            self
5236        }
5237
5238        /// Sets all the options, replacing any prior values.
5239        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5240            self.0.options = v.into();
5241            self
5242        }
5243
5244        /// Sends the request.
5245        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5246            (*self.0.stub)
5247                .list_locations(self.0.request, self.0.options)
5248                .await
5249                .map(gax::response::Response::into_body)
5250        }
5251
5252        /// Streams each page in the collection.
5253        pub fn by_page(
5254            self,
5255        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5256        {
5257            use std::clone::Clone;
5258            let token = self.0.request.page_token.clone();
5259            let execute = move |token: String| {
5260                let mut builder = self.clone();
5261                builder.0.request = builder.0.request.set_page_token(token);
5262                builder.send()
5263            };
5264            gax::paginator::internal::new_paginator(token, execute)
5265        }
5266
5267        /// Streams each item in the collection.
5268        pub fn by_item(
5269            self,
5270        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5271        {
5272            use gax::paginator::Paginator;
5273            self.by_page().items()
5274        }
5275
5276        /// Sets the value of [name][location::model::ListLocationsRequest::name].
5277        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5278            self.0.request.name = v.into();
5279            self
5280        }
5281
5282        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
5283        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5284            self.0.request.filter = v.into();
5285            self
5286        }
5287
5288        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
5289        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5290            self.0.request.page_size = v.into();
5291            self
5292        }
5293
5294        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
5295        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5296            self.0.request.page_token = v.into();
5297            self
5298        }
5299    }
5300
5301    #[doc(hidden)]
5302    impl gax::options::internal::RequestBuilder for ListLocations {
5303        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5304            &mut self.0.options
5305        }
5306    }
5307
5308    /// The request builder for [ConversationDatasets::get_location][crate::client::ConversationDatasets::get_location] calls.
5309    ///
5310    /// # Example
5311    /// ```no_run
5312    /// # use google_cloud_dialogflow_v2::builder;
5313    /// use builder::conversation_datasets::GetLocation;
5314    /// # tokio_test::block_on(async {
5315    ///
5316    /// let builder = prepare_request_builder();
5317    /// let response = builder.send().await?;
5318    /// # gax::Result::<()>::Ok(()) });
5319    ///
5320    /// fn prepare_request_builder() -> GetLocation {
5321    ///   # panic!();
5322    ///   // ... details omitted ...
5323    /// }
5324    /// ```
5325    #[derive(Clone, Debug)]
5326    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5327
5328    impl GetLocation {
5329        pub(crate) fn new(
5330            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5331        ) -> Self {
5332            Self(RequestBuilder::new(stub))
5333        }
5334
5335        /// Sets the full request, replacing any prior values.
5336        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5337            self.0.request = v.into();
5338            self
5339        }
5340
5341        /// Sets all the options, replacing any prior values.
5342        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5343            self.0.options = v.into();
5344            self
5345        }
5346
5347        /// Sends the request.
5348        pub async fn send(self) -> Result<location::model::Location> {
5349            (*self.0.stub)
5350                .get_location(self.0.request, self.0.options)
5351                .await
5352                .map(gax::response::Response::into_body)
5353        }
5354
5355        /// Sets the value of [name][location::model::GetLocationRequest::name].
5356        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5357            self.0.request.name = v.into();
5358            self
5359        }
5360    }
5361
5362    #[doc(hidden)]
5363    impl gax::options::internal::RequestBuilder for GetLocation {
5364        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5365            &mut self.0.options
5366        }
5367    }
5368
5369    /// The request builder for [ConversationDatasets::list_operations][crate::client::ConversationDatasets::list_operations] calls.
5370    ///
5371    /// # Example
5372    /// ```no_run
5373    /// # use google_cloud_dialogflow_v2::builder;
5374    /// use builder::conversation_datasets::ListOperations;
5375    /// # tokio_test::block_on(async {
5376    /// use gax::paginator::ItemPaginator;
5377    ///
5378    /// let builder = prepare_request_builder();
5379    /// let mut items = builder.by_item();
5380    /// while let Some(result) = items.next().await {
5381    ///   let item = result?;
5382    /// }
5383    /// # gax::Result::<()>::Ok(()) });
5384    ///
5385    /// fn prepare_request_builder() -> ListOperations {
5386    ///   # panic!();
5387    ///   // ... details omitted ...
5388    /// }
5389    /// ```
5390    #[derive(Clone, Debug)]
5391    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5392
5393    impl ListOperations {
5394        pub(crate) fn new(
5395            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5396        ) -> Self {
5397            Self(RequestBuilder::new(stub))
5398        }
5399
5400        /// Sets the full request, replacing any prior values.
5401        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5402            mut self,
5403            v: V,
5404        ) -> Self {
5405            self.0.request = v.into();
5406            self
5407        }
5408
5409        /// Sets all the options, replacing any prior values.
5410        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5411            self.0.options = v.into();
5412            self
5413        }
5414
5415        /// Sends the request.
5416        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5417            (*self.0.stub)
5418                .list_operations(self.0.request, self.0.options)
5419                .await
5420                .map(gax::response::Response::into_body)
5421        }
5422
5423        /// Streams each page in the collection.
5424        pub fn by_page(
5425            self,
5426        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5427        {
5428            use std::clone::Clone;
5429            let token = self.0.request.page_token.clone();
5430            let execute = move |token: String| {
5431                let mut builder = self.clone();
5432                builder.0.request = builder.0.request.set_page_token(token);
5433                builder.send()
5434            };
5435            gax::paginator::internal::new_paginator(token, execute)
5436        }
5437
5438        /// Streams each item in the collection.
5439        pub fn by_item(
5440            self,
5441        ) -> impl gax::paginator::ItemPaginator<
5442            longrunning::model::ListOperationsResponse,
5443            gax::error::Error,
5444        > {
5445            use gax::paginator::Paginator;
5446            self.by_page().items()
5447        }
5448
5449        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
5450        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5451            self.0.request.name = v.into();
5452            self
5453        }
5454
5455        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
5456        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5457            self.0.request.filter = v.into();
5458            self
5459        }
5460
5461        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
5462        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5463            self.0.request.page_size = v.into();
5464            self
5465        }
5466
5467        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
5468        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5469            self.0.request.page_token = v.into();
5470            self
5471        }
5472
5473        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
5474        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5475            self.0.request.return_partial_success = v.into();
5476            self
5477        }
5478    }
5479
5480    #[doc(hidden)]
5481    impl gax::options::internal::RequestBuilder for ListOperations {
5482        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5483            &mut self.0.options
5484        }
5485    }
5486
5487    /// The request builder for [ConversationDatasets::get_operation][crate::client::ConversationDatasets::get_operation] calls.
5488    ///
5489    /// # Example
5490    /// ```no_run
5491    /// # use google_cloud_dialogflow_v2::builder;
5492    /// use builder::conversation_datasets::GetOperation;
5493    /// # tokio_test::block_on(async {
5494    ///
5495    /// let builder = prepare_request_builder();
5496    /// let response = builder.send().await?;
5497    /// # gax::Result::<()>::Ok(()) });
5498    ///
5499    /// fn prepare_request_builder() -> GetOperation {
5500    ///   # panic!();
5501    ///   // ... details omitted ...
5502    /// }
5503    /// ```
5504    #[derive(Clone, Debug)]
5505    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5506
5507    impl GetOperation {
5508        pub(crate) fn new(
5509            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5510        ) -> Self {
5511            Self(RequestBuilder::new(stub))
5512        }
5513
5514        /// Sets the full request, replacing any prior values.
5515        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5516            mut self,
5517            v: V,
5518        ) -> Self {
5519            self.0.request = v.into();
5520            self
5521        }
5522
5523        /// Sets all the options, replacing any prior values.
5524        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5525            self.0.options = v.into();
5526            self
5527        }
5528
5529        /// Sends the request.
5530        pub async fn send(self) -> Result<longrunning::model::Operation> {
5531            (*self.0.stub)
5532                .get_operation(self.0.request, self.0.options)
5533                .await
5534                .map(gax::response::Response::into_body)
5535        }
5536
5537        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
5538        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5539            self.0.request.name = v.into();
5540            self
5541        }
5542    }
5543
5544    #[doc(hidden)]
5545    impl gax::options::internal::RequestBuilder for GetOperation {
5546        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5547            &mut self.0.options
5548        }
5549    }
5550
5551    /// The request builder for [ConversationDatasets::cancel_operation][crate::client::ConversationDatasets::cancel_operation] calls.
5552    ///
5553    /// # Example
5554    /// ```no_run
5555    /// # use google_cloud_dialogflow_v2::builder;
5556    /// use builder::conversation_datasets::CancelOperation;
5557    /// # tokio_test::block_on(async {
5558    ///
5559    /// let builder = prepare_request_builder();
5560    /// let response = builder.send().await?;
5561    /// # gax::Result::<()>::Ok(()) });
5562    ///
5563    /// fn prepare_request_builder() -> CancelOperation {
5564    ///   # panic!();
5565    ///   // ... details omitted ...
5566    /// }
5567    /// ```
5568    #[derive(Clone, Debug)]
5569    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5570
5571    impl CancelOperation {
5572        pub(crate) fn new(
5573            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5574        ) -> Self {
5575            Self(RequestBuilder::new(stub))
5576        }
5577
5578        /// Sets the full request, replacing any prior values.
5579        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5580            mut self,
5581            v: V,
5582        ) -> Self {
5583            self.0.request = v.into();
5584            self
5585        }
5586
5587        /// Sets all the options, replacing any prior values.
5588        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5589            self.0.options = v.into();
5590            self
5591        }
5592
5593        /// Sends the request.
5594        pub async fn send(self) -> Result<()> {
5595            (*self.0.stub)
5596                .cancel_operation(self.0.request, self.0.options)
5597                .await
5598                .map(gax::response::Response::into_body)
5599        }
5600
5601        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
5602        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5603            self.0.request.name = v.into();
5604            self
5605        }
5606    }
5607
5608    #[doc(hidden)]
5609    impl gax::options::internal::RequestBuilder for CancelOperation {
5610        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5611            &mut self.0.options
5612        }
5613    }
5614}
5615
5616#[cfg(feature = "conversation-models")]
5617#[cfg_attr(docsrs, doc(cfg(feature = "conversation-models")))]
5618pub mod conversation_models {
5619    use crate::Result;
5620
5621    /// A builder for [ConversationModels][crate::client::ConversationModels].
5622    ///
5623    /// ```
5624    /// # tokio_test::block_on(async {
5625    /// # use google_cloud_dialogflow_v2::*;
5626    /// # use builder::conversation_models::ClientBuilder;
5627    /// # use client::ConversationModels;
5628    /// let builder : ClientBuilder = ConversationModels::builder();
5629    /// let client = builder
5630    ///     .with_endpoint("https://dialogflow.googleapis.com")
5631    ///     .build().await?;
5632    /// # gax::client_builder::Result::<()>::Ok(()) });
5633    /// ```
5634    pub type ClientBuilder =
5635        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5636
5637    pub(crate) mod client {
5638        use super::super::super::client::ConversationModels;
5639        pub struct Factory;
5640        impl gax::client_builder::internal::ClientFactory for Factory {
5641            type Client = ConversationModels;
5642            type Credentials = gaxi::options::Credentials;
5643            async fn build(
5644                self,
5645                config: gaxi::options::ClientConfig,
5646            ) -> gax::client_builder::Result<Self::Client> {
5647                Self::Client::new(config).await
5648            }
5649        }
5650    }
5651
5652    /// Common implementation for [crate::client::ConversationModels] request builders.
5653    #[derive(Clone, Debug)]
5654    pub(crate) struct RequestBuilder<R: std::default::Default> {
5655        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5656        request: R,
5657        options: gax::options::RequestOptions,
5658    }
5659
5660    impl<R> RequestBuilder<R>
5661    where
5662        R: std::default::Default,
5663    {
5664        pub(crate) fn new(
5665            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5666        ) -> Self {
5667            Self {
5668                stub,
5669                request: R::default(),
5670                options: gax::options::RequestOptions::default(),
5671            }
5672        }
5673    }
5674
5675    /// The request builder for [ConversationModels::create_conversation_model][crate::client::ConversationModels::create_conversation_model] calls.
5676    ///
5677    /// # Example
5678    /// ```no_run
5679    /// # use google_cloud_dialogflow_v2::builder;
5680    /// use builder::conversation_models::CreateConversationModel;
5681    /// # tokio_test::block_on(async {
5682    /// use lro::Poller;
5683    ///
5684    /// let builder = prepare_request_builder();
5685    /// let response = builder.poller().until_done().await?;
5686    /// # gax::Result::<()>::Ok(()) });
5687    ///
5688    /// fn prepare_request_builder() -> CreateConversationModel {
5689    ///   # panic!();
5690    ///   // ... details omitted ...
5691    /// }
5692    /// ```
5693    #[derive(Clone, Debug)]
5694    pub struct CreateConversationModel(
5695        RequestBuilder<crate::model::CreateConversationModelRequest>,
5696    );
5697
5698    impl CreateConversationModel {
5699        pub(crate) fn new(
5700            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5701        ) -> Self {
5702            Self(RequestBuilder::new(stub))
5703        }
5704
5705        /// Sets the full request, replacing any prior values.
5706        pub fn with_request<V: Into<crate::model::CreateConversationModelRequest>>(
5707            mut self,
5708            v: V,
5709        ) -> Self {
5710            self.0.request = v.into();
5711            self
5712        }
5713
5714        /// Sets all the options, replacing any prior values.
5715        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5716            self.0.options = v.into();
5717            self
5718        }
5719
5720        /// Sends the request.
5721        ///
5722        /// # Long running operations
5723        ///
5724        /// This starts, but does not poll, a longrunning operation. More information
5725        /// on [create_conversation_model][crate::client::ConversationModels::create_conversation_model].
5726        pub async fn send(self) -> Result<longrunning::model::Operation> {
5727            (*self.0.stub)
5728                .create_conversation_model(self.0.request, self.0.options)
5729                .await
5730                .map(gax::response::Response::into_body)
5731        }
5732
5733        /// Creates a [Poller][lro::Poller] to work with `create_conversation_model`.
5734        pub fn poller(
5735            self,
5736        ) -> impl lro::Poller<
5737            crate::model::ConversationModel,
5738            crate::model::CreateConversationModelOperationMetadata,
5739        > {
5740            type Operation = lro::internal::Operation<
5741                crate::model::ConversationModel,
5742                crate::model::CreateConversationModelOperationMetadata,
5743            >;
5744            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5745            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5746
5747            let stub = self.0.stub.clone();
5748            let mut options = self.0.options.clone();
5749            options.set_retry_policy(gax::retry_policy::NeverRetry);
5750            let query = move |name| {
5751                let stub = stub.clone();
5752                let options = options.clone();
5753                async {
5754                    let op = GetOperation::new(stub)
5755                        .set_name(name)
5756                        .with_options(options)
5757                        .send()
5758                        .await?;
5759                    Ok(Operation::new(op))
5760                }
5761            };
5762
5763            let start = move || async {
5764                let op = self.send().await?;
5765                Ok(Operation::new(op))
5766            };
5767
5768            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5769        }
5770
5771        /// Sets the value of [parent][crate::model::CreateConversationModelRequest::parent].
5772        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5773            self.0.request.parent = v.into();
5774            self
5775        }
5776
5777        /// Sets the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5778        ///
5779        /// This is a **required** field for requests.
5780        pub fn set_conversation_model<T>(mut self, v: T) -> Self
5781        where
5782            T: std::convert::Into<crate::model::ConversationModel>,
5783        {
5784            self.0.request.conversation_model = std::option::Option::Some(v.into());
5785            self
5786        }
5787
5788        /// Sets or clears the value of [conversation_model][crate::model::CreateConversationModelRequest::conversation_model].
5789        ///
5790        /// This is a **required** field for requests.
5791        pub fn set_or_clear_conversation_model<T>(mut self, v: std::option::Option<T>) -> Self
5792        where
5793            T: std::convert::Into<crate::model::ConversationModel>,
5794        {
5795            self.0.request.conversation_model = v.map(|x| x.into());
5796            self
5797        }
5798    }
5799
5800    #[doc(hidden)]
5801    impl gax::options::internal::RequestBuilder for CreateConversationModel {
5802        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5803            &mut self.0.options
5804        }
5805    }
5806
5807    /// The request builder for [ConversationModels::get_conversation_model][crate::client::ConversationModels::get_conversation_model] calls.
5808    ///
5809    /// # Example
5810    /// ```no_run
5811    /// # use google_cloud_dialogflow_v2::builder;
5812    /// use builder::conversation_models::GetConversationModel;
5813    /// # tokio_test::block_on(async {
5814    ///
5815    /// let builder = prepare_request_builder();
5816    /// let response = builder.send().await?;
5817    /// # gax::Result::<()>::Ok(()) });
5818    ///
5819    /// fn prepare_request_builder() -> GetConversationModel {
5820    ///   # panic!();
5821    ///   // ... details omitted ...
5822    /// }
5823    /// ```
5824    #[derive(Clone, Debug)]
5825    pub struct GetConversationModel(RequestBuilder<crate::model::GetConversationModelRequest>);
5826
5827    impl GetConversationModel {
5828        pub(crate) fn new(
5829            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5830        ) -> Self {
5831            Self(RequestBuilder::new(stub))
5832        }
5833
5834        /// Sets the full request, replacing any prior values.
5835        pub fn with_request<V: Into<crate::model::GetConversationModelRequest>>(
5836            mut self,
5837            v: V,
5838        ) -> Self {
5839            self.0.request = v.into();
5840            self
5841        }
5842
5843        /// Sets all the options, replacing any prior values.
5844        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5845            self.0.options = v.into();
5846            self
5847        }
5848
5849        /// Sends the request.
5850        pub async fn send(self) -> Result<crate::model::ConversationModel> {
5851            (*self.0.stub)
5852                .get_conversation_model(self.0.request, self.0.options)
5853                .await
5854                .map(gax::response::Response::into_body)
5855        }
5856
5857        /// Sets the value of [name][crate::model::GetConversationModelRequest::name].
5858        ///
5859        /// This is a **required** field for requests.
5860        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5861            self.0.request.name = v.into();
5862            self
5863        }
5864    }
5865
5866    #[doc(hidden)]
5867    impl gax::options::internal::RequestBuilder for GetConversationModel {
5868        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5869            &mut self.0.options
5870        }
5871    }
5872
5873    /// The request builder for [ConversationModels::list_conversation_models][crate::client::ConversationModels::list_conversation_models] calls.
5874    ///
5875    /// # Example
5876    /// ```no_run
5877    /// # use google_cloud_dialogflow_v2::builder;
5878    /// use builder::conversation_models::ListConversationModels;
5879    /// # tokio_test::block_on(async {
5880    /// use gax::paginator::ItemPaginator;
5881    ///
5882    /// let builder = prepare_request_builder();
5883    /// let mut items = builder.by_item();
5884    /// while let Some(result) = items.next().await {
5885    ///   let item = result?;
5886    /// }
5887    /// # gax::Result::<()>::Ok(()) });
5888    ///
5889    /// fn prepare_request_builder() -> ListConversationModels {
5890    ///   # panic!();
5891    ///   // ... details omitted ...
5892    /// }
5893    /// ```
5894    #[derive(Clone, Debug)]
5895    pub struct ListConversationModels(RequestBuilder<crate::model::ListConversationModelsRequest>);
5896
5897    impl ListConversationModels {
5898        pub(crate) fn new(
5899            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5900        ) -> Self {
5901            Self(RequestBuilder::new(stub))
5902        }
5903
5904        /// Sets the full request, replacing any prior values.
5905        pub fn with_request<V: Into<crate::model::ListConversationModelsRequest>>(
5906            mut self,
5907            v: V,
5908        ) -> Self {
5909            self.0.request = v.into();
5910            self
5911        }
5912
5913        /// Sets all the options, replacing any prior values.
5914        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5915            self.0.options = v.into();
5916            self
5917        }
5918
5919        /// Sends the request.
5920        pub async fn send(self) -> Result<crate::model::ListConversationModelsResponse> {
5921            (*self.0.stub)
5922                .list_conversation_models(self.0.request, self.0.options)
5923                .await
5924                .map(gax::response::Response::into_body)
5925        }
5926
5927        /// Streams each page in the collection.
5928        pub fn by_page(
5929            self,
5930        ) -> impl gax::paginator::Paginator<
5931            crate::model::ListConversationModelsResponse,
5932            gax::error::Error,
5933        > {
5934            use std::clone::Clone;
5935            let token = self.0.request.page_token.clone();
5936            let execute = move |token: String| {
5937                let mut builder = self.clone();
5938                builder.0.request = builder.0.request.set_page_token(token);
5939                builder.send()
5940            };
5941            gax::paginator::internal::new_paginator(token, execute)
5942        }
5943
5944        /// Streams each item in the collection.
5945        pub fn by_item(
5946            self,
5947        ) -> impl gax::paginator::ItemPaginator<
5948            crate::model::ListConversationModelsResponse,
5949            gax::error::Error,
5950        > {
5951            use gax::paginator::Paginator;
5952            self.by_page().items()
5953        }
5954
5955        /// Sets the value of [parent][crate::model::ListConversationModelsRequest::parent].
5956        ///
5957        /// This is a **required** field for requests.
5958        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5959            self.0.request.parent = v.into();
5960            self
5961        }
5962
5963        /// Sets the value of [page_size][crate::model::ListConversationModelsRequest::page_size].
5964        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5965            self.0.request.page_size = v.into();
5966            self
5967        }
5968
5969        /// Sets the value of [page_token][crate::model::ListConversationModelsRequest::page_token].
5970        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5971            self.0.request.page_token = v.into();
5972            self
5973        }
5974    }
5975
5976    #[doc(hidden)]
5977    impl gax::options::internal::RequestBuilder for ListConversationModels {
5978        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5979            &mut self.0.options
5980        }
5981    }
5982
5983    /// The request builder for [ConversationModels::delete_conversation_model][crate::client::ConversationModels::delete_conversation_model] calls.
5984    ///
5985    /// # Example
5986    /// ```no_run
5987    /// # use google_cloud_dialogflow_v2::builder;
5988    /// use builder::conversation_models::DeleteConversationModel;
5989    /// # tokio_test::block_on(async {
5990    /// use lro::Poller;
5991    ///
5992    /// let builder = prepare_request_builder();
5993    /// let response = builder.poller().until_done().await?;
5994    /// # gax::Result::<()>::Ok(()) });
5995    ///
5996    /// fn prepare_request_builder() -> DeleteConversationModel {
5997    ///   # panic!();
5998    ///   // ... details omitted ...
5999    /// }
6000    /// ```
6001    #[derive(Clone, Debug)]
6002    pub struct DeleteConversationModel(
6003        RequestBuilder<crate::model::DeleteConversationModelRequest>,
6004    );
6005
6006    impl DeleteConversationModel {
6007        pub(crate) fn new(
6008            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6009        ) -> Self {
6010            Self(RequestBuilder::new(stub))
6011        }
6012
6013        /// Sets the full request, replacing any prior values.
6014        pub fn with_request<V: Into<crate::model::DeleteConversationModelRequest>>(
6015            mut self,
6016            v: V,
6017        ) -> Self {
6018            self.0.request = v.into();
6019            self
6020        }
6021
6022        /// Sets all the options, replacing any prior values.
6023        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6024            self.0.options = v.into();
6025            self
6026        }
6027
6028        /// Sends the request.
6029        ///
6030        /// # Long running operations
6031        ///
6032        /// This starts, but does not poll, a longrunning operation. More information
6033        /// on [delete_conversation_model][crate::client::ConversationModels::delete_conversation_model].
6034        pub async fn send(self) -> Result<longrunning::model::Operation> {
6035            (*self.0.stub)
6036                .delete_conversation_model(self.0.request, self.0.options)
6037                .await
6038                .map(gax::response::Response::into_body)
6039        }
6040
6041        /// Creates a [Poller][lro::Poller] to work with `delete_conversation_model`.
6042        pub fn poller(
6043            self,
6044        ) -> impl lro::Poller<(), crate::model::DeleteConversationModelOperationMetadata> {
6045            type Operation = lro::internal::Operation<
6046                wkt::Empty,
6047                crate::model::DeleteConversationModelOperationMetadata,
6048            >;
6049            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6050            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6051
6052            let stub = self.0.stub.clone();
6053            let mut options = self.0.options.clone();
6054            options.set_retry_policy(gax::retry_policy::NeverRetry);
6055            let query = move |name| {
6056                let stub = stub.clone();
6057                let options = options.clone();
6058                async {
6059                    let op = GetOperation::new(stub)
6060                        .set_name(name)
6061                        .with_options(options)
6062                        .send()
6063                        .await?;
6064                    Ok(Operation::new(op))
6065                }
6066            };
6067
6068            let start = move || async {
6069                let op = self.send().await?;
6070                Ok(Operation::new(op))
6071            };
6072
6073            lro::internal::new_unit_response_poller(
6074                polling_error_policy,
6075                polling_backoff_policy,
6076                start,
6077                query,
6078            )
6079        }
6080
6081        /// Sets the value of [name][crate::model::DeleteConversationModelRequest::name].
6082        ///
6083        /// This is a **required** field for requests.
6084        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6085            self.0.request.name = v.into();
6086            self
6087        }
6088    }
6089
6090    #[doc(hidden)]
6091    impl gax::options::internal::RequestBuilder for DeleteConversationModel {
6092        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6093            &mut self.0.options
6094        }
6095    }
6096
6097    /// The request builder for [ConversationModels::deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model] calls.
6098    ///
6099    /// # Example
6100    /// ```no_run
6101    /// # use google_cloud_dialogflow_v2::builder;
6102    /// use builder::conversation_models::DeployConversationModel;
6103    /// # tokio_test::block_on(async {
6104    /// use lro::Poller;
6105    ///
6106    /// let builder = prepare_request_builder();
6107    /// let response = builder.poller().until_done().await?;
6108    /// # gax::Result::<()>::Ok(()) });
6109    ///
6110    /// fn prepare_request_builder() -> DeployConversationModel {
6111    ///   # panic!();
6112    ///   // ... details omitted ...
6113    /// }
6114    /// ```
6115    #[derive(Clone, Debug)]
6116    pub struct DeployConversationModel(
6117        RequestBuilder<crate::model::DeployConversationModelRequest>,
6118    );
6119
6120    impl DeployConversationModel {
6121        pub(crate) fn new(
6122            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6123        ) -> Self {
6124            Self(RequestBuilder::new(stub))
6125        }
6126
6127        /// Sets the full request, replacing any prior values.
6128        pub fn with_request<V: Into<crate::model::DeployConversationModelRequest>>(
6129            mut self,
6130            v: V,
6131        ) -> Self {
6132            self.0.request = v.into();
6133            self
6134        }
6135
6136        /// Sets all the options, replacing any prior values.
6137        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6138            self.0.options = v.into();
6139            self
6140        }
6141
6142        /// Sends the request.
6143        ///
6144        /// # Long running operations
6145        ///
6146        /// This starts, but does not poll, a longrunning operation. More information
6147        /// on [deploy_conversation_model][crate::client::ConversationModels::deploy_conversation_model].
6148        pub async fn send(self) -> Result<longrunning::model::Operation> {
6149            (*self.0.stub)
6150                .deploy_conversation_model(self.0.request, self.0.options)
6151                .await
6152                .map(gax::response::Response::into_body)
6153        }
6154
6155        /// Creates a [Poller][lro::Poller] to work with `deploy_conversation_model`.
6156        pub fn poller(
6157            self,
6158        ) -> impl lro::Poller<(), crate::model::DeployConversationModelOperationMetadata> {
6159            type Operation = lro::internal::Operation<
6160                wkt::Empty,
6161                crate::model::DeployConversationModelOperationMetadata,
6162            >;
6163            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6164            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6165
6166            let stub = self.0.stub.clone();
6167            let mut options = self.0.options.clone();
6168            options.set_retry_policy(gax::retry_policy::NeverRetry);
6169            let query = move |name| {
6170                let stub = stub.clone();
6171                let options = options.clone();
6172                async {
6173                    let op = GetOperation::new(stub)
6174                        .set_name(name)
6175                        .with_options(options)
6176                        .send()
6177                        .await?;
6178                    Ok(Operation::new(op))
6179                }
6180            };
6181
6182            let start = move || async {
6183                let op = self.send().await?;
6184                Ok(Operation::new(op))
6185            };
6186
6187            lro::internal::new_unit_response_poller(
6188                polling_error_policy,
6189                polling_backoff_policy,
6190                start,
6191                query,
6192            )
6193        }
6194
6195        /// Sets the value of [name][crate::model::DeployConversationModelRequest::name].
6196        ///
6197        /// This is a **required** field for requests.
6198        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6199            self.0.request.name = v.into();
6200            self
6201        }
6202    }
6203
6204    #[doc(hidden)]
6205    impl gax::options::internal::RequestBuilder for DeployConversationModel {
6206        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6207            &mut self.0.options
6208        }
6209    }
6210
6211    /// The request builder for [ConversationModels::undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model] calls.
6212    ///
6213    /// # Example
6214    /// ```no_run
6215    /// # use google_cloud_dialogflow_v2::builder;
6216    /// use builder::conversation_models::UndeployConversationModel;
6217    /// # tokio_test::block_on(async {
6218    /// use lro::Poller;
6219    ///
6220    /// let builder = prepare_request_builder();
6221    /// let response = builder.poller().until_done().await?;
6222    /// # gax::Result::<()>::Ok(()) });
6223    ///
6224    /// fn prepare_request_builder() -> UndeployConversationModel {
6225    ///   # panic!();
6226    ///   // ... details omitted ...
6227    /// }
6228    /// ```
6229    #[derive(Clone, Debug)]
6230    pub struct UndeployConversationModel(
6231        RequestBuilder<crate::model::UndeployConversationModelRequest>,
6232    );
6233
6234    impl UndeployConversationModel {
6235        pub(crate) fn new(
6236            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6237        ) -> Self {
6238            Self(RequestBuilder::new(stub))
6239        }
6240
6241        /// Sets the full request, replacing any prior values.
6242        pub fn with_request<V: Into<crate::model::UndeployConversationModelRequest>>(
6243            mut self,
6244            v: V,
6245        ) -> Self {
6246            self.0.request = v.into();
6247            self
6248        }
6249
6250        /// Sets all the options, replacing any prior values.
6251        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6252            self.0.options = v.into();
6253            self
6254        }
6255
6256        /// Sends the request.
6257        ///
6258        /// # Long running operations
6259        ///
6260        /// This starts, but does not poll, a longrunning operation. More information
6261        /// on [undeploy_conversation_model][crate::client::ConversationModels::undeploy_conversation_model].
6262        pub async fn send(self) -> Result<longrunning::model::Operation> {
6263            (*self.0.stub)
6264                .undeploy_conversation_model(self.0.request, self.0.options)
6265                .await
6266                .map(gax::response::Response::into_body)
6267        }
6268
6269        /// Creates a [Poller][lro::Poller] to work with `undeploy_conversation_model`.
6270        pub fn poller(
6271            self,
6272        ) -> impl lro::Poller<(), crate::model::UndeployConversationModelOperationMetadata>
6273        {
6274            type Operation = lro::internal::Operation<
6275                wkt::Empty,
6276                crate::model::UndeployConversationModelOperationMetadata,
6277            >;
6278            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6279            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6280
6281            let stub = self.0.stub.clone();
6282            let mut options = self.0.options.clone();
6283            options.set_retry_policy(gax::retry_policy::NeverRetry);
6284            let query = move |name| {
6285                let stub = stub.clone();
6286                let options = options.clone();
6287                async {
6288                    let op = GetOperation::new(stub)
6289                        .set_name(name)
6290                        .with_options(options)
6291                        .send()
6292                        .await?;
6293                    Ok(Operation::new(op))
6294                }
6295            };
6296
6297            let start = move || async {
6298                let op = self.send().await?;
6299                Ok(Operation::new(op))
6300            };
6301
6302            lro::internal::new_unit_response_poller(
6303                polling_error_policy,
6304                polling_backoff_policy,
6305                start,
6306                query,
6307            )
6308        }
6309
6310        /// Sets the value of [name][crate::model::UndeployConversationModelRequest::name].
6311        ///
6312        /// This is a **required** field for requests.
6313        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6314            self.0.request.name = v.into();
6315            self
6316        }
6317    }
6318
6319    #[doc(hidden)]
6320    impl gax::options::internal::RequestBuilder for UndeployConversationModel {
6321        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6322            &mut self.0.options
6323        }
6324    }
6325
6326    /// The request builder for [ConversationModels::get_conversation_model_evaluation][crate::client::ConversationModels::get_conversation_model_evaluation] calls.
6327    ///
6328    /// # Example
6329    /// ```no_run
6330    /// # use google_cloud_dialogflow_v2::builder;
6331    /// use builder::conversation_models::GetConversationModelEvaluation;
6332    /// # tokio_test::block_on(async {
6333    ///
6334    /// let builder = prepare_request_builder();
6335    /// let response = builder.send().await?;
6336    /// # gax::Result::<()>::Ok(()) });
6337    ///
6338    /// fn prepare_request_builder() -> GetConversationModelEvaluation {
6339    ///   # panic!();
6340    ///   // ... details omitted ...
6341    /// }
6342    /// ```
6343    #[derive(Clone, Debug)]
6344    pub struct GetConversationModelEvaluation(
6345        RequestBuilder<crate::model::GetConversationModelEvaluationRequest>,
6346    );
6347
6348    impl GetConversationModelEvaluation {
6349        pub(crate) fn new(
6350            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6351        ) -> Self {
6352            Self(RequestBuilder::new(stub))
6353        }
6354
6355        /// Sets the full request, replacing any prior values.
6356        pub fn with_request<V: Into<crate::model::GetConversationModelEvaluationRequest>>(
6357            mut self,
6358            v: V,
6359        ) -> Self {
6360            self.0.request = v.into();
6361            self
6362        }
6363
6364        /// Sets all the options, replacing any prior values.
6365        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6366            self.0.options = v.into();
6367            self
6368        }
6369
6370        /// Sends the request.
6371        pub async fn send(self) -> Result<crate::model::ConversationModelEvaluation> {
6372            (*self.0.stub)
6373                .get_conversation_model_evaluation(self.0.request, self.0.options)
6374                .await
6375                .map(gax::response::Response::into_body)
6376        }
6377
6378        /// Sets the value of [name][crate::model::GetConversationModelEvaluationRequest::name].
6379        ///
6380        /// This is a **required** field for requests.
6381        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6382            self.0.request.name = v.into();
6383            self
6384        }
6385    }
6386
6387    #[doc(hidden)]
6388    impl gax::options::internal::RequestBuilder for GetConversationModelEvaluation {
6389        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6390            &mut self.0.options
6391        }
6392    }
6393
6394    /// The request builder for [ConversationModels::list_conversation_model_evaluations][crate::client::ConversationModels::list_conversation_model_evaluations] calls.
6395    ///
6396    /// # Example
6397    /// ```no_run
6398    /// # use google_cloud_dialogflow_v2::builder;
6399    /// use builder::conversation_models::ListConversationModelEvaluations;
6400    /// # tokio_test::block_on(async {
6401    /// use gax::paginator::ItemPaginator;
6402    ///
6403    /// let builder = prepare_request_builder();
6404    /// let mut items = builder.by_item();
6405    /// while let Some(result) = items.next().await {
6406    ///   let item = result?;
6407    /// }
6408    /// # gax::Result::<()>::Ok(()) });
6409    ///
6410    /// fn prepare_request_builder() -> ListConversationModelEvaluations {
6411    ///   # panic!();
6412    ///   // ... details omitted ...
6413    /// }
6414    /// ```
6415    #[derive(Clone, Debug)]
6416    pub struct ListConversationModelEvaluations(
6417        RequestBuilder<crate::model::ListConversationModelEvaluationsRequest>,
6418    );
6419
6420    impl ListConversationModelEvaluations {
6421        pub(crate) fn new(
6422            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6423        ) -> Self {
6424            Self(RequestBuilder::new(stub))
6425        }
6426
6427        /// Sets the full request, replacing any prior values.
6428        pub fn with_request<V: Into<crate::model::ListConversationModelEvaluationsRequest>>(
6429            mut self,
6430            v: V,
6431        ) -> Self {
6432            self.0.request = v.into();
6433            self
6434        }
6435
6436        /// Sets all the options, replacing any prior values.
6437        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6438            self.0.options = v.into();
6439            self
6440        }
6441
6442        /// Sends the request.
6443        pub async fn send(self) -> Result<crate::model::ListConversationModelEvaluationsResponse> {
6444            (*self.0.stub)
6445                .list_conversation_model_evaluations(self.0.request, self.0.options)
6446                .await
6447                .map(gax::response::Response::into_body)
6448        }
6449
6450        /// Streams each page in the collection.
6451        pub fn by_page(
6452            self,
6453        ) -> impl gax::paginator::Paginator<
6454            crate::model::ListConversationModelEvaluationsResponse,
6455            gax::error::Error,
6456        > {
6457            use std::clone::Clone;
6458            let token = self.0.request.page_token.clone();
6459            let execute = move |token: String| {
6460                let mut builder = self.clone();
6461                builder.0.request = builder.0.request.set_page_token(token);
6462                builder.send()
6463            };
6464            gax::paginator::internal::new_paginator(token, execute)
6465        }
6466
6467        /// Streams each item in the collection.
6468        pub fn by_item(
6469            self,
6470        ) -> impl gax::paginator::ItemPaginator<
6471            crate::model::ListConversationModelEvaluationsResponse,
6472            gax::error::Error,
6473        > {
6474            use gax::paginator::Paginator;
6475            self.by_page().items()
6476        }
6477
6478        /// Sets the value of [parent][crate::model::ListConversationModelEvaluationsRequest::parent].
6479        ///
6480        /// This is a **required** field for requests.
6481        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6482            self.0.request.parent = v.into();
6483            self
6484        }
6485
6486        /// Sets the value of [page_size][crate::model::ListConversationModelEvaluationsRequest::page_size].
6487        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6488            self.0.request.page_size = v.into();
6489            self
6490        }
6491
6492        /// Sets the value of [page_token][crate::model::ListConversationModelEvaluationsRequest::page_token].
6493        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6494            self.0.request.page_token = v.into();
6495            self
6496        }
6497    }
6498
6499    #[doc(hidden)]
6500    impl gax::options::internal::RequestBuilder for ListConversationModelEvaluations {
6501        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6502            &mut self.0.options
6503        }
6504    }
6505
6506    /// The request builder for [ConversationModels::create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation] calls.
6507    ///
6508    /// # Example
6509    /// ```no_run
6510    /// # use google_cloud_dialogflow_v2::builder;
6511    /// use builder::conversation_models::CreateConversationModelEvaluation;
6512    /// # tokio_test::block_on(async {
6513    /// use lro::Poller;
6514    ///
6515    /// let builder = prepare_request_builder();
6516    /// let response = builder.poller().until_done().await?;
6517    /// # gax::Result::<()>::Ok(()) });
6518    ///
6519    /// fn prepare_request_builder() -> CreateConversationModelEvaluation {
6520    ///   # panic!();
6521    ///   // ... details omitted ...
6522    /// }
6523    /// ```
6524    #[derive(Clone, Debug)]
6525    pub struct CreateConversationModelEvaluation(
6526        RequestBuilder<crate::model::CreateConversationModelEvaluationRequest>,
6527    );
6528
6529    impl CreateConversationModelEvaluation {
6530        pub(crate) fn new(
6531            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6532        ) -> Self {
6533            Self(RequestBuilder::new(stub))
6534        }
6535
6536        /// Sets the full request, replacing any prior values.
6537        pub fn with_request<V: Into<crate::model::CreateConversationModelEvaluationRequest>>(
6538            mut self,
6539            v: V,
6540        ) -> Self {
6541            self.0.request = v.into();
6542            self
6543        }
6544
6545        /// Sets all the options, replacing any prior values.
6546        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6547            self.0.options = v.into();
6548            self
6549        }
6550
6551        /// Sends the request.
6552        ///
6553        /// # Long running operations
6554        ///
6555        /// This starts, but does not poll, a longrunning operation. More information
6556        /// on [create_conversation_model_evaluation][crate::client::ConversationModels::create_conversation_model_evaluation].
6557        pub async fn send(self) -> Result<longrunning::model::Operation> {
6558            (*self.0.stub)
6559                .create_conversation_model_evaluation(self.0.request, self.0.options)
6560                .await
6561                .map(gax::response::Response::into_body)
6562        }
6563
6564        /// Creates a [Poller][lro::Poller] to work with `create_conversation_model_evaluation`.
6565        pub fn poller(
6566            self,
6567        ) -> impl lro::Poller<
6568            crate::model::ConversationModelEvaluation,
6569            crate::model::CreateConversationModelEvaluationOperationMetadata,
6570        > {
6571            type Operation = lro::internal::Operation<
6572                crate::model::ConversationModelEvaluation,
6573                crate::model::CreateConversationModelEvaluationOperationMetadata,
6574            >;
6575            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6576            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6577
6578            let stub = self.0.stub.clone();
6579            let mut options = self.0.options.clone();
6580            options.set_retry_policy(gax::retry_policy::NeverRetry);
6581            let query = move |name| {
6582                let stub = stub.clone();
6583                let options = options.clone();
6584                async {
6585                    let op = GetOperation::new(stub)
6586                        .set_name(name)
6587                        .with_options(options)
6588                        .send()
6589                        .await?;
6590                    Ok(Operation::new(op))
6591                }
6592            };
6593
6594            let start = move || async {
6595                let op = self.send().await?;
6596                Ok(Operation::new(op))
6597            };
6598
6599            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6600        }
6601
6602        /// Sets the value of [parent][crate::model::CreateConversationModelEvaluationRequest::parent].
6603        ///
6604        /// This is a **required** field for requests.
6605        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6606            self.0.request.parent = v.into();
6607            self
6608        }
6609
6610        /// Sets the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6611        ///
6612        /// This is a **required** field for requests.
6613        pub fn set_conversation_model_evaluation<T>(mut self, v: T) -> Self
6614        where
6615            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6616        {
6617            self.0.request.conversation_model_evaluation = std::option::Option::Some(v.into());
6618            self
6619        }
6620
6621        /// Sets or clears the value of [conversation_model_evaluation][crate::model::CreateConversationModelEvaluationRequest::conversation_model_evaluation].
6622        ///
6623        /// This is a **required** field for requests.
6624        pub fn set_or_clear_conversation_model_evaluation<T>(
6625            mut self,
6626            v: std::option::Option<T>,
6627        ) -> Self
6628        where
6629            T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6630        {
6631            self.0.request.conversation_model_evaluation = v.map(|x| x.into());
6632            self
6633        }
6634    }
6635
6636    #[doc(hidden)]
6637    impl gax::options::internal::RequestBuilder for CreateConversationModelEvaluation {
6638        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6639            &mut self.0.options
6640        }
6641    }
6642
6643    /// The request builder for [ConversationModels::list_locations][crate::client::ConversationModels::list_locations] calls.
6644    ///
6645    /// # Example
6646    /// ```no_run
6647    /// # use google_cloud_dialogflow_v2::builder;
6648    /// use builder::conversation_models::ListLocations;
6649    /// # tokio_test::block_on(async {
6650    /// use gax::paginator::ItemPaginator;
6651    ///
6652    /// let builder = prepare_request_builder();
6653    /// let mut items = builder.by_item();
6654    /// while let Some(result) = items.next().await {
6655    ///   let item = result?;
6656    /// }
6657    /// # gax::Result::<()>::Ok(()) });
6658    ///
6659    /// fn prepare_request_builder() -> ListLocations {
6660    ///   # panic!();
6661    ///   // ... details omitted ...
6662    /// }
6663    /// ```
6664    #[derive(Clone, Debug)]
6665    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
6666
6667    impl ListLocations {
6668        pub(crate) fn new(
6669            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6670        ) -> Self {
6671            Self(RequestBuilder::new(stub))
6672        }
6673
6674        /// Sets the full request, replacing any prior values.
6675        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
6676            mut self,
6677            v: V,
6678        ) -> Self {
6679            self.0.request = v.into();
6680            self
6681        }
6682
6683        /// Sets all the options, replacing any prior values.
6684        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6685            self.0.options = v.into();
6686            self
6687        }
6688
6689        /// Sends the request.
6690        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
6691            (*self.0.stub)
6692                .list_locations(self.0.request, self.0.options)
6693                .await
6694                .map(gax::response::Response::into_body)
6695        }
6696
6697        /// Streams each page in the collection.
6698        pub fn by_page(
6699            self,
6700        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
6701        {
6702            use std::clone::Clone;
6703            let token = self.0.request.page_token.clone();
6704            let execute = move |token: String| {
6705                let mut builder = self.clone();
6706                builder.0.request = builder.0.request.set_page_token(token);
6707                builder.send()
6708            };
6709            gax::paginator::internal::new_paginator(token, execute)
6710        }
6711
6712        /// Streams each item in the collection.
6713        pub fn by_item(
6714            self,
6715        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
6716        {
6717            use gax::paginator::Paginator;
6718            self.by_page().items()
6719        }
6720
6721        /// Sets the value of [name][location::model::ListLocationsRequest::name].
6722        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6723            self.0.request.name = v.into();
6724            self
6725        }
6726
6727        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
6728        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6729            self.0.request.filter = v.into();
6730            self
6731        }
6732
6733        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
6734        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6735            self.0.request.page_size = v.into();
6736            self
6737        }
6738
6739        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
6740        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6741            self.0.request.page_token = v.into();
6742            self
6743        }
6744    }
6745
6746    #[doc(hidden)]
6747    impl gax::options::internal::RequestBuilder for ListLocations {
6748        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6749            &mut self.0.options
6750        }
6751    }
6752
6753    /// The request builder for [ConversationModels::get_location][crate::client::ConversationModels::get_location] calls.
6754    ///
6755    /// # Example
6756    /// ```no_run
6757    /// # use google_cloud_dialogflow_v2::builder;
6758    /// use builder::conversation_models::GetLocation;
6759    /// # tokio_test::block_on(async {
6760    ///
6761    /// let builder = prepare_request_builder();
6762    /// let response = builder.send().await?;
6763    /// # gax::Result::<()>::Ok(()) });
6764    ///
6765    /// fn prepare_request_builder() -> GetLocation {
6766    ///   # panic!();
6767    ///   // ... details omitted ...
6768    /// }
6769    /// ```
6770    #[derive(Clone, Debug)]
6771    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
6772
6773    impl GetLocation {
6774        pub(crate) fn new(
6775            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6776        ) -> Self {
6777            Self(RequestBuilder::new(stub))
6778        }
6779
6780        /// Sets the full request, replacing any prior values.
6781        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6782            self.0.request = v.into();
6783            self
6784        }
6785
6786        /// Sets all the options, replacing any prior values.
6787        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6788            self.0.options = v.into();
6789            self
6790        }
6791
6792        /// Sends the request.
6793        pub async fn send(self) -> Result<location::model::Location> {
6794            (*self.0.stub)
6795                .get_location(self.0.request, self.0.options)
6796                .await
6797                .map(gax::response::Response::into_body)
6798        }
6799
6800        /// Sets the value of [name][location::model::GetLocationRequest::name].
6801        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6802            self.0.request.name = v.into();
6803            self
6804        }
6805    }
6806
6807    #[doc(hidden)]
6808    impl gax::options::internal::RequestBuilder for GetLocation {
6809        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6810            &mut self.0.options
6811        }
6812    }
6813
6814    /// The request builder for [ConversationModels::list_operations][crate::client::ConversationModels::list_operations] calls.
6815    ///
6816    /// # Example
6817    /// ```no_run
6818    /// # use google_cloud_dialogflow_v2::builder;
6819    /// use builder::conversation_models::ListOperations;
6820    /// # tokio_test::block_on(async {
6821    /// use gax::paginator::ItemPaginator;
6822    ///
6823    /// let builder = prepare_request_builder();
6824    /// let mut items = builder.by_item();
6825    /// while let Some(result) = items.next().await {
6826    ///   let item = result?;
6827    /// }
6828    /// # gax::Result::<()>::Ok(()) });
6829    ///
6830    /// fn prepare_request_builder() -> ListOperations {
6831    ///   # panic!();
6832    ///   // ... details omitted ...
6833    /// }
6834    /// ```
6835    #[derive(Clone, Debug)]
6836    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6837
6838    impl ListOperations {
6839        pub(crate) fn new(
6840            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6841        ) -> Self {
6842            Self(RequestBuilder::new(stub))
6843        }
6844
6845        /// Sets the full request, replacing any prior values.
6846        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6847            mut self,
6848            v: V,
6849        ) -> Self {
6850            self.0.request = v.into();
6851            self
6852        }
6853
6854        /// Sets all the options, replacing any prior values.
6855        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6856            self.0.options = v.into();
6857            self
6858        }
6859
6860        /// Sends the request.
6861        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6862            (*self.0.stub)
6863                .list_operations(self.0.request, self.0.options)
6864                .await
6865                .map(gax::response::Response::into_body)
6866        }
6867
6868        /// Streams each page in the collection.
6869        pub fn by_page(
6870            self,
6871        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6872        {
6873            use std::clone::Clone;
6874            let token = self.0.request.page_token.clone();
6875            let execute = move |token: String| {
6876                let mut builder = self.clone();
6877                builder.0.request = builder.0.request.set_page_token(token);
6878                builder.send()
6879            };
6880            gax::paginator::internal::new_paginator(token, execute)
6881        }
6882
6883        /// Streams each item in the collection.
6884        pub fn by_item(
6885            self,
6886        ) -> impl gax::paginator::ItemPaginator<
6887            longrunning::model::ListOperationsResponse,
6888            gax::error::Error,
6889        > {
6890            use gax::paginator::Paginator;
6891            self.by_page().items()
6892        }
6893
6894        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
6895        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6896            self.0.request.name = v.into();
6897            self
6898        }
6899
6900        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
6901        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6902            self.0.request.filter = v.into();
6903            self
6904        }
6905
6906        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
6907        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6908            self.0.request.page_size = v.into();
6909            self
6910        }
6911
6912        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
6913        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6914            self.0.request.page_token = v.into();
6915            self
6916        }
6917
6918        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
6919        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6920            self.0.request.return_partial_success = v.into();
6921            self
6922        }
6923    }
6924
6925    #[doc(hidden)]
6926    impl gax::options::internal::RequestBuilder for ListOperations {
6927        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6928            &mut self.0.options
6929        }
6930    }
6931
6932    /// The request builder for [ConversationModels::get_operation][crate::client::ConversationModels::get_operation] calls.
6933    ///
6934    /// # Example
6935    /// ```no_run
6936    /// # use google_cloud_dialogflow_v2::builder;
6937    /// use builder::conversation_models::GetOperation;
6938    /// # tokio_test::block_on(async {
6939    ///
6940    /// let builder = prepare_request_builder();
6941    /// let response = builder.send().await?;
6942    /// # gax::Result::<()>::Ok(()) });
6943    ///
6944    /// fn prepare_request_builder() -> GetOperation {
6945    ///   # panic!();
6946    ///   // ... details omitted ...
6947    /// }
6948    /// ```
6949    #[derive(Clone, Debug)]
6950    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6951
6952    impl GetOperation {
6953        pub(crate) fn new(
6954            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6955        ) -> Self {
6956            Self(RequestBuilder::new(stub))
6957        }
6958
6959        /// Sets the full request, replacing any prior values.
6960        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6961            mut self,
6962            v: V,
6963        ) -> Self {
6964            self.0.request = v.into();
6965            self
6966        }
6967
6968        /// Sets all the options, replacing any prior values.
6969        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6970            self.0.options = v.into();
6971            self
6972        }
6973
6974        /// Sends the request.
6975        pub async fn send(self) -> Result<longrunning::model::Operation> {
6976            (*self.0.stub)
6977                .get_operation(self.0.request, self.0.options)
6978                .await
6979                .map(gax::response::Response::into_body)
6980        }
6981
6982        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
6983        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6984            self.0.request.name = v.into();
6985            self
6986        }
6987    }
6988
6989    #[doc(hidden)]
6990    impl gax::options::internal::RequestBuilder for GetOperation {
6991        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6992            &mut self.0.options
6993        }
6994    }
6995
6996    /// The request builder for [ConversationModels::cancel_operation][crate::client::ConversationModels::cancel_operation] calls.
6997    ///
6998    /// # Example
6999    /// ```no_run
7000    /// # use google_cloud_dialogflow_v2::builder;
7001    /// use builder::conversation_models::CancelOperation;
7002    /// # tokio_test::block_on(async {
7003    ///
7004    /// let builder = prepare_request_builder();
7005    /// let response = builder.send().await?;
7006    /// # gax::Result::<()>::Ok(()) });
7007    ///
7008    /// fn prepare_request_builder() -> CancelOperation {
7009    ///   # panic!();
7010    ///   // ... details omitted ...
7011    /// }
7012    /// ```
7013    #[derive(Clone, Debug)]
7014    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
7015
7016    impl CancelOperation {
7017        pub(crate) fn new(
7018            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7019        ) -> Self {
7020            Self(RequestBuilder::new(stub))
7021        }
7022
7023        /// Sets the full request, replacing any prior values.
7024        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
7025            mut self,
7026            v: V,
7027        ) -> Self {
7028            self.0.request = v.into();
7029            self
7030        }
7031
7032        /// Sets all the options, replacing any prior values.
7033        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7034            self.0.options = v.into();
7035            self
7036        }
7037
7038        /// Sends the request.
7039        pub async fn send(self) -> Result<()> {
7040            (*self.0.stub)
7041                .cancel_operation(self.0.request, self.0.options)
7042                .await
7043                .map(gax::response::Response::into_body)
7044        }
7045
7046        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
7047        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7048            self.0.request.name = v.into();
7049            self
7050        }
7051    }
7052
7053    #[doc(hidden)]
7054    impl gax::options::internal::RequestBuilder for CancelOperation {
7055        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7056            &mut self.0.options
7057        }
7058    }
7059}
7060
7061#[cfg(feature = "conversation-profiles")]
7062#[cfg_attr(docsrs, doc(cfg(feature = "conversation-profiles")))]
7063pub mod conversation_profiles {
7064    use crate::Result;
7065
7066    /// A builder for [ConversationProfiles][crate::client::ConversationProfiles].
7067    ///
7068    /// ```
7069    /// # tokio_test::block_on(async {
7070    /// # use google_cloud_dialogflow_v2::*;
7071    /// # use builder::conversation_profiles::ClientBuilder;
7072    /// # use client::ConversationProfiles;
7073    /// let builder : ClientBuilder = ConversationProfiles::builder();
7074    /// let client = builder
7075    ///     .with_endpoint("https://dialogflow.googleapis.com")
7076    ///     .build().await?;
7077    /// # gax::client_builder::Result::<()>::Ok(()) });
7078    /// ```
7079    pub type ClientBuilder =
7080        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7081
7082    pub(crate) mod client {
7083        use super::super::super::client::ConversationProfiles;
7084        pub struct Factory;
7085        impl gax::client_builder::internal::ClientFactory for Factory {
7086            type Client = ConversationProfiles;
7087            type Credentials = gaxi::options::Credentials;
7088            async fn build(
7089                self,
7090                config: gaxi::options::ClientConfig,
7091            ) -> gax::client_builder::Result<Self::Client> {
7092                Self::Client::new(config).await
7093            }
7094        }
7095    }
7096
7097    /// Common implementation for [crate::client::ConversationProfiles] request builders.
7098    #[derive(Clone, Debug)]
7099    pub(crate) struct RequestBuilder<R: std::default::Default> {
7100        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7101        request: R,
7102        options: gax::options::RequestOptions,
7103    }
7104
7105    impl<R> RequestBuilder<R>
7106    where
7107        R: std::default::Default,
7108    {
7109        pub(crate) fn new(
7110            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7111        ) -> Self {
7112            Self {
7113                stub,
7114                request: R::default(),
7115                options: gax::options::RequestOptions::default(),
7116            }
7117        }
7118    }
7119
7120    /// The request builder for [ConversationProfiles::list_conversation_profiles][crate::client::ConversationProfiles::list_conversation_profiles] calls.
7121    ///
7122    /// # Example
7123    /// ```no_run
7124    /// # use google_cloud_dialogflow_v2::builder;
7125    /// use builder::conversation_profiles::ListConversationProfiles;
7126    /// # tokio_test::block_on(async {
7127    /// use gax::paginator::ItemPaginator;
7128    ///
7129    /// let builder = prepare_request_builder();
7130    /// let mut items = builder.by_item();
7131    /// while let Some(result) = items.next().await {
7132    ///   let item = result?;
7133    /// }
7134    /// # gax::Result::<()>::Ok(()) });
7135    ///
7136    /// fn prepare_request_builder() -> ListConversationProfiles {
7137    ///   # panic!();
7138    ///   // ... details omitted ...
7139    /// }
7140    /// ```
7141    #[derive(Clone, Debug)]
7142    pub struct ListConversationProfiles(
7143        RequestBuilder<crate::model::ListConversationProfilesRequest>,
7144    );
7145
7146    impl ListConversationProfiles {
7147        pub(crate) fn new(
7148            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7149        ) -> Self {
7150            Self(RequestBuilder::new(stub))
7151        }
7152
7153        /// Sets the full request, replacing any prior values.
7154        pub fn with_request<V: Into<crate::model::ListConversationProfilesRequest>>(
7155            mut self,
7156            v: V,
7157        ) -> Self {
7158            self.0.request = v.into();
7159            self
7160        }
7161
7162        /// Sets all the options, replacing any prior values.
7163        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7164            self.0.options = v.into();
7165            self
7166        }
7167
7168        /// Sends the request.
7169        pub async fn send(self) -> Result<crate::model::ListConversationProfilesResponse> {
7170            (*self.0.stub)
7171                .list_conversation_profiles(self.0.request, self.0.options)
7172                .await
7173                .map(gax::response::Response::into_body)
7174        }
7175
7176        /// Streams each page in the collection.
7177        pub fn by_page(
7178            self,
7179        ) -> impl gax::paginator::Paginator<
7180            crate::model::ListConversationProfilesResponse,
7181            gax::error::Error,
7182        > {
7183            use std::clone::Clone;
7184            let token = self.0.request.page_token.clone();
7185            let execute = move |token: String| {
7186                let mut builder = self.clone();
7187                builder.0.request = builder.0.request.set_page_token(token);
7188                builder.send()
7189            };
7190            gax::paginator::internal::new_paginator(token, execute)
7191        }
7192
7193        /// Streams each item in the collection.
7194        pub fn by_item(
7195            self,
7196        ) -> impl gax::paginator::ItemPaginator<
7197            crate::model::ListConversationProfilesResponse,
7198            gax::error::Error,
7199        > {
7200            use gax::paginator::Paginator;
7201            self.by_page().items()
7202        }
7203
7204        /// Sets the value of [parent][crate::model::ListConversationProfilesRequest::parent].
7205        ///
7206        /// This is a **required** field for requests.
7207        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7208            self.0.request.parent = v.into();
7209            self
7210        }
7211
7212        /// Sets the value of [page_size][crate::model::ListConversationProfilesRequest::page_size].
7213        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7214            self.0.request.page_size = v.into();
7215            self
7216        }
7217
7218        /// Sets the value of [page_token][crate::model::ListConversationProfilesRequest::page_token].
7219        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7220            self.0.request.page_token = v.into();
7221            self
7222        }
7223    }
7224
7225    #[doc(hidden)]
7226    impl gax::options::internal::RequestBuilder for ListConversationProfiles {
7227        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7228            &mut self.0.options
7229        }
7230    }
7231
7232    /// The request builder for [ConversationProfiles::get_conversation_profile][crate::client::ConversationProfiles::get_conversation_profile] calls.
7233    ///
7234    /// # Example
7235    /// ```no_run
7236    /// # use google_cloud_dialogflow_v2::builder;
7237    /// use builder::conversation_profiles::GetConversationProfile;
7238    /// # tokio_test::block_on(async {
7239    ///
7240    /// let builder = prepare_request_builder();
7241    /// let response = builder.send().await?;
7242    /// # gax::Result::<()>::Ok(()) });
7243    ///
7244    /// fn prepare_request_builder() -> GetConversationProfile {
7245    ///   # panic!();
7246    ///   // ... details omitted ...
7247    /// }
7248    /// ```
7249    #[derive(Clone, Debug)]
7250    pub struct GetConversationProfile(RequestBuilder<crate::model::GetConversationProfileRequest>);
7251
7252    impl GetConversationProfile {
7253        pub(crate) fn new(
7254            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7255        ) -> Self {
7256            Self(RequestBuilder::new(stub))
7257        }
7258
7259        /// Sets the full request, replacing any prior values.
7260        pub fn with_request<V: Into<crate::model::GetConversationProfileRequest>>(
7261            mut self,
7262            v: V,
7263        ) -> Self {
7264            self.0.request = v.into();
7265            self
7266        }
7267
7268        /// Sets all the options, replacing any prior values.
7269        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7270            self.0.options = v.into();
7271            self
7272        }
7273
7274        /// Sends the request.
7275        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7276            (*self.0.stub)
7277                .get_conversation_profile(self.0.request, self.0.options)
7278                .await
7279                .map(gax::response::Response::into_body)
7280        }
7281
7282        /// Sets the value of [name][crate::model::GetConversationProfileRequest::name].
7283        ///
7284        /// This is a **required** field for requests.
7285        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7286            self.0.request.name = v.into();
7287            self
7288        }
7289    }
7290
7291    #[doc(hidden)]
7292    impl gax::options::internal::RequestBuilder for GetConversationProfile {
7293        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7294            &mut self.0.options
7295        }
7296    }
7297
7298    /// The request builder for [ConversationProfiles::create_conversation_profile][crate::client::ConversationProfiles::create_conversation_profile] calls.
7299    ///
7300    /// # Example
7301    /// ```no_run
7302    /// # use google_cloud_dialogflow_v2::builder;
7303    /// use builder::conversation_profiles::CreateConversationProfile;
7304    /// # tokio_test::block_on(async {
7305    ///
7306    /// let builder = prepare_request_builder();
7307    /// let response = builder.send().await?;
7308    /// # gax::Result::<()>::Ok(()) });
7309    ///
7310    /// fn prepare_request_builder() -> CreateConversationProfile {
7311    ///   # panic!();
7312    ///   // ... details omitted ...
7313    /// }
7314    /// ```
7315    #[derive(Clone, Debug)]
7316    pub struct CreateConversationProfile(
7317        RequestBuilder<crate::model::CreateConversationProfileRequest>,
7318    );
7319
7320    impl CreateConversationProfile {
7321        pub(crate) fn new(
7322            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7323        ) -> Self {
7324            Self(RequestBuilder::new(stub))
7325        }
7326
7327        /// Sets the full request, replacing any prior values.
7328        pub fn with_request<V: Into<crate::model::CreateConversationProfileRequest>>(
7329            mut self,
7330            v: V,
7331        ) -> Self {
7332            self.0.request = v.into();
7333            self
7334        }
7335
7336        /// Sets all the options, replacing any prior values.
7337        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7338            self.0.options = v.into();
7339            self
7340        }
7341
7342        /// Sends the request.
7343        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7344            (*self.0.stub)
7345                .create_conversation_profile(self.0.request, self.0.options)
7346                .await
7347                .map(gax::response::Response::into_body)
7348        }
7349
7350        /// Sets the value of [parent][crate::model::CreateConversationProfileRequest::parent].
7351        ///
7352        /// This is a **required** field for requests.
7353        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7354            self.0.request.parent = v.into();
7355            self
7356        }
7357
7358        /// Sets the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7359        ///
7360        /// This is a **required** field for requests.
7361        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7362        where
7363            T: std::convert::Into<crate::model::ConversationProfile>,
7364        {
7365            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7366            self
7367        }
7368
7369        /// Sets or clears the value of [conversation_profile][crate::model::CreateConversationProfileRequest::conversation_profile].
7370        ///
7371        /// This is a **required** field for requests.
7372        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7373        where
7374            T: std::convert::Into<crate::model::ConversationProfile>,
7375        {
7376            self.0.request.conversation_profile = v.map(|x| x.into());
7377            self
7378        }
7379    }
7380
7381    #[doc(hidden)]
7382    impl gax::options::internal::RequestBuilder for CreateConversationProfile {
7383        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7384            &mut self.0.options
7385        }
7386    }
7387
7388    /// The request builder for [ConversationProfiles::update_conversation_profile][crate::client::ConversationProfiles::update_conversation_profile] calls.
7389    ///
7390    /// # Example
7391    /// ```no_run
7392    /// # use google_cloud_dialogflow_v2::builder;
7393    /// use builder::conversation_profiles::UpdateConversationProfile;
7394    /// # tokio_test::block_on(async {
7395    ///
7396    /// let builder = prepare_request_builder();
7397    /// let response = builder.send().await?;
7398    /// # gax::Result::<()>::Ok(()) });
7399    ///
7400    /// fn prepare_request_builder() -> UpdateConversationProfile {
7401    ///   # panic!();
7402    ///   // ... details omitted ...
7403    /// }
7404    /// ```
7405    #[derive(Clone, Debug)]
7406    pub struct UpdateConversationProfile(
7407        RequestBuilder<crate::model::UpdateConversationProfileRequest>,
7408    );
7409
7410    impl UpdateConversationProfile {
7411        pub(crate) fn new(
7412            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7413        ) -> Self {
7414            Self(RequestBuilder::new(stub))
7415        }
7416
7417        /// Sets the full request, replacing any prior values.
7418        pub fn with_request<V: Into<crate::model::UpdateConversationProfileRequest>>(
7419            mut self,
7420            v: V,
7421        ) -> Self {
7422            self.0.request = v.into();
7423            self
7424        }
7425
7426        /// Sets all the options, replacing any prior values.
7427        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7428            self.0.options = v.into();
7429            self
7430        }
7431
7432        /// Sends the request.
7433        pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7434            (*self.0.stub)
7435                .update_conversation_profile(self.0.request, self.0.options)
7436                .await
7437                .map(gax::response::Response::into_body)
7438        }
7439
7440        /// Sets the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7441        ///
7442        /// This is a **required** field for requests.
7443        pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7444        where
7445            T: std::convert::Into<crate::model::ConversationProfile>,
7446        {
7447            self.0.request.conversation_profile = std::option::Option::Some(v.into());
7448            self
7449        }
7450
7451        /// Sets or clears the value of [conversation_profile][crate::model::UpdateConversationProfileRequest::conversation_profile].
7452        ///
7453        /// This is a **required** field for requests.
7454        pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7455        where
7456            T: std::convert::Into<crate::model::ConversationProfile>,
7457        {
7458            self.0.request.conversation_profile = v.map(|x| x.into());
7459            self
7460        }
7461
7462        /// Sets the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7463        ///
7464        /// This is a **required** field for requests.
7465        pub fn set_update_mask<T>(mut self, v: T) -> Self
7466        where
7467            T: std::convert::Into<wkt::FieldMask>,
7468        {
7469            self.0.request.update_mask = std::option::Option::Some(v.into());
7470            self
7471        }
7472
7473        /// Sets or clears the value of [update_mask][crate::model::UpdateConversationProfileRequest::update_mask].
7474        ///
7475        /// This is a **required** field for requests.
7476        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7477        where
7478            T: std::convert::Into<wkt::FieldMask>,
7479        {
7480            self.0.request.update_mask = v.map(|x| x.into());
7481            self
7482        }
7483    }
7484
7485    #[doc(hidden)]
7486    impl gax::options::internal::RequestBuilder for UpdateConversationProfile {
7487        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7488            &mut self.0.options
7489        }
7490    }
7491
7492    /// The request builder for [ConversationProfiles::delete_conversation_profile][crate::client::ConversationProfiles::delete_conversation_profile] calls.
7493    ///
7494    /// # Example
7495    /// ```no_run
7496    /// # use google_cloud_dialogflow_v2::builder;
7497    /// use builder::conversation_profiles::DeleteConversationProfile;
7498    /// # tokio_test::block_on(async {
7499    ///
7500    /// let builder = prepare_request_builder();
7501    /// let response = builder.send().await?;
7502    /// # gax::Result::<()>::Ok(()) });
7503    ///
7504    /// fn prepare_request_builder() -> DeleteConversationProfile {
7505    ///   # panic!();
7506    ///   // ... details omitted ...
7507    /// }
7508    /// ```
7509    #[derive(Clone, Debug)]
7510    pub struct DeleteConversationProfile(
7511        RequestBuilder<crate::model::DeleteConversationProfileRequest>,
7512    );
7513
7514    impl DeleteConversationProfile {
7515        pub(crate) fn new(
7516            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7517        ) -> Self {
7518            Self(RequestBuilder::new(stub))
7519        }
7520
7521        /// Sets the full request, replacing any prior values.
7522        pub fn with_request<V: Into<crate::model::DeleteConversationProfileRequest>>(
7523            mut self,
7524            v: V,
7525        ) -> Self {
7526            self.0.request = v.into();
7527            self
7528        }
7529
7530        /// Sets all the options, replacing any prior values.
7531        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7532            self.0.options = v.into();
7533            self
7534        }
7535
7536        /// Sends the request.
7537        pub async fn send(self) -> Result<()> {
7538            (*self.0.stub)
7539                .delete_conversation_profile(self.0.request, self.0.options)
7540                .await
7541                .map(gax::response::Response::into_body)
7542        }
7543
7544        /// Sets the value of [name][crate::model::DeleteConversationProfileRequest::name].
7545        ///
7546        /// This is a **required** field for requests.
7547        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7548            self.0.request.name = v.into();
7549            self
7550        }
7551    }
7552
7553    #[doc(hidden)]
7554    impl gax::options::internal::RequestBuilder for DeleteConversationProfile {
7555        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7556            &mut self.0.options
7557        }
7558    }
7559
7560    /// The request builder for [ConversationProfiles::set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config] calls.
7561    ///
7562    /// # Example
7563    /// ```no_run
7564    /// # use google_cloud_dialogflow_v2::builder;
7565    /// use builder::conversation_profiles::SetSuggestionFeatureConfig;
7566    /// # tokio_test::block_on(async {
7567    /// use lro::Poller;
7568    ///
7569    /// let builder = prepare_request_builder();
7570    /// let response = builder.poller().until_done().await?;
7571    /// # gax::Result::<()>::Ok(()) });
7572    ///
7573    /// fn prepare_request_builder() -> SetSuggestionFeatureConfig {
7574    ///   # panic!();
7575    ///   // ... details omitted ...
7576    /// }
7577    /// ```
7578    #[derive(Clone, Debug)]
7579    pub struct SetSuggestionFeatureConfig(
7580        RequestBuilder<crate::model::SetSuggestionFeatureConfigRequest>,
7581    );
7582
7583    impl SetSuggestionFeatureConfig {
7584        pub(crate) fn new(
7585            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7586        ) -> Self {
7587            Self(RequestBuilder::new(stub))
7588        }
7589
7590        /// Sets the full request, replacing any prior values.
7591        pub fn with_request<V: Into<crate::model::SetSuggestionFeatureConfigRequest>>(
7592            mut self,
7593            v: V,
7594        ) -> Self {
7595            self.0.request = v.into();
7596            self
7597        }
7598
7599        /// Sets all the options, replacing any prior values.
7600        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7601            self.0.options = v.into();
7602            self
7603        }
7604
7605        /// Sends the request.
7606        ///
7607        /// # Long running operations
7608        ///
7609        /// This starts, but does not poll, a longrunning operation. More information
7610        /// on [set_suggestion_feature_config][crate::client::ConversationProfiles::set_suggestion_feature_config].
7611        pub async fn send(self) -> Result<longrunning::model::Operation> {
7612            (*self.0.stub)
7613                .set_suggestion_feature_config(self.0.request, self.0.options)
7614                .await
7615                .map(gax::response::Response::into_body)
7616        }
7617
7618        /// Creates a [Poller][lro::Poller] to work with `set_suggestion_feature_config`.
7619        pub fn poller(
7620            self,
7621        ) -> impl lro::Poller<
7622            crate::model::ConversationProfile,
7623            crate::model::SetSuggestionFeatureConfigOperationMetadata,
7624        > {
7625            type Operation = lro::internal::Operation<
7626                crate::model::ConversationProfile,
7627                crate::model::SetSuggestionFeatureConfigOperationMetadata,
7628            >;
7629            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7630            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7631
7632            let stub = self.0.stub.clone();
7633            let mut options = self.0.options.clone();
7634            options.set_retry_policy(gax::retry_policy::NeverRetry);
7635            let query = move |name| {
7636                let stub = stub.clone();
7637                let options = options.clone();
7638                async {
7639                    let op = GetOperation::new(stub)
7640                        .set_name(name)
7641                        .with_options(options)
7642                        .send()
7643                        .await?;
7644                    Ok(Operation::new(op))
7645                }
7646            };
7647
7648            let start = move || async {
7649                let op = self.send().await?;
7650                Ok(Operation::new(op))
7651            };
7652
7653            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7654        }
7655
7656        /// Sets the value of [conversation_profile][crate::model::SetSuggestionFeatureConfigRequest::conversation_profile].
7657        ///
7658        /// This is a **required** field for requests.
7659        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7660            self.0.request.conversation_profile = v.into();
7661            self
7662        }
7663
7664        /// Sets the value of [participant_role][crate::model::SetSuggestionFeatureConfigRequest::participant_role].
7665        ///
7666        /// This is a **required** field for requests.
7667        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7668            mut self,
7669            v: T,
7670        ) -> Self {
7671            self.0.request.participant_role = v.into();
7672            self
7673        }
7674
7675        /// Sets the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7676        ///
7677        /// This is a **required** field for requests.
7678        pub fn set_suggestion_feature_config<T>(mut self, v: T) -> Self
7679        where
7680            T: std::convert::Into<
7681                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7682                >,
7683        {
7684            self.0.request.suggestion_feature_config = std::option::Option::Some(v.into());
7685            self
7686        }
7687
7688        /// Sets or clears the value of [suggestion_feature_config][crate::model::SetSuggestionFeatureConfigRequest::suggestion_feature_config].
7689        ///
7690        /// This is a **required** field for requests.
7691        pub fn set_or_clear_suggestion_feature_config<T>(
7692            mut self,
7693            v: std::option::Option<T>,
7694        ) -> Self
7695        where
7696            T: std::convert::Into<
7697                    crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7698                >,
7699        {
7700            self.0.request.suggestion_feature_config = v.map(|x| x.into());
7701            self
7702        }
7703    }
7704
7705    #[doc(hidden)]
7706    impl gax::options::internal::RequestBuilder for SetSuggestionFeatureConfig {
7707        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7708            &mut self.0.options
7709        }
7710    }
7711
7712    /// The request builder for [ConversationProfiles::clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config] calls.
7713    ///
7714    /// # Example
7715    /// ```no_run
7716    /// # use google_cloud_dialogflow_v2::builder;
7717    /// use builder::conversation_profiles::ClearSuggestionFeatureConfig;
7718    /// # tokio_test::block_on(async {
7719    /// use lro::Poller;
7720    ///
7721    /// let builder = prepare_request_builder();
7722    /// let response = builder.poller().until_done().await?;
7723    /// # gax::Result::<()>::Ok(()) });
7724    ///
7725    /// fn prepare_request_builder() -> ClearSuggestionFeatureConfig {
7726    ///   # panic!();
7727    ///   // ... details omitted ...
7728    /// }
7729    /// ```
7730    #[derive(Clone, Debug)]
7731    pub struct ClearSuggestionFeatureConfig(
7732        RequestBuilder<crate::model::ClearSuggestionFeatureConfigRequest>,
7733    );
7734
7735    impl ClearSuggestionFeatureConfig {
7736        pub(crate) fn new(
7737            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7738        ) -> Self {
7739            Self(RequestBuilder::new(stub))
7740        }
7741
7742        /// Sets the full request, replacing any prior values.
7743        pub fn with_request<V: Into<crate::model::ClearSuggestionFeatureConfigRequest>>(
7744            mut self,
7745            v: V,
7746        ) -> Self {
7747            self.0.request = v.into();
7748            self
7749        }
7750
7751        /// Sets all the options, replacing any prior values.
7752        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7753            self.0.options = v.into();
7754            self
7755        }
7756
7757        /// Sends the request.
7758        ///
7759        /// # Long running operations
7760        ///
7761        /// This starts, but does not poll, a longrunning operation. More information
7762        /// on [clear_suggestion_feature_config][crate::client::ConversationProfiles::clear_suggestion_feature_config].
7763        pub async fn send(self) -> Result<longrunning::model::Operation> {
7764            (*self.0.stub)
7765                .clear_suggestion_feature_config(self.0.request, self.0.options)
7766                .await
7767                .map(gax::response::Response::into_body)
7768        }
7769
7770        /// Creates a [Poller][lro::Poller] to work with `clear_suggestion_feature_config`.
7771        pub fn poller(
7772            self,
7773        ) -> impl lro::Poller<
7774            crate::model::ConversationProfile,
7775            crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7776        > {
7777            type Operation = lro::internal::Operation<
7778                crate::model::ConversationProfile,
7779                crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7780            >;
7781            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7782            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7783
7784            let stub = self.0.stub.clone();
7785            let mut options = self.0.options.clone();
7786            options.set_retry_policy(gax::retry_policy::NeverRetry);
7787            let query = move |name| {
7788                let stub = stub.clone();
7789                let options = options.clone();
7790                async {
7791                    let op = GetOperation::new(stub)
7792                        .set_name(name)
7793                        .with_options(options)
7794                        .send()
7795                        .await?;
7796                    Ok(Operation::new(op))
7797                }
7798            };
7799
7800            let start = move || async {
7801                let op = self.send().await?;
7802                Ok(Operation::new(op))
7803            };
7804
7805            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7806        }
7807
7808        /// Sets the value of [conversation_profile][crate::model::ClearSuggestionFeatureConfigRequest::conversation_profile].
7809        ///
7810        /// This is a **required** field for requests.
7811        pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7812            self.0.request.conversation_profile = v.into();
7813            self
7814        }
7815
7816        /// Sets the value of [participant_role][crate::model::ClearSuggestionFeatureConfigRequest::participant_role].
7817        ///
7818        /// This is a **required** field for requests.
7819        pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7820            mut self,
7821            v: T,
7822        ) -> Self {
7823            self.0.request.participant_role = v.into();
7824            self
7825        }
7826
7827        /// Sets the value of [suggestion_feature_type][crate::model::ClearSuggestionFeatureConfigRequest::suggestion_feature_type].
7828        ///
7829        /// This is a **required** field for requests.
7830        pub fn set_suggestion_feature_type<T: Into<crate::model::suggestion_feature::Type>>(
7831            mut self,
7832            v: T,
7833        ) -> Self {
7834            self.0.request.suggestion_feature_type = v.into();
7835            self
7836        }
7837    }
7838
7839    #[doc(hidden)]
7840    impl gax::options::internal::RequestBuilder for ClearSuggestionFeatureConfig {
7841        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7842            &mut self.0.options
7843        }
7844    }
7845
7846    /// The request builder for [ConversationProfiles::list_locations][crate::client::ConversationProfiles::list_locations] calls.
7847    ///
7848    /// # Example
7849    /// ```no_run
7850    /// # use google_cloud_dialogflow_v2::builder;
7851    /// use builder::conversation_profiles::ListLocations;
7852    /// # tokio_test::block_on(async {
7853    /// use gax::paginator::ItemPaginator;
7854    ///
7855    /// let builder = prepare_request_builder();
7856    /// let mut items = builder.by_item();
7857    /// while let Some(result) = items.next().await {
7858    ///   let item = result?;
7859    /// }
7860    /// # gax::Result::<()>::Ok(()) });
7861    ///
7862    /// fn prepare_request_builder() -> ListLocations {
7863    ///   # panic!();
7864    ///   // ... details omitted ...
7865    /// }
7866    /// ```
7867    #[derive(Clone, Debug)]
7868    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7869
7870    impl ListLocations {
7871        pub(crate) fn new(
7872            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7873        ) -> Self {
7874            Self(RequestBuilder::new(stub))
7875        }
7876
7877        /// Sets the full request, replacing any prior values.
7878        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7879            mut self,
7880            v: V,
7881        ) -> Self {
7882            self.0.request = v.into();
7883            self
7884        }
7885
7886        /// Sets all the options, replacing any prior values.
7887        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7888            self.0.options = v.into();
7889            self
7890        }
7891
7892        /// Sends the request.
7893        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7894            (*self.0.stub)
7895                .list_locations(self.0.request, self.0.options)
7896                .await
7897                .map(gax::response::Response::into_body)
7898        }
7899
7900        /// Streams each page in the collection.
7901        pub fn by_page(
7902            self,
7903        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7904        {
7905            use std::clone::Clone;
7906            let token = self.0.request.page_token.clone();
7907            let execute = move |token: String| {
7908                let mut builder = self.clone();
7909                builder.0.request = builder.0.request.set_page_token(token);
7910                builder.send()
7911            };
7912            gax::paginator::internal::new_paginator(token, execute)
7913        }
7914
7915        /// Streams each item in the collection.
7916        pub fn by_item(
7917            self,
7918        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7919        {
7920            use gax::paginator::Paginator;
7921            self.by_page().items()
7922        }
7923
7924        /// Sets the value of [name][location::model::ListLocationsRequest::name].
7925        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7926            self.0.request.name = v.into();
7927            self
7928        }
7929
7930        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
7931        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7932            self.0.request.filter = v.into();
7933            self
7934        }
7935
7936        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
7937        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7938            self.0.request.page_size = v.into();
7939            self
7940        }
7941
7942        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
7943        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7944            self.0.request.page_token = v.into();
7945            self
7946        }
7947    }
7948
7949    #[doc(hidden)]
7950    impl gax::options::internal::RequestBuilder for ListLocations {
7951        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7952            &mut self.0.options
7953        }
7954    }
7955
7956    /// The request builder for [ConversationProfiles::get_location][crate::client::ConversationProfiles::get_location] calls.
7957    ///
7958    /// # Example
7959    /// ```no_run
7960    /// # use google_cloud_dialogflow_v2::builder;
7961    /// use builder::conversation_profiles::GetLocation;
7962    /// # tokio_test::block_on(async {
7963    ///
7964    /// let builder = prepare_request_builder();
7965    /// let response = builder.send().await?;
7966    /// # gax::Result::<()>::Ok(()) });
7967    ///
7968    /// fn prepare_request_builder() -> GetLocation {
7969    ///   # panic!();
7970    ///   // ... details omitted ...
7971    /// }
7972    /// ```
7973    #[derive(Clone, Debug)]
7974    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7975
7976    impl GetLocation {
7977        pub(crate) fn new(
7978            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7979        ) -> Self {
7980            Self(RequestBuilder::new(stub))
7981        }
7982
7983        /// Sets the full request, replacing any prior values.
7984        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7985            self.0.request = v.into();
7986            self
7987        }
7988
7989        /// Sets all the options, replacing any prior values.
7990        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7991            self.0.options = v.into();
7992            self
7993        }
7994
7995        /// Sends the request.
7996        pub async fn send(self) -> Result<location::model::Location> {
7997            (*self.0.stub)
7998                .get_location(self.0.request, self.0.options)
7999                .await
8000                .map(gax::response::Response::into_body)
8001        }
8002
8003        /// Sets the value of [name][location::model::GetLocationRequest::name].
8004        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8005            self.0.request.name = v.into();
8006            self
8007        }
8008    }
8009
8010    #[doc(hidden)]
8011    impl gax::options::internal::RequestBuilder for GetLocation {
8012        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8013            &mut self.0.options
8014        }
8015    }
8016
8017    /// The request builder for [ConversationProfiles::list_operations][crate::client::ConversationProfiles::list_operations] calls.
8018    ///
8019    /// # Example
8020    /// ```no_run
8021    /// # use google_cloud_dialogflow_v2::builder;
8022    /// use builder::conversation_profiles::ListOperations;
8023    /// # tokio_test::block_on(async {
8024    /// use gax::paginator::ItemPaginator;
8025    ///
8026    /// let builder = prepare_request_builder();
8027    /// let mut items = builder.by_item();
8028    /// while let Some(result) = items.next().await {
8029    ///   let item = result?;
8030    /// }
8031    /// # gax::Result::<()>::Ok(()) });
8032    ///
8033    /// fn prepare_request_builder() -> ListOperations {
8034    ///   # panic!();
8035    ///   // ... details omitted ...
8036    /// }
8037    /// ```
8038    #[derive(Clone, Debug)]
8039    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8040
8041    impl ListOperations {
8042        pub(crate) fn new(
8043            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8044        ) -> Self {
8045            Self(RequestBuilder::new(stub))
8046        }
8047
8048        /// Sets the full request, replacing any prior values.
8049        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8050            mut self,
8051            v: V,
8052        ) -> Self {
8053            self.0.request = v.into();
8054            self
8055        }
8056
8057        /// Sets all the options, replacing any prior values.
8058        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8059            self.0.options = v.into();
8060            self
8061        }
8062
8063        /// Sends the request.
8064        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8065            (*self.0.stub)
8066                .list_operations(self.0.request, self.0.options)
8067                .await
8068                .map(gax::response::Response::into_body)
8069        }
8070
8071        /// Streams each page in the collection.
8072        pub fn by_page(
8073            self,
8074        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8075        {
8076            use std::clone::Clone;
8077            let token = self.0.request.page_token.clone();
8078            let execute = move |token: String| {
8079                let mut builder = self.clone();
8080                builder.0.request = builder.0.request.set_page_token(token);
8081                builder.send()
8082            };
8083            gax::paginator::internal::new_paginator(token, execute)
8084        }
8085
8086        /// Streams each item in the collection.
8087        pub fn by_item(
8088            self,
8089        ) -> impl gax::paginator::ItemPaginator<
8090            longrunning::model::ListOperationsResponse,
8091            gax::error::Error,
8092        > {
8093            use gax::paginator::Paginator;
8094            self.by_page().items()
8095        }
8096
8097        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
8098        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8099            self.0.request.name = v.into();
8100            self
8101        }
8102
8103        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
8104        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8105            self.0.request.filter = v.into();
8106            self
8107        }
8108
8109        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
8110        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8111            self.0.request.page_size = v.into();
8112            self
8113        }
8114
8115        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
8116        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8117            self.0.request.page_token = v.into();
8118            self
8119        }
8120
8121        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
8122        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8123            self.0.request.return_partial_success = v.into();
8124            self
8125        }
8126    }
8127
8128    #[doc(hidden)]
8129    impl gax::options::internal::RequestBuilder for ListOperations {
8130        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8131            &mut self.0.options
8132        }
8133    }
8134
8135    /// The request builder for [ConversationProfiles::get_operation][crate::client::ConversationProfiles::get_operation] calls.
8136    ///
8137    /// # Example
8138    /// ```no_run
8139    /// # use google_cloud_dialogflow_v2::builder;
8140    /// use builder::conversation_profiles::GetOperation;
8141    /// # tokio_test::block_on(async {
8142    ///
8143    /// let builder = prepare_request_builder();
8144    /// let response = builder.send().await?;
8145    /// # gax::Result::<()>::Ok(()) });
8146    ///
8147    /// fn prepare_request_builder() -> GetOperation {
8148    ///   # panic!();
8149    ///   // ... details omitted ...
8150    /// }
8151    /// ```
8152    #[derive(Clone, Debug)]
8153    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8154
8155    impl GetOperation {
8156        pub(crate) fn new(
8157            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8158        ) -> Self {
8159            Self(RequestBuilder::new(stub))
8160        }
8161
8162        /// Sets the full request, replacing any prior values.
8163        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8164            mut self,
8165            v: V,
8166        ) -> Self {
8167            self.0.request = v.into();
8168            self
8169        }
8170
8171        /// Sets all the options, replacing any prior values.
8172        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8173            self.0.options = v.into();
8174            self
8175        }
8176
8177        /// Sends the request.
8178        pub async fn send(self) -> Result<longrunning::model::Operation> {
8179            (*self.0.stub)
8180                .get_operation(self.0.request, self.0.options)
8181                .await
8182                .map(gax::response::Response::into_body)
8183        }
8184
8185        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
8186        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8187            self.0.request.name = v.into();
8188            self
8189        }
8190    }
8191
8192    #[doc(hidden)]
8193    impl gax::options::internal::RequestBuilder for GetOperation {
8194        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8195            &mut self.0.options
8196        }
8197    }
8198
8199    /// The request builder for [ConversationProfiles::cancel_operation][crate::client::ConversationProfiles::cancel_operation] calls.
8200    ///
8201    /// # Example
8202    /// ```no_run
8203    /// # use google_cloud_dialogflow_v2::builder;
8204    /// use builder::conversation_profiles::CancelOperation;
8205    /// # tokio_test::block_on(async {
8206    ///
8207    /// let builder = prepare_request_builder();
8208    /// let response = builder.send().await?;
8209    /// # gax::Result::<()>::Ok(()) });
8210    ///
8211    /// fn prepare_request_builder() -> CancelOperation {
8212    ///   # panic!();
8213    ///   // ... details omitted ...
8214    /// }
8215    /// ```
8216    #[derive(Clone, Debug)]
8217    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8218
8219    impl CancelOperation {
8220        pub(crate) fn new(
8221            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8222        ) -> Self {
8223            Self(RequestBuilder::new(stub))
8224        }
8225
8226        /// Sets the full request, replacing any prior values.
8227        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8228            mut self,
8229            v: V,
8230        ) -> Self {
8231            self.0.request = v.into();
8232            self
8233        }
8234
8235        /// Sets all the options, replacing any prior values.
8236        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8237            self.0.options = v.into();
8238            self
8239        }
8240
8241        /// Sends the request.
8242        pub async fn send(self) -> Result<()> {
8243            (*self.0.stub)
8244                .cancel_operation(self.0.request, self.0.options)
8245                .await
8246                .map(gax::response::Response::into_body)
8247        }
8248
8249        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
8250        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8251            self.0.request.name = v.into();
8252            self
8253        }
8254    }
8255
8256    #[doc(hidden)]
8257    impl gax::options::internal::RequestBuilder for CancelOperation {
8258        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8259            &mut self.0.options
8260        }
8261    }
8262}
8263
8264#[cfg(feature = "documents")]
8265#[cfg_attr(docsrs, doc(cfg(feature = "documents")))]
8266pub mod documents {
8267    use crate::Result;
8268
8269    /// A builder for [Documents][crate::client::Documents].
8270    ///
8271    /// ```
8272    /// # tokio_test::block_on(async {
8273    /// # use google_cloud_dialogflow_v2::*;
8274    /// # use builder::documents::ClientBuilder;
8275    /// # use client::Documents;
8276    /// let builder : ClientBuilder = Documents::builder();
8277    /// let client = builder
8278    ///     .with_endpoint("https://dialogflow.googleapis.com")
8279    ///     .build().await?;
8280    /// # gax::client_builder::Result::<()>::Ok(()) });
8281    /// ```
8282    pub type ClientBuilder =
8283        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8284
8285    pub(crate) mod client {
8286        use super::super::super::client::Documents;
8287        pub struct Factory;
8288        impl gax::client_builder::internal::ClientFactory for Factory {
8289            type Client = Documents;
8290            type Credentials = gaxi::options::Credentials;
8291            async fn build(
8292                self,
8293                config: gaxi::options::ClientConfig,
8294            ) -> gax::client_builder::Result<Self::Client> {
8295                Self::Client::new(config).await
8296            }
8297        }
8298    }
8299
8300    /// Common implementation for [crate::client::Documents] request builders.
8301    #[derive(Clone, Debug)]
8302    pub(crate) struct RequestBuilder<R: std::default::Default> {
8303        stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8304        request: R,
8305        options: gax::options::RequestOptions,
8306    }
8307
8308    impl<R> RequestBuilder<R>
8309    where
8310        R: std::default::Default,
8311    {
8312        pub(crate) fn new(
8313            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8314        ) -> Self {
8315            Self {
8316                stub,
8317                request: R::default(),
8318                options: gax::options::RequestOptions::default(),
8319            }
8320        }
8321    }
8322
8323    /// The request builder for [Documents::list_documents][crate::client::Documents::list_documents] calls.
8324    ///
8325    /// # Example
8326    /// ```no_run
8327    /// # use google_cloud_dialogflow_v2::builder;
8328    /// use builder::documents::ListDocuments;
8329    /// # tokio_test::block_on(async {
8330    /// use gax::paginator::ItemPaginator;
8331    ///
8332    /// let builder = prepare_request_builder();
8333    /// let mut items = builder.by_item();
8334    /// while let Some(result) = items.next().await {
8335    ///   let item = result?;
8336    /// }
8337    /// # gax::Result::<()>::Ok(()) });
8338    ///
8339    /// fn prepare_request_builder() -> ListDocuments {
8340    ///   # panic!();
8341    ///   // ... details omitted ...
8342    /// }
8343    /// ```
8344    #[derive(Clone, Debug)]
8345    pub struct ListDocuments(RequestBuilder<crate::model::ListDocumentsRequest>);
8346
8347    impl ListDocuments {
8348        pub(crate) fn new(
8349            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8350        ) -> Self {
8351            Self(RequestBuilder::new(stub))
8352        }
8353
8354        /// Sets the full request, replacing any prior values.
8355        pub fn with_request<V: Into<crate::model::ListDocumentsRequest>>(mut self, v: V) -> Self {
8356            self.0.request = v.into();
8357            self
8358        }
8359
8360        /// Sets all the options, replacing any prior values.
8361        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8362            self.0.options = v.into();
8363            self
8364        }
8365
8366        /// Sends the request.
8367        pub async fn send(self) -> Result<crate::model::ListDocumentsResponse> {
8368            (*self.0.stub)
8369                .list_documents(self.0.request, self.0.options)
8370                .await
8371                .map(gax::response::Response::into_body)
8372        }
8373
8374        /// Streams each page in the collection.
8375        pub fn by_page(
8376            self,
8377        ) -> impl gax::paginator::Paginator<crate::model::ListDocumentsResponse, gax::error::Error>
8378        {
8379            use std::clone::Clone;
8380            let token = self.0.request.page_token.clone();
8381            let execute = move |token: String| {
8382                let mut builder = self.clone();
8383                builder.0.request = builder.0.request.set_page_token(token);
8384                builder.send()
8385            };
8386            gax::paginator::internal::new_paginator(token, execute)
8387        }
8388
8389        /// Streams each item in the collection.
8390        pub fn by_item(
8391            self,
8392        ) -> impl gax::paginator::ItemPaginator<crate::model::ListDocumentsResponse, gax::error::Error>
8393        {
8394            use gax::paginator::Paginator;
8395            self.by_page().items()
8396        }
8397
8398        /// Sets the value of [parent][crate::model::ListDocumentsRequest::parent].
8399        ///
8400        /// This is a **required** field for requests.
8401        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8402            self.0.request.parent = v.into();
8403            self
8404        }
8405
8406        /// Sets the value of [page_size][crate::model::ListDocumentsRequest::page_size].
8407        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8408            self.0.request.page_size = v.into();
8409            self
8410        }
8411
8412        /// Sets the value of [page_token][crate::model::ListDocumentsRequest::page_token].
8413        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8414            self.0.request.page_token = v.into();
8415            self
8416        }
8417
8418        /// Sets the value of [filter][crate::model::ListDocumentsRequest::filter].
8419        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8420            self.0.request.filter = v.into();
8421            self
8422        }
8423    }
8424
8425    #[doc(hidden)]
8426    impl gax::options::internal::RequestBuilder for ListDocuments {
8427        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8428            &mut self.0.options
8429        }
8430    }
8431
8432    /// The request builder for [Documents::get_document][crate::client::Documents::get_document] calls.
8433    ///
8434    /// # Example
8435    /// ```no_run
8436    /// # use google_cloud_dialogflow_v2::builder;
8437    /// use builder::documents::GetDocument;
8438    /// # tokio_test::block_on(async {
8439    ///
8440    /// let builder = prepare_request_builder();
8441    /// let response = builder.send().await?;
8442    /// # gax::Result::<()>::Ok(()) });
8443    ///
8444    /// fn prepare_request_builder() -> GetDocument {
8445    ///   # panic!();
8446    ///   // ... details omitted ...
8447    /// }
8448    /// ```
8449    #[derive(Clone, Debug)]
8450    pub struct GetDocument(RequestBuilder<crate::model::GetDocumentRequest>);
8451
8452    impl GetDocument {
8453        pub(crate) fn new(
8454            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8455        ) -> Self {
8456            Self(RequestBuilder::new(stub))
8457        }
8458
8459        /// Sets the full request, replacing any prior values.
8460        pub fn with_request<V: Into<crate::model::GetDocumentRequest>>(mut self, v: V) -> Self {
8461            self.0.request = v.into();
8462            self
8463        }
8464
8465        /// Sets all the options, replacing any prior values.
8466        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8467            self.0.options = v.into();
8468            self
8469        }
8470
8471        /// Sends the request.
8472        pub async fn send(self) -> Result<crate::model::Document> {
8473            (*self.0.stub)
8474                .get_document(self.0.request, self.0.options)
8475                .await
8476                .map(gax::response::Response::into_body)
8477        }
8478
8479        /// Sets the value of [name][crate::model::GetDocumentRequest::name].
8480        ///
8481        /// This is a **required** field for requests.
8482        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8483            self.0.request.name = v.into();
8484            self
8485        }
8486    }
8487
8488    #[doc(hidden)]
8489    impl gax::options::internal::RequestBuilder for GetDocument {
8490        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8491            &mut self.0.options
8492        }
8493    }
8494
8495    /// The request builder for [Documents::create_document][crate::client::Documents::create_document] calls.
8496    ///
8497    /// # Example
8498    /// ```no_run
8499    /// # use google_cloud_dialogflow_v2::builder;
8500    /// use builder::documents::CreateDocument;
8501    /// # tokio_test::block_on(async {
8502    /// use lro::Poller;
8503    ///
8504    /// let builder = prepare_request_builder();
8505    /// let response = builder.poller().until_done().await?;
8506    /// # gax::Result::<()>::Ok(()) });
8507    ///
8508    /// fn prepare_request_builder() -> CreateDocument {
8509    ///   # panic!();
8510    ///   // ... details omitted ...
8511    /// }
8512    /// ```
8513    #[derive(Clone, Debug)]
8514    pub struct CreateDocument(RequestBuilder<crate::model::CreateDocumentRequest>);
8515
8516    impl CreateDocument {
8517        pub(crate) fn new(
8518            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8519        ) -> Self {
8520            Self(RequestBuilder::new(stub))
8521        }
8522
8523        /// Sets the full request, replacing any prior values.
8524        pub fn with_request<V: Into<crate::model::CreateDocumentRequest>>(mut self, v: V) -> Self {
8525            self.0.request = v.into();
8526            self
8527        }
8528
8529        /// Sets all the options, replacing any prior values.
8530        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8531            self.0.options = v.into();
8532            self
8533        }
8534
8535        /// Sends the request.
8536        ///
8537        /// # Long running operations
8538        ///
8539        /// This starts, but does not poll, a longrunning operation. More information
8540        /// on [create_document][crate::client::Documents::create_document].
8541        pub async fn send(self) -> Result<longrunning::model::Operation> {
8542            (*self.0.stub)
8543                .create_document(self.0.request, self.0.options)
8544                .await
8545                .map(gax::response::Response::into_body)
8546        }
8547
8548        /// Creates a [Poller][lro::Poller] to work with `create_document`.
8549        pub fn poller(
8550            self,
8551        ) -> impl lro::Poller<crate::model::Document, crate::model::KnowledgeOperationMetadata>
8552        {
8553            type Operation = lro::internal::Operation<
8554                crate::model::Document,
8555                crate::model::KnowledgeOperationMetadata,
8556            >;
8557            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8558            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8559
8560            let stub = self.0.stub.clone();
8561            let mut options = self.0.options.clone();
8562            options.set_retry_policy(gax::retry_policy::NeverRetry);
8563            let query = move |name| {
8564                let stub = stub.clone();
8565                let options = options.clone();
8566                async {
8567                    let op = GetOperation::new(stub)
8568                        .set_name(name)
8569                        .with_options(options)
8570                        .send()
8571                        .await?;
8572                    Ok(Operation::new(op))
8573                }
8574            };
8575
8576            let start = move || async {
8577                let op = self.send().await?;
8578                Ok(Operation::new(op))
8579            };
8580
8581            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8582        }
8583
8584        /// Sets the value of [parent][crate::model::CreateDocumentRequest::parent].
8585        ///
8586        /// This is a **required** field for requests.
8587        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8588            self.0.request.parent = v.into();
8589            self
8590        }
8591
8592        /// Sets the value of [document][crate::model::CreateDocumentRequest::document].
8593        ///
8594        /// This is a **required** field for requests.
8595        pub fn set_document<T>(mut self, v: T) -> Self
8596        where
8597            T: std::convert::Into<crate::model::Document>,
8598        {
8599            self.0.request.document = std::option::Option::Some(v.into());
8600            self
8601        }
8602
8603        /// Sets or clears the value of [document][crate::model::CreateDocumentRequest::document].
8604        ///
8605        /// This is a **required** field for requests.
8606        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
8607        where
8608            T: std::convert::Into<crate::model::Document>,
8609        {
8610            self.0.request.document = v.map(|x| x.into());
8611            self
8612        }
8613    }
8614
8615    #[doc(hidden)]
8616    impl gax::options::internal::RequestBuilder for CreateDocument {
8617        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8618            &mut self.0.options
8619        }
8620    }
8621
8622    /// The request builder for [Documents::import_documents][crate::client::Documents::import_documents] calls.
8623    ///
8624    /// # Example
8625    /// ```no_run
8626    /// # use google_cloud_dialogflow_v2::builder;
8627    /// use builder::documents::ImportDocuments;
8628    /// # tokio_test::block_on(async {
8629    /// use lro::Poller;
8630    ///
8631    /// let builder = prepare_request_builder();
8632    /// let response = builder.poller().until_done().await?;
8633    /// # gax::Result::<()>::Ok(()) });
8634    ///
8635    /// fn prepare_request_builder() -> ImportDocuments {
8636    ///   # panic!();
8637    ///   // ... details omitted ...
8638    /// }
8639    /// ```
8640    #[derive(Clone, Debug)]
8641    pub struct ImportDocuments(RequestBuilder<crate::model::ImportDocumentsRequest>);
8642
8643    impl ImportDocuments {
8644        pub(crate) fn new(
8645            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8646        ) -> Self {
8647            Self(RequestBuilder::new(stub))
8648        }
8649
8650        /// Sets the full request, replacing any prior values.
8651        pub fn with_request<V: Into<crate::model::ImportDocumentsRequest>>(mut self, v: V) -> Self {
8652            self.0.request = v.into();
8653            self
8654        }
8655
8656        /// Sets all the options, replacing any prior values.
8657        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8658            self.0.options = v.into();
8659            self
8660        }
8661
8662        /// Sends the request.
8663        ///
8664        /// # Long running operations
8665        ///
8666        /// This starts, but does not poll, a longrunning operation. More information
8667        /// on [import_documents][crate::client::Documents::import_documents].
8668        pub async fn send(self) -> Result<longrunning::model::Operation> {
8669            (*self.0.stub)
8670                .import_documents(self.0.request, self.0.options)
8671                .await
8672                .map(gax::response::Response::into_body)
8673        }
8674
8675        /// Creates a [Poller][lro::Poller] to work with `import_documents`.
8676        pub fn poller(
8677            self,
8678        ) -> impl lro::Poller<
8679            crate::model::ImportDocumentsResponse,
8680            crate::model::KnowledgeOperationMetadata,
8681        > {
8682            type Operation = lro::internal::Operation<
8683                crate::model::ImportDocumentsResponse,
8684                crate::model::KnowledgeOperationMetadata,
8685            >;
8686            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8687            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8688
8689            let stub = self.0.stub.clone();
8690            let mut options = self.0.options.clone();
8691            options.set_retry_policy(gax::retry_policy::NeverRetry);
8692            let query = move |name| {
8693                let stub = stub.clone();
8694                let options = options.clone();
8695                async {
8696                    let op = GetOperation::new(stub)
8697                        .set_name(name)
8698                        .with_options(options)
8699                        .send()
8700                        .await?;
8701                    Ok(Operation::new(op))
8702                }
8703            };
8704
8705            let start = move || async {
8706                let op = self.send().await?;
8707                Ok(Operation::new(op))
8708            };
8709
8710            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8711        }
8712
8713        /// Sets the value of [parent][crate::model::ImportDocumentsRequest::parent].
8714        ///
8715        /// This is a **required** field for requests.
8716        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8717            self.0.request.parent = v.into();
8718            self
8719        }
8720
8721        /// Sets the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8722        ///
8723        /// This is a **required** field for requests.
8724        pub fn set_document_template<T>(mut self, v: T) -> Self
8725        where
8726            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8727        {
8728            self.0.request.document_template = std::option::Option::Some(v.into());
8729            self
8730        }
8731
8732        /// Sets or clears the value of [document_template][crate::model::ImportDocumentsRequest::document_template].
8733        ///
8734        /// This is a **required** field for requests.
8735        pub fn set_or_clear_document_template<T>(mut self, v: std::option::Option<T>) -> Self
8736        where
8737            T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8738        {
8739            self.0.request.document_template = v.map(|x| x.into());
8740            self
8741        }
8742
8743        /// Sets the value of [import_gcs_custom_metadata][crate::model::ImportDocumentsRequest::import_gcs_custom_metadata].
8744        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
8745            self.0.request.import_gcs_custom_metadata = v.into();
8746            self
8747        }
8748
8749        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source].
8750        ///
8751        /// Note that all the setters affecting `source` are
8752        /// mutually exclusive.
8753        pub fn set_source<T: Into<Option<crate::model::import_documents_request::Source>>>(
8754            mut self,
8755            v: T,
8756        ) -> Self {
8757            self.0.request.source = v.into();
8758            self
8759        }
8760
8761        /// Sets the value of [source][crate::model::ImportDocumentsRequest::source]
8762        /// to hold a `GcsSource`.
8763        ///
8764        /// Note that all the setters affecting `source` are
8765        /// mutually exclusive.
8766        pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSources>>>(
8767            mut self,
8768            v: T,
8769        ) -> Self {
8770            self.0.request = self.0.request.set_gcs_source(v);
8771            self
8772        }
8773    }
8774
8775    #[doc(hidden)]
8776    impl gax::options::internal::RequestBuilder for ImportDocuments {
8777        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8778            &mut self.0.options
8779        }
8780    }
8781
8782    /// The request builder for [Documents::delete_document][crate::client::Documents::delete_document] calls.
8783    ///
8784    /// # Example
8785    /// ```no_run
8786    /// # use google_cloud_dialogflow_v2::builder;
8787    /// use builder::documents::DeleteDocument;
8788    /// # tokio_test::block_on(async {
8789    /// use lro::Poller;
8790    ///
8791    /// let builder = prepare_request_builder();
8792    /// let response = builder.poller().until_done().await?;
8793    /// # gax::Result::<()>::Ok(()) });
8794    ///
8795    /// fn prepare_request_builder() -> DeleteDocument {
8796    ///   # panic!();
8797    ///   // ... details omitted ...
8798    /// }
8799    /// ```
8800    #[derive(Clone, Debug)]
8801    pub struct DeleteDocument(RequestBuilder<crate::model::DeleteDocumentRequest>);
8802
8803    impl DeleteDocument {
8804        pub(crate) fn new(
8805            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8806        ) -> Self {
8807            Self(RequestBuilder::new(stub))
8808        }
8809
8810        /// Sets the full request, replacing any prior values.
8811        pub fn with_request<V: Into<crate::model::DeleteDocumentRequest>>(mut self, v: V) -> Self {
8812            self.0.request = v.into();
8813            self
8814        }
8815
8816        /// Sets all the options, replacing any prior values.
8817        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8818            self.0.options = v.into();
8819            self
8820        }
8821
8822        /// Sends the request.
8823        ///
8824        /// # Long running operations
8825        ///
8826        /// This starts, but does not poll, a longrunning operation. More information
8827        /// on [delete_document][crate::client::Documents::delete_document].
8828        pub async fn send(self) -> Result<longrunning::model::Operation> {
8829            (*self.0.stub)
8830                .delete_document(self.0.request, self.0.options)
8831                .await
8832                .map(gax::response::Response::into_body)
8833        }
8834
8835        /// Creates a [Poller][lro::Poller] to work with `delete_document`.
8836        pub fn poller(self) -> impl lro::Poller<(), crate::model::KnowledgeOperationMetadata> {
8837            type Operation =
8838                lro::internal::Operation<wkt::Empty, crate::model::KnowledgeOperationMetadata>;
8839            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8840            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8841
8842            let stub = self.0.stub.clone();
8843            let mut options = self.0.options.clone();
8844            options.set_retry_policy(gax::retry_policy::NeverRetry);
8845            let query = move |name| {
8846                let stub = stub.clone();
8847                let options = options.clone();
8848                async {
8849                    let op = GetOperation::new(stub)
8850                        .set_name(name)
8851                        .with_options(options)
8852                        .send()
8853                        .await?;
8854                    Ok(Operation::new(op))
8855                }
8856            };
8857
8858            let start = move || async {
8859                let op = self.send().await?;
8860                Ok(Operation::new(op))
8861            };
8862
8863            lro::internal::new_unit_response_poller(
8864                polling_error_policy,
8865                polling_backoff_policy,
8866                start,
8867                query,
8868            )
8869        }
8870
8871        /// Sets the value of [name][crate::model::DeleteDocumentRequest::name].
8872        ///
8873        /// This is a **required** field for requests.
8874        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8875            self.0.request.name = v.into();
8876            self
8877        }
8878    }
8879
8880    #[doc(hidden)]
8881    impl gax::options::internal::RequestBuilder for DeleteDocument {
8882        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8883            &mut self.0.options
8884        }
8885    }
8886
8887    /// The request builder for [Documents::update_document][crate::client::Documents::update_document] calls.
8888    ///
8889    /// # Example
8890    /// ```no_run
8891    /// # use google_cloud_dialogflow_v2::builder;
8892    /// use builder::documents::UpdateDocument;
8893    /// # tokio_test::block_on(async {
8894    /// use lro::Poller;
8895    ///
8896    /// let builder = prepare_request_builder();
8897    /// let response = builder.poller().until_done().await?;
8898    /// # gax::Result::<()>::Ok(()) });
8899    ///
8900    /// fn prepare_request_builder() -> UpdateDocument {
8901    ///   # panic!();
8902    ///   // ... details omitted ...
8903    /// }
8904    /// ```
8905    #[derive(Clone, Debug)]
8906    pub struct UpdateDocument(RequestBuilder<crate::model::UpdateDocumentRequest>);
8907
8908    impl UpdateDocument {
8909        pub(crate) fn new(
8910            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8911        ) -> Self {
8912            Self(RequestBuilder::new(stub))
8913        }
8914
8915        /// Sets the full request, replacing any prior values.
8916        pub fn with_request<V: Into<crate::model::UpdateDocumentRequest>>(mut self, v: V) -> Self {
8917            self.0.request = v.into();
8918            self
8919        }
8920
8921        /// Sets all the options, replacing any prior values.
8922        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8923            self.0.options = v.into();
8924            self
8925        }
8926
8927        /// Sends the request.
8928        ///
8929        /// # Long running operations
8930        ///
8931        /// This starts, but does not poll, a longrunning operation. More information
8932        /// on [update_document][crate::client::Documents::update_document].
8933        pub async fn send(self) -> Result<longrunning::model::Operation> {
8934            (*self.0.stub)
8935                .update_document(self.0.request, self.0.options)
8936                .await
8937                .map(gax::response::Response::into_body)
8938        }
8939
8940        /// Creates a [Poller][lro::Poller] to work with `update_document`.
8941        pub fn poller(
8942            self,
8943        ) -> impl lro::Poller<crate::model::Document, crate::model::KnowledgeOperationMetadata>
8944        {
8945            type Operation = lro::internal::Operation<
8946                crate::model::Document,
8947                crate::model::KnowledgeOperationMetadata,
8948            >;
8949            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8950            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8951
8952            let stub = self.0.stub.clone();
8953            let mut options = self.0.options.clone();
8954            options.set_retry_policy(gax::retry_policy::NeverRetry);
8955            let query = move |name| {
8956                let stub = stub.clone();
8957                let options = options.clone();
8958                async {
8959                    let op = GetOperation::new(stub)
8960                        .set_name(name)
8961                        .with_options(options)
8962                        .send()
8963                        .await?;
8964                    Ok(Operation::new(op))
8965                }
8966            };
8967
8968            let start = move || async {
8969                let op = self.send().await?;
8970                Ok(Operation::new(op))
8971            };
8972
8973            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8974        }
8975
8976        /// Sets the value of [document][crate::model::UpdateDocumentRequest::document].
8977        ///
8978        /// This is a **required** field for requests.
8979        pub fn set_document<T>(mut self, v: T) -> Self
8980        where
8981            T: std::convert::Into<crate::model::Document>,
8982        {
8983            self.0.request.document = std::option::Option::Some(v.into());
8984            self
8985        }
8986
8987        /// Sets or clears the value of [document][crate::model::UpdateDocumentRequest::document].
8988        ///
8989        /// This is a **required** field for requests.
8990        pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
8991        where
8992            T: std::convert::Into<crate::model::Document>,
8993        {
8994            self.0.request.document = v.map(|x| x.into());
8995            self
8996        }
8997
8998        /// Sets the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
8999        pub fn set_update_mask<T>(mut self, v: T) -> Self
9000        where
9001            T: std::convert::Into<wkt::FieldMask>,
9002        {
9003            self.0.request.update_mask = std::option::Option::Some(v.into());
9004            self
9005        }
9006
9007        /// Sets or clears the value of [update_mask][crate::model::UpdateDocumentRequest::update_mask].
9008        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9009        where
9010            T: std::convert::Into<wkt::FieldMask>,
9011        {
9012            self.0.request.update_mask = v.map(|x| x.into());
9013            self
9014        }
9015    }
9016
9017    #[doc(hidden)]
9018    impl gax::options::internal::RequestBuilder for UpdateDocument {
9019        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9020            &mut self.0.options
9021        }
9022    }
9023
9024    /// The request builder for [Documents::reload_document][crate::client::Documents::reload_document] calls.
9025    ///
9026    /// # Example
9027    /// ```no_run
9028    /// # use google_cloud_dialogflow_v2::builder;
9029    /// use builder::documents::ReloadDocument;
9030    /// # tokio_test::block_on(async {
9031    /// use lro::Poller;
9032    ///
9033    /// let builder = prepare_request_builder();
9034    /// let response = builder.poller().until_done().await?;
9035    /// # gax::Result::<()>::Ok(()) });
9036    ///
9037    /// fn prepare_request_builder() -> ReloadDocument {
9038    ///   # panic!();
9039    ///   // ... details omitted ...
9040    /// }
9041    /// ```
9042    #[derive(Clone, Debug)]
9043    pub struct ReloadDocument(RequestBuilder<crate::model::ReloadDocumentRequest>);
9044
9045    impl ReloadDocument {
9046        pub(crate) fn new(
9047            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9048        ) -> Self {
9049            Self(RequestBuilder::new(stub))
9050        }
9051
9052        /// Sets the full request, replacing any prior values.
9053        pub fn with_request<V: Into<crate::model::ReloadDocumentRequest>>(mut self, v: V) -> Self {
9054            self.0.request = v.into();
9055            self
9056        }
9057
9058        /// Sets all the options, replacing any prior values.
9059        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9060            self.0.options = v.into();
9061            self
9062        }
9063
9064        /// Sends the request.
9065        ///
9066        /// # Long running operations
9067        ///
9068        /// This starts, but does not poll, a longrunning operation. More information
9069        /// on [reload_document][crate::client::Documents::reload_document].
9070        pub async fn send(self) -> Result<longrunning::model::Operation> {
9071            (*self.0.stub)
9072                .reload_document(self.0.request, self.0.options)
9073                .await
9074                .map(gax::response::Response::into_body)
9075        }
9076
9077        /// Creates a [Poller][lro::Poller] to work with `reload_document`.
9078        pub fn poller(
9079            self,
9080        ) -> impl lro::Poller<crate::model::Document, crate::model::KnowledgeOperationMetadata>
9081        {
9082            type Operation = lro::internal::Operation<
9083                crate::model::Document,
9084                crate::model::KnowledgeOperationMetadata,
9085            >;
9086            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9087            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9088
9089            let stub = self.0.stub.clone();
9090            let mut options = self.0.options.clone();
9091            options.set_retry_policy(gax::retry_policy::NeverRetry);
9092            let query = move |name| {
9093                let stub = stub.clone();
9094                let options = options.clone();
9095                async {
9096                    let op = GetOperation::new(stub)
9097                        .set_name(name)
9098                        .with_options(options)
9099                        .send()
9100                        .await?;
9101                    Ok(Operation::new(op))
9102                }
9103            };
9104
9105            let start = move || async {
9106                let op = self.send().await?;
9107                Ok(Operation::new(op))
9108            };
9109
9110            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9111        }
9112
9113        /// Sets the value of [name][crate::model::ReloadDocumentRequest::name].
9114        ///
9115        /// This is a **required** field for requests.
9116        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9117            self.0.request.name = v.into();
9118            self
9119        }
9120
9121        /// Sets the value of [import_gcs_custom_metadata][crate::model::ReloadDocumentRequest::import_gcs_custom_metadata].
9122        pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
9123            self.0.request.import_gcs_custom_metadata = v.into();
9124            self
9125        }
9126
9127        /// Sets the value of [smart_messaging_partial_update][crate::model::ReloadDocumentRequest::smart_messaging_partial_update].
9128        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9129            self.0.request.smart_messaging_partial_update = v.into();
9130            self
9131        }
9132
9133        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source].
9134        ///
9135        /// Note that all the setters affecting `source` are
9136        /// mutually exclusive.
9137        pub fn set_source<T: Into<Option<crate::model::reload_document_request::Source>>>(
9138            mut self,
9139            v: T,
9140        ) -> Self {
9141            self.0.request.source = v.into();
9142            self
9143        }
9144
9145        /// Sets the value of [source][crate::model::ReloadDocumentRequest::source]
9146        /// to hold a `ContentUri`.
9147        ///
9148        /// Note that all the setters affecting `source` are
9149        /// mutually exclusive.
9150        pub fn set_content_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9151            self.0.request = self.0.request.set_content_uri(v);
9152            self
9153        }
9154    }
9155
9156    #[doc(hidden)]
9157    impl gax::options::internal::RequestBuilder for ReloadDocument {
9158        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9159            &mut self.0.options
9160        }
9161    }
9162
9163    /// The request builder for [Documents::export_document][crate::client::Documents::export_document] calls.
9164    ///
9165    /// # Example
9166    /// ```no_run
9167    /// # use google_cloud_dialogflow_v2::builder;
9168    /// use builder::documents::ExportDocument;
9169    /// # tokio_test::block_on(async {
9170    /// use lro::Poller;
9171    ///
9172    /// let builder = prepare_request_builder();
9173    /// let response = builder.poller().until_done().await?;
9174    /// # gax::Result::<()>::Ok(()) });
9175    ///
9176    /// fn prepare_request_builder() -> ExportDocument {
9177    ///   # panic!();
9178    ///   // ... details omitted ...
9179    /// }
9180    /// ```
9181    #[derive(Clone, Debug)]
9182    pub struct ExportDocument(RequestBuilder<crate::model::ExportDocumentRequest>);
9183
9184    impl ExportDocument {
9185        pub(crate) fn new(
9186            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9187        ) -> Self {
9188            Self(RequestBuilder::new(stub))
9189        }
9190
9191        /// Sets the full request, replacing any prior values.
9192        pub fn with_request<V: Into<crate::model::ExportDocumentRequest>>(mut self, v: V) -> Self {
9193            self.0.request = v.into();
9194            self
9195        }
9196
9197        /// Sets all the options, replacing any prior values.
9198        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9199            self.0.options = v.into();
9200            self
9201        }
9202
9203        /// Sends the request.
9204        ///
9205        /// # Long running operations
9206        ///
9207        /// This starts, but does not poll, a longrunning operation. More information
9208        /// on [export_document][crate::client::Documents::export_document].
9209        pub async fn send(self) -> Result<longrunning::model::Operation> {
9210            (*self.0.stub)
9211                .export_document(self.0.request, self.0.options)
9212                .await
9213                .map(gax::response::Response::into_body)
9214        }
9215
9216        /// Creates a [Poller][lro::Poller] to work with `export_document`.
9217        pub fn poller(
9218            self,
9219        ) -> impl lro::Poller<crate::model::Document, crate::model::KnowledgeOperationMetadata>
9220        {
9221            type Operation = lro::internal::Operation<
9222                crate::model::Document,
9223                crate::model::KnowledgeOperationMetadata,
9224            >;
9225            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9226            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9227
9228            let stub = self.0.stub.clone();
9229            let mut options = self.0.options.clone();
9230            options.set_retry_policy(gax::retry_policy::NeverRetry);
9231            let query = move |name| {
9232                let stub = stub.clone();
9233                let options = options.clone();
9234                async {
9235                    let op = GetOperation::new(stub)
9236                        .set_name(name)
9237                        .with_options(options)
9238                        .send()
9239                        .await?;
9240                    Ok(Operation::new(op))
9241                }
9242            };
9243
9244            let start = move || async {
9245                let op = self.send().await?;
9246                Ok(Operation::new(op))
9247            };
9248
9249            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9250        }
9251
9252        /// Sets the value of [name][crate::model::ExportDocumentRequest::name].
9253        ///
9254        /// This is a **required** field for requests.
9255        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9256            self.0.request.name = v.into();
9257            self
9258        }
9259
9260        /// Sets the value of [export_full_content][crate::model::ExportDocumentRequest::export_full_content].
9261        pub fn set_export_full_content<T: Into<bool>>(mut self, v: T) -> Self {
9262            self.0.request.export_full_content = v.into();
9263            self
9264        }
9265
9266        /// Sets the value of [smart_messaging_partial_update][crate::model::ExportDocumentRequest::smart_messaging_partial_update].
9267        pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9268            self.0.request.smart_messaging_partial_update = v.into();
9269            self
9270        }
9271
9272        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination].
9273        ///
9274        /// Note that all the setters affecting `destination` are
9275        /// mutually exclusive.
9276        pub fn set_destination<
9277            T: Into<Option<crate::model::export_document_request::Destination>>,
9278        >(
9279            mut self,
9280            v: T,
9281        ) -> Self {
9282            self.0.request.destination = v.into();
9283            self
9284        }
9285
9286        /// Sets the value of [destination][crate::model::ExportDocumentRequest::destination]
9287        /// to hold a `GcsDestination`.
9288        ///
9289        /// Note that all the setters affecting `destination` are
9290        /// mutually exclusive.
9291        pub fn set_gcs_destination<
9292            T: std::convert::Into<std::boxed::Box<crate::model::GcsDestination>>,
9293        >(
9294            mut self,
9295            v: T,
9296        ) -> Self {
9297            self.0.request = self.0.request.set_gcs_destination(v);
9298            self
9299        }
9300    }
9301
9302    #[doc(hidden)]
9303    impl gax::options::internal::RequestBuilder for ExportDocument {
9304        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9305            &mut self.0.options
9306        }
9307    }
9308
9309    /// The request builder for [Documents::list_locations][crate::client::Documents::list_locations] calls.
9310    ///
9311    /// # Example
9312    /// ```no_run
9313    /// # use google_cloud_dialogflow_v2::builder;
9314    /// use builder::documents::ListLocations;
9315    /// # tokio_test::block_on(async {
9316    /// use gax::paginator::ItemPaginator;
9317    ///
9318    /// let builder = prepare_request_builder();
9319    /// let mut items = builder.by_item();
9320    /// while let Some(result) = items.next().await {
9321    ///   let item = result?;
9322    /// }
9323    /// # gax::Result::<()>::Ok(()) });
9324    ///
9325    /// fn prepare_request_builder() -> ListLocations {
9326    ///   # panic!();
9327    ///   // ... details omitted ...
9328    /// }
9329    /// ```
9330    #[derive(Clone, Debug)]
9331    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9332
9333    impl ListLocations {
9334        pub(crate) fn new(
9335            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9336        ) -> Self {
9337            Self(RequestBuilder::new(stub))
9338        }
9339
9340        /// Sets the full request, replacing any prior values.
9341        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9342            mut self,
9343            v: V,
9344        ) -> Self {
9345            self.0.request = v.into();
9346            self
9347        }
9348
9349        /// Sets all the options, replacing any prior values.
9350        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9351            self.0.options = v.into();
9352            self
9353        }
9354
9355        /// Sends the request.
9356        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9357            (*self.0.stub)
9358                .list_locations(self.0.request, self.0.options)
9359                .await
9360                .map(gax::response::Response::into_body)
9361        }
9362
9363        /// Streams each page in the collection.
9364        pub fn by_page(
9365            self,
9366        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9367        {
9368            use std::clone::Clone;
9369            let token = self.0.request.page_token.clone();
9370            let execute = move |token: String| {
9371                let mut builder = self.clone();
9372                builder.0.request = builder.0.request.set_page_token(token);
9373                builder.send()
9374            };
9375            gax::paginator::internal::new_paginator(token, execute)
9376        }
9377
9378        /// Streams each item in the collection.
9379        pub fn by_item(
9380            self,
9381        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9382        {
9383            use gax::paginator::Paginator;
9384            self.by_page().items()
9385        }
9386
9387        /// Sets the value of [name][location::model::ListLocationsRequest::name].
9388        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9389            self.0.request.name = v.into();
9390            self
9391        }
9392
9393        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
9394        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9395            self.0.request.filter = v.into();
9396            self
9397        }
9398
9399        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
9400        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9401            self.0.request.page_size = v.into();
9402            self
9403        }
9404
9405        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
9406        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9407            self.0.request.page_token = v.into();
9408            self
9409        }
9410    }
9411
9412    #[doc(hidden)]
9413    impl gax::options::internal::RequestBuilder for ListLocations {
9414        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9415            &mut self.0.options
9416        }
9417    }
9418
9419    /// The request builder for [Documents::get_location][crate::client::Documents::get_location] calls.
9420    ///
9421    /// # Example
9422    /// ```no_run
9423    /// # use google_cloud_dialogflow_v2::builder;
9424    /// use builder::documents::GetLocation;
9425    /// # tokio_test::block_on(async {
9426    ///
9427    /// let builder = prepare_request_builder();
9428    /// let response = builder.send().await?;
9429    /// # gax::Result::<()>::Ok(()) });
9430    ///
9431    /// fn prepare_request_builder() -> GetLocation {
9432    ///   # panic!();
9433    ///   // ... details omitted ...
9434    /// }
9435    /// ```
9436    #[derive(Clone, Debug)]
9437    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
9438
9439    impl GetLocation {
9440        pub(crate) fn new(
9441            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9442        ) -> Self {
9443            Self(RequestBuilder::new(stub))
9444        }
9445
9446        /// Sets the full request, replacing any prior values.
9447        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
9448            self.0.request = v.into();
9449            self
9450        }
9451
9452        /// Sets all the options, replacing any prior values.
9453        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9454            self.0.options = v.into();
9455            self
9456        }
9457
9458        /// Sends the request.
9459        pub async fn send(self) -> Result<location::model::Location> {
9460            (*self.0.stub)
9461                .get_location(self.0.request, self.0.options)
9462                .await
9463                .map(gax::response::Response::into_body)
9464        }
9465
9466        /// Sets the value of [name][location::model::GetLocationRequest::name].
9467        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9468            self.0.request.name = v.into();
9469            self
9470        }
9471    }
9472
9473    #[doc(hidden)]
9474    impl gax::options::internal::RequestBuilder for GetLocation {
9475        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9476            &mut self.0.options
9477        }
9478    }
9479
9480    /// The request builder for [Documents::list_operations][crate::client::Documents::list_operations] calls.
9481    ///
9482    /// # Example
9483    /// ```no_run
9484    /// # use google_cloud_dialogflow_v2::builder;
9485    /// use builder::documents::ListOperations;
9486    /// # tokio_test::block_on(async {
9487    /// use gax::paginator::ItemPaginator;
9488    ///
9489    /// let builder = prepare_request_builder();
9490    /// let mut items = builder.by_item();
9491    /// while let Some(result) = items.next().await {
9492    ///   let item = result?;
9493    /// }
9494    /// # gax::Result::<()>::Ok(()) });
9495    ///
9496    /// fn prepare_request_builder() -> ListOperations {
9497    ///   # panic!();
9498    ///   // ... details omitted ...
9499    /// }
9500    /// ```
9501    #[derive(Clone, Debug)]
9502    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
9503
9504    impl ListOperations {
9505        pub(crate) fn new(
9506            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9507        ) -> Self {
9508            Self(RequestBuilder::new(stub))
9509        }
9510
9511        /// Sets the full request, replacing any prior values.
9512        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
9513            mut self,
9514            v: V,
9515        ) -> Self {
9516            self.0.request = v.into();
9517            self
9518        }
9519
9520        /// Sets all the options, replacing any prior values.
9521        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9522            self.0.options = v.into();
9523            self
9524        }
9525
9526        /// Sends the request.
9527        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
9528            (*self.0.stub)
9529                .list_operations(self.0.request, self.0.options)
9530                .await
9531                .map(gax::response::Response::into_body)
9532        }
9533
9534        /// Streams each page in the collection.
9535        pub fn by_page(
9536            self,
9537        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
9538        {
9539            use std::clone::Clone;
9540            let token = self.0.request.page_token.clone();
9541            let execute = move |token: String| {
9542                let mut builder = self.clone();
9543                builder.0.request = builder.0.request.set_page_token(token);
9544                builder.send()
9545            };
9546            gax::paginator::internal::new_paginator(token, execute)
9547        }
9548
9549        /// Streams each item in the collection.
9550        pub fn by_item(
9551            self,
9552        ) -> impl gax::paginator::ItemPaginator<
9553            longrunning::model::ListOperationsResponse,
9554            gax::error::Error,
9555        > {
9556            use gax::paginator::Paginator;
9557            self.by_page().items()
9558        }
9559
9560        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
9561        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9562            self.0.request.name = v.into();
9563            self
9564        }
9565
9566        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
9567        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9568            self.0.request.filter = v.into();
9569            self
9570        }
9571
9572        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
9573        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9574            self.0.request.page_size = v.into();
9575            self
9576        }
9577
9578        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
9579        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9580            self.0.request.page_token = v.into();
9581            self
9582        }
9583
9584        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
9585        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9586            self.0.request.return_partial_success = v.into();
9587            self
9588        }
9589    }
9590
9591    #[doc(hidden)]
9592    impl gax::options::internal::RequestBuilder for ListOperations {
9593        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9594            &mut self.0.options
9595        }
9596    }
9597
9598    /// The request builder for [Documents::get_operation][crate::client::Documents::get_operation] calls.
9599    ///
9600    /// # Example
9601    /// ```no_run
9602    /// # use google_cloud_dialogflow_v2::builder;
9603    /// use builder::documents::GetOperation;
9604    /// # tokio_test::block_on(async {
9605    ///
9606    /// let builder = prepare_request_builder();
9607    /// let response = builder.send().await?;
9608    /// # gax::Result::<()>::Ok(()) });
9609    ///
9610    /// fn prepare_request_builder() -> GetOperation {
9611    ///   # panic!();
9612    ///   // ... details omitted ...
9613    /// }
9614    /// ```
9615    #[derive(Clone, Debug)]
9616    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
9617
9618    impl GetOperation {
9619        pub(crate) fn new(
9620            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9621        ) -> Self {
9622            Self(RequestBuilder::new(stub))
9623        }
9624
9625        /// Sets the full request, replacing any prior values.
9626        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
9627            mut self,
9628            v: V,
9629        ) -> Self {
9630            self.0.request = v.into();
9631            self
9632        }
9633
9634        /// Sets all the options, replacing any prior values.
9635        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9636            self.0.options = v.into();
9637            self
9638        }
9639
9640        /// Sends the request.
9641        pub async fn send(self) -> Result<longrunning::model::Operation> {
9642            (*self.0.stub)
9643                .get_operation(self.0.request, self.0.options)
9644                .await
9645                .map(gax::response::Response::into_body)
9646        }
9647
9648        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
9649        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9650            self.0.request.name = v.into();
9651            self
9652        }
9653    }
9654
9655    #[doc(hidden)]
9656    impl gax::options::internal::RequestBuilder for GetOperation {
9657        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9658            &mut self.0.options
9659        }
9660    }
9661
9662    /// The request builder for [Documents::cancel_operation][crate::client::Documents::cancel_operation] calls.
9663    ///
9664    /// # Example
9665    /// ```no_run
9666    /// # use google_cloud_dialogflow_v2::builder;
9667    /// use builder::documents::CancelOperation;
9668    /// # tokio_test::block_on(async {
9669    ///
9670    /// let builder = prepare_request_builder();
9671    /// let response = builder.send().await?;
9672    /// # gax::Result::<()>::Ok(()) });
9673    ///
9674    /// fn prepare_request_builder() -> CancelOperation {
9675    ///   # panic!();
9676    ///   // ... details omitted ...
9677    /// }
9678    /// ```
9679    #[derive(Clone, Debug)]
9680    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
9681
9682    impl CancelOperation {
9683        pub(crate) fn new(
9684            stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9685        ) -> Self {
9686            Self(RequestBuilder::new(stub))
9687        }
9688
9689        /// Sets the full request, replacing any prior values.
9690        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
9691            mut self,
9692            v: V,
9693        ) -> Self {
9694            self.0.request = v.into();
9695            self
9696        }
9697
9698        /// Sets all the options, replacing any prior values.
9699        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9700            self.0.options = v.into();
9701            self
9702        }
9703
9704        /// Sends the request.
9705        pub async fn send(self) -> Result<()> {
9706            (*self.0.stub)
9707                .cancel_operation(self.0.request, self.0.options)
9708                .await
9709                .map(gax::response::Response::into_body)
9710        }
9711
9712        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
9713        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9714            self.0.request.name = v.into();
9715            self
9716        }
9717    }
9718
9719    #[doc(hidden)]
9720    impl gax::options::internal::RequestBuilder for CancelOperation {
9721        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9722            &mut self.0.options
9723        }
9724    }
9725}
9726
9727#[cfg(feature = "encryption-spec-service")]
9728#[cfg_attr(docsrs, doc(cfg(feature = "encryption-spec-service")))]
9729pub mod encryption_spec_service {
9730    use crate::Result;
9731
9732    /// A builder for [EncryptionSpecService][crate::client::EncryptionSpecService].
9733    ///
9734    /// ```
9735    /// # tokio_test::block_on(async {
9736    /// # use google_cloud_dialogflow_v2::*;
9737    /// # use builder::encryption_spec_service::ClientBuilder;
9738    /// # use client::EncryptionSpecService;
9739    /// let builder : ClientBuilder = EncryptionSpecService::builder();
9740    /// let client = builder
9741    ///     .with_endpoint("https://dialogflow.googleapis.com")
9742    ///     .build().await?;
9743    /// # gax::client_builder::Result::<()>::Ok(()) });
9744    /// ```
9745    pub type ClientBuilder =
9746        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9747
9748    pub(crate) mod client {
9749        use super::super::super::client::EncryptionSpecService;
9750        pub struct Factory;
9751        impl gax::client_builder::internal::ClientFactory for Factory {
9752            type Client = EncryptionSpecService;
9753            type Credentials = gaxi::options::Credentials;
9754            async fn build(
9755                self,
9756                config: gaxi::options::ClientConfig,
9757            ) -> gax::client_builder::Result<Self::Client> {
9758                Self::Client::new(config).await
9759            }
9760        }
9761    }
9762
9763    /// Common implementation for [crate::client::EncryptionSpecService] request builders.
9764    #[derive(Clone, Debug)]
9765    pub(crate) struct RequestBuilder<R: std::default::Default> {
9766        stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9767        request: R,
9768        options: gax::options::RequestOptions,
9769    }
9770
9771    impl<R> RequestBuilder<R>
9772    where
9773        R: std::default::Default,
9774    {
9775        pub(crate) fn new(
9776            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9777        ) -> Self {
9778            Self {
9779                stub,
9780                request: R::default(),
9781                options: gax::options::RequestOptions::default(),
9782            }
9783        }
9784    }
9785
9786    /// The request builder for [EncryptionSpecService::get_encryption_spec][crate::client::EncryptionSpecService::get_encryption_spec] calls.
9787    ///
9788    /// # Example
9789    /// ```no_run
9790    /// # use google_cloud_dialogflow_v2::builder;
9791    /// use builder::encryption_spec_service::GetEncryptionSpec;
9792    /// # tokio_test::block_on(async {
9793    ///
9794    /// let builder = prepare_request_builder();
9795    /// let response = builder.send().await?;
9796    /// # gax::Result::<()>::Ok(()) });
9797    ///
9798    /// fn prepare_request_builder() -> GetEncryptionSpec {
9799    ///   # panic!();
9800    ///   // ... details omitted ...
9801    /// }
9802    /// ```
9803    #[derive(Clone, Debug)]
9804    pub struct GetEncryptionSpec(RequestBuilder<crate::model::GetEncryptionSpecRequest>);
9805
9806    impl GetEncryptionSpec {
9807        pub(crate) fn new(
9808            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9809        ) -> Self {
9810            Self(RequestBuilder::new(stub))
9811        }
9812
9813        /// Sets the full request, replacing any prior values.
9814        pub fn with_request<V: Into<crate::model::GetEncryptionSpecRequest>>(
9815            mut self,
9816            v: V,
9817        ) -> Self {
9818            self.0.request = v.into();
9819            self
9820        }
9821
9822        /// Sets all the options, replacing any prior values.
9823        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9824            self.0.options = v.into();
9825            self
9826        }
9827
9828        /// Sends the request.
9829        pub async fn send(self) -> Result<crate::model::EncryptionSpec> {
9830            (*self.0.stub)
9831                .get_encryption_spec(self.0.request, self.0.options)
9832                .await
9833                .map(gax::response::Response::into_body)
9834        }
9835
9836        /// Sets the value of [name][crate::model::GetEncryptionSpecRequest::name].
9837        ///
9838        /// This is a **required** field for requests.
9839        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9840            self.0.request.name = v.into();
9841            self
9842        }
9843    }
9844
9845    #[doc(hidden)]
9846    impl gax::options::internal::RequestBuilder for GetEncryptionSpec {
9847        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9848            &mut self.0.options
9849        }
9850    }
9851
9852    /// The request builder for [EncryptionSpecService::initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec] calls.
9853    ///
9854    /// # Example
9855    /// ```no_run
9856    /// # use google_cloud_dialogflow_v2::builder;
9857    /// use builder::encryption_spec_service::InitializeEncryptionSpec;
9858    /// # tokio_test::block_on(async {
9859    /// use lro::Poller;
9860    ///
9861    /// let builder = prepare_request_builder();
9862    /// let response = builder.poller().until_done().await?;
9863    /// # gax::Result::<()>::Ok(()) });
9864    ///
9865    /// fn prepare_request_builder() -> InitializeEncryptionSpec {
9866    ///   # panic!();
9867    ///   // ... details omitted ...
9868    /// }
9869    /// ```
9870    #[derive(Clone, Debug)]
9871    pub struct InitializeEncryptionSpec(
9872        RequestBuilder<crate::model::InitializeEncryptionSpecRequest>,
9873    );
9874
9875    impl InitializeEncryptionSpec {
9876        pub(crate) fn new(
9877            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
9878        ) -> Self {
9879            Self(RequestBuilder::new(stub))
9880        }
9881
9882        /// Sets the full request, replacing any prior values.
9883        pub fn with_request<V: Into<crate::model::InitializeEncryptionSpecRequest>>(
9884            mut self,
9885            v: V,
9886        ) -> Self {
9887            self.0.request = v.into();
9888            self
9889        }
9890
9891        /// Sets all the options, replacing any prior values.
9892        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9893            self.0.options = v.into();
9894            self
9895        }
9896
9897        /// Sends the request.
9898        ///
9899        /// # Long running operations
9900        ///
9901        /// This starts, but does not poll, a longrunning operation. More information
9902        /// on [initialize_encryption_spec][crate::client::EncryptionSpecService::initialize_encryption_spec].
9903        pub async fn send(self) -> Result<longrunning::model::Operation> {
9904            (*self.0.stub)
9905                .initialize_encryption_spec(self.0.request, self.0.options)
9906                .await
9907                .map(gax::response::Response::into_body)
9908        }
9909
9910        /// Creates a [Poller][lro::Poller] to work with `initialize_encryption_spec`.
9911        pub fn poller(
9912            self,
9913        ) -> impl lro::Poller<
9914            crate::model::InitializeEncryptionSpecResponse,
9915            crate::model::InitializeEncryptionSpecMetadata,
9916        > {
9917            type Operation = lro::internal::Operation<
9918                crate::model::InitializeEncryptionSpecResponse,
9919                crate::model::InitializeEncryptionSpecMetadata,
9920            >;
9921            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9922            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9923
9924            let stub = self.0.stub.clone();
9925            let mut options = self.0.options.clone();
9926            options.set_retry_policy(gax::retry_policy::NeverRetry);
9927            let query = move |name| {
9928                let stub = stub.clone();
9929                let options = options.clone();
9930                async {
9931                    let op = GetOperation::new(stub)
9932                        .set_name(name)
9933                        .with_options(options)
9934                        .send()
9935                        .await?;
9936                    Ok(Operation::new(op))
9937                }
9938            };
9939
9940            let start = move || async {
9941                let op = self.send().await?;
9942                Ok(Operation::new(op))
9943            };
9944
9945            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9946        }
9947
9948        /// Sets the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
9949        ///
9950        /// This is a **required** field for requests.
9951        pub fn set_encryption_spec<T>(mut self, v: T) -> Self
9952        where
9953            T: std::convert::Into<crate::model::EncryptionSpec>,
9954        {
9955            self.0.request.encryption_spec = std::option::Option::Some(v.into());
9956            self
9957        }
9958
9959        /// Sets or clears the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
9960        ///
9961        /// This is a **required** field for requests.
9962        pub fn set_or_clear_encryption_spec<T>(mut self, v: std::option::Option<T>) -> Self
9963        where
9964            T: std::convert::Into<crate::model::EncryptionSpec>,
9965        {
9966            self.0.request.encryption_spec = v.map(|x| x.into());
9967            self
9968        }
9969    }
9970
9971    #[doc(hidden)]
9972    impl gax::options::internal::RequestBuilder for InitializeEncryptionSpec {
9973        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9974            &mut self.0.options
9975        }
9976    }
9977
9978    /// The request builder for [EncryptionSpecService::list_locations][crate::client::EncryptionSpecService::list_locations] calls.
9979    ///
9980    /// # Example
9981    /// ```no_run
9982    /// # use google_cloud_dialogflow_v2::builder;
9983    /// use builder::encryption_spec_service::ListLocations;
9984    /// # tokio_test::block_on(async {
9985    /// use gax::paginator::ItemPaginator;
9986    ///
9987    /// let builder = prepare_request_builder();
9988    /// let mut items = builder.by_item();
9989    /// while let Some(result) = items.next().await {
9990    ///   let item = result?;
9991    /// }
9992    /// # gax::Result::<()>::Ok(()) });
9993    ///
9994    /// fn prepare_request_builder() -> ListLocations {
9995    ///   # panic!();
9996    ///   // ... details omitted ...
9997    /// }
9998    /// ```
9999    #[derive(Clone, Debug)]
10000    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10001
10002    impl ListLocations {
10003        pub(crate) fn new(
10004            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10005        ) -> Self {
10006            Self(RequestBuilder::new(stub))
10007        }
10008
10009        /// Sets the full request, replacing any prior values.
10010        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10011            mut self,
10012            v: V,
10013        ) -> Self {
10014            self.0.request = v.into();
10015            self
10016        }
10017
10018        /// Sets all the options, replacing any prior values.
10019        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10020            self.0.options = v.into();
10021            self
10022        }
10023
10024        /// Sends the request.
10025        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10026            (*self.0.stub)
10027                .list_locations(self.0.request, self.0.options)
10028                .await
10029                .map(gax::response::Response::into_body)
10030        }
10031
10032        /// Streams each page in the collection.
10033        pub fn by_page(
10034            self,
10035        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10036        {
10037            use std::clone::Clone;
10038            let token = self.0.request.page_token.clone();
10039            let execute = move |token: String| {
10040                let mut builder = self.clone();
10041                builder.0.request = builder.0.request.set_page_token(token);
10042                builder.send()
10043            };
10044            gax::paginator::internal::new_paginator(token, execute)
10045        }
10046
10047        /// Streams each item in the collection.
10048        pub fn by_item(
10049            self,
10050        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10051        {
10052            use gax::paginator::Paginator;
10053            self.by_page().items()
10054        }
10055
10056        /// Sets the value of [name][location::model::ListLocationsRequest::name].
10057        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10058            self.0.request.name = v.into();
10059            self
10060        }
10061
10062        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
10063        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10064            self.0.request.filter = v.into();
10065            self
10066        }
10067
10068        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
10069        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10070            self.0.request.page_size = v.into();
10071            self
10072        }
10073
10074        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
10075        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10076            self.0.request.page_token = v.into();
10077            self
10078        }
10079    }
10080
10081    #[doc(hidden)]
10082    impl gax::options::internal::RequestBuilder for ListLocations {
10083        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10084            &mut self.0.options
10085        }
10086    }
10087
10088    /// The request builder for [EncryptionSpecService::get_location][crate::client::EncryptionSpecService::get_location] calls.
10089    ///
10090    /// # Example
10091    /// ```no_run
10092    /// # use google_cloud_dialogflow_v2::builder;
10093    /// use builder::encryption_spec_service::GetLocation;
10094    /// # tokio_test::block_on(async {
10095    ///
10096    /// let builder = prepare_request_builder();
10097    /// let response = builder.send().await?;
10098    /// # gax::Result::<()>::Ok(()) });
10099    ///
10100    /// fn prepare_request_builder() -> GetLocation {
10101    ///   # panic!();
10102    ///   // ... details omitted ...
10103    /// }
10104    /// ```
10105    #[derive(Clone, Debug)]
10106    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10107
10108    impl GetLocation {
10109        pub(crate) fn new(
10110            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10111        ) -> Self {
10112            Self(RequestBuilder::new(stub))
10113        }
10114
10115        /// Sets the full request, replacing any prior values.
10116        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10117            self.0.request = v.into();
10118            self
10119        }
10120
10121        /// Sets all the options, replacing any prior values.
10122        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10123            self.0.options = v.into();
10124            self
10125        }
10126
10127        /// Sends the request.
10128        pub async fn send(self) -> Result<location::model::Location> {
10129            (*self.0.stub)
10130                .get_location(self.0.request, self.0.options)
10131                .await
10132                .map(gax::response::Response::into_body)
10133        }
10134
10135        /// Sets the value of [name][location::model::GetLocationRequest::name].
10136        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10137            self.0.request.name = v.into();
10138            self
10139        }
10140    }
10141
10142    #[doc(hidden)]
10143    impl gax::options::internal::RequestBuilder for GetLocation {
10144        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10145            &mut self.0.options
10146        }
10147    }
10148
10149    /// The request builder for [EncryptionSpecService::list_operations][crate::client::EncryptionSpecService::list_operations] calls.
10150    ///
10151    /// # Example
10152    /// ```no_run
10153    /// # use google_cloud_dialogflow_v2::builder;
10154    /// use builder::encryption_spec_service::ListOperations;
10155    /// # tokio_test::block_on(async {
10156    /// use gax::paginator::ItemPaginator;
10157    ///
10158    /// let builder = prepare_request_builder();
10159    /// let mut items = builder.by_item();
10160    /// while let Some(result) = items.next().await {
10161    ///   let item = result?;
10162    /// }
10163    /// # gax::Result::<()>::Ok(()) });
10164    ///
10165    /// fn prepare_request_builder() -> ListOperations {
10166    ///   # panic!();
10167    ///   // ... details omitted ...
10168    /// }
10169    /// ```
10170    #[derive(Clone, Debug)]
10171    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10172
10173    impl ListOperations {
10174        pub(crate) fn new(
10175            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10176        ) -> Self {
10177            Self(RequestBuilder::new(stub))
10178        }
10179
10180        /// Sets the full request, replacing any prior values.
10181        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10182            mut self,
10183            v: V,
10184        ) -> Self {
10185            self.0.request = v.into();
10186            self
10187        }
10188
10189        /// Sets all the options, replacing any prior values.
10190        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10191            self.0.options = v.into();
10192            self
10193        }
10194
10195        /// Sends the request.
10196        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10197            (*self.0.stub)
10198                .list_operations(self.0.request, self.0.options)
10199                .await
10200                .map(gax::response::Response::into_body)
10201        }
10202
10203        /// Streams each page in the collection.
10204        pub fn by_page(
10205            self,
10206        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10207        {
10208            use std::clone::Clone;
10209            let token = self.0.request.page_token.clone();
10210            let execute = move |token: String| {
10211                let mut builder = self.clone();
10212                builder.0.request = builder.0.request.set_page_token(token);
10213                builder.send()
10214            };
10215            gax::paginator::internal::new_paginator(token, execute)
10216        }
10217
10218        /// Streams each item in the collection.
10219        pub fn by_item(
10220            self,
10221        ) -> impl gax::paginator::ItemPaginator<
10222            longrunning::model::ListOperationsResponse,
10223            gax::error::Error,
10224        > {
10225            use gax::paginator::Paginator;
10226            self.by_page().items()
10227        }
10228
10229        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
10230        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10231            self.0.request.name = v.into();
10232            self
10233        }
10234
10235        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
10236        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10237            self.0.request.filter = v.into();
10238            self
10239        }
10240
10241        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
10242        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10243            self.0.request.page_size = v.into();
10244            self
10245        }
10246
10247        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
10248        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10249            self.0.request.page_token = v.into();
10250            self
10251        }
10252
10253        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
10254        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10255            self.0.request.return_partial_success = v.into();
10256            self
10257        }
10258    }
10259
10260    #[doc(hidden)]
10261    impl gax::options::internal::RequestBuilder for ListOperations {
10262        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10263            &mut self.0.options
10264        }
10265    }
10266
10267    /// The request builder for [EncryptionSpecService::get_operation][crate::client::EncryptionSpecService::get_operation] calls.
10268    ///
10269    /// # Example
10270    /// ```no_run
10271    /// # use google_cloud_dialogflow_v2::builder;
10272    /// use builder::encryption_spec_service::GetOperation;
10273    /// # tokio_test::block_on(async {
10274    ///
10275    /// let builder = prepare_request_builder();
10276    /// let response = builder.send().await?;
10277    /// # gax::Result::<()>::Ok(()) });
10278    ///
10279    /// fn prepare_request_builder() -> GetOperation {
10280    ///   # panic!();
10281    ///   // ... details omitted ...
10282    /// }
10283    /// ```
10284    #[derive(Clone, Debug)]
10285    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
10286
10287    impl GetOperation {
10288        pub(crate) fn new(
10289            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10290        ) -> Self {
10291            Self(RequestBuilder::new(stub))
10292        }
10293
10294        /// Sets the full request, replacing any prior values.
10295        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
10296            mut self,
10297            v: V,
10298        ) -> Self {
10299            self.0.request = v.into();
10300            self
10301        }
10302
10303        /// Sets all the options, replacing any prior values.
10304        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10305            self.0.options = v.into();
10306            self
10307        }
10308
10309        /// Sends the request.
10310        pub async fn send(self) -> Result<longrunning::model::Operation> {
10311            (*self.0.stub)
10312                .get_operation(self.0.request, self.0.options)
10313                .await
10314                .map(gax::response::Response::into_body)
10315        }
10316
10317        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
10318        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10319            self.0.request.name = v.into();
10320            self
10321        }
10322    }
10323
10324    #[doc(hidden)]
10325    impl gax::options::internal::RequestBuilder for GetOperation {
10326        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10327            &mut self.0.options
10328        }
10329    }
10330
10331    /// The request builder for [EncryptionSpecService::cancel_operation][crate::client::EncryptionSpecService::cancel_operation] calls.
10332    ///
10333    /// # Example
10334    /// ```no_run
10335    /// # use google_cloud_dialogflow_v2::builder;
10336    /// use builder::encryption_spec_service::CancelOperation;
10337    /// # tokio_test::block_on(async {
10338    ///
10339    /// let builder = prepare_request_builder();
10340    /// let response = builder.send().await?;
10341    /// # gax::Result::<()>::Ok(()) });
10342    ///
10343    /// fn prepare_request_builder() -> CancelOperation {
10344    ///   # panic!();
10345    ///   // ... details omitted ...
10346    /// }
10347    /// ```
10348    #[derive(Clone, Debug)]
10349    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
10350
10351    impl CancelOperation {
10352        pub(crate) fn new(
10353            stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10354        ) -> Self {
10355            Self(RequestBuilder::new(stub))
10356        }
10357
10358        /// Sets the full request, replacing any prior values.
10359        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
10360            mut self,
10361            v: V,
10362        ) -> Self {
10363            self.0.request = v.into();
10364            self
10365        }
10366
10367        /// Sets all the options, replacing any prior values.
10368        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10369            self.0.options = v.into();
10370            self
10371        }
10372
10373        /// Sends the request.
10374        pub async fn send(self) -> Result<()> {
10375            (*self.0.stub)
10376                .cancel_operation(self.0.request, self.0.options)
10377                .await
10378                .map(gax::response::Response::into_body)
10379        }
10380
10381        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
10382        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10383            self.0.request.name = v.into();
10384            self
10385        }
10386    }
10387
10388    #[doc(hidden)]
10389    impl gax::options::internal::RequestBuilder for CancelOperation {
10390        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10391            &mut self.0.options
10392        }
10393    }
10394}
10395
10396#[cfg(feature = "entity-types")]
10397#[cfg_attr(docsrs, doc(cfg(feature = "entity-types")))]
10398pub mod entity_types {
10399    use crate::Result;
10400
10401    /// A builder for [EntityTypes][crate::client::EntityTypes].
10402    ///
10403    /// ```
10404    /// # tokio_test::block_on(async {
10405    /// # use google_cloud_dialogflow_v2::*;
10406    /// # use builder::entity_types::ClientBuilder;
10407    /// # use client::EntityTypes;
10408    /// let builder : ClientBuilder = EntityTypes::builder();
10409    /// let client = builder
10410    ///     .with_endpoint("https://dialogflow.googleapis.com")
10411    ///     .build().await?;
10412    /// # gax::client_builder::Result::<()>::Ok(()) });
10413    /// ```
10414    pub type ClientBuilder =
10415        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10416
10417    pub(crate) mod client {
10418        use super::super::super::client::EntityTypes;
10419        pub struct Factory;
10420        impl gax::client_builder::internal::ClientFactory for Factory {
10421            type Client = EntityTypes;
10422            type Credentials = gaxi::options::Credentials;
10423            async fn build(
10424                self,
10425                config: gaxi::options::ClientConfig,
10426            ) -> gax::client_builder::Result<Self::Client> {
10427                Self::Client::new(config).await
10428            }
10429        }
10430    }
10431
10432    /// Common implementation for [crate::client::EntityTypes] request builders.
10433    #[derive(Clone, Debug)]
10434    pub(crate) struct RequestBuilder<R: std::default::Default> {
10435        stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10436        request: R,
10437        options: gax::options::RequestOptions,
10438    }
10439
10440    impl<R> RequestBuilder<R>
10441    where
10442        R: std::default::Default,
10443    {
10444        pub(crate) fn new(
10445            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10446        ) -> Self {
10447            Self {
10448                stub,
10449                request: R::default(),
10450                options: gax::options::RequestOptions::default(),
10451            }
10452        }
10453    }
10454
10455    /// The request builder for [EntityTypes::list_entity_types][crate::client::EntityTypes::list_entity_types] calls.
10456    ///
10457    /// # Example
10458    /// ```no_run
10459    /// # use google_cloud_dialogflow_v2::builder;
10460    /// use builder::entity_types::ListEntityTypes;
10461    /// # tokio_test::block_on(async {
10462    /// use gax::paginator::ItemPaginator;
10463    ///
10464    /// let builder = prepare_request_builder();
10465    /// let mut items = builder.by_item();
10466    /// while let Some(result) = items.next().await {
10467    ///   let item = result?;
10468    /// }
10469    /// # gax::Result::<()>::Ok(()) });
10470    ///
10471    /// fn prepare_request_builder() -> ListEntityTypes {
10472    ///   # panic!();
10473    ///   // ... details omitted ...
10474    /// }
10475    /// ```
10476    #[derive(Clone, Debug)]
10477    pub struct ListEntityTypes(RequestBuilder<crate::model::ListEntityTypesRequest>);
10478
10479    impl ListEntityTypes {
10480        pub(crate) fn new(
10481            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10482        ) -> Self {
10483            Self(RequestBuilder::new(stub))
10484        }
10485
10486        /// Sets the full request, replacing any prior values.
10487        pub fn with_request<V: Into<crate::model::ListEntityTypesRequest>>(mut self, v: V) -> Self {
10488            self.0.request = v.into();
10489            self
10490        }
10491
10492        /// Sets all the options, replacing any prior values.
10493        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10494            self.0.options = v.into();
10495            self
10496        }
10497
10498        /// Sends the request.
10499        pub async fn send(self) -> Result<crate::model::ListEntityTypesResponse> {
10500            (*self.0.stub)
10501                .list_entity_types(self.0.request, self.0.options)
10502                .await
10503                .map(gax::response::Response::into_body)
10504        }
10505
10506        /// Streams each page in the collection.
10507        pub fn by_page(
10508            self,
10509        ) -> impl gax::paginator::Paginator<crate::model::ListEntityTypesResponse, gax::error::Error>
10510        {
10511            use std::clone::Clone;
10512            let token = self.0.request.page_token.clone();
10513            let execute = move |token: String| {
10514                let mut builder = self.clone();
10515                builder.0.request = builder.0.request.set_page_token(token);
10516                builder.send()
10517            };
10518            gax::paginator::internal::new_paginator(token, execute)
10519        }
10520
10521        /// Streams each item in the collection.
10522        pub fn by_item(
10523            self,
10524        ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntityTypesResponse, gax::error::Error>
10525        {
10526            use gax::paginator::Paginator;
10527            self.by_page().items()
10528        }
10529
10530        /// Sets the value of [parent][crate::model::ListEntityTypesRequest::parent].
10531        ///
10532        /// This is a **required** field for requests.
10533        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10534            self.0.request.parent = v.into();
10535            self
10536        }
10537
10538        /// Sets the value of [language_code][crate::model::ListEntityTypesRequest::language_code].
10539        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10540            self.0.request.language_code = v.into();
10541            self
10542        }
10543
10544        /// Sets the value of [page_size][crate::model::ListEntityTypesRequest::page_size].
10545        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10546            self.0.request.page_size = v.into();
10547            self
10548        }
10549
10550        /// Sets the value of [page_token][crate::model::ListEntityTypesRequest::page_token].
10551        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10552            self.0.request.page_token = v.into();
10553            self
10554        }
10555    }
10556
10557    #[doc(hidden)]
10558    impl gax::options::internal::RequestBuilder for ListEntityTypes {
10559        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10560            &mut self.0.options
10561        }
10562    }
10563
10564    /// The request builder for [EntityTypes::get_entity_type][crate::client::EntityTypes::get_entity_type] calls.
10565    ///
10566    /// # Example
10567    /// ```no_run
10568    /// # use google_cloud_dialogflow_v2::builder;
10569    /// use builder::entity_types::GetEntityType;
10570    /// # tokio_test::block_on(async {
10571    ///
10572    /// let builder = prepare_request_builder();
10573    /// let response = builder.send().await?;
10574    /// # gax::Result::<()>::Ok(()) });
10575    ///
10576    /// fn prepare_request_builder() -> GetEntityType {
10577    ///   # panic!();
10578    ///   // ... details omitted ...
10579    /// }
10580    /// ```
10581    #[derive(Clone, Debug)]
10582    pub struct GetEntityType(RequestBuilder<crate::model::GetEntityTypeRequest>);
10583
10584    impl GetEntityType {
10585        pub(crate) fn new(
10586            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10587        ) -> Self {
10588            Self(RequestBuilder::new(stub))
10589        }
10590
10591        /// Sets the full request, replacing any prior values.
10592        pub fn with_request<V: Into<crate::model::GetEntityTypeRequest>>(mut self, v: V) -> Self {
10593            self.0.request = v.into();
10594            self
10595        }
10596
10597        /// Sets all the options, replacing any prior values.
10598        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10599            self.0.options = v.into();
10600            self
10601        }
10602
10603        /// Sends the request.
10604        pub async fn send(self) -> Result<crate::model::EntityType> {
10605            (*self.0.stub)
10606                .get_entity_type(self.0.request, self.0.options)
10607                .await
10608                .map(gax::response::Response::into_body)
10609        }
10610
10611        /// Sets the value of [name][crate::model::GetEntityTypeRequest::name].
10612        ///
10613        /// This is a **required** field for requests.
10614        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10615            self.0.request.name = v.into();
10616            self
10617        }
10618
10619        /// Sets the value of [language_code][crate::model::GetEntityTypeRequest::language_code].
10620        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10621            self.0.request.language_code = v.into();
10622            self
10623        }
10624    }
10625
10626    #[doc(hidden)]
10627    impl gax::options::internal::RequestBuilder for GetEntityType {
10628        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10629            &mut self.0.options
10630        }
10631    }
10632
10633    /// The request builder for [EntityTypes::create_entity_type][crate::client::EntityTypes::create_entity_type] calls.
10634    ///
10635    /// # Example
10636    /// ```no_run
10637    /// # use google_cloud_dialogflow_v2::builder;
10638    /// use builder::entity_types::CreateEntityType;
10639    /// # tokio_test::block_on(async {
10640    ///
10641    /// let builder = prepare_request_builder();
10642    /// let response = builder.send().await?;
10643    /// # gax::Result::<()>::Ok(()) });
10644    ///
10645    /// fn prepare_request_builder() -> CreateEntityType {
10646    ///   # panic!();
10647    ///   // ... details omitted ...
10648    /// }
10649    /// ```
10650    #[derive(Clone, Debug)]
10651    pub struct CreateEntityType(RequestBuilder<crate::model::CreateEntityTypeRequest>);
10652
10653    impl CreateEntityType {
10654        pub(crate) fn new(
10655            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10656        ) -> Self {
10657            Self(RequestBuilder::new(stub))
10658        }
10659
10660        /// Sets the full request, replacing any prior values.
10661        pub fn with_request<V: Into<crate::model::CreateEntityTypeRequest>>(
10662            mut self,
10663            v: V,
10664        ) -> Self {
10665            self.0.request = v.into();
10666            self
10667        }
10668
10669        /// Sets all the options, replacing any prior values.
10670        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10671            self.0.options = v.into();
10672            self
10673        }
10674
10675        /// Sends the request.
10676        pub async fn send(self) -> Result<crate::model::EntityType> {
10677            (*self.0.stub)
10678                .create_entity_type(self.0.request, self.0.options)
10679                .await
10680                .map(gax::response::Response::into_body)
10681        }
10682
10683        /// Sets the value of [parent][crate::model::CreateEntityTypeRequest::parent].
10684        ///
10685        /// This is a **required** field for requests.
10686        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10687            self.0.request.parent = v.into();
10688            self
10689        }
10690
10691        /// Sets the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10692        ///
10693        /// This is a **required** field for requests.
10694        pub fn set_entity_type<T>(mut self, v: T) -> Self
10695        where
10696            T: std::convert::Into<crate::model::EntityType>,
10697        {
10698            self.0.request.entity_type = std::option::Option::Some(v.into());
10699            self
10700        }
10701
10702        /// Sets or clears the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
10703        ///
10704        /// This is a **required** field for requests.
10705        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
10706        where
10707            T: std::convert::Into<crate::model::EntityType>,
10708        {
10709            self.0.request.entity_type = v.map(|x| x.into());
10710            self
10711        }
10712
10713        /// Sets the value of [language_code][crate::model::CreateEntityTypeRequest::language_code].
10714        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10715            self.0.request.language_code = v.into();
10716            self
10717        }
10718    }
10719
10720    #[doc(hidden)]
10721    impl gax::options::internal::RequestBuilder for CreateEntityType {
10722        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10723            &mut self.0.options
10724        }
10725    }
10726
10727    /// The request builder for [EntityTypes::update_entity_type][crate::client::EntityTypes::update_entity_type] calls.
10728    ///
10729    /// # Example
10730    /// ```no_run
10731    /// # use google_cloud_dialogflow_v2::builder;
10732    /// use builder::entity_types::UpdateEntityType;
10733    /// # tokio_test::block_on(async {
10734    ///
10735    /// let builder = prepare_request_builder();
10736    /// let response = builder.send().await?;
10737    /// # gax::Result::<()>::Ok(()) });
10738    ///
10739    /// fn prepare_request_builder() -> UpdateEntityType {
10740    ///   # panic!();
10741    ///   // ... details omitted ...
10742    /// }
10743    /// ```
10744    #[derive(Clone, Debug)]
10745    pub struct UpdateEntityType(RequestBuilder<crate::model::UpdateEntityTypeRequest>);
10746
10747    impl UpdateEntityType {
10748        pub(crate) fn new(
10749            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10750        ) -> Self {
10751            Self(RequestBuilder::new(stub))
10752        }
10753
10754        /// Sets the full request, replacing any prior values.
10755        pub fn with_request<V: Into<crate::model::UpdateEntityTypeRequest>>(
10756            mut self,
10757            v: V,
10758        ) -> Self {
10759            self.0.request = v.into();
10760            self
10761        }
10762
10763        /// Sets all the options, replacing any prior values.
10764        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10765            self.0.options = v.into();
10766            self
10767        }
10768
10769        /// Sends the request.
10770        pub async fn send(self) -> Result<crate::model::EntityType> {
10771            (*self.0.stub)
10772                .update_entity_type(self.0.request, self.0.options)
10773                .await
10774                .map(gax::response::Response::into_body)
10775        }
10776
10777        /// Sets the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
10778        ///
10779        /// This is a **required** field for requests.
10780        pub fn set_entity_type<T>(mut self, v: T) -> Self
10781        where
10782            T: std::convert::Into<crate::model::EntityType>,
10783        {
10784            self.0.request.entity_type = std::option::Option::Some(v.into());
10785            self
10786        }
10787
10788        /// Sets or clears the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
10789        ///
10790        /// This is a **required** field for requests.
10791        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
10792        where
10793            T: std::convert::Into<crate::model::EntityType>,
10794        {
10795            self.0.request.entity_type = v.map(|x| x.into());
10796            self
10797        }
10798
10799        /// Sets the value of [language_code][crate::model::UpdateEntityTypeRequest::language_code].
10800        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10801            self.0.request.language_code = v.into();
10802            self
10803        }
10804
10805        /// Sets the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
10806        pub fn set_update_mask<T>(mut self, v: T) -> Self
10807        where
10808            T: std::convert::Into<wkt::FieldMask>,
10809        {
10810            self.0.request.update_mask = std::option::Option::Some(v.into());
10811            self
10812        }
10813
10814        /// Sets or clears the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
10815        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10816        where
10817            T: std::convert::Into<wkt::FieldMask>,
10818        {
10819            self.0.request.update_mask = v.map(|x| x.into());
10820            self
10821        }
10822    }
10823
10824    #[doc(hidden)]
10825    impl gax::options::internal::RequestBuilder for UpdateEntityType {
10826        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10827            &mut self.0.options
10828        }
10829    }
10830
10831    /// The request builder for [EntityTypes::delete_entity_type][crate::client::EntityTypes::delete_entity_type] calls.
10832    ///
10833    /// # Example
10834    /// ```no_run
10835    /// # use google_cloud_dialogflow_v2::builder;
10836    /// use builder::entity_types::DeleteEntityType;
10837    /// # tokio_test::block_on(async {
10838    ///
10839    /// let builder = prepare_request_builder();
10840    /// let response = builder.send().await?;
10841    /// # gax::Result::<()>::Ok(()) });
10842    ///
10843    /// fn prepare_request_builder() -> DeleteEntityType {
10844    ///   # panic!();
10845    ///   // ... details omitted ...
10846    /// }
10847    /// ```
10848    #[derive(Clone, Debug)]
10849    pub struct DeleteEntityType(RequestBuilder<crate::model::DeleteEntityTypeRequest>);
10850
10851    impl DeleteEntityType {
10852        pub(crate) fn new(
10853            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10854        ) -> Self {
10855            Self(RequestBuilder::new(stub))
10856        }
10857
10858        /// Sets the full request, replacing any prior values.
10859        pub fn with_request<V: Into<crate::model::DeleteEntityTypeRequest>>(
10860            mut self,
10861            v: V,
10862        ) -> Self {
10863            self.0.request = v.into();
10864            self
10865        }
10866
10867        /// Sets all the options, replacing any prior values.
10868        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10869            self.0.options = v.into();
10870            self
10871        }
10872
10873        /// Sends the request.
10874        pub async fn send(self) -> Result<()> {
10875            (*self.0.stub)
10876                .delete_entity_type(self.0.request, self.0.options)
10877                .await
10878                .map(gax::response::Response::into_body)
10879        }
10880
10881        /// Sets the value of [name][crate::model::DeleteEntityTypeRequest::name].
10882        ///
10883        /// This is a **required** field for requests.
10884        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10885            self.0.request.name = v.into();
10886            self
10887        }
10888    }
10889
10890    #[doc(hidden)]
10891    impl gax::options::internal::RequestBuilder for DeleteEntityType {
10892        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10893            &mut self.0.options
10894        }
10895    }
10896
10897    /// The request builder for [EntityTypes::batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types] calls.
10898    ///
10899    /// # Example
10900    /// ```no_run
10901    /// # use google_cloud_dialogflow_v2::builder;
10902    /// use builder::entity_types::BatchUpdateEntityTypes;
10903    /// # tokio_test::block_on(async {
10904    /// use lro::Poller;
10905    ///
10906    /// let builder = prepare_request_builder();
10907    /// let response = builder.poller().until_done().await?;
10908    /// # gax::Result::<()>::Ok(()) });
10909    ///
10910    /// fn prepare_request_builder() -> BatchUpdateEntityTypes {
10911    ///   # panic!();
10912    ///   // ... details omitted ...
10913    /// }
10914    /// ```
10915    #[derive(Clone, Debug)]
10916    pub struct BatchUpdateEntityTypes(RequestBuilder<crate::model::BatchUpdateEntityTypesRequest>);
10917
10918    impl BatchUpdateEntityTypes {
10919        pub(crate) fn new(
10920            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10921        ) -> Self {
10922            Self(RequestBuilder::new(stub))
10923        }
10924
10925        /// Sets the full request, replacing any prior values.
10926        pub fn with_request<V: Into<crate::model::BatchUpdateEntityTypesRequest>>(
10927            mut self,
10928            v: V,
10929        ) -> Self {
10930            self.0.request = v.into();
10931            self
10932        }
10933
10934        /// Sets all the options, replacing any prior values.
10935        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10936            self.0.options = v.into();
10937            self
10938        }
10939
10940        /// Sends the request.
10941        ///
10942        /// # Long running operations
10943        ///
10944        /// This starts, but does not poll, a longrunning operation. More information
10945        /// on [batch_update_entity_types][crate::client::EntityTypes::batch_update_entity_types].
10946        pub async fn send(self) -> Result<longrunning::model::Operation> {
10947            (*self.0.stub)
10948                .batch_update_entity_types(self.0.request, self.0.options)
10949                .await
10950                .map(gax::response::Response::into_body)
10951        }
10952
10953        /// Creates a [Poller][lro::Poller] to work with `batch_update_entity_types`.
10954        pub fn poller(
10955            self,
10956        ) -> impl lro::Poller<crate::model::BatchUpdateEntityTypesResponse, wkt::Struct> {
10957            type Operation =
10958                lro::internal::Operation<crate::model::BatchUpdateEntityTypesResponse, wkt::Struct>;
10959            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10960            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10961
10962            let stub = self.0.stub.clone();
10963            let mut options = self.0.options.clone();
10964            options.set_retry_policy(gax::retry_policy::NeverRetry);
10965            let query = move |name| {
10966                let stub = stub.clone();
10967                let options = options.clone();
10968                async {
10969                    let op = GetOperation::new(stub)
10970                        .set_name(name)
10971                        .with_options(options)
10972                        .send()
10973                        .await?;
10974                    Ok(Operation::new(op))
10975                }
10976            };
10977
10978            let start = move || async {
10979                let op = self.send().await?;
10980                Ok(Operation::new(op))
10981            };
10982
10983            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10984        }
10985
10986        /// Sets the value of [parent][crate::model::BatchUpdateEntityTypesRequest::parent].
10987        ///
10988        /// This is a **required** field for requests.
10989        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10990            self.0.request.parent = v.into();
10991            self
10992        }
10993
10994        /// Sets the value of [language_code][crate::model::BatchUpdateEntityTypesRequest::language_code].
10995        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10996            self.0.request.language_code = v.into();
10997            self
10998        }
10999
11000        /// Sets the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
11001        pub fn set_update_mask<T>(mut self, v: T) -> Self
11002        where
11003            T: std::convert::Into<wkt::FieldMask>,
11004        {
11005            self.0.request.update_mask = std::option::Option::Some(v.into());
11006            self
11007        }
11008
11009        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntityTypesRequest::update_mask].
11010        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11011        where
11012            T: std::convert::Into<wkt::FieldMask>,
11013        {
11014            self.0.request.update_mask = v.map(|x| x.into());
11015            self
11016        }
11017
11018        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch].
11019        ///
11020        /// Note that all the setters affecting `entity_type_batch` are
11021        /// mutually exclusive.
11022        pub fn set_entity_type_batch<
11023            T: Into<Option<crate::model::batch_update_entity_types_request::EntityTypeBatch>>,
11024        >(
11025            mut self,
11026            v: T,
11027        ) -> Self {
11028            self.0.request.entity_type_batch = v.into();
11029            self
11030        }
11031
11032        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
11033        /// to hold a `EntityTypeBatchUri`.
11034        ///
11035        /// Note that all the setters affecting `entity_type_batch` are
11036        /// mutually exclusive.
11037        pub fn set_entity_type_batch_uri<T: std::convert::Into<std::string::String>>(
11038            mut self,
11039            v: T,
11040        ) -> Self {
11041            self.0.request = self.0.request.set_entity_type_batch_uri(v);
11042            self
11043        }
11044
11045        /// Sets the value of [entity_type_batch][crate::model::BatchUpdateEntityTypesRequest::entity_type_batch]
11046        /// to hold a `EntityTypeBatchInline`.
11047        ///
11048        /// Note that all the setters affecting `entity_type_batch` are
11049        /// mutually exclusive.
11050        pub fn set_entity_type_batch_inline<
11051            T: std::convert::Into<std::boxed::Box<crate::model::EntityTypeBatch>>,
11052        >(
11053            mut self,
11054            v: T,
11055        ) -> Self {
11056            self.0.request = self.0.request.set_entity_type_batch_inline(v);
11057            self
11058        }
11059    }
11060
11061    #[doc(hidden)]
11062    impl gax::options::internal::RequestBuilder for BatchUpdateEntityTypes {
11063        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11064            &mut self.0.options
11065        }
11066    }
11067
11068    /// The request builder for [EntityTypes::batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types] calls.
11069    ///
11070    /// # Example
11071    /// ```no_run
11072    /// # use google_cloud_dialogflow_v2::builder;
11073    /// use builder::entity_types::BatchDeleteEntityTypes;
11074    /// # tokio_test::block_on(async {
11075    /// use lro::Poller;
11076    ///
11077    /// let builder = prepare_request_builder();
11078    /// let response = builder.poller().until_done().await?;
11079    /// # gax::Result::<()>::Ok(()) });
11080    ///
11081    /// fn prepare_request_builder() -> BatchDeleteEntityTypes {
11082    ///   # panic!();
11083    ///   // ... details omitted ...
11084    /// }
11085    /// ```
11086    #[derive(Clone, Debug)]
11087    pub struct BatchDeleteEntityTypes(RequestBuilder<crate::model::BatchDeleteEntityTypesRequest>);
11088
11089    impl BatchDeleteEntityTypes {
11090        pub(crate) fn new(
11091            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11092        ) -> Self {
11093            Self(RequestBuilder::new(stub))
11094        }
11095
11096        /// Sets the full request, replacing any prior values.
11097        pub fn with_request<V: Into<crate::model::BatchDeleteEntityTypesRequest>>(
11098            mut self,
11099            v: V,
11100        ) -> Self {
11101            self.0.request = v.into();
11102            self
11103        }
11104
11105        /// Sets all the options, replacing any prior values.
11106        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11107            self.0.options = v.into();
11108            self
11109        }
11110
11111        /// Sends the request.
11112        ///
11113        /// # Long running operations
11114        ///
11115        /// This starts, but does not poll, a longrunning operation. More information
11116        /// on [batch_delete_entity_types][crate::client::EntityTypes::batch_delete_entity_types].
11117        pub async fn send(self) -> Result<longrunning::model::Operation> {
11118            (*self.0.stub)
11119                .batch_delete_entity_types(self.0.request, self.0.options)
11120                .await
11121                .map(gax::response::Response::into_body)
11122        }
11123
11124        /// Creates a [Poller][lro::Poller] to work with `batch_delete_entity_types`.
11125        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
11126            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
11127            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11128            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11129
11130            let stub = self.0.stub.clone();
11131            let mut options = self.0.options.clone();
11132            options.set_retry_policy(gax::retry_policy::NeverRetry);
11133            let query = move |name| {
11134                let stub = stub.clone();
11135                let options = options.clone();
11136                async {
11137                    let op = GetOperation::new(stub)
11138                        .set_name(name)
11139                        .with_options(options)
11140                        .send()
11141                        .await?;
11142                    Ok(Operation::new(op))
11143                }
11144            };
11145
11146            let start = move || async {
11147                let op = self.send().await?;
11148                Ok(Operation::new(op))
11149            };
11150
11151            lro::internal::new_unit_response_poller(
11152                polling_error_policy,
11153                polling_backoff_policy,
11154                start,
11155                query,
11156            )
11157        }
11158
11159        /// Sets the value of [parent][crate::model::BatchDeleteEntityTypesRequest::parent].
11160        ///
11161        /// This is a **required** field for requests.
11162        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11163            self.0.request.parent = v.into();
11164            self
11165        }
11166
11167        /// Sets the value of [entity_type_names][crate::model::BatchDeleteEntityTypesRequest::entity_type_names].
11168        ///
11169        /// This is a **required** field for requests.
11170        pub fn set_entity_type_names<T, V>(mut self, v: T) -> Self
11171        where
11172            T: std::iter::IntoIterator<Item = V>,
11173            V: std::convert::Into<std::string::String>,
11174        {
11175            use std::iter::Iterator;
11176            self.0.request.entity_type_names = v.into_iter().map(|i| i.into()).collect();
11177            self
11178        }
11179    }
11180
11181    #[doc(hidden)]
11182    impl gax::options::internal::RequestBuilder for BatchDeleteEntityTypes {
11183        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11184            &mut self.0.options
11185        }
11186    }
11187
11188    /// The request builder for [EntityTypes::batch_create_entities][crate::client::EntityTypes::batch_create_entities] calls.
11189    ///
11190    /// # Example
11191    /// ```no_run
11192    /// # use google_cloud_dialogflow_v2::builder;
11193    /// use builder::entity_types::BatchCreateEntities;
11194    /// # tokio_test::block_on(async {
11195    /// use lro::Poller;
11196    ///
11197    /// let builder = prepare_request_builder();
11198    /// let response = builder.poller().until_done().await?;
11199    /// # gax::Result::<()>::Ok(()) });
11200    ///
11201    /// fn prepare_request_builder() -> BatchCreateEntities {
11202    ///   # panic!();
11203    ///   // ... details omitted ...
11204    /// }
11205    /// ```
11206    #[derive(Clone, Debug)]
11207    pub struct BatchCreateEntities(RequestBuilder<crate::model::BatchCreateEntitiesRequest>);
11208
11209    impl BatchCreateEntities {
11210        pub(crate) fn new(
11211            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11212        ) -> Self {
11213            Self(RequestBuilder::new(stub))
11214        }
11215
11216        /// Sets the full request, replacing any prior values.
11217        pub fn with_request<V: Into<crate::model::BatchCreateEntitiesRequest>>(
11218            mut self,
11219            v: V,
11220        ) -> Self {
11221            self.0.request = v.into();
11222            self
11223        }
11224
11225        /// Sets all the options, replacing any prior values.
11226        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11227            self.0.options = v.into();
11228            self
11229        }
11230
11231        /// Sends the request.
11232        ///
11233        /// # Long running operations
11234        ///
11235        /// This starts, but does not poll, a longrunning operation. More information
11236        /// on [batch_create_entities][crate::client::EntityTypes::batch_create_entities].
11237        pub async fn send(self) -> Result<longrunning::model::Operation> {
11238            (*self.0.stub)
11239                .batch_create_entities(self.0.request, self.0.options)
11240                .await
11241                .map(gax::response::Response::into_body)
11242        }
11243
11244        /// Creates a [Poller][lro::Poller] to work with `batch_create_entities`.
11245        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
11246            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
11247            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11248            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11249
11250            let stub = self.0.stub.clone();
11251            let mut options = self.0.options.clone();
11252            options.set_retry_policy(gax::retry_policy::NeverRetry);
11253            let query = move |name| {
11254                let stub = stub.clone();
11255                let options = options.clone();
11256                async {
11257                    let op = GetOperation::new(stub)
11258                        .set_name(name)
11259                        .with_options(options)
11260                        .send()
11261                        .await?;
11262                    Ok(Operation::new(op))
11263                }
11264            };
11265
11266            let start = move || async {
11267                let op = self.send().await?;
11268                Ok(Operation::new(op))
11269            };
11270
11271            lro::internal::new_unit_response_poller(
11272                polling_error_policy,
11273                polling_backoff_policy,
11274                start,
11275                query,
11276            )
11277        }
11278
11279        /// Sets the value of [parent][crate::model::BatchCreateEntitiesRequest::parent].
11280        ///
11281        /// This is a **required** field for requests.
11282        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11283            self.0.request.parent = v.into();
11284            self
11285        }
11286
11287        /// Sets the value of [entities][crate::model::BatchCreateEntitiesRequest::entities].
11288        ///
11289        /// This is a **required** field for requests.
11290        pub fn set_entities<T, V>(mut self, v: T) -> Self
11291        where
11292            T: std::iter::IntoIterator<Item = V>,
11293            V: std::convert::Into<crate::model::entity_type::Entity>,
11294        {
11295            use std::iter::Iterator;
11296            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11297            self
11298        }
11299
11300        /// Sets the value of [language_code][crate::model::BatchCreateEntitiesRequest::language_code].
11301        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11302            self.0.request.language_code = v.into();
11303            self
11304        }
11305    }
11306
11307    #[doc(hidden)]
11308    impl gax::options::internal::RequestBuilder for BatchCreateEntities {
11309        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11310            &mut self.0.options
11311        }
11312    }
11313
11314    /// The request builder for [EntityTypes::batch_update_entities][crate::client::EntityTypes::batch_update_entities] calls.
11315    ///
11316    /// # Example
11317    /// ```no_run
11318    /// # use google_cloud_dialogflow_v2::builder;
11319    /// use builder::entity_types::BatchUpdateEntities;
11320    /// # tokio_test::block_on(async {
11321    /// use lro::Poller;
11322    ///
11323    /// let builder = prepare_request_builder();
11324    /// let response = builder.poller().until_done().await?;
11325    /// # gax::Result::<()>::Ok(()) });
11326    ///
11327    /// fn prepare_request_builder() -> BatchUpdateEntities {
11328    ///   # panic!();
11329    ///   // ... details omitted ...
11330    /// }
11331    /// ```
11332    #[derive(Clone, Debug)]
11333    pub struct BatchUpdateEntities(RequestBuilder<crate::model::BatchUpdateEntitiesRequest>);
11334
11335    impl BatchUpdateEntities {
11336        pub(crate) fn new(
11337            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11338        ) -> Self {
11339            Self(RequestBuilder::new(stub))
11340        }
11341
11342        /// Sets the full request, replacing any prior values.
11343        pub fn with_request<V: Into<crate::model::BatchUpdateEntitiesRequest>>(
11344            mut self,
11345            v: V,
11346        ) -> Self {
11347            self.0.request = v.into();
11348            self
11349        }
11350
11351        /// Sets all the options, replacing any prior values.
11352        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11353            self.0.options = v.into();
11354            self
11355        }
11356
11357        /// Sends the request.
11358        ///
11359        /// # Long running operations
11360        ///
11361        /// This starts, but does not poll, a longrunning operation. More information
11362        /// on [batch_update_entities][crate::client::EntityTypes::batch_update_entities].
11363        pub async fn send(self) -> Result<longrunning::model::Operation> {
11364            (*self.0.stub)
11365                .batch_update_entities(self.0.request, self.0.options)
11366                .await
11367                .map(gax::response::Response::into_body)
11368        }
11369
11370        /// Creates a [Poller][lro::Poller] to work with `batch_update_entities`.
11371        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
11372            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
11373            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11374            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11375
11376            let stub = self.0.stub.clone();
11377            let mut options = self.0.options.clone();
11378            options.set_retry_policy(gax::retry_policy::NeverRetry);
11379            let query = move |name| {
11380                let stub = stub.clone();
11381                let options = options.clone();
11382                async {
11383                    let op = GetOperation::new(stub)
11384                        .set_name(name)
11385                        .with_options(options)
11386                        .send()
11387                        .await?;
11388                    Ok(Operation::new(op))
11389                }
11390            };
11391
11392            let start = move || async {
11393                let op = self.send().await?;
11394                Ok(Operation::new(op))
11395            };
11396
11397            lro::internal::new_unit_response_poller(
11398                polling_error_policy,
11399                polling_backoff_policy,
11400                start,
11401                query,
11402            )
11403        }
11404
11405        /// Sets the value of [parent][crate::model::BatchUpdateEntitiesRequest::parent].
11406        ///
11407        /// This is a **required** field for requests.
11408        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11409            self.0.request.parent = v.into();
11410            self
11411        }
11412
11413        /// Sets the value of [entities][crate::model::BatchUpdateEntitiesRequest::entities].
11414        ///
11415        /// This is a **required** field for requests.
11416        pub fn set_entities<T, V>(mut self, v: T) -> Self
11417        where
11418            T: std::iter::IntoIterator<Item = V>,
11419            V: std::convert::Into<crate::model::entity_type::Entity>,
11420        {
11421            use std::iter::Iterator;
11422            self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11423            self
11424        }
11425
11426        /// Sets the value of [language_code][crate::model::BatchUpdateEntitiesRequest::language_code].
11427        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11428            self.0.request.language_code = v.into();
11429            self
11430        }
11431
11432        /// Sets the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11433        pub fn set_update_mask<T>(mut self, v: T) -> Self
11434        where
11435            T: std::convert::Into<wkt::FieldMask>,
11436        {
11437            self.0.request.update_mask = std::option::Option::Some(v.into());
11438            self
11439        }
11440
11441        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateEntitiesRequest::update_mask].
11442        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11443        where
11444            T: std::convert::Into<wkt::FieldMask>,
11445        {
11446            self.0.request.update_mask = v.map(|x| x.into());
11447            self
11448        }
11449    }
11450
11451    #[doc(hidden)]
11452    impl gax::options::internal::RequestBuilder for BatchUpdateEntities {
11453        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11454            &mut self.0.options
11455        }
11456    }
11457
11458    /// The request builder for [EntityTypes::batch_delete_entities][crate::client::EntityTypes::batch_delete_entities] calls.
11459    ///
11460    /// # Example
11461    /// ```no_run
11462    /// # use google_cloud_dialogflow_v2::builder;
11463    /// use builder::entity_types::BatchDeleteEntities;
11464    /// # tokio_test::block_on(async {
11465    /// use lro::Poller;
11466    ///
11467    /// let builder = prepare_request_builder();
11468    /// let response = builder.poller().until_done().await?;
11469    /// # gax::Result::<()>::Ok(()) });
11470    ///
11471    /// fn prepare_request_builder() -> BatchDeleteEntities {
11472    ///   # panic!();
11473    ///   // ... details omitted ...
11474    /// }
11475    /// ```
11476    #[derive(Clone, Debug)]
11477    pub struct BatchDeleteEntities(RequestBuilder<crate::model::BatchDeleteEntitiesRequest>);
11478
11479    impl BatchDeleteEntities {
11480        pub(crate) fn new(
11481            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11482        ) -> Self {
11483            Self(RequestBuilder::new(stub))
11484        }
11485
11486        /// Sets the full request, replacing any prior values.
11487        pub fn with_request<V: Into<crate::model::BatchDeleteEntitiesRequest>>(
11488            mut self,
11489            v: V,
11490        ) -> Self {
11491            self.0.request = v.into();
11492            self
11493        }
11494
11495        /// Sets all the options, replacing any prior values.
11496        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11497            self.0.options = v.into();
11498            self
11499        }
11500
11501        /// Sends the request.
11502        ///
11503        /// # Long running operations
11504        ///
11505        /// This starts, but does not poll, a longrunning operation. More information
11506        /// on [batch_delete_entities][crate::client::EntityTypes::batch_delete_entities].
11507        pub async fn send(self) -> Result<longrunning::model::Operation> {
11508            (*self.0.stub)
11509                .batch_delete_entities(self.0.request, self.0.options)
11510                .await
11511                .map(gax::response::Response::into_body)
11512        }
11513
11514        /// Creates a [Poller][lro::Poller] to work with `batch_delete_entities`.
11515        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
11516            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
11517            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11518            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11519
11520            let stub = self.0.stub.clone();
11521            let mut options = self.0.options.clone();
11522            options.set_retry_policy(gax::retry_policy::NeverRetry);
11523            let query = move |name| {
11524                let stub = stub.clone();
11525                let options = options.clone();
11526                async {
11527                    let op = GetOperation::new(stub)
11528                        .set_name(name)
11529                        .with_options(options)
11530                        .send()
11531                        .await?;
11532                    Ok(Operation::new(op))
11533                }
11534            };
11535
11536            let start = move || async {
11537                let op = self.send().await?;
11538                Ok(Operation::new(op))
11539            };
11540
11541            lro::internal::new_unit_response_poller(
11542                polling_error_policy,
11543                polling_backoff_policy,
11544                start,
11545                query,
11546            )
11547        }
11548
11549        /// Sets the value of [parent][crate::model::BatchDeleteEntitiesRequest::parent].
11550        ///
11551        /// This is a **required** field for requests.
11552        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11553            self.0.request.parent = v.into();
11554            self
11555        }
11556
11557        /// Sets the value of [entity_values][crate::model::BatchDeleteEntitiesRequest::entity_values].
11558        ///
11559        /// This is a **required** field for requests.
11560        pub fn set_entity_values<T, V>(mut self, v: T) -> Self
11561        where
11562            T: std::iter::IntoIterator<Item = V>,
11563            V: std::convert::Into<std::string::String>,
11564        {
11565            use std::iter::Iterator;
11566            self.0.request.entity_values = v.into_iter().map(|i| i.into()).collect();
11567            self
11568        }
11569
11570        /// Sets the value of [language_code][crate::model::BatchDeleteEntitiesRequest::language_code].
11571        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11572            self.0.request.language_code = v.into();
11573            self
11574        }
11575    }
11576
11577    #[doc(hidden)]
11578    impl gax::options::internal::RequestBuilder for BatchDeleteEntities {
11579        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11580            &mut self.0.options
11581        }
11582    }
11583
11584    /// The request builder for [EntityTypes::list_locations][crate::client::EntityTypes::list_locations] calls.
11585    ///
11586    /// # Example
11587    /// ```no_run
11588    /// # use google_cloud_dialogflow_v2::builder;
11589    /// use builder::entity_types::ListLocations;
11590    /// # tokio_test::block_on(async {
11591    /// use gax::paginator::ItemPaginator;
11592    ///
11593    /// let builder = prepare_request_builder();
11594    /// let mut items = builder.by_item();
11595    /// while let Some(result) = items.next().await {
11596    ///   let item = result?;
11597    /// }
11598    /// # gax::Result::<()>::Ok(()) });
11599    ///
11600    /// fn prepare_request_builder() -> ListLocations {
11601    ///   # panic!();
11602    ///   // ... details omitted ...
11603    /// }
11604    /// ```
11605    #[derive(Clone, Debug)]
11606    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
11607
11608    impl ListLocations {
11609        pub(crate) fn new(
11610            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11611        ) -> Self {
11612            Self(RequestBuilder::new(stub))
11613        }
11614
11615        /// Sets the full request, replacing any prior values.
11616        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
11617            mut self,
11618            v: V,
11619        ) -> Self {
11620            self.0.request = v.into();
11621            self
11622        }
11623
11624        /// Sets all the options, replacing any prior values.
11625        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11626            self.0.options = v.into();
11627            self
11628        }
11629
11630        /// Sends the request.
11631        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
11632            (*self.0.stub)
11633                .list_locations(self.0.request, self.0.options)
11634                .await
11635                .map(gax::response::Response::into_body)
11636        }
11637
11638        /// Streams each page in the collection.
11639        pub fn by_page(
11640            self,
11641        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
11642        {
11643            use std::clone::Clone;
11644            let token = self.0.request.page_token.clone();
11645            let execute = move |token: String| {
11646                let mut builder = self.clone();
11647                builder.0.request = builder.0.request.set_page_token(token);
11648                builder.send()
11649            };
11650            gax::paginator::internal::new_paginator(token, execute)
11651        }
11652
11653        /// Streams each item in the collection.
11654        pub fn by_item(
11655            self,
11656        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
11657        {
11658            use gax::paginator::Paginator;
11659            self.by_page().items()
11660        }
11661
11662        /// Sets the value of [name][location::model::ListLocationsRequest::name].
11663        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11664            self.0.request.name = v.into();
11665            self
11666        }
11667
11668        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
11669        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11670            self.0.request.filter = v.into();
11671            self
11672        }
11673
11674        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
11675        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11676            self.0.request.page_size = v.into();
11677            self
11678        }
11679
11680        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
11681        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11682            self.0.request.page_token = v.into();
11683            self
11684        }
11685    }
11686
11687    #[doc(hidden)]
11688    impl gax::options::internal::RequestBuilder for ListLocations {
11689        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11690            &mut self.0.options
11691        }
11692    }
11693
11694    /// The request builder for [EntityTypes::get_location][crate::client::EntityTypes::get_location] calls.
11695    ///
11696    /// # Example
11697    /// ```no_run
11698    /// # use google_cloud_dialogflow_v2::builder;
11699    /// use builder::entity_types::GetLocation;
11700    /// # tokio_test::block_on(async {
11701    ///
11702    /// let builder = prepare_request_builder();
11703    /// let response = builder.send().await?;
11704    /// # gax::Result::<()>::Ok(()) });
11705    ///
11706    /// fn prepare_request_builder() -> GetLocation {
11707    ///   # panic!();
11708    ///   // ... details omitted ...
11709    /// }
11710    /// ```
11711    #[derive(Clone, Debug)]
11712    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
11713
11714    impl GetLocation {
11715        pub(crate) fn new(
11716            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11717        ) -> Self {
11718            Self(RequestBuilder::new(stub))
11719        }
11720
11721        /// Sets the full request, replacing any prior values.
11722        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
11723            self.0.request = v.into();
11724            self
11725        }
11726
11727        /// Sets all the options, replacing any prior values.
11728        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11729            self.0.options = v.into();
11730            self
11731        }
11732
11733        /// Sends the request.
11734        pub async fn send(self) -> Result<location::model::Location> {
11735            (*self.0.stub)
11736                .get_location(self.0.request, self.0.options)
11737                .await
11738                .map(gax::response::Response::into_body)
11739        }
11740
11741        /// Sets the value of [name][location::model::GetLocationRequest::name].
11742        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11743            self.0.request.name = v.into();
11744            self
11745        }
11746    }
11747
11748    #[doc(hidden)]
11749    impl gax::options::internal::RequestBuilder for GetLocation {
11750        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11751            &mut self.0.options
11752        }
11753    }
11754
11755    /// The request builder for [EntityTypes::list_operations][crate::client::EntityTypes::list_operations] calls.
11756    ///
11757    /// # Example
11758    /// ```no_run
11759    /// # use google_cloud_dialogflow_v2::builder;
11760    /// use builder::entity_types::ListOperations;
11761    /// # tokio_test::block_on(async {
11762    /// use gax::paginator::ItemPaginator;
11763    ///
11764    /// let builder = prepare_request_builder();
11765    /// let mut items = builder.by_item();
11766    /// while let Some(result) = items.next().await {
11767    ///   let item = result?;
11768    /// }
11769    /// # gax::Result::<()>::Ok(()) });
11770    ///
11771    /// fn prepare_request_builder() -> ListOperations {
11772    ///   # panic!();
11773    ///   // ... details omitted ...
11774    /// }
11775    /// ```
11776    #[derive(Clone, Debug)]
11777    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
11778
11779    impl ListOperations {
11780        pub(crate) fn new(
11781            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11782        ) -> Self {
11783            Self(RequestBuilder::new(stub))
11784        }
11785
11786        /// Sets the full request, replacing any prior values.
11787        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
11788            mut self,
11789            v: V,
11790        ) -> Self {
11791            self.0.request = v.into();
11792            self
11793        }
11794
11795        /// Sets all the options, replacing any prior values.
11796        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11797            self.0.options = v.into();
11798            self
11799        }
11800
11801        /// Sends the request.
11802        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
11803            (*self.0.stub)
11804                .list_operations(self.0.request, self.0.options)
11805                .await
11806                .map(gax::response::Response::into_body)
11807        }
11808
11809        /// Streams each page in the collection.
11810        pub fn by_page(
11811            self,
11812        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
11813        {
11814            use std::clone::Clone;
11815            let token = self.0.request.page_token.clone();
11816            let execute = move |token: String| {
11817                let mut builder = self.clone();
11818                builder.0.request = builder.0.request.set_page_token(token);
11819                builder.send()
11820            };
11821            gax::paginator::internal::new_paginator(token, execute)
11822        }
11823
11824        /// Streams each item in the collection.
11825        pub fn by_item(
11826            self,
11827        ) -> impl gax::paginator::ItemPaginator<
11828            longrunning::model::ListOperationsResponse,
11829            gax::error::Error,
11830        > {
11831            use gax::paginator::Paginator;
11832            self.by_page().items()
11833        }
11834
11835        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
11836        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11837            self.0.request.name = v.into();
11838            self
11839        }
11840
11841        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
11842        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11843            self.0.request.filter = v.into();
11844            self
11845        }
11846
11847        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
11848        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11849            self.0.request.page_size = v.into();
11850            self
11851        }
11852
11853        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
11854        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11855            self.0.request.page_token = v.into();
11856            self
11857        }
11858
11859        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
11860        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11861            self.0.request.return_partial_success = v.into();
11862            self
11863        }
11864    }
11865
11866    #[doc(hidden)]
11867    impl gax::options::internal::RequestBuilder for ListOperations {
11868        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11869            &mut self.0.options
11870        }
11871    }
11872
11873    /// The request builder for [EntityTypes::get_operation][crate::client::EntityTypes::get_operation] calls.
11874    ///
11875    /// # Example
11876    /// ```no_run
11877    /// # use google_cloud_dialogflow_v2::builder;
11878    /// use builder::entity_types::GetOperation;
11879    /// # tokio_test::block_on(async {
11880    ///
11881    /// let builder = prepare_request_builder();
11882    /// let response = builder.send().await?;
11883    /// # gax::Result::<()>::Ok(()) });
11884    ///
11885    /// fn prepare_request_builder() -> GetOperation {
11886    ///   # panic!();
11887    ///   // ... details omitted ...
11888    /// }
11889    /// ```
11890    #[derive(Clone, Debug)]
11891    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11892
11893    impl GetOperation {
11894        pub(crate) fn new(
11895            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11896        ) -> Self {
11897            Self(RequestBuilder::new(stub))
11898        }
11899
11900        /// Sets the full request, replacing any prior values.
11901        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11902            mut self,
11903            v: V,
11904        ) -> Self {
11905            self.0.request = v.into();
11906            self
11907        }
11908
11909        /// Sets all the options, replacing any prior values.
11910        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11911            self.0.options = v.into();
11912            self
11913        }
11914
11915        /// Sends the request.
11916        pub async fn send(self) -> Result<longrunning::model::Operation> {
11917            (*self.0.stub)
11918                .get_operation(self.0.request, self.0.options)
11919                .await
11920                .map(gax::response::Response::into_body)
11921        }
11922
11923        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
11924        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11925            self.0.request.name = v.into();
11926            self
11927        }
11928    }
11929
11930    #[doc(hidden)]
11931    impl gax::options::internal::RequestBuilder for GetOperation {
11932        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11933            &mut self.0.options
11934        }
11935    }
11936
11937    /// The request builder for [EntityTypes::cancel_operation][crate::client::EntityTypes::cancel_operation] calls.
11938    ///
11939    /// # Example
11940    /// ```no_run
11941    /// # use google_cloud_dialogflow_v2::builder;
11942    /// use builder::entity_types::CancelOperation;
11943    /// # tokio_test::block_on(async {
11944    ///
11945    /// let builder = prepare_request_builder();
11946    /// let response = builder.send().await?;
11947    /// # gax::Result::<()>::Ok(()) });
11948    ///
11949    /// fn prepare_request_builder() -> CancelOperation {
11950    ///   # panic!();
11951    ///   // ... details omitted ...
11952    /// }
11953    /// ```
11954    #[derive(Clone, Debug)]
11955    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11956
11957    impl CancelOperation {
11958        pub(crate) fn new(
11959            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11960        ) -> Self {
11961            Self(RequestBuilder::new(stub))
11962        }
11963
11964        /// Sets the full request, replacing any prior values.
11965        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11966            mut self,
11967            v: V,
11968        ) -> Self {
11969            self.0.request = v.into();
11970            self
11971        }
11972
11973        /// Sets all the options, replacing any prior values.
11974        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11975            self.0.options = v.into();
11976            self
11977        }
11978
11979        /// Sends the request.
11980        pub async fn send(self) -> Result<()> {
11981            (*self.0.stub)
11982                .cancel_operation(self.0.request, self.0.options)
11983                .await
11984                .map(gax::response::Response::into_body)
11985        }
11986
11987        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
11988        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11989            self.0.request.name = v.into();
11990            self
11991        }
11992    }
11993
11994    #[doc(hidden)]
11995    impl gax::options::internal::RequestBuilder for CancelOperation {
11996        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11997            &mut self.0.options
11998        }
11999    }
12000}
12001
12002#[cfg(feature = "environments")]
12003#[cfg_attr(docsrs, doc(cfg(feature = "environments")))]
12004pub mod environments {
12005    use crate::Result;
12006
12007    /// A builder for [Environments][crate::client::Environments].
12008    ///
12009    /// ```
12010    /// # tokio_test::block_on(async {
12011    /// # use google_cloud_dialogflow_v2::*;
12012    /// # use builder::environments::ClientBuilder;
12013    /// # use client::Environments;
12014    /// let builder : ClientBuilder = Environments::builder();
12015    /// let client = builder
12016    ///     .with_endpoint("https://dialogflow.googleapis.com")
12017    ///     .build().await?;
12018    /// # gax::client_builder::Result::<()>::Ok(()) });
12019    /// ```
12020    pub type ClientBuilder =
12021        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12022
12023    pub(crate) mod client {
12024        use super::super::super::client::Environments;
12025        pub struct Factory;
12026        impl gax::client_builder::internal::ClientFactory for Factory {
12027            type Client = Environments;
12028            type Credentials = gaxi::options::Credentials;
12029            async fn build(
12030                self,
12031                config: gaxi::options::ClientConfig,
12032            ) -> gax::client_builder::Result<Self::Client> {
12033                Self::Client::new(config).await
12034            }
12035        }
12036    }
12037
12038    /// Common implementation for [crate::client::Environments] request builders.
12039    #[derive(Clone, Debug)]
12040    pub(crate) struct RequestBuilder<R: std::default::Default> {
12041        stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12042        request: R,
12043        options: gax::options::RequestOptions,
12044    }
12045
12046    impl<R> RequestBuilder<R>
12047    where
12048        R: std::default::Default,
12049    {
12050        pub(crate) fn new(
12051            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12052        ) -> Self {
12053            Self {
12054                stub,
12055                request: R::default(),
12056                options: gax::options::RequestOptions::default(),
12057            }
12058        }
12059    }
12060
12061    /// The request builder for [Environments::list_environments][crate::client::Environments::list_environments] calls.
12062    ///
12063    /// # Example
12064    /// ```no_run
12065    /// # use google_cloud_dialogflow_v2::builder;
12066    /// use builder::environments::ListEnvironments;
12067    /// # tokio_test::block_on(async {
12068    /// use gax::paginator::ItemPaginator;
12069    ///
12070    /// let builder = prepare_request_builder();
12071    /// let mut items = builder.by_item();
12072    /// while let Some(result) = items.next().await {
12073    ///   let item = result?;
12074    /// }
12075    /// # gax::Result::<()>::Ok(()) });
12076    ///
12077    /// fn prepare_request_builder() -> ListEnvironments {
12078    ///   # panic!();
12079    ///   // ... details omitted ...
12080    /// }
12081    /// ```
12082    #[derive(Clone, Debug)]
12083    pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
12084
12085    impl ListEnvironments {
12086        pub(crate) fn new(
12087            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12088        ) -> Self {
12089            Self(RequestBuilder::new(stub))
12090        }
12091
12092        /// Sets the full request, replacing any prior values.
12093        pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
12094            mut self,
12095            v: V,
12096        ) -> Self {
12097            self.0.request = v.into();
12098            self
12099        }
12100
12101        /// Sets all the options, replacing any prior values.
12102        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12103            self.0.options = v.into();
12104            self
12105        }
12106
12107        /// Sends the request.
12108        pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
12109            (*self.0.stub)
12110                .list_environments(self.0.request, self.0.options)
12111                .await
12112                .map(gax::response::Response::into_body)
12113        }
12114
12115        /// Streams each page in the collection.
12116        pub fn by_page(
12117            self,
12118        ) -> impl gax::paginator::Paginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
12119        {
12120            use std::clone::Clone;
12121            let token = self.0.request.page_token.clone();
12122            let execute = move |token: String| {
12123                let mut builder = self.clone();
12124                builder.0.request = builder.0.request.set_page_token(token);
12125                builder.send()
12126            };
12127            gax::paginator::internal::new_paginator(token, execute)
12128        }
12129
12130        /// Streams each item in the collection.
12131        pub fn by_item(
12132            self,
12133        ) -> impl gax::paginator::ItemPaginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
12134        {
12135            use gax::paginator::Paginator;
12136            self.by_page().items()
12137        }
12138
12139        /// Sets the value of [parent][crate::model::ListEnvironmentsRequest::parent].
12140        ///
12141        /// This is a **required** field for requests.
12142        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12143            self.0.request.parent = v.into();
12144            self
12145        }
12146
12147        /// Sets the value of [page_size][crate::model::ListEnvironmentsRequest::page_size].
12148        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12149            self.0.request.page_size = v.into();
12150            self
12151        }
12152
12153        /// Sets the value of [page_token][crate::model::ListEnvironmentsRequest::page_token].
12154        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12155            self.0.request.page_token = v.into();
12156            self
12157        }
12158    }
12159
12160    #[doc(hidden)]
12161    impl gax::options::internal::RequestBuilder for ListEnvironments {
12162        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12163            &mut self.0.options
12164        }
12165    }
12166
12167    /// The request builder for [Environments::get_environment][crate::client::Environments::get_environment] calls.
12168    ///
12169    /// # Example
12170    /// ```no_run
12171    /// # use google_cloud_dialogflow_v2::builder;
12172    /// use builder::environments::GetEnvironment;
12173    /// # tokio_test::block_on(async {
12174    ///
12175    /// let builder = prepare_request_builder();
12176    /// let response = builder.send().await?;
12177    /// # gax::Result::<()>::Ok(()) });
12178    ///
12179    /// fn prepare_request_builder() -> GetEnvironment {
12180    ///   # panic!();
12181    ///   // ... details omitted ...
12182    /// }
12183    /// ```
12184    #[derive(Clone, Debug)]
12185    pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
12186
12187    impl GetEnvironment {
12188        pub(crate) fn new(
12189            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12190        ) -> Self {
12191            Self(RequestBuilder::new(stub))
12192        }
12193
12194        /// Sets the full request, replacing any prior values.
12195        pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
12196            self.0.request = v.into();
12197            self
12198        }
12199
12200        /// Sets all the options, replacing any prior values.
12201        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12202            self.0.options = v.into();
12203            self
12204        }
12205
12206        /// Sends the request.
12207        pub async fn send(self) -> Result<crate::model::Environment> {
12208            (*self.0.stub)
12209                .get_environment(self.0.request, self.0.options)
12210                .await
12211                .map(gax::response::Response::into_body)
12212        }
12213
12214        /// Sets the value of [name][crate::model::GetEnvironmentRequest::name].
12215        ///
12216        /// This is a **required** field for requests.
12217        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12218            self.0.request.name = v.into();
12219            self
12220        }
12221    }
12222
12223    #[doc(hidden)]
12224    impl gax::options::internal::RequestBuilder for GetEnvironment {
12225        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12226            &mut self.0.options
12227        }
12228    }
12229
12230    /// The request builder for [Environments::create_environment][crate::client::Environments::create_environment] calls.
12231    ///
12232    /// # Example
12233    /// ```no_run
12234    /// # use google_cloud_dialogflow_v2::builder;
12235    /// use builder::environments::CreateEnvironment;
12236    /// # tokio_test::block_on(async {
12237    ///
12238    /// let builder = prepare_request_builder();
12239    /// let response = builder.send().await?;
12240    /// # gax::Result::<()>::Ok(()) });
12241    ///
12242    /// fn prepare_request_builder() -> CreateEnvironment {
12243    ///   # panic!();
12244    ///   // ... details omitted ...
12245    /// }
12246    /// ```
12247    #[derive(Clone, Debug)]
12248    pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
12249
12250    impl CreateEnvironment {
12251        pub(crate) fn new(
12252            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12253        ) -> Self {
12254            Self(RequestBuilder::new(stub))
12255        }
12256
12257        /// Sets the full request, replacing any prior values.
12258        pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
12259            mut self,
12260            v: V,
12261        ) -> Self {
12262            self.0.request = v.into();
12263            self
12264        }
12265
12266        /// Sets all the options, replacing any prior values.
12267        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12268            self.0.options = v.into();
12269            self
12270        }
12271
12272        /// Sends the request.
12273        pub async fn send(self) -> Result<crate::model::Environment> {
12274            (*self.0.stub)
12275                .create_environment(self.0.request, self.0.options)
12276                .await
12277                .map(gax::response::Response::into_body)
12278        }
12279
12280        /// Sets the value of [parent][crate::model::CreateEnvironmentRequest::parent].
12281        ///
12282        /// This is a **required** field for requests.
12283        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12284            self.0.request.parent = v.into();
12285            self
12286        }
12287
12288        /// Sets the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12289        ///
12290        /// This is a **required** field for requests.
12291        pub fn set_environment<T>(mut self, v: T) -> Self
12292        where
12293            T: std::convert::Into<crate::model::Environment>,
12294        {
12295            self.0.request.environment = std::option::Option::Some(v.into());
12296            self
12297        }
12298
12299        /// Sets or clears the value of [environment][crate::model::CreateEnvironmentRequest::environment].
12300        ///
12301        /// This is a **required** field for requests.
12302        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12303        where
12304            T: std::convert::Into<crate::model::Environment>,
12305        {
12306            self.0.request.environment = v.map(|x| x.into());
12307            self
12308        }
12309
12310        /// Sets the value of [environment_id][crate::model::CreateEnvironmentRequest::environment_id].
12311        ///
12312        /// This is a **required** field for requests.
12313        pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12314            self.0.request.environment_id = v.into();
12315            self
12316        }
12317    }
12318
12319    #[doc(hidden)]
12320    impl gax::options::internal::RequestBuilder for CreateEnvironment {
12321        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12322            &mut self.0.options
12323        }
12324    }
12325
12326    /// The request builder for [Environments::update_environment][crate::client::Environments::update_environment] calls.
12327    ///
12328    /// # Example
12329    /// ```no_run
12330    /// # use google_cloud_dialogflow_v2::builder;
12331    /// use builder::environments::UpdateEnvironment;
12332    /// # tokio_test::block_on(async {
12333    ///
12334    /// let builder = prepare_request_builder();
12335    /// let response = builder.send().await?;
12336    /// # gax::Result::<()>::Ok(()) });
12337    ///
12338    /// fn prepare_request_builder() -> UpdateEnvironment {
12339    ///   # panic!();
12340    ///   // ... details omitted ...
12341    /// }
12342    /// ```
12343    #[derive(Clone, Debug)]
12344    pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
12345
12346    impl UpdateEnvironment {
12347        pub(crate) fn new(
12348            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12349        ) -> Self {
12350            Self(RequestBuilder::new(stub))
12351        }
12352
12353        /// Sets the full request, replacing any prior values.
12354        pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
12355            mut self,
12356            v: V,
12357        ) -> Self {
12358            self.0.request = v.into();
12359            self
12360        }
12361
12362        /// Sets all the options, replacing any prior values.
12363        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12364            self.0.options = v.into();
12365            self
12366        }
12367
12368        /// Sends the request.
12369        pub async fn send(self) -> Result<crate::model::Environment> {
12370            (*self.0.stub)
12371                .update_environment(self.0.request, self.0.options)
12372                .await
12373                .map(gax::response::Response::into_body)
12374        }
12375
12376        /// Sets the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12377        ///
12378        /// This is a **required** field for requests.
12379        pub fn set_environment<T>(mut self, v: T) -> Self
12380        where
12381            T: std::convert::Into<crate::model::Environment>,
12382        {
12383            self.0.request.environment = std::option::Option::Some(v.into());
12384            self
12385        }
12386
12387        /// Sets or clears the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
12388        ///
12389        /// This is a **required** field for requests.
12390        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12391        where
12392            T: std::convert::Into<crate::model::Environment>,
12393        {
12394            self.0.request.environment = v.map(|x| x.into());
12395            self
12396        }
12397
12398        /// Sets the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12399        ///
12400        /// This is a **required** field for requests.
12401        pub fn set_update_mask<T>(mut self, v: T) -> Self
12402        where
12403            T: std::convert::Into<wkt::FieldMask>,
12404        {
12405            self.0.request.update_mask = std::option::Option::Some(v.into());
12406            self
12407        }
12408
12409        /// Sets or clears the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
12410        ///
12411        /// This is a **required** field for requests.
12412        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12413        where
12414            T: std::convert::Into<wkt::FieldMask>,
12415        {
12416            self.0.request.update_mask = v.map(|x| x.into());
12417            self
12418        }
12419
12420        /// Sets the value of [allow_load_to_draft_and_discard_changes][crate::model::UpdateEnvironmentRequest::allow_load_to_draft_and_discard_changes].
12421        pub fn set_allow_load_to_draft_and_discard_changes<T: Into<bool>>(mut self, v: T) -> Self {
12422            self.0.request.allow_load_to_draft_and_discard_changes = v.into();
12423            self
12424        }
12425    }
12426
12427    #[doc(hidden)]
12428    impl gax::options::internal::RequestBuilder for UpdateEnvironment {
12429        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12430            &mut self.0.options
12431        }
12432    }
12433
12434    /// The request builder for [Environments::delete_environment][crate::client::Environments::delete_environment] calls.
12435    ///
12436    /// # Example
12437    /// ```no_run
12438    /// # use google_cloud_dialogflow_v2::builder;
12439    /// use builder::environments::DeleteEnvironment;
12440    /// # tokio_test::block_on(async {
12441    ///
12442    /// let builder = prepare_request_builder();
12443    /// let response = builder.send().await?;
12444    /// # gax::Result::<()>::Ok(()) });
12445    ///
12446    /// fn prepare_request_builder() -> DeleteEnvironment {
12447    ///   # panic!();
12448    ///   // ... details omitted ...
12449    /// }
12450    /// ```
12451    #[derive(Clone, Debug)]
12452    pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
12453
12454    impl DeleteEnvironment {
12455        pub(crate) fn new(
12456            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12457        ) -> Self {
12458            Self(RequestBuilder::new(stub))
12459        }
12460
12461        /// Sets the full request, replacing any prior values.
12462        pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
12463            mut self,
12464            v: V,
12465        ) -> Self {
12466            self.0.request = v.into();
12467            self
12468        }
12469
12470        /// Sets all the options, replacing any prior values.
12471        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12472            self.0.options = v.into();
12473            self
12474        }
12475
12476        /// Sends the request.
12477        pub async fn send(self) -> Result<()> {
12478            (*self.0.stub)
12479                .delete_environment(self.0.request, self.0.options)
12480                .await
12481                .map(gax::response::Response::into_body)
12482        }
12483
12484        /// Sets the value of [name][crate::model::DeleteEnvironmentRequest::name].
12485        ///
12486        /// This is a **required** field for requests.
12487        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12488            self.0.request.name = v.into();
12489            self
12490        }
12491    }
12492
12493    #[doc(hidden)]
12494    impl gax::options::internal::RequestBuilder for DeleteEnvironment {
12495        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12496            &mut self.0.options
12497        }
12498    }
12499
12500    /// The request builder for [Environments::get_environment_history][crate::client::Environments::get_environment_history] calls.
12501    ///
12502    /// # Example
12503    /// ```no_run
12504    /// # use google_cloud_dialogflow_v2::builder;
12505    /// use builder::environments::GetEnvironmentHistory;
12506    /// # tokio_test::block_on(async {
12507    /// use gax::paginator::ItemPaginator;
12508    ///
12509    /// let builder = prepare_request_builder();
12510    /// let mut items = builder.by_item();
12511    /// while let Some(result) = items.next().await {
12512    ///   let item = result?;
12513    /// }
12514    /// # gax::Result::<()>::Ok(()) });
12515    ///
12516    /// fn prepare_request_builder() -> GetEnvironmentHistory {
12517    ///   # panic!();
12518    ///   // ... details omitted ...
12519    /// }
12520    /// ```
12521    #[derive(Clone, Debug)]
12522    pub struct GetEnvironmentHistory(RequestBuilder<crate::model::GetEnvironmentHistoryRequest>);
12523
12524    impl GetEnvironmentHistory {
12525        pub(crate) fn new(
12526            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12527        ) -> Self {
12528            Self(RequestBuilder::new(stub))
12529        }
12530
12531        /// Sets the full request, replacing any prior values.
12532        pub fn with_request<V: Into<crate::model::GetEnvironmentHistoryRequest>>(
12533            mut self,
12534            v: V,
12535        ) -> Self {
12536            self.0.request = v.into();
12537            self
12538        }
12539
12540        /// Sets all the options, replacing any prior values.
12541        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12542            self.0.options = v.into();
12543            self
12544        }
12545
12546        /// Sends the request.
12547        pub async fn send(self) -> Result<crate::model::EnvironmentHistory> {
12548            (*self.0.stub)
12549                .get_environment_history(self.0.request, self.0.options)
12550                .await
12551                .map(gax::response::Response::into_body)
12552        }
12553
12554        /// Streams each page in the collection.
12555        pub fn by_page(
12556            self,
12557        ) -> impl gax::paginator::Paginator<crate::model::EnvironmentHistory, gax::error::Error>
12558        {
12559            use std::clone::Clone;
12560            let token = self.0.request.page_token.clone();
12561            let execute = move |token: String| {
12562                let mut builder = self.clone();
12563                builder.0.request = builder.0.request.set_page_token(token);
12564                builder.send()
12565            };
12566            gax::paginator::internal::new_paginator(token, execute)
12567        }
12568
12569        /// Streams each item in the collection.
12570        pub fn by_item(
12571            self,
12572        ) -> impl gax::paginator::ItemPaginator<crate::model::EnvironmentHistory, gax::error::Error>
12573        {
12574            use gax::paginator::Paginator;
12575            self.by_page().items()
12576        }
12577
12578        /// Sets the value of [parent][crate::model::GetEnvironmentHistoryRequest::parent].
12579        ///
12580        /// This is a **required** field for requests.
12581        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12582            self.0.request.parent = v.into();
12583            self
12584        }
12585
12586        /// Sets the value of [page_size][crate::model::GetEnvironmentHistoryRequest::page_size].
12587        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12588            self.0.request.page_size = v.into();
12589            self
12590        }
12591
12592        /// Sets the value of [page_token][crate::model::GetEnvironmentHistoryRequest::page_token].
12593        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12594            self.0.request.page_token = v.into();
12595            self
12596        }
12597    }
12598
12599    #[doc(hidden)]
12600    impl gax::options::internal::RequestBuilder for GetEnvironmentHistory {
12601        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12602            &mut self.0.options
12603        }
12604    }
12605
12606    /// The request builder for [Environments::list_locations][crate::client::Environments::list_locations] calls.
12607    ///
12608    /// # Example
12609    /// ```no_run
12610    /// # use google_cloud_dialogflow_v2::builder;
12611    /// use builder::environments::ListLocations;
12612    /// # tokio_test::block_on(async {
12613    /// use gax::paginator::ItemPaginator;
12614    ///
12615    /// let builder = prepare_request_builder();
12616    /// let mut items = builder.by_item();
12617    /// while let Some(result) = items.next().await {
12618    ///   let item = result?;
12619    /// }
12620    /// # gax::Result::<()>::Ok(()) });
12621    ///
12622    /// fn prepare_request_builder() -> ListLocations {
12623    ///   # panic!();
12624    ///   // ... details omitted ...
12625    /// }
12626    /// ```
12627    #[derive(Clone, Debug)]
12628    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
12629
12630    impl ListLocations {
12631        pub(crate) fn new(
12632            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12633        ) -> Self {
12634            Self(RequestBuilder::new(stub))
12635        }
12636
12637        /// Sets the full request, replacing any prior values.
12638        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
12639            mut self,
12640            v: V,
12641        ) -> Self {
12642            self.0.request = v.into();
12643            self
12644        }
12645
12646        /// Sets all the options, replacing any prior values.
12647        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12648            self.0.options = v.into();
12649            self
12650        }
12651
12652        /// Sends the request.
12653        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
12654            (*self.0.stub)
12655                .list_locations(self.0.request, self.0.options)
12656                .await
12657                .map(gax::response::Response::into_body)
12658        }
12659
12660        /// Streams each page in the collection.
12661        pub fn by_page(
12662            self,
12663        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
12664        {
12665            use std::clone::Clone;
12666            let token = self.0.request.page_token.clone();
12667            let execute = move |token: String| {
12668                let mut builder = self.clone();
12669                builder.0.request = builder.0.request.set_page_token(token);
12670                builder.send()
12671            };
12672            gax::paginator::internal::new_paginator(token, execute)
12673        }
12674
12675        /// Streams each item in the collection.
12676        pub fn by_item(
12677            self,
12678        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
12679        {
12680            use gax::paginator::Paginator;
12681            self.by_page().items()
12682        }
12683
12684        /// Sets the value of [name][location::model::ListLocationsRequest::name].
12685        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12686            self.0.request.name = v.into();
12687            self
12688        }
12689
12690        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
12691        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12692            self.0.request.filter = v.into();
12693            self
12694        }
12695
12696        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
12697        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12698            self.0.request.page_size = v.into();
12699            self
12700        }
12701
12702        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
12703        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12704            self.0.request.page_token = v.into();
12705            self
12706        }
12707    }
12708
12709    #[doc(hidden)]
12710    impl gax::options::internal::RequestBuilder for ListLocations {
12711        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12712            &mut self.0.options
12713        }
12714    }
12715
12716    /// The request builder for [Environments::get_location][crate::client::Environments::get_location] calls.
12717    ///
12718    /// # Example
12719    /// ```no_run
12720    /// # use google_cloud_dialogflow_v2::builder;
12721    /// use builder::environments::GetLocation;
12722    /// # tokio_test::block_on(async {
12723    ///
12724    /// let builder = prepare_request_builder();
12725    /// let response = builder.send().await?;
12726    /// # gax::Result::<()>::Ok(()) });
12727    ///
12728    /// fn prepare_request_builder() -> GetLocation {
12729    ///   # panic!();
12730    ///   // ... details omitted ...
12731    /// }
12732    /// ```
12733    #[derive(Clone, Debug)]
12734    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
12735
12736    impl GetLocation {
12737        pub(crate) fn new(
12738            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12739        ) -> Self {
12740            Self(RequestBuilder::new(stub))
12741        }
12742
12743        /// Sets the full request, replacing any prior values.
12744        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
12745            self.0.request = v.into();
12746            self
12747        }
12748
12749        /// Sets all the options, replacing any prior values.
12750        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12751            self.0.options = v.into();
12752            self
12753        }
12754
12755        /// Sends the request.
12756        pub async fn send(self) -> Result<location::model::Location> {
12757            (*self.0.stub)
12758                .get_location(self.0.request, self.0.options)
12759                .await
12760                .map(gax::response::Response::into_body)
12761        }
12762
12763        /// Sets the value of [name][location::model::GetLocationRequest::name].
12764        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12765            self.0.request.name = v.into();
12766            self
12767        }
12768    }
12769
12770    #[doc(hidden)]
12771    impl gax::options::internal::RequestBuilder for GetLocation {
12772        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12773            &mut self.0.options
12774        }
12775    }
12776
12777    /// The request builder for [Environments::list_operations][crate::client::Environments::list_operations] calls.
12778    ///
12779    /// # Example
12780    /// ```no_run
12781    /// # use google_cloud_dialogflow_v2::builder;
12782    /// use builder::environments::ListOperations;
12783    /// # tokio_test::block_on(async {
12784    /// use gax::paginator::ItemPaginator;
12785    ///
12786    /// let builder = prepare_request_builder();
12787    /// let mut items = builder.by_item();
12788    /// while let Some(result) = items.next().await {
12789    ///   let item = result?;
12790    /// }
12791    /// # gax::Result::<()>::Ok(()) });
12792    ///
12793    /// fn prepare_request_builder() -> ListOperations {
12794    ///   # panic!();
12795    ///   // ... details omitted ...
12796    /// }
12797    /// ```
12798    #[derive(Clone, Debug)]
12799    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
12800
12801    impl ListOperations {
12802        pub(crate) fn new(
12803            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12804        ) -> Self {
12805            Self(RequestBuilder::new(stub))
12806        }
12807
12808        /// Sets the full request, replacing any prior values.
12809        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
12810            mut self,
12811            v: V,
12812        ) -> Self {
12813            self.0.request = v.into();
12814            self
12815        }
12816
12817        /// Sets all the options, replacing any prior values.
12818        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12819            self.0.options = v.into();
12820            self
12821        }
12822
12823        /// Sends the request.
12824        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
12825            (*self.0.stub)
12826                .list_operations(self.0.request, self.0.options)
12827                .await
12828                .map(gax::response::Response::into_body)
12829        }
12830
12831        /// Streams each page in the collection.
12832        pub fn by_page(
12833            self,
12834        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
12835        {
12836            use std::clone::Clone;
12837            let token = self.0.request.page_token.clone();
12838            let execute = move |token: String| {
12839                let mut builder = self.clone();
12840                builder.0.request = builder.0.request.set_page_token(token);
12841                builder.send()
12842            };
12843            gax::paginator::internal::new_paginator(token, execute)
12844        }
12845
12846        /// Streams each item in the collection.
12847        pub fn by_item(
12848            self,
12849        ) -> impl gax::paginator::ItemPaginator<
12850            longrunning::model::ListOperationsResponse,
12851            gax::error::Error,
12852        > {
12853            use gax::paginator::Paginator;
12854            self.by_page().items()
12855        }
12856
12857        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
12858        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12859            self.0.request.name = v.into();
12860            self
12861        }
12862
12863        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
12864        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12865            self.0.request.filter = v.into();
12866            self
12867        }
12868
12869        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
12870        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12871            self.0.request.page_size = v.into();
12872            self
12873        }
12874
12875        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
12876        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12877            self.0.request.page_token = v.into();
12878            self
12879        }
12880
12881        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
12882        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
12883            self.0.request.return_partial_success = v.into();
12884            self
12885        }
12886    }
12887
12888    #[doc(hidden)]
12889    impl gax::options::internal::RequestBuilder for ListOperations {
12890        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12891            &mut self.0.options
12892        }
12893    }
12894
12895    /// The request builder for [Environments::get_operation][crate::client::Environments::get_operation] calls.
12896    ///
12897    /// # Example
12898    /// ```no_run
12899    /// # use google_cloud_dialogflow_v2::builder;
12900    /// use builder::environments::GetOperation;
12901    /// # tokio_test::block_on(async {
12902    ///
12903    /// let builder = prepare_request_builder();
12904    /// let response = builder.send().await?;
12905    /// # gax::Result::<()>::Ok(()) });
12906    ///
12907    /// fn prepare_request_builder() -> GetOperation {
12908    ///   # panic!();
12909    ///   // ... details omitted ...
12910    /// }
12911    /// ```
12912    #[derive(Clone, Debug)]
12913    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
12914
12915    impl GetOperation {
12916        pub(crate) fn new(
12917            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12918        ) -> Self {
12919            Self(RequestBuilder::new(stub))
12920        }
12921
12922        /// Sets the full request, replacing any prior values.
12923        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
12924            mut self,
12925            v: V,
12926        ) -> Self {
12927            self.0.request = v.into();
12928            self
12929        }
12930
12931        /// Sets all the options, replacing any prior values.
12932        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12933            self.0.options = v.into();
12934            self
12935        }
12936
12937        /// Sends the request.
12938        pub async fn send(self) -> Result<longrunning::model::Operation> {
12939            (*self.0.stub)
12940                .get_operation(self.0.request, self.0.options)
12941                .await
12942                .map(gax::response::Response::into_body)
12943        }
12944
12945        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
12946        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12947            self.0.request.name = v.into();
12948            self
12949        }
12950    }
12951
12952    #[doc(hidden)]
12953    impl gax::options::internal::RequestBuilder for GetOperation {
12954        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12955            &mut self.0.options
12956        }
12957    }
12958
12959    /// The request builder for [Environments::cancel_operation][crate::client::Environments::cancel_operation] calls.
12960    ///
12961    /// # Example
12962    /// ```no_run
12963    /// # use google_cloud_dialogflow_v2::builder;
12964    /// use builder::environments::CancelOperation;
12965    /// # tokio_test::block_on(async {
12966    ///
12967    /// let builder = prepare_request_builder();
12968    /// let response = builder.send().await?;
12969    /// # gax::Result::<()>::Ok(()) });
12970    ///
12971    /// fn prepare_request_builder() -> CancelOperation {
12972    ///   # panic!();
12973    ///   // ... details omitted ...
12974    /// }
12975    /// ```
12976    #[derive(Clone, Debug)]
12977    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
12978
12979    impl CancelOperation {
12980        pub(crate) fn new(
12981            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12982        ) -> Self {
12983            Self(RequestBuilder::new(stub))
12984        }
12985
12986        /// Sets the full request, replacing any prior values.
12987        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
12988            mut self,
12989            v: V,
12990        ) -> Self {
12991            self.0.request = v.into();
12992            self
12993        }
12994
12995        /// Sets all the options, replacing any prior values.
12996        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12997            self.0.options = v.into();
12998            self
12999        }
13000
13001        /// Sends the request.
13002        pub async fn send(self) -> Result<()> {
13003            (*self.0.stub)
13004                .cancel_operation(self.0.request, self.0.options)
13005                .await
13006                .map(gax::response::Response::into_body)
13007        }
13008
13009        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
13010        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13011            self.0.request.name = v.into();
13012            self
13013        }
13014    }
13015
13016    #[doc(hidden)]
13017    impl gax::options::internal::RequestBuilder for CancelOperation {
13018        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13019            &mut self.0.options
13020        }
13021    }
13022}
13023
13024#[cfg(feature = "fulfillments")]
13025#[cfg_attr(docsrs, doc(cfg(feature = "fulfillments")))]
13026pub mod fulfillments {
13027    use crate::Result;
13028
13029    /// A builder for [Fulfillments][crate::client::Fulfillments].
13030    ///
13031    /// ```
13032    /// # tokio_test::block_on(async {
13033    /// # use google_cloud_dialogflow_v2::*;
13034    /// # use builder::fulfillments::ClientBuilder;
13035    /// # use client::Fulfillments;
13036    /// let builder : ClientBuilder = Fulfillments::builder();
13037    /// let client = builder
13038    ///     .with_endpoint("https://dialogflow.googleapis.com")
13039    ///     .build().await?;
13040    /// # gax::client_builder::Result::<()>::Ok(()) });
13041    /// ```
13042    pub type ClientBuilder =
13043        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13044
13045    pub(crate) mod client {
13046        use super::super::super::client::Fulfillments;
13047        pub struct Factory;
13048        impl gax::client_builder::internal::ClientFactory for Factory {
13049            type Client = Fulfillments;
13050            type Credentials = gaxi::options::Credentials;
13051            async fn build(
13052                self,
13053                config: gaxi::options::ClientConfig,
13054            ) -> gax::client_builder::Result<Self::Client> {
13055                Self::Client::new(config).await
13056            }
13057        }
13058    }
13059
13060    /// Common implementation for [crate::client::Fulfillments] request builders.
13061    #[derive(Clone, Debug)]
13062    pub(crate) struct RequestBuilder<R: std::default::Default> {
13063        stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13064        request: R,
13065        options: gax::options::RequestOptions,
13066    }
13067
13068    impl<R> RequestBuilder<R>
13069    where
13070        R: std::default::Default,
13071    {
13072        pub(crate) fn new(
13073            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13074        ) -> Self {
13075            Self {
13076                stub,
13077                request: R::default(),
13078                options: gax::options::RequestOptions::default(),
13079            }
13080        }
13081    }
13082
13083    /// The request builder for [Fulfillments::get_fulfillment][crate::client::Fulfillments::get_fulfillment] calls.
13084    ///
13085    /// # Example
13086    /// ```no_run
13087    /// # use google_cloud_dialogflow_v2::builder;
13088    /// use builder::fulfillments::GetFulfillment;
13089    /// # tokio_test::block_on(async {
13090    ///
13091    /// let builder = prepare_request_builder();
13092    /// let response = builder.send().await?;
13093    /// # gax::Result::<()>::Ok(()) });
13094    ///
13095    /// fn prepare_request_builder() -> GetFulfillment {
13096    ///   # panic!();
13097    ///   // ... details omitted ...
13098    /// }
13099    /// ```
13100    #[derive(Clone, Debug)]
13101    pub struct GetFulfillment(RequestBuilder<crate::model::GetFulfillmentRequest>);
13102
13103    impl GetFulfillment {
13104        pub(crate) fn new(
13105            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13106        ) -> Self {
13107            Self(RequestBuilder::new(stub))
13108        }
13109
13110        /// Sets the full request, replacing any prior values.
13111        pub fn with_request<V: Into<crate::model::GetFulfillmentRequest>>(mut self, v: V) -> Self {
13112            self.0.request = v.into();
13113            self
13114        }
13115
13116        /// Sets all the options, replacing any prior values.
13117        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13118            self.0.options = v.into();
13119            self
13120        }
13121
13122        /// Sends the request.
13123        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13124            (*self.0.stub)
13125                .get_fulfillment(self.0.request, self.0.options)
13126                .await
13127                .map(gax::response::Response::into_body)
13128        }
13129
13130        /// Sets the value of [name][crate::model::GetFulfillmentRequest::name].
13131        ///
13132        /// This is a **required** field for requests.
13133        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13134            self.0.request.name = v.into();
13135            self
13136        }
13137    }
13138
13139    #[doc(hidden)]
13140    impl gax::options::internal::RequestBuilder for GetFulfillment {
13141        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13142            &mut self.0.options
13143        }
13144    }
13145
13146    /// The request builder for [Fulfillments::update_fulfillment][crate::client::Fulfillments::update_fulfillment] calls.
13147    ///
13148    /// # Example
13149    /// ```no_run
13150    /// # use google_cloud_dialogflow_v2::builder;
13151    /// use builder::fulfillments::UpdateFulfillment;
13152    /// # tokio_test::block_on(async {
13153    ///
13154    /// let builder = prepare_request_builder();
13155    /// let response = builder.send().await?;
13156    /// # gax::Result::<()>::Ok(()) });
13157    ///
13158    /// fn prepare_request_builder() -> UpdateFulfillment {
13159    ///   # panic!();
13160    ///   // ... details omitted ...
13161    /// }
13162    /// ```
13163    #[derive(Clone, Debug)]
13164    pub struct UpdateFulfillment(RequestBuilder<crate::model::UpdateFulfillmentRequest>);
13165
13166    impl UpdateFulfillment {
13167        pub(crate) fn new(
13168            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13169        ) -> Self {
13170            Self(RequestBuilder::new(stub))
13171        }
13172
13173        /// Sets the full request, replacing any prior values.
13174        pub fn with_request<V: Into<crate::model::UpdateFulfillmentRequest>>(
13175            mut self,
13176            v: V,
13177        ) -> Self {
13178            self.0.request = v.into();
13179            self
13180        }
13181
13182        /// Sets all the options, replacing any prior values.
13183        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13184            self.0.options = v.into();
13185            self
13186        }
13187
13188        /// Sends the request.
13189        pub async fn send(self) -> Result<crate::model::Fulfillment> {
13190            (*self.0.stub)
13191                .update_fulfillment(self.0.request, self.0.options)
13192                .await
13193                .map(gax::response::Response::into_body)
13194        }
13195
13196        /// Sets the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13197        ///
13198        /// This is a **required** field for requests.
13199        pub fn set_fulfillment<T>(mut self, v: T) -> Self
13200        where
13201            T: std::convert::Into<crate::model::Fulfillment>,
13202        {
13203            self.0.request.fulfillment = std::option::Option::Some(v.into());
13204            self
13205        }
13206
13207        /// Sets or clears the value of [fulfillment][crate::model::UpdateFulfillmentRequest::fulfillment].
13208        ///
13209        /// This is a **required** field for requests.
13210        pub fn set_or_clear_fulfillment<T>(mut self, v: std::option::Option<T>) -> Self
13211        where
13212            T: std::convert::Into<crate::model::Fulfillment>,
13213        {
13214            self.0.request.fulfillment = v.map(|x| x.into());
13215            self
13216        }
13217
13218        /// Sets the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13219        ///
13220        /// This is a **required** field for requests.
13221        pub fn set_update_mask<T>(mut self, v: T) -> Self
13222        where
13223            T: std::convert::Into<wkt::FieldMask>,
13224        {
13225            self.0.request.update_mask = std::option::Option::Some(v.into());
13226            self
13227        }
13228
13229        /// Sets or clears the value of [update_mask][crate::model::UpdateFulfillmentRequest::update_mask].
13230        ///
13231        /// This is a **required** field for requests.
13232        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13233        where
13234            T: std::convert::Into<wkt::FieldMask>,
13235        {
13236            self.0.request.update_mask = v.map(|x| x.into());
13237            self
13238        }
13239    }
13240
13241    #[doc(hidden)]
13242    impl gax::options::internal::RequestBuilder for UpdateFulfillment {
13243        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13244            &mut self.0.options
13245        }
13246    }
13247
13248    /// The request builder for [Fulfillments::list_locations][crate::client::Fulfillments::list_locations] calls.
13249    ///
13250    /// # Example
13251    /// ```no_run
13252    /// # use google_cloud_dialogflow_v2::builder;
13253    /// use builder::fulfillments::ListLocations;
13254    /// # tokio_test::block_on(async {
13255    /// use gax::paginator::ItemPaginator;
13256    ///
13257    /// let builder = prepare_request_builder();
13258    /// let mut items = builder.by_item();
13259    /// while let Some(result) = items.next().await {
13260    ///   let item = result?;
13261    /// }
13262    /// # gax::Result::<()>::Ok(()) });
13263    ///
13264    /// fn prepare_request_builder() -> ListLocations {
13265    ///   # panic!();
13266    ///   // ... details omitted ...
13267    /// }
13268    /// ```
13269    #[derive(Clone, Debug)]
13270    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
13271
13272    impl ListLocations {
13273        pub(crate) fn new(
13274            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13275        ) -> Self {
13276            Self(RequestBuilder::new(stub))
13277        }
13278
13279        /// Sets the full request, replacing any prior values.
13280        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
13281            mut self,
13282            v: V,
13283        ) -> Self {
13284            self.0.request = v.into();
13285            self
13286        }
13287
13288        /// Sets all the options, replacing any prior values.
13289        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13290            self.0.options = v.into();
13291            self
13292        }
13293
13294        /// Sends the request.
13295        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
13296            (*self.0.stub)
13297                .list_locations(self.0.request, self.0.options)
13298                .await
13299                .map(gax::response::Response::into_body)
13300        }
13301
13302        /// Streams each page in the collection.
13303        pub fn by_page(
13304            self,
13305        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
13306        {
13307            use std::clone::Clone;
13308            let token = self.0.request.page_token.clone();
13309            let execute = move |token: String| {
13310                let mut builder = self.clone();
13311                builder.0.request = builder.0.request.set_page_token(token);
13312                builder.send()
13313            };
13314            gax::paginator::internal::new_paginator(token, execute)
13315        }
13316
13317        /// Streams each item in the collection.
13318        pub fn by_item(
13319            self,
13320        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
13321        {
13322            use gax::paginator::Paginator;
13323            self.by_page().items()
13324        }
13325
13326        /// Sets the value of [name][location::model::ListLocationsRequest::name].
13327        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13328            self.0.request.name = v.into();
13329            self
13330        }
13331
13332        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
13333        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13334            self.0.request.filter = v.into();
13335            self
13336        }
13337
13338        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
13339        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13340            self.0.request.page_size = v.into();
13341            self
13342        }
13343
13344        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
13345        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13346            self.0.request.page_token = v.into();
13347            self
13348        }
13349    }
13350
13351    #[doc(hidden)]
13352    impl gax::options::internal::RequestBuilder for ListLocations {
13353        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13354            &mut self.0.options
13355        }
13356    }
13357
13358    /// The request builder for [Fulfillments::get_location][crate::client::Fulfillments::get_location] calls.
13359    ///
13360    /// # Example
13361    /// ```no_run
13362    /// # use google_cloud_dialogflow_v2::builder;
13363    /// use builder::fulfillments::GetLocation;
13364    /// # tokio_test::block_on(async {
13365    ///
13366    /// let builder = prepare_request_builder();
13367    /// let response = builder.send().await?;
13368    /// # gax::Result::<()>::Ok(()) });
13369    ///
13370    /// fn prepare_request_builder() -> GetLocation {
13371    ///   # panic!();
13372    ///   // ... details omitted ...
13373    /// }
13374    /// ```
13375    #[derive(Clone, Debug)]
13376    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
13377
13378    impl GetLocation {
13379        pub(crate) fn new(
13380            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13381        ) -> Self {
13382            Self(RequestBuilder::new(stub))
13383        }
13384
13385        /// Sets the full request, replacing any prior values.
13386        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
13387            self.0.request = v.into();
13388            self
13389        }
13390
13391        /// Sets all the options, replacing any prior values.
13392        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13393            self.0.options = v.into();
13394            self
13395        }
13396
13397        /// Sends the request.
13398        pub async fn send(self) -> Result<location::model::Location> {
13399            (*self.0.stub)
13400                .get_location(self.0.request, self.0.options)
13401                .await
13402                .map(gax::response::Response::into_body)
13403        }
13404
13405        /// Sets the value of [name][location::model::GetLocationRequest::name].
13406        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13407            self.0.request.name = v.into();
13408            self
13409        }
13410    }
13411
13412    #[doc(hidden)]
13413    impl gax::options::internal::RequestBuilder for GetLocation {
13414        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13415            &mut self.0.options
13416        }
13417    }
13418
13419    /// The request builder for [Fulfillments::list_operations][crate::client::Fulfillments::list_operations] calls.
13420    ///
13421    /// # Example
13422    /// ```no_run
13423    /// # use google_cloud_dialogflow_v2::builder;
13424    /// use builder::fulfillments::ListOperations;
13425    /// # tokio_test::block_on(async {
13426    /// use gax::paginator::ItemPaginator;
13427    ///
13428    /// let builder = prepare_request_builder();
13429    /// let mut items = builder.by_item();
13430    /// while let Some(result) = items.next().await {
13431    ///   let item = result?;
13432    /// }
13433    /// # gax::Result::<()>::Ok(()) });
13434    ///
13435    /// fn prepare_request_builder() -> ListOperations {
13436    ///   # panic!();
13437    ///   // ... details omitted ...
13438    /// }
13439    /// ```
13440    #[derive(Clone, Debug)]
13441    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
13442
13443    impl ListOperations {
13444        pub(crate) fn new(
13445            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13446        ) -> Self {
13447            Self(RequestBuilder::new(stub))
13448        }
13449
13450        /// Sets the full request, replacing any prior values.
13451        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
13452            mut self,
13453            v: V,
13454        ) -> Self {
13455            self.0.request = v.into();
13456            self
13457        }
13458
13459        /// Sets all the options, replacing any prior values.
13460        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13461            self.0.options = v.into();
13462            self
13463        }
13464
13465        /// Sends the request.
13466        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
13467            (*self.0.stub)
13468                .list_operations(self.0.request, self.0.options)
13469                .await
13470                .map(gax::response::Response::into_body)
13471        }
13472
13473        /// Streams each page in the collection.
13474        pub fn by_page(
13475            self,
13476        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
13477        {
13478            use std::clone::Clone;
13479            let token = self.0.request.page_token.clone();
13480            let execute = move |token: String| {
13481                let mut builder = self.clone();
13482                builder.0.request = builder.0.request.set_page_token(token);
13483                builder.send()
13484            };
13485            gax::paginator::internal::new_paginator(token, execute)
13486        }
13487
13488        /// Streams each item in the collection.
13489        pub fn by_item(
13490            self,
13491        ) -> impl gax::paginator::ItemPaginator<
13492            longrunning::model::ListOperationsResponse,
13493            gax::error::Error,
13494        > {
13495            use gax::paginator::Paginator;
13496            self.by_page().items()
13497        }
13498
13499        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
13500        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13501            self.0.request.name = v.into();
13502            self
13503        }
13504
13505        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
13506        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13507            self.0.request.filter = v.into();
13508            self
13509        }
13510
13511        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
13512        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13513            self.0.request.page_size = v.into();
13514            self
13515        }
13516
13517        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
13518        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13519            self.0.request.page_token = v.into();
13520            self
13521        }
13522
13523        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
13524        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13525            self.0.request.return_partial_success = v.into();
13526            self
13527        }
13528    }
13529
13530    #[doc(hidden)]
13531    impl gax::options::internal::RequestBuilder for ListOperations {
13532        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13533            &mut self.0.options
13534        }
13535    }
13536
13537    /// The request builder for [Fulfillments::get_operation][crate::client::Fulfillments::get_operation] calls.
13538    ///
13539    /// # Example
13540    /// ```no_run
13541    /// # use google_cloud_dialogflow_v2::builder;
13542    /// use builder::fulfillments::GetOperation;
13543    /// # tokio_test::block_on(async {
13544    ///
13545    /// let builder = prepare_request_builder();
13546    /// let response = builder.send().await?;
13547    /// # gax::Result::<()>::Ok(()) });
13548    ///
13549    /// fn prepare_request_builder() -> GetOperation {
13550    ///   # panic!();
13551    ///   // ... details omitted ...
13552    /// }
13553    /// ```
13554    #[derive(Clone, Debug)]
13555    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
13556
13557    impl GetOperation {
13558        pub(crate) fn new(
13559            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13560        ) -> Self {
13561            Self(RequestBuilder::new(stub))
13562        }
13563
13564        /// Sets the full request, replacing any prior values.
13565        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
13566            mut self,
13567            v: V,
13568        ) -> Self {
13569            self.0.request = v.into();
13570            self
13571        }
13572
13573        /// Sets all the options, replacing any prior values.
13574        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13575            self.0.options = v.into();
13576            self
13577        }
13578
13579        /// Sends the request.
13580        pub async fn send(self) -> Result<longrunning::model::Operation> {
13581            (*self.0.stub)
13582                .get_operation(self.0.request, self.0.options)
13583                .await
13584                .map(gax::response::Response::into_body)
13585        }
13586
13587        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
13588        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13589            self.0.request.name = v.into();
13590            self
13591        }
13592    }
13593
13594    #[doc(hidden)]
13595    impl gax::options::internal::RequestBuilder for GetOperation {
13596        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13597            &mut self.0.options
13598        }
13599    }
13600
13601    /// The request builder for [Fulfillments::cancel_operation][crate::client::Fulfillments::cancel_operation] calls.
13602    ///
13603    /// # Example
13604    /// ```no_run
13605    /// # use google_cloud_dialogflow_v2::builder;
13606    /// use builder::fulfillments::CancelOperation;
13607    /// # tokio_test::block_on(async {
13608    ///
13609    /// let builder = prepare_request_builder();
13610    /// let response = builder.send().await?;
13611    /// # gax::Result::<()>::Ok(()) });
13612    ///
13613    /// fn prepare_request_builder() -> CancelOperation {
13614    ///   # panic!();
13615    ///   // ... details omitted ...
13616    /// }
13617    /// ```
13618    #[derive(Clone, Debug)]
13619    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
13620
13621    impl CancelOperation {
13622        pub(crate) fn new(
13623            stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13624        ) -> Self {
13625            Self(RequestBuilder::new(stub))
13626        }
13627
13628        /// Sets the full request, replacing any prior values.
13629        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
13630            mut self,
13631            v: V,
13632        ) -> Self {
13633            self.0.request = v.into();
13634            self
13635        }
13636
13637        /// Sets all the options, replacing any prior values.
13638        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13639            self.0.options = v.into();
13640            self
13641        }
13642
13643        /// Sends the request.
13644        pub async fn send(self) -> Result<()> {
13645            (*self.0.stub)
13646                .cancel_operation(self.0.request, self.0.options)
13647                .await
13648                .map(gax::response::Response::into_body)
13649        }
13650
13651        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
13652        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13653            self.0.request.name = v.into();
13654            self
13655        }
13656    }
13657
13658    #[doc(hidden)]
13659    impl gax::options::internal::RequestBuilder for CancelOperation {
13660        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13661            &mut self.0.options
13662        }
13663    }
13664}
13665
13666#[cfg(feature = "generators")]
13667#[cfg_attr(docsrs, doc(cfg(feature = "generators")))]
13668pub mod generators {
13669    use crate::Result;
13670
13671    /// A builder for [Generators][crate::client::Generators].
13672    ///
13673    /// ```
13674    /// # tokio_test::block_on(async {
13675    /// # use google_cloud_dialogflow_v2::*;
13676    /// # use builder::generators::ClientBuilder;
13677    /// # use client::Generators;
13678    /// let builder : ClientBuilder = Generators::builder();
13679    /// let client = builder
13680    ///     .with_endpoint("https://dialogflow.googleapis.com")
13681    ///     .build().await?;
13682    /// # gax::client_builder::Result::<()>::Ok(()) });
13683    /// ```
13684    pub type ClientBuilder =
13685        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13686
13687    pub(crate) mod client {
13688        use super::super::super::client::Generators;
13689        pub struct Factory;
13690        impl gax::client_builder::internal::ClientFactory for Factory {
13691            type Client = Generators;
13692            type Credentials = gaxi::options::Credentials;
13693            async fn build(
13694                self,
13695                config: gaxi::options::ClientConfig,
13696            ) -> gax::client_builder::Result<Self::Client> {
13697                Self::Client::new(config).await
13698            }
13699        }
13700    }
13701
13702    /// Common implementation for [crate::client::Generators] request builders.
13703    #[derive(Clone, Debug)]
13704    pub(crate) struct RequestBuilder<R: std::default::Default> {
13705        stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13706        request: R,
13707        options: gax::options::RequestOptions,
13708    }
13709
13710    impl<R> RequestBuilder<R>
13711    where
13712        R: std::default::Default,
13713    {
13714        pub(crate) fn new(
13715            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13716        ) -> Self {
13717            Self {
13718                stub,
13719                request: R::default(),
13720                options: gax::options::RequestOptions::default(),
13721            }
13722        }
13723    }
13724
13725    /// The request builder for [Generators::create_generator][crate::client::Generators::create_generator] calls.
13726    ///
13727    /// # Example
13728    /// ```no_run
13729    /// # use google_cloud_dialogflow_v2::builder;
13730    /// use builder::generators::CreateGenerator;
13731    /// # tokio_test::block_on(async {
13732    ///
13733    /// let builder = prepare_request_builder();
13734    /// let response = builder.send().await?;
13735    /// # gax::Result::<()>::Ok(()) });
13736    ///
13737    /// fn prepare_request_builder() -> CreateGenerator {
13738    ///   # panic!();
13739    ///   // ... details omitted ...
13740    /// }
13741    /// ```
13742    #[derive(Clone, Debug)]
13743    pub struct CreateGenerator(RequestBuilder<crate::model::CreateGeneratorRequest>);
13744
13745    impl CreateGenerator {
13746        pub(crate) fn new(
13747            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13748        ) -> Self {
13749            Self(RequestBuilder::new(stub))
13750        }
13751
13752        /// Sets the full request, replacing any prior values.
13753        pub fn with_request<V: Into<crate::model::CreateGeneratorRequest>>(mut self, v: V) -> Self {
13754            self.0.request = v.into();
13755            self
13756        }
13757
13758        /// Sets all the options, replacing any prior values.
13759        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13760            self.0.options = v.into();
13761            self
13762        }
13763
13764        /// Sends the request.
13765        pub async fn send(self) -> Result<crate::model::Generator> {
13766            (*self.0.stub)
13767                .create_generator(self.0.request, self.0.options)
13768                .await
13769                .map(gax::response::Response::into_body)
13770        }
13771
13772        /// Sets the value of [parent][crate::model::CreateGeneratorRequest::parent].
13773        ///
13774        /// This is a **required** field for requests.
13775        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13776            self.0.request.parent = v.into();
13777            self
13778        }
13779
13780        /// Sets the value of [generator][crate::model::CreateGeneratorRequest::generator].
13781        ///
13782        /// This is a **required** field for requests.
13783        pub fn set_generator<T>(mut self, v: T) -> Self
13784        where
13785            T: std::convert::Into<crate::model::Generator>,
13786        {
13787            self.0.request.generator = std::option::Option::Some(v.into());
13788            self
13789        }
13790
13791        /// Sets or clears the value of [generator][crate::model::CreateGeneratorRequest::generator].
13792        ///
13793        /// This is a **required** field for requests.
13794        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
13795        where
13796            T: std::convert::Into<crate::model::Generator>,
13797        {
13798            self.0.request.generator = v.map(|x| x.into());
13799            self
13800        }
13801
13802        /// Sets the value of [generator_id][crate::model::CreateGeneratorRequest::generator_id].
13803        pub fn set_generator_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13804            self.0.request.generator_id = v.into();
13805            self
13806        }
13807    }
13808
13809    #[doc(hidden)]
13810    impl gax::options::internal::RequestBuilder for CreateGenerator {
13811        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13812            &mut self.0.options
13813        }
13814    }
13815
13816    /// The request builder for [Generators::get_generator][crate::client::Generators::get_generator] calls.
13817    ///
13818    /// # Example
13819    /// ```no_run
13820    /// # use google_cloud_dialogflow_v2::builder;
13821    /// use builder::generators::GetGenerator;
13822    /// # tokio_test::block_on(async {
13823    ///
13824    /// let builder = prepare_request_builder();
13825    /// let response = builder.send().await?;
13826    /// # gax::Result::<()>::Ok(()) });
13827    ///
13828    /// fn prepare_request_builder() -> GetGenerator {
13829    ///   # panic!();
13830    ///   // ... details omitted ...
13831    /// }
13832    /// ```
13833    #[derive(Clone, Debug)]
13834    pub struct GetGenerator(RequestBuilder<crate::model::GetGeneratorRequest>);
13835
13836    impl GetGenerator {
13837        pub(crate) fn new(
13838            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13839        ) -> Self {
13840            Self(RequestBuilder::new(stub))
13841        }
13842
13843        /// Sets the full request, replacing any prior values.
13844        pub fn with_request<V: Into<crate::model::GetGeneratorRequest>>(mut self, v: V) -> Self {
13845            self.0.request = v.into();
13846            self
13847        }
13848
13849        /// Sets all the options, replacing any prior values.
13850        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13851            self.0.options = v.into();
13852            self
13853        }
13854
13855        /// Sends the request.
13856        pub async fn send(self) -> Result<crate::model::Generator> {
13857            (*self.0.stub)
13858                .get_generator(self.0.request, self.0.options)
13859                .await
13860                .map(gax::response::Response::into_body)
13861        }
13862
13863        /// Sets the value of [name][crate::model::GetGeneratorRequest::name].
13864        ///
13865        /// This is a **required** field for requests.
13866        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13867            self.0.request.name = v.into();
13868            self
13869        }
13870    }
13871
13872    #[doc(hidden)]
13873    impl gax::options::internal::RequestBuilder for GetGenerator {
13874        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13875            &mut self.0.options
13876        }
13877    }
13878
13879    /// The request builder for [Generators::list_generators][crate::client::Generators::list_generators] calls.
13880    ///
13881    /// # Example
13882    /// ```no_run
13883    /// # use google_cloud_dialogflow_v2::builder;
13884    /// use builder::generators::ListGenerators;
13885    /// # tokio_test::block_on(async {
13886    /// use gax::paginator::ItemPaginator;
13887    ///
13888    /// let builder = prepare_request_builder();
13889    /// let mut items = builder.by_item();
13890    /// while let Some(result) = items.next().await {
13891    ///   let item = result?;
13892    /// }
13893    /// # gax::Result::<()>::Ok(()) });
13894    ///
13895    /// fn prepare_request_builder() -> ListGenerators {
13896    ///   # panic!();
13897    ///   // ... details omitted ...
13898    /// }
13899    /// ```
13900    #[derive(Clone, Debug)]
13901    pub struct ListGenerators(RequestBuilder<crate::model::ListGeneratorsRequest>);
13902
13903    impl ListGenerators {
13904        pub(crate) fn new(
13905            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
13906        ) -> Self {
13907            Self(RequestBuilder::new(stub))
13908        }
13909
13910        /// Sets the full request, replacing any prior values.
13911        pub fn with_request<V: Into<crate::model::ListGeneratorsRequest>>(mut self, v: V) -> Self {
13912            self.0.request = v.into();
13913            self
13914        }
13915
13916        /// Sets all the options, replacing any prior values.
13917        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13918            self.0.options = v.into();
13919            self
13920        }
13921
13922        /// Sends the request.
13923        pub async fn send(self) -> Result<crate::model::ListGeneratorsResponse> {
13924            (*self.0.stub)
13925                .list_generators(self.0.request, self.0.options)
13926                .await
13927                .map(gax::response::Response::into_body)
13928        }
13929
13930        /// Streams each page in the collection.
13931        pub fn by_page(
13932            self,
13933        ) -> impl gax::paginator::Paginator<crate::model::ListGeneratorsResponse, gax::error::Error>
13934        {
13935            use std::clone::Clone;
13936            let token = self.0.request.page_token.clone();
13937            let execute = move |token: String| {
13938                let mut builder = self.clone();
13939                builder.0.request = builder.0.request.set_page_token(token);
13940                builder.send()
13941            };
13942            gax::paginator::internal::new_paginator(token, execute)
13943        }
13944
13945        /// Streams each item in the collection.
13946        pub fn by_item(
13947            self,
13948        ) -> impl gax::paginator::ItemPaginator<crate::model::ListGeneratorsResponse, gax::error::Error>
13949        {
13950            use gax::paginator::Paginator;
13951            self.by_page().items()
13952        }
13953
13954        /// Sets the value of [parent][crate::model::ListGeneratorsRequest::parent].
13955        ///
13956        /// This is a **required** field for requests.
13957        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13958            self.0.request.parent = v.into();
13959            self
13960        }
13961
13962        /// Sets the value of [page_size][crate::model::ListGeneratorsRequest::page_size].
13963        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13964            self.0.request.page_size = v.into();
13965            self
13966        }
13967
13968        /// Sets the value of [page_token][crate::model::ListGeneratorsRequest::page_token].
13969        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13970            self.0.request.page_token = v.into();
13971            self
13972        }
13973    }
13974
13975    #[doc(hidden)]
13976    impl gax::options::internal::RequestBuilder for ListGenerators {
13977        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13978            &mut self.0.options
13979        }
13980    }
13981
13982    /// The request builder for [Generators::delete_generator][crate::client::Generators::delete_generator] calls.
13983    ///
13984    /// # Example
13985    /// ```no_run
13986    /// # use google_cloud_dialogflow_v2::builder;
13987    /// use builder::generators::DeleteGenerator;
13988    /// # tokio_test::block_on(async {
13989    ///
13990    /// let builder = prepare_request_builder();
13991    /// let response = builder.send().await?;
13992    /// # gax::Result::<()>::Ok(()) });
13993    ///
13994    /// fn prepare_request_builder() -> DeleteGenerator {
13995    ///   # panic!();
13996    ///   // ... details omitted ...
13997    /// }
13998    /// ```
13999    #[derive(Clone, Debug)]
14000    pub struct DeleteGenerator(RequestBuilder<crate::model::DeleteGeneratorRequest>);
14001
14002    impl DeleteGenerator {
14003        pub(crate) fn new(
14004            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14005        ) -> Self {
14006            Self(RequestBuilder::new(stub))
14007        }
14008
14009        /// Sets the full request, replacing any prior values.
14010        pub fn with_request<V: Into<crate::model::DeleteGeneratorRequest>>(mut self, v: V) -> Self {
14011            self.0.request = v.into();
14012            self
14013        }
14014
14015        /// Sets all the options, replacing any prior values.
14016        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14017            self.0.options = v.into();
14018            self
14019        }
14020
14021        /// Sends the request.
14022        pub async fn send(self) -> Result<()> {
14023            (*self.0.stub)
14024                .delete_generator(self.0.request, self.0.options)
14025                .await
14026                .map(gax::response::Response::into_body)
14027        }
14028
14029        /// Sets the value of [name][crate::model::DeleteGeneratorRequest::name].
14030        ///
14031        /// This is a **required** field for requests.
14032        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14033            self.0.request.name = v.into();
14034            self
14035        }
14036    }
14037
14038    #[doc(hidden)]
14039    impl gax::options::internal::RequestBuilder for DeleteGenerator {
14040        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14041            &mut self.0.options
14042        }
14043    }
14044
14045    /// The request builder for [Generators::update_generator][crate::client::Generators::update_generator] calls.
14046    ///
14047    /// # Example
14048    /// ```no_run
14049    /// # use google_cloud_dialogflow_v2::builder;
14050    /// use builder::generators::UpdateGenerator;
14051    /// # tokio_test::block_on(async {
14052    ///
14053    /// let builder = prepare_request_builder();
14054    /// let response = builder.send().await?;
14055    /// # gax::Result::<()>::Ok(()) });
14056    ///
14057    /// fn prepare_request_builder() -> UpdateGenerator {
14058    ///   # panic!();
14059    ///   // ... details omitted ...
14060    /// }
14061    /// ```
14062    #[derive(Clone, Debug)]
14063    pub struct UpdateGenerator(RequestBuilder<crate::model::UpdateGeneratorRequest>);
14064
14065    impl UpdateGenerator {
14066        pub(crate) fn new(
14067            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14068        ) -> Self {
14069            Self(RequestBuilder::new(stub))
14070        }
14071
14072        /// Sets the full request, replacing any prior values.
14073        pub fn with_request<V: Into<crate::model::UpdateGeneratorRequest>>(mut self, v: V) -> Self {
14074            self.0.request = v.into();
14075            self
14076        }
14077
14078        /// Sets all the options, replacing any prior values.
14079        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14080            self.0.options = v.into();
14081            self
14082        }
14083
14084        /// Sends the request.
14085        pub async fn send(self) -> Result<crate::model::Generator> {
14086            (*self.0.stub)
14087                .update_generator(self.0.request, self.0.options)
14088                .await
14089                .map(gax::response::Response::into_body)
14090        }
14091
14092        /// Sets the value of [generator][crate::model::UpdateGeneratorRequest::generator].
14093        ///
14094        /// This is a **required** field for requests.
14095        pub fn set_generator<T>(mut self, v: T) -> Self
14096        where
14097            T: std::convert::Into<crate::model::Generator>,
14098        {
14099            self.0.request.generator = std::option::Option::Some(v.into());
14100            self
14101        }
14102
14103        /// Sets or clears the value of [generator][crate::model::UpdateGeneratorRequest::generator].
14104        ///
14105        /// This is a **required** field for requests.
14106        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
14107        where
14108            T: std::convert::Into<crate::model::Generator>,
14109        {
14110            self.0.request.generator = v.map(|x| x.into());
14111            self
14112        }
14113
14114        /// Sets the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
14115        pub fn set_update_mask<T>(mut self, v: T) -> Self
14116        where
14117            T: std::convert::Into<wkt::FieldMask>,
14118        {
14119            self.0.request.update_mask = std::option::Option::Some(v.into());
14120            self
14121        }
14122
14123        /// Sets or clears the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
14124        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14125        where
14126            T: std::convert::Into<wkt::FieldMask>,
14127        {
14128            self.0.request.update_mask = v.map(|x| x.into());
14129            self
14130        }
14131    }
14132
14133    #[doc(hidden)]
14134    impl gax::options::internal::RequestBuilder for UpdateGenerator {
14135        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14136            &mut self.0.options
14137        }
14138    }
14139
14140    /// The request builder for [Generators::list_locations][crate::client::Generators::list_locations] calls.
14141    ///
14142    /// # Example
14143    /// ```no_run
14144    /// # use google_cloud_dialogflow_v2::builder;
14145    /// use builder::generators::ListLocations;
14146    /// # tokio_test::block_on(async {
14147    /// use gax::paginator::ItemPaginator;
14148    ///
14149    /// let builder = prepare_request_builder();
14150    /// let mut items = builder.by_item();
14151    /// while let Some(result) = items.next().await {
14152    ///   let item = result?;
14153    /// }
14154    /// # gax::Result::<()>::Ok(()) });
14155    ///
14156    /// fn prepare_request_builder() -> ListLocations {
14157    ///   # panic!();
14158    ///   // ... details omitted ...
14159    /// }
14160    /// ```
14161    #[derive(Clone, Debug)]
14162    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
14163
14164    impl ListLocations {
14165        pub(crate) fn new(
14166            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14167        ) -> Self {
14168            Self(RequestBuilder::new(stub))
14169        }
14170
14171        /// Sets the full request, replacing any prior values.
14172        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
14173            mut self,
14174            v: V,
14175        ) -> Self {
14176            self.0.request = v.into();
14177            self
14178        }
14179
14180        /// Sets all the options, replacing any prior values.
14181        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14182            self.0.options = v.into();
14183            self
14184        }
14185
14186        /// Sends the request.
14187        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
14188            (*self.0.stub)
14189                .list_locations(self.0.request, self.0.options)
14190                .await
14191                .map(gax::response::Response::into_body)
14192        }
14193
14194        /// Streams each page in the collection.
14195        pub fn by_page(
14196            self,
14197        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
14198        {
14199            use std::clone::Clone;
14200            let token = self.0.request.page_token.clone();
14201            let execute = move |token: String| {
14202                let mut builder = self.clone();
14203                builder.0.request = builder.0.request.set_page_token(token);
14204                builder.send()
14205            };
14206            gax::paginator::internal::new_paginator(token, execute)
14207        }
14208
14209        /// Streams each item in the collection.
14210        pub fn by_item(
14211            self,
14212        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
14213        {
14214            use gax::paginator::Paginator;
14215            self.by_page().items()
14216        }
14217
14218        /// Sets the value of [name][location::model::ListLocationsRequest::name].
14219        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14220            self.0.request.name = v.into();
14221            self
14222        }
14223
14224        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
14225        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14226            self.0.request.filter = v.into();
14227            self
14228        }
14229
14230        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
14231        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14232            self.0.request.page_size = v.into();
14233            self
14234        }
14235
14236        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
14237        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14238            self.0.request.page_token = v.into();
14239            self
14240        }
14241    }
14242
14243    #[doc(hidden)]
14244    impl gax::options::internal::RequestBuilder for ListLocations {
14245        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14246            &mut self.0.options
14247        }
14248    }
14249
14250    /// The request builder for [Generators::get_location][crate::client::Generators::get_location] calls.
14251    ///
14252    /// # Example
14253    /// ```no_run
14254    /// # use google_cloud_dialogflow_v2::builder;
14255    /// use builder::generators::GetLocation;
14256    /// # tokio_test::block_on(async {
14257    ///
14258    /// let builder = prepare_request_builder();
14259    /// let response = builder.send().await?;
14260    /// # gax::Result::<()>::Ok(()) });
14261    ///
14262    /// fn prepare_request_builder() -> GetLocation {
14263    ///   # panic!();
14264    ///   // ... details omitted ...
14265    /// }
14266    /// ```
14267    #[derive(Clone, Debug)]
14268    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
14269
14270    impl GetLocation {
14271        pub(crate) fn new(
14272            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14273        ) -> Self {
14274            Self(RequestBuilder::new(stub))
14275        }
14276
14277        /// Sets the full request, replacing any prior values.
14278        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
14279            self.0.request = v.into();
14280            self
14281        }
14282
14283        /// Sets all the options, replacing any prior values.
14284        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14285            self.0.options = v.into();
14286            self
14287        }
14288
14289        /// Sends the request.
14290        pub async fn send(self) -> Result<location::model::Location> {
14291            (*self.0.stub)
14292                .get_location(self.0.request, self.0.options)
14293                .await
14294                .map(gax::response::Response::into_body)
14295        }
14296
14297        /// Sets the value of [name][location::model::GetLocationRequest::name].
14298        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14299            self.0.request.name = v.into();
14300            self
14301        }
14302    }
14303
14304    #[doc(hidden)]
14305    impl gax::options::internal::RequestBuilder for GetLocation {
14306        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14307            &mut self.0.options
14308        }
14309    }
14310
14311    /// The request builder for [Generators::list_operations][crate::client::Generators::list_operations] calls.
14312    ///
14313    /// # Example
14314    /// ```no_run
14315    /// # use google_cloud_dialogflow_v2::builder;
14316    /// use builder::generators::ListOperations;
14317    /// # tokio_test::block_on(async {
14318    /// use gax::paginator::ItemPaginator;
14319    ///
14320    /// let builder = prepare_request_builder();
14321    /// let mut items = builder.by_item();
14322    /// while let Some(result) = items.next().await {
14323    ///   let item = result?;
14324    /// }
14325    /// # gax::Result::<()>::Ok(()) });
14326    ///
14327    /// fn prepare_request_builder() -> ListOperations {
14328    ///   # panic!();
14329    ///   // ... details omitted ...
14330    /// }
14331    /// ```
14332    #[derive(Clone, Debug)]
14333    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
14334
14335    impl ListOperations {
14336        pub(crate) fn new(
14337            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14338        ) -> Self {
14339            Self(RequestBuilder::new(stub))
14340        }
14341
14342        /// Sets the full request, replacing any prior values.
14343        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
14344            mut self,
14345            v: V,
14346        ) -> Self {
14347            self.0.request = v.into();
14348            self
14349        }
14350
14351        /// Sets all the options, replacing any prior values.
14352        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14353            self.0.options = v.into();
14354            self
14355        }
14356
14357        /// Sends the request.
14358        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
14359            (*self.0.stub)
14360                .list_operations(self.0.request, self.0.options)
14361                .await
14362                .map(gax::response::Response::into_body)
14363        }
14364
14365        /// Streams each page in the collection.
14366        pub fn by_page(
14367            self,
14368        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
14369        {
14370            use std::clone::Clone;
14371            let token = self.0.request.page_token.clone();
14372            let execute = move |token: String| {
14373                let mut builder = self.clone();
14374                builder.0.request = builder.0.request.set_page_token(token);
14375                builder.send()
14376            };
14377            gax::paginator::internal::new_paginator(token, execute)
14378        }
14379
14380        /// Streams each item in the collection.
14381        pub fn by_item(
14382            self,
14383        ) -> impl gax::paginator::ItemPaginator<
14384            longrunning::model::ListOperationsResponse,
14385            gax::error::Error,
14386        > {
14387            use gax::paginator::Paginator;
14388            self.by_page().items()
14389        }
14390
14391        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
14392        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14393            self.0.request.name = v.into();
14394            self
14395        }
14396
14397        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
14398        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14399            self.0.request.filter = v.into();
14400            self
14401        }
14402
14403        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
14404        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14405            self.0.request.page_size = v.into();
14406            self
14407        }
14408
14409        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
14410        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14411            self.0.request.page_token = v.into();
14412            self
14413        }
14414
14415        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
14416        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14417            self.0.request.return_partial_success = v.into();
14418            self
14419        }
14420    }
14421
14422    #[doc(hidden)]
14423    impl gax::options::internal::RequestBuilder for ListOperations {
14424        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14425            &mut self.0.options
14426        }
14427    }
14428
14429    /// The request builder for [Generators::get_operation][crate::client::Generators::get_operation] calls.
14430    ///
14431    /// # Example
14432    /// ```no_run
14433    /// # use google_cloud_dialogflow_v2::builder;
14434    /// use builder::generators::GetOperation;
14435    /// # tokio_test::block_on(async {
14436    ///
14437    /// let builder = prepare_request_builder();
14438    /// let response = builder.send().await?;
14439    /// # gax::Result::<()>::Ok(()) });
14440    ///
14441    /// fn prepare_request_builder() -> GetOperation {
14442    ///   # panic!();
14443    ///   // ... details omitted ...
14444    /// }
14445    /// ```
14446    #[derive(Clone, Debug)]
14447    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
14448
14449    impl GetOperation {
14450        pub(crate) fn new(
14451            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14452        ) -> Self {
14453            Self(RequestBuilder::new(stub))
14454        }
14455
14456        /// Sets the full request, replacing any prior values.
14457        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
14458            mut self,
14459            v: V,
14460        ) -> Self {
14461            self.0.request = v.into();
14462            self
14463        }
14464
14465        /// Sets all the options, replacing any prior values.
14466        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14467            self.0.options = v.into();
14468            self
14469        }
14470
14471        /// Sends the request.
14472        pub async fn send(self) -> Result<longrunning::model::Operation> {
14473            (*self.0.stub)
14474                .get_operation(self.0.request, self.0.options)
14475                .await
14476                .map(gax::response::Response::into_body)
14477        }
14478
14479        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
14480        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14481            self.0.request.name = v.into();
14482            self
14483        }
14484    }
14485
14486    #[doc(hidden)]
14487    impl gax::options::internal::RequestBuilder for GetOperation {
14488        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14489            &mut self.0.options
14490        }
14491    }
14492
14493    /// The request builder for [Generators::cancel_operation][crate::client::Generators::cancel_operation] calls.
14494    ///
14495    /// # Example
14496    /// ```no_run
14497    /// # use google_cloud_dialogflow_v2::builder;
14498    /// use builder::generators::CancelOperation;
14499    /// # tokio_test::block_on(async {
14500    ///
14501    /// let builder = prepare_request_builder();
14502    /// let response = builder.send().await?;
14503    /// # gax::Result::<()>::Ok(()) });
14504    ///
14505    /// fn prepare_request_builder() -> CancelOperation {
14506    ///   # panic!();
14507    ///   // ... details omitted ...
14508    /// }
14509    /// ```
14510    #[derive(Clone, Debug)]
14511    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
14512
14513    impl CancelOperation {
14514        pub(crate) fn new(
14515            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14516        ) -> Self {
14517            Self(RequestBuilder::new(stub))
14518        }
14519
14520        /// Sets the full request, replacing any prior values.
14521        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
14522            mut self,
14523            v: V,
14524        ) -> Self {
14525            self.0.request = v.into();
14526            self
14527        }
14528
14529        /// Sets all the options, replacing any prior values.
14530        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14531            self.0.options = v.into();
14532            self
14533        }
14534
14535        /// Sends the request.
14536        pub async fn send(self) -> Result<()> {
14537            (*self.0.stub)
14538                .cancel_operation(self.0.request, self.0.options)
14539                .await
14540                .map(gax::response::Response::into_body)
14541        }
14542
14543        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
14544        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14545            self.0.request.name = v.into();
14546            self
14547        }
14548    }
14549
14550    #[doc(hidden)]
14551    impl gax::options::internal::RequestBuilder for CancelOperation {
14552        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14553            &mut self.0.options
14554        }
14555    }
14556}
14557
14558#[cfg(feature = "intents")]
14559#[cfg_attr(docsrs, doc(cfg(feature = "intents")))]
14560pub mod intents {
14561    use crate::Result;
14562
14563    /// A builder for [Intents][crate::client::Intents].
14564    ///
14565    /// ```
14566    /// # tokio_test::block_on(async {
14567    /// # use google_cloud_dialogflow_v2::*;
14568    /// # use builder::intents::ClientBuilder;
14569    /// # use client::Intents;
14570    /// let builder : ClientBuilder = Intents::builder();
14571    /// let client = builder
14572    ///     .with_endpoint("https://dialogflow.googleapis.com")
14573    ///     .build().await?;
14574    /// # gax::client_builder::Result::<()>::Ok(()) });
14575    /// ```
14576    pub type ClientBuilder =
14577        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14578
14579    pub(crate) mod client {
14580        use super::super::super::client::Intents;
14581        pub struct Factory;
14582        impl gax::client_builder::internal::ClientFactory for Factory {
14583            type Client = Intents;
14584            type Credentials = gaxi::options::Credentials;
14585            async fn build(
14586                self,
14587                config: gaxi::options::ClientConfig,
14588            ) -> gax::client_builder::Result<Self::Client> {
14589                Self::Client::new(config).await
14590            }
14591        }
14592    }
14593
14594    /// Common implementation for [crate::client::Intents] request builders.
14595    #[derive(Clone, Debug)]
14596    pub(crate) struct RequestBuilder<R: std::default::Default> {
14597        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>,
14598        request: R,
14599        options: gax::options::RequestOptions,
14600    }
14601
14602    impl<R> RequestBuilder<R>
14603    where
14604        R: std::default::Default,
14605    {
14606        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
14607            Self {
14608                stub,
14609                request: R::default(),
14610                options: gax::options::RequestOptions::default(),
14611            }
14612        }
14613    }
14614
14615    /// The request builder for [Intents::list_intents][crate::client::Intents::list_intents] calls.
14616    ///
14617    /// # Example
14618    /// ```no_run
14619    /// # use google_cloud_dialogflow_v2::builder;
14620    /// use builder::intents::ListIntents;
14621    /// # tokio_test::block_on(async {
14622    /// use gax::paginator::ItemPaginator;
14623    ///
14624    /// let builder = prepare_request_builder();
14625    /// let mut items = builder.by_item();
14626    /// while let Some(result) = items.next().await {
14627    ///   let item = result?;
14628    /// }
14629    /// # gax::Result::<()>::Ok(()) });
14630    ///
14631    /// fn prepare_request_builder() -> ListIntents {
14632    ///   # panic!();
14633    ///   // ... details omitted ...
14634    /// }
14635    /// ```
14636    #[derive(Clone, Debug)]
14637    pub struct ListIntents(RequestBuilder<crate::model::ListIntentsRequest>);
14638
14639    impl ListIntents {
14640        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
14641            Self(RequestBuilder::new(stub))
14642        }
14643
14644        /// Sets the full request, replacing any prior values.
14645        pub fn with_request<V: Into<crate::model::ListIntentsRequest>>(mut self, v: V) -> Self {
14646            self.0.request = v.into();
14647            self
14648        }
14649
14650        /// Sets all the options, replacing any prior values.
14651        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14652            self.0.options = v.into();
14653            self
14654        }
14655
14656        /// Sends the request.
14657        pub async fn send(self) -> Result<crate::model::ListIntentsResponse> {
14658            (*self.0.stub)
14659                .list_intents(self.0.request, self.0.options)
14660                .await
14661                .map(gax::response::Response::into_body)
14662        }
14663
14664        /// Streams each page in the collection.
14665        pub fn by_page(
14666            self,
14667        ) -> impl gax::paginator::Paginator<crate::model::ListIntentsResponse, gax::error::Error>
14668        {
14669            use std::clone::Clone;
14670            let token = self.0.request.page_token.clone();
14671            let execute = move |token: String| {
14672                let mut builder = self.clone();
14673                builder.0.request = builder.0.request.set_page_token(token);
14674                builder.send()
14675            };
14676            gax::paginator::internal::new_paginator(token, execute)
14677        }
14678
14679        /// Streams each item in the collection.
14680        pub fn by_item(
14681            self,
14682        ) -> impl gax::paginator::ItemPaginator<crate::model::ListIntentsResponse, gax::error::Error>
14683        {
14684            use gax::paginator::Paginator;
14685            self.by_page().items()
14686        }
14687
14688        /// Sets the value of [parent][crate::model::ListIntentsRequest::parent].
14689        ///
14690        /// This is a **required** field for requests.
14691        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14692            self.0.request.parent = v.into();
14693            self
14694        }
14695
14696        /// Sets the value of [language_code][crate::model::ListIntentsRequest::language_code].
14697        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
14698            self.0.request.language_code = v.into();
14699            self
14700        }
14701
14702        /// Sets the value of [intent_view][crate::model::ListIntentsRequest::intent_view].
14703        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
14704            self.0.request.intent_view = v.into();
14705            self
14706        }
14707
14708        /// Sets the value of [page_size][crate::model::ListIntentsRequest::page_size].
14709        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14710            self.0.request.page_size = v.into();
14711            self
14712        }
14713
14714        /// Sets the value of [page_token][crate::model::ListIntentsRequest::page_token].
14715        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14716            self.0.request.page_token = v.into();
14717            self
14718        }
14719    }
14720
14721    #[doc(hidden)]
14722    impl gax::options::internal::RequestBuilder for ListIntents {
14723        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14724            &mut self.0.options
14725        }
14726    }
14727
14728    /// The request builder for [Intents::get_intent][crate::client::Intents::get_intent] calls.
14729    ///
14730    /// # Example
14731    /// ```no_run
14732    /// # use google_cloud_dialogflow_v2::builder;
14733    /// use builder::intents::GetIntent;
14734    /// # tokio_test::block_on(async {
14735    ///
14736    /// let builder = prepare_request_builder();
14737    /// let response = builder.send().await?;
14738    /// # gax::Result::<()>::Ok(()) });
14739    ///
14740    /// fn prepare_request_builder() -> GetIntent {
14741    ///   # panic!();
14742    ///   // ... details omitted ...
14743    /// }
14744    /// ```
14745    #[derive(Clone, Debug)]
14746    pub struct GetIntent(RequestBuilder<crate::model::GetIntentRequest>);
14747
14748    impl GetIntent {
14749        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
14750            Self(RequestBuilder::new(stub))
14751        }
14752
14753        /// Sets the full request, replacing any prior values.
14754        pub fn with_request<V: Into<crate::model::GetIntentRequest>>(mut self, v: V) -> Self {
14755            self.0.request = v.into();
14756            self
14757        }
14758
14759        /// Sets all the options, replacing any prior values.
14760        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14761            self.0.options = v.into();
14762            self
14763        }
14764
14765        /// Sends the request.
14766        pub async fn send(self) -> Result<crate::model::Intent> {
14767            (*self.0.stub)
14768                .get_intent(self.0.request, self.0.options)
14769                .await
14770                .map(gax::response::Response::into_body)
14771        }
14772
14773        /// Sets the value of [name][crate::model::GetIntentRequest::name].
14774        ///
14775        /// This is a **required** field for requests.
14776        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14777            self.0.request.name = v.into();
14778            self
14779        }
14780
14781        /// Sets the value of [language_code][crate::model::GetIntentRequest::language_code].
14782        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
14783            self.0.request.language_code = v.into();
14784            self
14785        }
14786
14787        /// Sets the value of [intent_view][crate::model::GetIntentRequest::intent_view].
14788        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
14789            self.0.request.intent_view = v.into();
14790            self
14791        }
14792    }
14793
14794    #[doc(hidden)]
14795    impl gax::options::internal::RequestBuilder for GetIntent {
14796        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14797            &mut self.0.options
14798        }
14799    }
14800
14801    /// The request builder for [Intents::create_intent][crate::client::Intents::create_intent] calls.
14802    ///
14803    /// # Example
14804    /// ```no_run
14805    /// # use google_cloud_dialogflow_v2::builder;
14806    /// use builder::intents::CreateIntent;
14807    /// # tokio_test::block_on(async {
14808    ///
14809    /// let builder = prepare_request_builder();
14810    /// let response = builder.send().await?;
14811    /// # gax::Result::<()>::Ok(()) });
14812    ///
14813    /// fn prepare_request_builder() -> CreateIntent {
14814    ///   # panic!();
14815    ///   // ... details omitted ...
14816    /// }
14817    /// ```
14818    #[derive(Clone, Debug)]
14819    pub struct CreateIntent(RequestBuilder<crate::model::CreateIntentRequest>);
14820
14821    impl CreateIntent {
14822        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
14823            Self(RequestBuilder::new(stub))
14824        }
14825
14826        /// Sets the full request, replacing any prior values.
14827        pub fn with_request<V: Into<crate::model::CreateIntentRequest>>(mut self, v: V) -> Self {
14828            self.0.request = v.into();
14829            self
14830        }
14831
14832        /// Sets all the options, replacing any prior values.
14833        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14834            self.0.options = v.into();
14835            self
14836        }
14837
14838        /// Sends the request.
14839        pub async fn send(self) -> Result<crate::model::Intent> {
14840            (*self.0.stub)
14841                .create_intent(self.0.request, self.0.options)
14842                .await
14843                .map(gax::response::Response::into_body)
14844        }
14845
14846        /// Sets the value of [parent][crate::model::CreateIntentRequest::parent].
14847        ///
14848        /// This is a **required** field for requests.
14849        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14850            self.0.request.parent = v.into();
14851            self
14852        }
14853
14854        /// Sets the value of [intent][crate::model::CreateIntentRequest::intent].
14855        ///
14856        /// This is a **required** field for requests.
14857        pub fn set_intent<T>(mut self, v: T) -> Self
14858        where
14859            T: std::convert::Into<crate::model::Intent>,
14860        {
14861            self.0.request.intent = std::option::Option::Some(v.into());
14862            self
14863        }
14864
14865        /// Sets or clears the value of [intent][crate::model::CreateIntentRequest::intent].
14866        ///
14867        /// This is a **required** field for requests.
14868        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
14869        where
14870            T: std::convert::Into<crate::model::Intent>,
14871        {
14872            self.0.request.intent = v.map(|x| x.into());
14873            self
14874        }
14875
14876        /// Sets the value of [language_code][crate::model::CreateIntentRequest::language_code].
14877        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
14878            self.0.request.language_code = v.into();
14879            self
14880        }
14881
14882        /// Sets the value of [intent_view][crate::model::CreateIntentRequest::intent_view].
14883        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
14884            self.0.request.intent_view = v.into();
14885            self
14886        }
14887    }
14888
14889    #[doc(hidden)]
14890    impl gax::options::internal::RequestBuilder for CreateIntent {
14891        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14892            &mut self.0.options
14893        }
14894    }
14895
14896    /// The request builder for [Intents::update_intent][crate::client::Intents::update_intent] calls.
14897    ///
14898    /// # Example
14899    /// ```no_run
14900    /// # use google_cloud_dialogflow_v2::builder;
14901    /// use builder::intents::UpdateIntent;
14902    /// # tokio_test::block_on(async {
14903    ///
14904    /// let builder = prepare_request_builder();
14905    /// let response = builder.send().await?;
14906    /// # gax::Result::<()>::Ok(()) });
14907    ///
14908    /// fn prepare_request_builder() -> UpdateIntent {
14909    ///   # panic!();
14910    ///   // ... details omitted ...
14911    /// }
14912    /// ```
14913    #[derive(Clone, Debug)]
14914    pub struct UpdateIntent(RequestBuilder<crate::model::UpdateIntentRequest>);
14915
14916    impl UpdateIntent {
14917        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
14918            Self(RequestBuilder::new(stub))
14919        }
14920
14921        /// Sets the full request, replacing any prior values.
14922        pub fn with_request<V: Into<crate::model::UpdateIntentRequest>>(mut self, v: V) -> Self {
14923            self.0.request = v.into();
14924            self
14925        }
14926
14927        /// Sets all the options, replacing any prior values.
14928        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14929            self.0.options = v.into();
14930            self
14931        }
14932
14933        /// Sends the request.
14934        pub async fn send(self) -> Result<crate::model::Intent> {
14935            (*self.0.stub)
14936                .update_intent(self.0.request, self.0.options)
14937                .await
14938                .map(gax::response::Response::into_body)
14939        }
14940
14941        /// Sets the value of [intent][crate::model::UpdateIntentRequest::intent].
14942        ///
14943        /// This is a **required** field for requests.
14944        pub fn set_intent<T>(mut self, v: T) -> Self
14945        where
14946            T: std::convert::Into<crate::model::Intent>,
14947        {
14948            self.0.request.intent = std::option::Option::Some(v.into());
14949            self
14950        }
14951
14952        /// Sets or clears the value of [intent][crate::model::UpdateIntentRequest::intent].
14953        ///
14954        /// This is a **required** field for requests.
14955        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
14956        where
14957            T: std::convert::Into<crate::model::Intent>,
14958        {
14959            self.0.request.intent = v.map(|x| x.into());
14960            self
14961        }
14962
14963        /// Sets the value of [language_code][crate::model::UpdateIntentRequest::language_code].
14964        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
14965            self.0.request.language_code = v.into();
14966            self
14967        }
14968
14969        /// Sets the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
14970        pub fn set_update_mask<T>(mut self, v: T) -> Self
14971        where
14972            T: std::convert::Into<wkt::FieldMask>,
14973        {
14974            self.0.request.update_mask = std::option::Option::Some(v.into());
14975            self
14976        }
14977
14978        /// Sets or clears the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
14979        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14980        where
14981            T: std::convert::Into<wkt::FieldMask>,
14982        {
14983            self.0.request.update_mask = v.map(|x| x.into());
14984            self
14985        }
14986
14987        /// Sets the value of [intent_view][crate::model::UpdateIntentRequest::intent_view].
14988        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
14989            self.0.request.intent_view = v.into();
14990            self
14991        }
14992    }
14993
14994    #[doc(hidden)]
14995    impl gax::options::internal::RequestBuilder for UpdateIntent {
14996        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14997            &mut self.0.options
14998        }
14999    }
15000
15001    /// The request builder for [Intents::delete_intent][crate::client::Intents::delete_intent] calls.
15002    ///
15003    /// # Example
15004    /// ```no_run
15005    /// # use google_cloud_dialogflow_v2::builder;
15006    /// use builder::intents::DeleteIntent;
15007    /// # tokio_test::block_on(async {
15008    ///
15009    /// let builder = prepare_request_builder();
15010    /// let response = builder.send().await?;
15011    /// # gax::Result::<()>::Ok(()) });
15012    ///
15013    /// fn prepare_request_builder() -> DeleteIntent {
15014    ///   # panic!();
15015    ///   // ... details omitted ...
15016    /// }
15017    /// ```
15018    #[derive(Clone, Debug)]
15019    pub struct DeleteIntent(RequestBuilder<crate::model::DeleteIntentRequest>);
15020
15021    impl DeleteIntent {
15022        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15023            Self(RequestBuilder::new(stub))
15024        }
15025
15026        /// Sets the full request, replacing any prior values.
15027        pub fn with_request<V: Into<crate::model::DeleteIntentRequest>>(mut self, v: V) -> Self {
15028            self.0.request = v.into();
15029            self
15030        }
15031
15032        /// Sets all the options, replacing any prior values.
15033        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15034            self.0.options = v.into();
15035            self
15036        }
15037
15038        /// Sends the request.
15039        pub async fn send(self) -> Result<()> {
15040            (*self.0.stub)
15041                .delete_intent(self.0.request, self.0.options)
15042                .await
15043                .map(gax::response::Response::into_body)
15044        }
15045
15046        /// Sets the value of [name][crate::model::DeleteIntentRequest::name].
15047        ///
15048        /// This is a **required** field for requests.
15049        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15050            self.0.request.name = v.into();
15051            self
15052        }
15053    }
15054
15055    #[doc(hidden)]
15056    impl gax::options::internal::RequestBuilder for DeleteIntent {
15057        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15058            &mut self.0.options
15059        }
15060    }
15061
15062    /// The request builder for [Intents::batch_update_intents][crate::client::Intents::batch_update_intents] calls.
15063    ///
15064    /// # Example
15065    /// ```no_run
15066    /// # use google_cloud_dialogflow_v2::builder;
15067    /// use builder::intents::BatchUpdateIntents;
15068    /// # tokio_test::block_on(async {
15069    /// use lro::Poller;
15070    ///
15071    /// let builder = prepare_request_builder();
15072    /// let response = builder.poller().until_done().await?;
15073    /// # gax::Result::<()>::Ok(()) });
15074    ///
15075    /// fn prepare_request_builder() -> BatchUpdateIntents {
15076    ///   # panic!();
15077    ///   // ... details omitted ...
15078    /// }
15079    /// ```
15080    #[derive(Clone, Debug)]
15081    pub struct BatchUpdateIntents(RequestBuilder<crate::model::BatchUpdateIntentsRequest>);
15082
15083    impl BatchUpdateIntents {
15084        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15085            Self(RequestBuilder::new(stub))
15086        }
15087
15088        /// Sets the full request, replacing any prior values.
15089        pub fn with_request<V: Into<crate::model::BatchUpdateIntentsRequest>>(
15090            mut self,
15091            v: V,
15092        ) -> Self {
15093            self.0.request = v.into();
15094            self
15095        }
15096
15097        /// Sets all the options, replacing any prior values.
15098        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15099            self.0.options = v.into();
15100            self
15101        }
15102
15103        /// Sends the request.
15104        ///
15105        /// # Long running operations
15106        ///
15107        /// This starts, but does not poll, a longrunning operation. More information
15108        /// on [batch_update_intents][crate::client::Intents::batch_update_intents].
15109        pub async fn send(self) -> Result<longrunning::model::Operation> {
15110            (*self.0.stub)
15111                .batch_update_intents(self.0.request, self.0.options)
15112                .await
15113                .map(gax::response::Response::into_body)
15114        }
15115
15116        /// Creates a [Poller][lro::Poller] to work with `batch_update_intents`.
15117        pub fn poller(
15118            self,
15119        ) -> impl lro::Poller<crate::model::BatchUpdateIntentsResponse, wkt::Struct> {
15120            type Operation =
15121                lro::internal::Operation<crate::model::BatchUpdateIntentsResponse, wkt::Struct>;
15122            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15123            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15124
15125            let stub = self.0.stub.clone();
15126            let mut options = self.0.options.clone();
15127            options.set_retry_policy(gax::retry_policy::NeverRetry);
15128            let query = move |name| {
15129                let stub = stub.clone();
15130                let options = options.clone();
15131                async {
15132                    let op = GetOperation::new(stub)
15133                        .set_name(name)
15134                        .with_options(options)
15135                        .send()
15136                        .await?;
15137                    Ok(Operation::new(op))
15138                }
15139            };
15140
15141            let start = move || async {
15142                let op = self.send().await?;
15143                Ok(Operation::new(op))
15144            };
15145
15146            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15147        }
15148
15149        /// Sets the value of [parent][crate::model::BatchUpdateIntentsRequest::parent].
15150        ///
15151        /// This is a **required** field for requests.
15152        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15153            self.0.request.parent = v.into();
15154            self
15155        }
15156
15157        /// Sets the value of [language_code][crate::model::BatchUpdateIntentsRequest::language_code].
15158        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15159            self.0.request.language_code = v.into();
15160            self
15161        }
15162
15163        /// Sets the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
15164        pub fn set_update_mask<T>(mut self, v: T) -> Self
15165        where
15166            T: std::convert::Into<wkt::FieldMask>,
15167        {
15168            self.0.request.update_mask = std::option::Option::Some(v.into());
15169            self
15170        }
15171
15172        /// Sets or clears the value of [update_mask][crate::model::BatchUpdateIntentsRequest::update_mask].
15173        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15174        where
15175            T: std::convert::Into<wkt::FieldMask>,
15176        {
15177            self.0.request.update_mask = v.map(|x| x.into());
15178            self
15179        }
15180
15181        /// Sets the value of [intent_view][crate::model::BatchUpdateIntentsRequest::intent_view].
15182        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15183            self.0.request.intent_view = v.into();
15184            self
15185        }
15186
15187        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch].
15188        ///
15189        /// Note that all the setters affecting `intent_batch` are
15190        /// mutually exclusive.
15191        pub fn set_intent_batch<
15192            T: Into<Option<crate::model::batch_update_intents_request::IntentBatch>>,
15193        >(
15194            mut self,
15195            v: T,
15196        ) -> Self {
15197            self.0.request.intent_batch = v.into();
15198            self
15199        }
15200
15201        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
15202        /// to hold a `IntentBatchUri`.
15203        ///
15204        /// Note that all the setters affecting `intent_batch` are
15205        /// mutually exclusive.
15206        pub fn set_intent_batch_uri<T: std::convert::Into<std::string::String>>(
15207            mut self,
15208            v: T,
15209        ) -> Self {
15210            self.0.request = self.0.request.set_intent_batch_uri(v);
15211            self
15212        }
15213
15214        /// Sets the value of [intent_batch][crate::model::BatchUpdateIntentsRequest::intent_batch]
15215        /// to hold a `IntentBatchInline`.
15216        ///
15217        /// Note that all the setters affecting `intent_batch` are
15218        /// mutually exclusive.
15219        pub fn set_intent_batch_inline<
15220            T: std::convert::Into<std::boxed::Box<crate::model::IntentBatch>>,
15221        >(
15222            mut self,
15223            v: T,
15224        ) -> Self {
15225            self.0.request = self.0.request.set_intent_batch_inline(v);
15226            self
15227        }
15228    }
15229
15230    #[doc(hidden)]
15231    impl gax::options::internal::RequestBuilder for BatchUpdateIntents {
15232        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15233            &mut self.0.options
15234        }
15235    }
15236
15237    /// The request builder for [Intents::batch_delete_intents][crate::client::Intents::batch_delete_intents] calls.
15238    ///
15239    /// # Example
15240    /// ```no_run
15241    /// # use google_cloud_dialogflow_v2::builder;
15242    /// use builder::intents::BatchDeleteIntents;
15243    /// # tokio_test::block_on(async {
15244    /// use lro::Poller;
15245    ///
15246    /// let builder = prepare_request_builder();
15247    /// let response = builder.poller().until_done().await?;
15248    /// # gax::Result::<()>::Ok(()) });
15249    ///
15250    /// fn prepare_request_builder() -> BatchDeleteIntents {
15251    ///   # panic!();
15252    ///   // ... details omitted ...
15253    /// }
15254    /// ```
15255    #[derive(Clone, Debug)]
15256    pub struct BatchDeleteIntents(RequestBuilder<crate::model::BatchDeleteIntentsRequest>);
15257
15258    impl BatchDeleteIntents {
15259        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15260            Self(RequestBuilder::new(stub))
15261        }
15262
15263        /// Sets the full request, replacing any prior values.
15264        pub fn with_request<V: Into<crate::model::BatchDeleteIntentsRequest>>(
15265            mut self,
15266            v: V,
15267        ) -> Self {
15268            self.0.request = v.into();
15269            self
15270        }
15271
15272        /// Sets all the options, replacing any prior values.
15273        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15274            self.0.options = v.into();
15275            self
15276        }
15277
15278        /// Sends the request.
15279        ///
15280        /// # Long running operations
15281        ///
15282        /// This starts, but does not poll, a longrunning operation. More information
15283        /// on [batch_delete_intents][crate::client::Intents::batch_delete_intents].
15284        pub async fn send(self) -> Result<longrunning::model::Operation> {
15285            (*self.0.stub)
15286                .batch_delete_intents(self.0.request, self.0.options)
15287                .await
15288                .map(gax::response::Response::into_body)
15289        }
15290
15291        /// Creates a [Poller][lro::Poller] to work with `batch_delete_intents`.
15292        pub fn poller(self) -> impl lro::Poller<(), wkt::Struct> {
15293            type Operation = lro::internal::Operation<wkt::Empty, wkt::Struct>;
15294            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15295            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15296
15297            let stub = self.0.stub.clone();
15298            let mut options = self.0.options.clone();
15299            options.set_retry_policy(gax::retry_policy::NeverRetry);
15300            let query = move |name| {
15301                let stub = stub.clone();
15302                let options = options.clone();
15303                async {
15304                    let op = GetOperation::new(stub)
15305                        .set_name(name)
15306                        .with_options(options)
15307                        .send()
15308                        .await?;
15309                    Ok(Operation::new(op))
15310                }
15311            };
15312
15313            let start = move || async {
15314                let op = self.send().await?;
15315                Ok(Operation::new(op))
15316            };
15317
15318            lro::internal::new_unit_response_poller(
15319                polling_error_policy,
15320                polling_backoff_policy,
15321                start,
15322                query,
15323            )
15324        }
15325
15326        /// Sets the value of [parent][crate::model::BatchDeleteIntentsRequest::parent].
15327        ///
15328        /// This is a **required** field for requests.
15329        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15330            self.0.request.parent = v.into();
15331            self
15332        }
15333
15334        /// Sets the value of [intents][crate::model::BatchDeleteIntentsRequest::intents].
15335        ///
15336        /// This is a **required** field for requests.
15337        pub fn set_intents<T, V>(mut self, v: T) -> Self
15338        where
15339            T: std::iter::IntoIterator<Item = V>,
15340            V: std::convert::Into<crate::model::Intent>,
15341        {
15342            use std::iter::Iterator;
15343            self.0.request.intents = v.into_iter().map(|i| i.into()).collect();
15344            self
15345        }
15346    }
15347
15348    #[doc(hidden)]
15349    impl gax::options::internal::RequestBuilder for BatchDeleteIntents {
15350        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15351            &mut self.0.options
15352        }
15353    }
15354
15355    /// The request builder for [Intents::list_locations][crate::client::Intents::list_locations] calls.
15356    ///
15357    /// # Example
15358    /// ```no_run
15359    /// # use google_cloud_dialogflow_v2::builder;
15360    /// use builder::intents::ListLocations;
15361    /// # tokio_test::block_on(async {
15362    /// use gax::paginator::ItemPaginator;
15363    ///
15364    /// let builder = prepare_request_builder();
15365    /// let mut items = builder.by_item();
15366    /// while let Some(result) = items.next().await {
15367    ///   let item = result?;
15368    /// }
15369    /// # gax::Result::<()>::Ok(()) });
15370    ///
15371    /// fn prepare_request_builder() -> ListLocations {
15372    ///   # panic!();
15373    ///   // ... details omitted ...
15374    /// }
15375    /// ```
15376    #[derive(Clone, Debug)]
15377    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
15378
15379    impl ListLocations {
15380        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15381            Self(RequestBuilder::new(stub))
15382        }
15383
15384        /// Sets the full request, replacing any prior values.
15385        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
15386            mut self,
15387            v: V,
15388        ) -> Self {
15389            self.0.request = v.into();
15390            self
15391        }
15392
15393        /// Sets all the options, replacing any prior values.
15394        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15395            self.0.options = v.into();
15396            self
15397        }
15398
15399        /// Sends the request.
15400        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
15401            (*self.0.stub)
15402                .list_locations(self.0.request, self.0.options)
15403                .await
15404                .map(gax::response::Response::into_body)
15405        }
15406
15407        /// Streams each page in the collection.
15408        pub fn by_page(
15409            self,
15410        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
15411        {
15412            use std::clone::Clone;
15413            let token = self.0.request.page_token.clone();
15414            let execute = move |token: String| {
15415                let mut builder = self.clone();
15416                builder.0.request = builder.0.request.set_page_token(token);
15417                builder.send()
15418            };
15419            gax::paginator::internal::new_paginator(token, execute)
15420        }
15421
15422        /// Streams each item in the collection.
15423        pub fn by_item(
15424            self,
15425        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
15426        {
15427            use gax::paginator::Paginator;
15428            self.by_page().items()
15429        }
15430
15431        /// Sets the value of [name][location::model::ListLocationsRequest::name].
15432        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15433            self.0.request.name = v.into();
15434            self
15435        }
15436
15437        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
15438        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15439            self.0.request.filter = v.into();
15440            self
15441        }
15442
15443        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
15444        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15445            self.0.request.page_size = v.into();
15446            self
15447        }
15448
15449        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
15450        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15451            self.0.request.page_token = v.into();
15452            self
15453        }
15454    }
15455
15456    #[doc(hidden)]
15457    impl gax::options::internal::RequestBuilder for ListLocations {
15458        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15459            &mut self.0.options
15460        }
15461    }
15462
15463    /// The request builder for [Intents::get_location][crate::client::Intents::get_location] calls.
15464    ///
15465    /// # Example
15466    /// ```no_run
15467    /// # use google_cloud_dialogflow_v2::builder;
15468    /// use builder::intents::GetLocation;
15469    /// # tokio_test::block_on(async {
15470    ///
15471    /// let builder = prepare_request_builder();
15472    /// let response = builder.send().await?;
15473    /// # gax::Result::<()>::Ok(()) });
15474    ///
15475    /// fn prepare_request_builder() -> GetLocation {
15476    ///   # panic!();
15477    ///   // ... details omitted ...
15478    /// }
15479    /// ```
15480    #[derive(Clone, Debug)]
15481    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
15482
15483    impl GetLocation {
15484        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15485            Self(RequestBuilder::new(stub))
15486        }
15487
15488        /// Sets the full request, replacing any prior values.
15489        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
15490            self.0.request = v.into();
15491            self
15492        }
15493
15494        /// Sets all the options, replacing any prior values.
15495        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15496            self.0.options = v.into();
15497            self
15498        }
15499
15500        /// Sends the request.
15501        pub async fn send(self) -> Result<location::model::Location> {
15502            (*self.0.stub)
15503                .get_location(self.0.request, self.0.options)
15504                .await
15505                .map(gax::response::Response::into_body)
15506        }
15507
15508        /// Sets the value of [name][location::model::GetLocationRequest::name].
15509        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15510            self.0.request.name = v.into();
15511            self
15512        }
15513    }
15514
15515    #[doc(hidden)]
15516    impl gax::options::internal::RequestBuilder for GetLocation {
15517        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15518            &mut self.0.options
15519        }
15520    }
15521
15522    /// The request builder for [Intents::list_operations][crate::client::Intents::list_operations] calls.
15523    ///
15524    /// # Example
15525    /// ```no_run
15526    /// # use google_cloud_dialogflow_v2::builder;
15527    /// use builder::intents::ListOperations;
15528    /// # tokio_test::block_on(async {
15529    /// use gax::paginator::ItemPaginator;
15530    ///
15531    /// let builder = prepare_request_builder();
15532    /// let mut items = builder.by_item();
15533    /// while let Some(result) = items.next().await {
15534    ///   let item = result?;
15535    /// }
15536    /// # gax::Result::<()>::Ok(()) });
15537    ///
15538    /// fn prepare_request_builder() -> ListOperations {
15539    ///   # panic!();
15540    ///   // ... details omitted ...
15541    /// }
15542    /// ```
15543    #[derive(Clone, Debug)]
15544    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
15545
15546    impl ListOperations {
15547        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15548            Self(RequestBuilder::new(stub))
15549        }
15550
15551        /// Sets the full request, replacing any prior values.
15552        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
15553            mut self,
15554            v: V,
15555        ) -> Self {
15556            self.0.request = v.into();
15557            self
15558        }
15559
15560        /// Sets all the options, replacing any prior values.
15561        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15562            self.0.options = v.into();
15563            self
15564        }
15565
15566        /// Sends the request.
15567        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
15568            (*self.0.stub)
15569                .list_operations(self.0.request, self.0.options)
15570                .await
15571                .map(gax::response::Response::into_body)
15572        }
15573
15574        /// Streams each page in the collection.
15575        pub fn by_page(
15576            self,
15577        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
15578        {
15579            use std::clone::Clone;
15580            let token = self.0.request.page_token.clone();
15581            let execute = move |token: String| {
15582                let mut builder = self.clone();
15583                builder.0.request = builder.0.request.set_page_token(token);
15584                builder.send()
15585            };
15586            gax::paginator::internal::new_paginator(token, execute)
15587        }
15588
15589        /// Streams each item in the collection.
15590        pub fn by_item(
15591            self,
15592        ) -> impl gax::paginator::ItemPaginator<
15593            longrunning::model::ListOperationsResponse,
15594            gax::error::Error,
15595        > {
15596            use gax::paginator::Paginator;
15597            self.by_page().items()
15598        }
15599
15600        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
15601        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15602            self.0.request.name = v.into();
15603            self
15604        }
15605
15606        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
15607        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15608            self.0.request.filter = v.into();
15609            self
15610        }
15611
15612        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
15613        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15614            self.0.request.page_size = v.into();
15615            self
15616        }
15617
15618        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
15619        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15620            self.0.request.page_token = v.into();
15621            self
15622        }
15623
15624        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
15625        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15626            self.0.request.return_partial_success = v.into();
15627            self
15628        }
15629    }
15630
15631    #[doc(hidden)]
15632    impl gax::options::internal::RequestBuilder for ListOperations {
15633        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15634            &mut self.0.options
15635        }
15636    }
15637
15638    /// The request builder for [Intents::get_operation][crate::client::Intents::get_operation] calls.
15639    ///
15640    /// # Example
15641    /// ```no_run
15642    /// # use google_cloud_dialogflow_v2::builder;
15643    /// use builder::intents::GetOperation;
15644    /// # tokio_test::block_on(async {
15645    ///
15646    /// let builder = prepare_request_builder();
15647    /// let response = builder.send().await?;
15648    /// # gax::Result::<()>::Ok(()) });
15649    ///
15650    /// fn prepare_request_builder() -> GetOperation {
15651    ///   # panic!();
15652    ///   // ... details omitted ...
15653    /// }
15654    /// ```
15655    #[derive(Clone, Debug)]
15656    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
15657
15658    impl GetOperation {
15659        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15660            Self(RequestBuilder::new(stub))
15661        }
15662
15663        /// Sets the full request, replacing any prior values.
15664        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
15665            mut self,
15666            v: V,
15667        ) -> Self {
15668            self.0.request = v.into();
15669            self
15670        }
15671
15672        /// Sets all the options, replacing any prior values.
15673        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15674            self.0.options = v.into();
15675            self
15676        }
15677
15678        /// Sends the request.
15679        pub async fn send(self) -> Result<longrunning::model::Operation> {
15680            (*self.0.stub)
15681                .get_operation(self.0.request, self.0.options)
15682                .await
15683                .map(gax::response::Response::into_body)
15684        }
15685
15686        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
15687        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15688            self.0.request.name = v.into();
15689            self
15690        }
15691    }
15692
15693    #[doc(hidden)]
15694    impl gax::options::internal::RequestBuilder for GetOperation {
15695        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15696            &mut self.0.options
15697        }
15698    }
15699
15700    /// The request builder for [Intents::cancel_operation][crate::client::Intents::cancel_operation] calls.
15701    ///
15702    /// # Example
15703    /// ```no_run
15704    /// # use google_cloud_dialogflow_v2::builder;
15705    /// use builder::intents::CancelOperation;
15706    /// # tokio_test::block_on(async {
15707    ///
15708    /// let builder = prepare_request_builder();
15709    /// let response = builder.send().await?;
15710    /// # gax::Result::<()>::Ok(()) });
15711    ///
15712    /// fn prepare_request_builder() -> CancelOperation {
15713    ///   # panic!();
15714    ///   // ... details omitted ...
15715    /// }
15716    /// ```
15717    #[derive(Clone, Debug)]
15718    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
15719
15720    impl CancelOperation {
15721        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15722            Self(RequestBuilder::new(stub))
15723        }
15724
15725        /// Sets the full request, replacing any prior values.
15726        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
15727            mut self,
15728            v: V,
15729        ) -> 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                .cancel_operation(self.0.request, self.0.options)
15744                .await
15745                .map(gax::response::Response::into_body)
15746        }
15747
15748        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
15749        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15750            self.0.request.name = v.into();
15751            self
15752        }
15753    }
15754
15755    #[doc(hidden)]
15756    impl gax::options::internal::RequestBuilder for CancelOperation {
15757        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15758            &mut self.0.options
15759        }
15760    }
15761}
15762
15763#[cfg(feature = "knowledge-bases")]
15764#[cfg_attr(docsrs, doc(cfg(feature = "knowledge-bases")))]
15765pub mod knowledge_bases {
15766    use crate::Result;
15767
15768    /// A builder for [KnowledgeBases][crate::client::KnowledgeBases].
15769    ///
15770    /// ```
15771    /// # tokio_test::block_on(async {
15772    /// # use google_cloud_dialogflow_v2::*;
15773    /// # use builder::knowledge_bases::ClientBuilder;
15774    /// # use client::KnowledgeBases;
15775    /// let builder : ClientBuilder = KnowledgeBases::builder();
15776    /// let client = builder
15777    ///     .with_endpoint("https://dialogflow.googleapis.com")
15778    ///     .build().await?;
15779    /// # gax::client_builder::Result::<()>::Ok(()) });
15780    /// ```
15781    pub type ClientBuilder =
15782        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15783
15784    pub(crate) mod client {
15785        use super::super::super::client::KnowledgeBases;
15786        pub struct Factory;
15787        impl gax::client_builder::internal::ClientFactory for Factory {
15788            type Client = KnowledgeBases;
15789            type Credentials = gaxi::options::Credentials;
15790            async fn build(
15791                self,
15792                config: gaxi::options::ClientConfig,
15793            ) -> gax::client_builder::Result<Self::Client> {
15794                Self::Client::new(config).await
15795            }
15796        }
15797    }
15798
15799    /// Common implementation for [crate::client::KnowledgeBases] request builders.
15800    #[derive(Clone, Debug)]
15801    pub(crate) struct RequestBuilder<R: std::default::Default> {
15802        stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
15803        request: R,
15804        options: gax::options::RequestOptions,
15805    }
15806
15807    impl<R> RequestBuilder<R>
15808    where
15809        R: std::default::Default,
15810    {
15811        pub(crate) fn new(
15812            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
15813        ) -> Self {
15814            Self {
15815                stub,
15816                request: R::default(),
15817                options: gax::options::RequestOptions::default(),
15818            }
15819        }
15820    }
15821
15822    /// The request builder for [KnowledgeBases::list_knowledge_bases][crate::client::KnowledgeBases::list_knowledge_bases] calls.
15823    ///
15824    /// # Example
15825    /// ```no_run
15826    /// # use google_cloud_dialogflow_v2::builder;
15827    /// use builder::knowledge_bases::ListKnowledgeBases;
15828    /// # tokio_test::block_on(async {
15829    /// use gax::paginator::ItemPaginator;
15830    ///
15831    /// let builder = prepare_request_builder();
15832    /// let mut items = builder.by_item();
15833    /// while let Some(result) = items.next().await {
15834    ///   let item = result?;
15835    /// }
15836    /// # gax::Result::<()>::Ok(()) });
15837    ///
15838    /// fn prepare_request_builder() -> ListKnowledgeBases {
15839    ///   # panic!();
15840    ///   // ... details omitted ...
15841    /// }
15842    /// ```
15843    #[derive(Clone, Debug)]
15844    pub struct ListKnowledgeBases(RequestBuilder<crate::model::ListKnowledgeBasesRequest>);
15845
15846    impl ListKnowledgeBases {
15847        pub(crate) fn new(
15848            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
15849        ) -> Self {
15850            Self(RequestBuilder::new(stub))
15851        }
15852
15853        /// Sets the full request, replacing any prior values.
15854        pub fn with_request<V: Into<crate::model::ListKnowledgeBasesRequest>>(
15855            mut self,
15856            v: V,
15857        ) -> Self {
15858            self.0.request = v.into();
15859            self
15860        }
15861
15862        /// Sets all the options, replacing any prior values.
15863        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15864            self.0.options = v.into();
15865            self
15866        }
15867
15868        /// Sends the request.
15869        pub async fn send(self) -> Result<crate::model::ListKnowledgeBasesResponse> {
15870            (*self.0.stub)
15871                .list_knowledge_bases(self.0.request, self.0.options)
15872                .await
15873                .map(gax::response::Response::into_body)
15874        }
15875
15876        /// Streams each page in the collection.
15877        pub fn by_page(
15878            self,
15879        ) -> impl gax::paginator::Paginator<crate::model::ListKnowledgeBasesResponse, gax::error::Error>
15880        {
15881            use std::clone::Clone;
15882            let token = self.0.request.page_token.clone();
15883            let execute = move |token: String| {
15884                let mut builder = self.clone();
15885                builder.0.request = builder.0.request.set_page_token(token);
15886                builder.send()
15887            };
15888            gax::paginator::internal::new_paginator(token, execute)
15889        }
15890
15891        /// Streams each item in the collection.
15892        pub fn by_item(
15893            self,
15894        ) -> impl gax::paginator::ItemPaginator<
15895            crate::model::ListKnowledgeBasesResponse,
15896            gax::error::Error,
15897        > {
15898            use gax::paginator::Paginator;
15899            self.by_page().items()
15900        }
15901
15902        /// Sets the value of [parent][crate::model::ListKnowledgeBasesRequest::parent].
15903        ///
15904        /// This is a **required** field for requests.
15905        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15906            self.0.request.parent = v.into();
15907            self
15908        }
15909
15910        /// Sets the value of [page_size][crate::model::ListKnowledgeBasesRequest::page_size].
15911        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15912            self.0.request.page_size = v.into();
15913            self
15914        }
15915
15916        /// Sets the value of [page_token][crate::model::ListKnowledgeBasesRequest::page_token].
15917        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15918            self.0.request.page_token = v.into();
15919            self
15920        }
15921
15922        /// Sets the value of [filter][crate::model::ListKnowledgeBasesRequest::filter].
15923        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15924            self.0.request.filter = v.into();
15925            self
15926        }
15927    }
15928
15929    #[doc(hidden)]
15930    impl gax::options::internal::RequestBuilder for ListKnowledgeBases {
15931        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15932            &mut self.0.options
15933        }
15934    }
15935
15936    /// The request builder for [KnowledgeBases::get_knowledge_base][crate::client::KnowledgeBases::get_knowledge_base] calls.
15937    ///
15938    /// # Example
15939    /// ```no_run
15940    /// # use google_cloud_dialogflow_v2::builder;
15941    /// use builder::knowledge_bases::GetKnowledgeBase;
15942    /// # tokio_test::block_on(async {
15943    ///
15944    /// let builder = prepare_request_builder();
15945    /// let response = builder.send().await?;
15946    /// # gax::Result::<()>::Ok(()) });
15947    ///
15948    /// fn prepare_request_builder() -> GetKnowledgeBase {
15949    ///   # panic!();
15950    ///   // ... details omitted ...
15951    /// }
15952    /// ```
15953    #[derive(Clone, Debug)]
15954    pub struct GetKnowledgeBase(RequestBuilder<crate::model::GetKnowledgeBaseRequest>);
15955
15956    impl GetKnowledgeBase {
15957        pub(crate) fn new(
15958            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
15959        ) -> 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::GetKnowledgeBaseRequest>>(
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        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
15980            (*self.0.stub)
15981                .get_knowledge_base(self.0.request, self.0.options)
15982                .await
15983                .map(gax::response::Response::into_body)
15984        }
15985
15986        /// Sets the value of [name][crate::model::GetKnowledgeBaseRequest::name].
15987        ///
15988        /// This is a **required** field for requests.
15989        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15990            self.0.request.name = v.into();
15991            self
15992        }
15993    }
15994
15995    #[doc(hidden)]
15996    impl gax::options::internal::RequestBuilder for GetKnowledgeBase {
15997        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15998            &mut self.0.options
15999        }
16000    }
16001
16002    /// The request builder for [KnowledgeBases::create_knowledge_base][crate::client::KnowledgeBases::create_knowledge_base] calls.
16003    ///
16004    /// # Example
16005    /// ```no_run
16006    /// # use google_cloud_dialogflow_v2::builder;
16007    /// use builder::knowledge_bases::CreateKnowledgeBase;
16008    /// # tokio_test::block_on(async {
16009    ///
16010    /// let builder = prepare_request_builder();
16011    /// let response = builder.send().await?;
16012    /// # gax::Result::<()>::Ok(()) });
16013    ///
16014    /// fn prepare_request_builder() -> CreateKnowledgeBase {
16015    ///   # panic!();
16016    ///   // ... details omitted ...
16017    /// }
16018    /// ```
16019    #[derive(Clone, Debug)]
16020    pub struct CreateKnowledgeBase(RequestBuilder<crate::model::CreateKnowledgeBaseRequest>);
16021
16022    impl CreateKnowledgeBase {
16023        pub(crate) fn new(
16024            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16025        ) -> Self {
16026            Self(RequestBuilder::new(stub))
16027        }
16028
16029        /// Sets the full request, replacing any prior values.
16030        pub fn with_request<V: Into<crate::model::CreateKnowledgeBaseRequest>>(
16031            mut self,
16032            v: V,
16033        ) -> Self {
16034            self.0.request = v.into();
16035            self
16036        }
16037
16038        /// Sets all the options, replacing any prior values.
16039        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16040            self.0.options = v.into();
16041            self
16042        }
16043
16044        /// Sends the request.
16045        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
16046            (*self.0.stub)
16047                .create_knowledge_base(self.0.request, self.0.options)
16048                .await
16049                .map(gax::response::Response::into_body)
16050        }
16051
16052        /// Sets the value of [parent][crate::model::CreateKnowledgeBaseRequest::parent].
16053        ///
16054        /// This is a **required** field for requests.
16055        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16056            self.0.request.parent = v.into();
16057            self
16058        }
16059
16060        /// Sets the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
16061        ///
16062        /// This is a **required** field for requests.
16063        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
16064        where
16065            T: std::convert::Into<crate::model::KnowledgeBase>,
16066        {
16067            self.0.request.knowledge_base = std::option::Option::Some(v.into());
16068            self
16069        }
16070
16071        /// Sets or clears the value of [knowledge_base][crate::model::CreateKnowledgeBaseRequest::knowledge_base].
16072        ///
16073        /// This is a **required** field for requests.
16074        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
16075        where
16076            T: std::convert::Into<crate::model::KnowledgeBase>,
16077        {
16078            self.0.request.knowledge_base = v.map(|x| x.into());
16079            self
16080        }
16081    }
16082
16083    #[doc(hidden)]
16084    impl gax::options::internal::RequestBuilder for CreateKnowledgeBase {
16085        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16086            &mut self.0.options
16087        }
16088    }
16089
16090    /// The request builder for [KnowledgeBases::delete_knowledge_base][crate::client::KnowledgeBases::delete_knowledge_base] calls.
16091    ///
16092    /// # Example
16093    /// ```no_run
16094    /// # use google_cloud_dialogflow_v2::builder;
16095    /// use builder::knowledge_bases::DeleteKnowledgeBase;
16096    /// # tokio_test::block_on(async {
16097    ///
16098    /// let builder = prepare_request_builder();
16099    /// let response = builder.send().await?;
16100    /// # gax::Result::<()>::Ok(()) });
16101    ///
16102    /// fn prepare_request_builder() -> DeleteKnowledgeBase {
16103    ///   # panic!();
16104    ///   // ... details omitted ...
16105    /// }
16106    /// ```
16107    #[derive(Clone, Debug)]
16108    pub struct DeleteKnowledgeBase(RequestBuilder<crate::model::DeleteKnowledgeBaseRequest>);
16109
16110    impl DeleteKnowledgeBase {
16111        pub(crate) fn new(
16112            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16113        ) -> Self {
16114            Self(RequestBuilder::new(stub))
16115        }
16116
16117        /// Sets the full request, replacing any prior values.
16118        pub fn with_request<V: Into<crate::model::DeleteKnowledgeBaseRequest>>(
16119            mut self,
16120            v: V,
16121        ) -> Self {
16122            self.0.request = v.into();
16123            self
16124        }
16125
16126        /// Sets all the options, replacing any prior values.
16127        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16128            self.0.options = v.into();
16129            self
16130        }
16131
16132        /// Sends the request.
16133        pub async fn send(self) -> Result<()> {
16134            (*self.0.stub)
16135                .delete_knowledge_base(self.0.request, self.0.options)
16136                .await
16137                .map(gax::response::Response::into_body)
16138        }
16139
16140        /// Sets the value of [name][crate::model::DeleteKnowledgeBaseRequest::name].
16141        ///
16142        /// This is a **required** field for requests.
16143        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16144            self.0.request.name = v.into();
16145            self
16146        }
16147
16148        /// Sets the value of [force][crate::model::DeleteKnowledgeBaseRequest::force].
16149        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
16150            self.0.request.force = v.into();
16151            self
16152        }
16153    }
16154
16155    #[doc(hidden)]
16156    impl gax::options::internal::RequestBuilder for DeleteKnowledgeBase {
16157        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16158            &mut self.0.options
16159        }
16160    }
16161
16162    /// The request builder for [KnowledgeBases::update_knowledge_base][crate::client::KnowledgeBases::update_knowledge_base] calls.
16163    ///
16164    /// # Example
16165    /// ```no_run
16166    /// # use google_cloud_dialogflow_v2::builder;
16167    /// use builder::knowledge_bases::UpdateKnowledgeBase;
16168    /// # tokio_test::block_on(async {
16169    ///
16170    /// let builder = prepare_request_builder();
16171    /// let response = builder.send().await?;
16172    /// # gax::Result::<()>::Ok(()) });
16173    ///
16174    /// fn prepare_request_builder() -> UpdateKnowledgeBase {
16175    ///   # panic!();
16176    ///   // ... details omitted ...
16177    /// }
16178    /// ```
16179    #[derive(Clone, Debug)]
16180    pub struct UpdateKnowledgeBase(RequestBuilder<crate::model::UpdateKnowledgeBaseRequest>);
16181
16182    impl UpdateKnowledgeBase {
16183        pub(crate) fn new(
16184            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16185        ) -> Self {
16186            Self(RequestBuilder::new(stub))
16187        }
16188
16189        /// Sets the full request, replacing any prior values.
16190        pub fn with_request<V: Into<crate::model::UpdateKnowledgeBaseRequest>>(
16191            mut self,
16192            v: V,
16193        ) -> Self {
16194            self.0.request = v.into();
16195            self
16196        }
16197
16198        /// Sets all the options, replacing any prior values.
16199        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16200            self.0.options = v.into();
16201            self
16202        }
16203
16204        /// Sends the request.
16205        pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
16206            (*self.0.stub)
16207                .update_knowledge_base(self.0.request, self.0.options)
16208                .await
16209                .map(gax::response::Response::into_body)
16210        }
16211
16212        /// Sets the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
16213        ///
16214        /// This is a **required** field for requests.
16215        pub fn set_knowledge_base<T>(mut self, v: T) -> Self
16216        where
16217            T: std::convert::Into<crate::model::KnowledgeBase>,
16218        {
16219            self.0.request.knowledge_base = std::option::Option::Some(v.into());
16220            self
16221        }
16222
16223        /// Sets or clears the value of [knowledge_base][crate::model::UpdateKnowledgeBaseRequest::knowledge_base].
16224        ///
16225        /// This is a **required** field for requests.
16226        pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
16227        where
16228            T: std::convert::Into<crate::model::KnowledgeBase>,
16229        {
16230            self.0.request.knowledge_base = v.map(|x| x.into());
16231            self
16232        }
16233
16234        /// Sets the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
16235        pub fn set_update_mask<T>(mut self, v: T) -> Self
16236        where
16237            T: std::convert::Into<wkt::FieldMask>,
16238        {
16239            self.0.request.update_mask = std::option::Option::Some(v.into());
16240            self
16241        }
16242
16243        /// Sets or clears the value of [update_mask][crate::model::UpdateKnowledgeBaseRequest::update_mask].
16244        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16245        where
16246            T: std::convert::Into<wkt::FieldMask>,
16247        {
16248            self.0.request.update_mask = v.map(|x| x.into());
16249            self
16250        }
16251    }
16252
16253    #[doc(hidden)]
16254    impl gax::options::internal::RequestBuilder for UpdateKnowledgeBase {
16255        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16256            &mut self.0.options
16257        }
16258    }
16259
16260    /// The request builder for [KnowledgeBases::list_locations][crate::client::KnowledgeBases::list_locations] calls.
16261    ///
16262    /// # Example
16263    /// ```no_run
16264    /// # use google_cloud_dialogflow_v2::builder;
16265    /// use builder::knowledge_bases::ListLocations;
16266    /// # tokio_test::block_on(async {
16267    /// use gax::paginator::ItemPaginator;
16268    ///
16269    /// let builder = prepare_request_builder();
16270    /// let mut items = builder.by_item();
16271    /// while let Some(result) = items.next().await {
16272    ///   let item = result?;
16273    /// }
16274    /// # gax::Result::<()>::Ok(()) });
16275    ///
16276    /// fn prepare_request_builder() -> ListLocations {
16277    ///   # panic!();
16278    ///   // ... details omitted ...
16279    /// }
16280    /// ```
16281    #[derive(Clone, Debug)]
16282    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
16283
16284    impl ListLocations {
16285        pub(crate) fn new(
16286            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16287        ) -> Self {
16288            Self(RequestBuilder::new(stub))
16289        }
16290
16291        /// Sets the full request, replacing any prior values.
16292        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
16293            mut self,
16294            v: V,
16295        ) -> Self {
16296            self.0.request = v.into();
16297            self
16298        }
16299
16300        /// Sets all the options, replacing any prior values.
16301        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16302            self.0.options = v.into();
16303            self
16304        }
16305
16306        /// Sends the request.
16307        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
16308            (*self.0.stub)
16309                .list_locations(self.0.request, self.0.options)
16310                .await
16311                .map(gax::response::Response::into_body)
16312        }
16313
16314        /// Streams each page in the collection.
16315        pub fn by_page(
16316            self,
16317        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
16318        {
16319            use std::clone::Clone;
16320            let token = self.0.request.page_token.clone();
16321            let execute = move |token: String| {
16322                let mut builder = self.clone();
16323                builder.0.request = builder.0.request.set_page_token(token);
16324                builder.send()
16325            };
16326            gax::paginator::internal::new_paginator(token, execute)
16327        }
16328
16329        /// Streams each item in the collection.
16330        pub fn by_item(
16331            self,
16332        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
16333        {
16334            use gax::paginator::Paginator;
16335            self.by_page().items()
16336        }
16337
16338        /// Sets the value of [name][location::model::ListLocationsRequest::name].
16339        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16340            self.0.request.name = v.into();
16341            self
16342        }
16343
16344        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
16345        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16346            self.0.request.filter = v.into();
16347            self
16348        }
16349
16350        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
16351        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16352            self.0.request.page_size = v.into();
16353            self
16354        }
16355
16356        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
16357        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16358            self.0.request.page_token = v.into();
16359            self
16360        }
16361    }
16362
16363    #[doc(hidden)]
16364    impl gax::options::internal::RequestBuilder for ListLocations {
16365        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16366            &mut self.0.options
16367        }
16368    }
16369
16370    /// The request builder for [KnowledgeBases::get_location][crate::client::KnowledgeBases::get_location] calls.
16371    ///
16372    /// # Example
16373    /// ```no_run
16374    /// # use google_cloud_dialogflow_v2::builder;
16375    /// use builder::knowledge_bases::GetLocation;
16376    /// # tokio_test::block_on(async {
16377    ///
16378    /// let builder = prepare_request_builder();
16379    /// let response = builder.send().await?;
16380    /// # gax::Result::<()>::Ok(()) });
16381    ///
16382    /// fn prepare_request_builder() -> GetLocation {
16383    ///   # panic!();
16384    ///   // ... details omitted ...
16385    /// }
16386    /// ```
16387    #[derive(Clone, Debug)]
16388    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
16389
16390    impl GetLocation {
16391        pub(crate) fn new(
16392            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16393        ) -> Self {
16394            Self(RequestBuilder::new(stub))
16395        }
16396
16397        /// Sets the full request, replacing any prior values.
16398        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
16399            self.0.request = v.into();
16400            self
16401        }
16402
16403        /// Sets all the options, replacing any prior values.
16404        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16405            self.0.options = v.into();
16406            self
16407        }
16408
16409        /// Sends the request.
16410        pub async fn send(self) -> Result<location::model::Location> {
16411            (*self.0.stub)
16412                .get_location(self.0.request, self.0.options)
16413                .await
16414                .map(gax::response::Response::into_body)
16415        }
16416
16417        /// Sets the value of [name][location::model::GetLocationRequest::name].
16418        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16419            self.0.request.name = v.into();
16420            self
16421        }
16422    }
16423
16424    #[doc(hidden)]
16425    impl gax::options::internal::RequestBuilder for GetLocation {
16426        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16427            &mut self.0.options
16428        }
16429    }
16430
16431    /// The request builder for [KnowledgeBases::list_operations][crate::client::KnowledgeBases::list_operations] calls.
16432    ///
16433    /// # Example
16434    /// ```no_run
16435    /// # use google_cloud_dialogflow_v2::builder;
16436    /// use builder::knowledge_bases::ListOperations;
16437    /// # tokio_test::block_on(async {
16438    /// use gax::paginator::ItemPaginator;
16439    ///
16440    /// let builder = prepare_request_builder();
16441    /// let mut items = builder.by_item();
16442    /// while let Some(result) = items.next().await {
16443    ///   let item = result?;
16444    /// }
16445    /// # gax::Result::<()>::Ok(()) });
16446    ///
16447    /// fn prepare_request_builder() -> ListOperations {
16448    ///   # panic!();
16449    ///   // ... details omitted ...
16450    /// }
16451    /// ```
16452    #[derive(Clone, Debug)]
16453    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
16454
16455    impl ListOperations {
16456        pub(crate) fn new(
16457            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16458        ) -> Self {
16459            Self(RequestBuilder::new(stub))
16460        }
16461
16462        /// Sets the full request, replacing any prior values.
16463        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
16464            mut self,
16465            v: V,
16466        ) -> Self {
16467            self.0.request = v.into();
16468            self
16469        }
16470
16471        /// Sets all the options, replacing any prior values.
16472        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16473            self.0.options = v.into();
16474            self
16475        }
16476
16477        /// Sends the request.
16478        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
16479            (*self.0.stub)
16480                .list_operations(self.0.request, self.0.options)
16481                .await
16482                .map(gax::response::Response::into_body)
16483        }
16484
16485        /// Streams each page in the collection.
16486        pub fn by_page(
16487            self,
16488        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
16489        {
16490            use std::clone::Clone;
16491            let token = self.0.request.page_token.clone();
16492            let execute = move |token: String| {
16493                let mut builder = self.clone();
16494                builder.0.request = builder.0.request.set_page_token(token);
16495                builder.send()
16496            };
16497            gax::paginator::internal::new_paginator(token, execute)
16498        }
16499
16500        /// Streams each item in the collection.
16501        pub fn by_item(
16502            self,
16503        ) -> impl gax::paginator::ItemPaginator<
16504            longrunning::model::ListOperationsResponse,
16505            gax::error::Error,
16506        > {
16507            use gax::paginator::Paginator;
16508            self.by_page().items()
16509        }
16510
16511        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
16512        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16513            self.0.request.name = v.into();
16514            self
16515        }
16516
16517        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
16518        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16519            self.0.request.filter = v.into();
16520            self
16521        }
16522
16523        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
16524        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16525            self.0.request.page_size = v.into();
16526            self
16527        }
16528
16529        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
16530        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16531            self.0.request.page_token = v.into();
16532            self
16533        }
16534
16535        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
16536        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16537            self.0.request.return_partial_success = v.into();
16538            self
16539        }
16540    }
16541
16542    #[doc(hidden)]
16543    impl gax::options::internal::RequestBuilder for ListOperations {
16544        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16545            &mut self.0.options
16546        }
16547    }
16548
16549    /// The request builder for [KnowledgeBases::get_operation][crate::client::KnowledgeBases::get_operation] calls.
16550    ///
16551    /// # Example
16552    /// ```no_run
16553    /// # use google_cloud_dialogflow_v2::builder;
16554    /// use builder::knowledge_bases::GetOperation;
16555    /// # tokio_test::block_on(async {
16556    ///
16557    /// let builder = prepare_request_builder();
16558    /// let response = builder.send().await?;
16559    /// # gax::Result::<()>::Ok(()) });
16560    ///
16561    /// fn prepare_request_builder() -> GetOperation {
16562    ///   # panic!();
16563    ///   // ... details omitted ...
16564    /// }
16565    /// ```
16566    #[derive(Clone, Debug)]
16567    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
16568
16569    impl GetOperation {
16570        pub(crate) fn new(
16571            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16572        ) -> Self {
16573            Self(RequestBuilder::new(stub))
16574        }
16575
16576        /// Sets the full request, replacing any prior values.
16577        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
16578            mut self,
16579            v: V,
16580        ) -> Self {
16581            self.0.request = v.into();
16582            self
16583        }
16584
16585        /// Sets all the options, replacing any prior values.
16586        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16587            self.0.options = v.into();
16588            self
16589        }
16590
16591        /// Sends the request.
16592        pub async fn send(self) -> Result<longrunning::model::Operation> {
16593            (*self.0.stub)
16594                .get_operation(self.0.request, self.0.options)
16595                .await
16596                .map(gax::response::Response::into_body)
16597        }
16598
16599        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
16600        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16601            self.0.request.name = v.into();
16602            self
16603        }
16604    }
16605
16606    #[doc(hidden)]
16607    impl gax::options::internal::RequestBuilder for GetOperation {
16608        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16609            &mut self.0.options
16610        }
16611    }
16612
16613    /// The request builder for [KnowledgeBases::cancel_operation][crate::client::KnowledgeBases::cancel_operation] calls.
16614    ///
16615    /// # Example
16616    /// ```no_run
16617    /// # use google_cloud_dialogflow_v2::builder;
16618    /// use builder::knowledge_bases::CancelOperation;
16619    /// # tokio_test::block_on(async {
16620    ///
16621    /// let builder = prepare_request_builder();
16622    /// let response = builder.send().await?;
16623    /// # gax::Result::<()>::Ok(()) });
16624    ///
16625    /// fn prepare_request_builder() -> CancelOperation {
16626    ///   # panic!();
16627    ///   // ... details omitted ...
16628    /// }
16629    /// ```
16630    #[derive(Clone, Debug)]
16631    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
16632
16633    impl CancelOperation {
16634        pub(crate) fn new(
16635            stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
16636        ) -> Self {
16637            Self(RequestBuilder::new(stub))
16638        }
16639
16640        /// Sets the full request, replacing any prior values.
16641        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
16642            mut self,
16643            v: V,
16644        ) -> Self {
16645            self.0.request = v.into();
16646            self
16647        }
16648
16649        /// Sets all the options, replacing any prior values.
16650        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16651            self.0.options = v.into();
16652            self
16653        }
16654
16655        /// Sends the request.
16656        pub async fn send(self) -> Result<()> {
16657            (*self.0.stub)
16658                .cancel_operation(self.0.request, self.0.options)
16659                .await
16660                .map(gax::response::Response::into_body)
16661        }
16662
16663        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
16664        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16665            self.0.request.name = v.into();
16666            self
16667        }
16668    }
16669
16670    #[doc(hidden)]
16671    impl gax::options::internal::RequestBuilder for CancelOperation {
16672        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16673            &mut self.0.options
16674        }
16675    }
16676}
16677
16678#[cfg(feature = "participants")]
16679#[cfg_attr(docsrs, doc(cfg(feature = "participants")))]
16680pub mod participants {
16681    use crate::Result;
16682
16683    /// A builder for [Participants][crate::client::Participants].
16684    ///
16685    /// ```
16686    /// # tokio_test::block_on(async {
16687    /// # use google_cloud_dialogflow_v2::*;
16688    /// # use builder::participants::ClientBuilder;
16689    /// # use client::Participants;
16690    /// let builder : ClientBuilder = Participants::builder();
16691    /// let client = builder
16692    ///     .with_endpoint("https://dialogflow.googleapis.com")
16693    ///     .build().await?;
16694    /// # gax::client_builder::Result::<()>::Ok(()) });
16695    /// ```
16696    pub type ClientBuilder =
16697        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16698
16699    pub(crate) mod client {
16700        use super::super::super::client::Participants;
16701        pub struct Factory;
16702        impl gax::client_builder::internal::ClientFactory for Factory {
16703            type Client = Participants;
16704            type Credentials = gaxi::options::Credentials;
16705            async fn build(
16706                self,
16707                config: gaxi::options::ClientConfig,
16708            ) -> gax::client_builder::Result<Self::Client> {
16709                Self::Client::new(config).await
16710            }
16711        }
16712    }
16713
16714    /// Common implementation for [crate::client::Participants] request builders.
16715    #[derive(Clone, Debug)]
16716    pub(crate) struct RequestBuilder<R: std::default::Default> {
16717        stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
16718        request: R,
16719        options: gax::options::RequestOptions,
16720    }
16721
16722    impl<R> RequestBuilder<R>
16723    where
16724        R: std::default::Default,
16725    {
16726        pub(crate) fn new(
16727            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
16728        ) -> Self {
16729            Self {
16730                stub,
16731                request: R::default(),
16732                options: gax::options::RequestOptions::default(),
16733            }
16734        }
16735    }
16736
16737    /// The request builder for [Participants::create_participant][crate::client::Participants::create_participant] calls.
16738    ///
16739    /// # Example
16740    /// ```no_run
16741    /// # use google_cloud_dialogflow_v2::builder;
16742    /// use builder::participants::CreateParticipant;
16743    /// # tokio_test::block_on(async {
16744    ///
16745    /// let builder = prepare_request_builder();
16746    /// let response = builder.send().await?;
16747    /// # gax::Result::<()>::Ok(()) });
16748    ///
16749    /// fn prepare_request_builder() -> CreateParticipant {
16750    ///   # panic!();
16751    ///   // ... details omitted ...
16752    /// }
16753    /// ```
16754    #[derive(Clone, Debug)]
16755    pub struct CreateParticipant(RequestBuilder<crate::model::CreateParticipantRequest>);
16756
16757    impl CreateParticipant {
16758        pub(crate) fn new(
16759            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
16760        ) -> Self {
16761            Self(RequestBuilder::new(stub))
16762        }
16763
16764        /// Sets the full request, replacing any prior values.
16765        pub fn with_request<V: Into<crate::model::CreateParticipantRequest>>(
16766            mut self,
16767            v: V,
16768        ) -> Self {
16769            self.0.request = v.into();
16770            self
16771        }
16772
16773        /// Sets all the options, replacing any prior values.
16774        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16775            self.0.options = v.into();
16776            self
16777        }
16778
16779        /// Sends the request.
16780        pub async fn send(self) -> Result<crate::model::Participant> {
16781            (*self.0.stub)
16782                .create_participant(self.0.request, self.0.options)
16783                .await
16784                .map(gax::response::Response::into_body)
16785        }
16786
16787        /// Sets the value of [parent][crate::model::CreateParticipantRequest::parent].
16788        ///
16789        /// This is a **required** field for requests.
16790        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16791            self.0.request.parent = v.into();
16792            self
16793        }
16794
16795        /// Sets the value of [participant][crate::model::CreateParticipantRequest::participant].
16796        ///
16797        /// This is a **required** field for requests.
16798        pub fn set_participant<T>(mut self, v: T) -> Self
16799        where
16800            T: std::convert::Into<crate::model::Participant>,
16801        {
16802            self.0.request.participant = std::option::Option::Some(v.into());
16803            self
16804        }
16805
16806        /// Sets or clears the value of [participant][crate::model::CreateParticipantRequest::participant].
16807        ///
16808        /// This is a **required** field for requests.
16809        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
16810        where
16811            T: std::convert::Into<crate::model::Participant>,
16812        {
16813            self.0.request.participant = v.map(|x| x.into());
16814            self
16815        }
16816    }
16817
16818    #[doc(hidden)]
16819    impl gax::options::internal::RequestBuilder for CreateParticipant {
16820        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16821            &mut self.0.options
16822        }
16823    }
16824
16825    /// The request builder for [Participants::get_participant][crate::client::Participants::get_participant] calls.
16826    ///
16827    /// # Example
16828    /// ```no_run
16829    /// # use google_cloud_dialogflow_v2::builder;
16830    /// use builder::participants::GetParticipant;
16831    /// # tokio_test::block_on(async {
16832    ///
16833    /// let builder = prepare_request_builder();
16834    /// let response = builder.send().await?;
16835    /// # gax::Result::<()>::Ok(()) });
16836    ///
16837    /// fn prepare_request_builder() -> GetParticipant {
16838    ///   # panic!();
16839    ///   // ... details omitted ...
16840    /// }
16841    /// ```
16842    #[derive(Clone, Debug)]
16843    pub struct GetParticipant(RequestBuilder<crate::model::GetParticipantRequest>);
16844
16845    impl GetParticipant {
16846        pub(crate) fn new(
16847            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
16848        ) -> Self {
16849            Self(RequestBuilder::new(stub))
16850        }
16851
16852        /// Sets the full request, replacing any prior values.
16853        pub fn with_request<V: Into<crate::model::GetParticipantRequest>>(mut self, v: V) -> Self {
16854            self.0.request = v.into();
16855            self
16856        }
16857
16858        /// Sets all the options, replacing any prior values.
16859        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16860            self.0.options = v.into();
16861            self
16862        }
16863
16864        /// Sends the request.
16865        pub async fn send(self) -> Result<crate::model::Participant> {
16866            (*self.0.stub)
16867                .get_participant(self.0.request, self.0.options)
16868                .await
16869                .map(gax::response::Response::into_body)
16870        }
16871
16872        /// Sets the value of [name][crate::model::GetParticipantRequest::name].
16873        ///
16874        /// This is a **required** field for requests.
16875        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16876            self.0.request.name = v.into();
16877            self
16878        }
16879    }
16880
16881    #[doc(hidden)]
16882    impl gax::options::internal::RequestBuilder for GetParticipant {
16883        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16884            &mut self.0.options
16885        }
16886    }
16887
16888    /// The request builder for [Participants::list_participants][crate::client::Participants::list_participants] calls.
16889    ///
16890    /// # Example
16891    /// ```no_run
16892    /// # use google_cloud_dialogflow_v2::builder;
16893    /// use builder::participants::ListParticipants;
16894    /// # tokio_test::block_on(async {
16895    /// use gax::paginator::ItemPaginator;
16896    ///
16897    /// let builder = prepare_request_builder();
16898    /// let mut items = builder.by_item();
16899    /// while let Some(result) = items.next().await {
16900    ///   let item = result?;
16901    /// }
16902    /// # gax::Result::<()>::Ok(()) });
16903    ///
16904    /// fn prepare_request_builder() -> ListParticipants {
16905    ///   # panic!();
16906    ///   // ... details omitted ...
16907    /// }
16908    /// ```
16909    #[derive(Clone, Debug)]
16910    pub struct ListParticipants(RequestBuilder<crate::model::ListParticipantsRequest>);
16911
16912    impl ListParticipants {
16913        pub(crate) fn new(
16914            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
16915        ) -> Self {
16916            Self(RequestBuilder::new(stub))
16917        }
16918
16919        /// Sets the full request, replacing any prior values.
16920        pub fn with_request<V: Into<crate::model::ListParticipantsRequest>>(
16921            mut self,
16922            v: V,
16923        ) -> Self {
16924            self.0.request = v.into();
16925            self
16926        }
16927
16928        /// Sets all the options, replacing any prior values.
16929        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16930            self.0.options = v.into();
16931            self
16932        }
16933
16934        /// Sends the request.
16935        pub async fn send(self) -> Result<crate::model::ListParticipantsResponse> {
16936            (*self.0.stub)
16937                .list_participants(self.0.request, self.0.options)
16938                .await
16939                .map(gax::response::Response::into_body)
16940        }
16941
16942        /// Streams each page in the collection.
16943        pub fn by_page(
16944            self,
16945        ) -> impl gax::paginator::Paginator<crate::model::ListParticipantsResponse, gax::error::Error>
16946        {
16947            use std::clone::Clone;
16948            let token = self.0.request.page_token.clone();
16949            let execute = move |token: String| {
16950                let mut builder = self.clone();
16951                builder.0.request = builder.0.request.set_page_token(token);
16952                builder.send()
16953            };
16954            gax::paginator::internal::new_paginator(token, execute)
16955        }
16956
16957        /// Streams each item in the collection.
16958        pub fn by_item(
16959            self,
16960        ) -> impl gax::paginator::ItemPaginator<crate::model::ListParticipantsResponse, gax::error::Error>
16961        {
16962            use gax::paginator::Paginator;
16963            self.by_page().items()
16964        }
16965
16966        /// Sets the value of [parent][crate::model::ListParticipantsRequest::parent].
16967        ///
16968        /// This is a **required** field for requests.
16969        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16970            self.0.request.parent = v.into();
16971            self
16972        }
16973
16974        /// Sets the value of [page_size][crate::model::ListParticipantsRequest::page_size].
16975        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16976            self.0.request.page_size = v.into();
16977            self
16978        }
16979
16980        /// Sets the value of [page_token][crate::model::ListParticipantsRequest::page_token].
16981        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16982            self.0.request.page_token = v.into();
16983            self
16984        }
16985    }
16986
16987    #[doc(hidden)]
16988    impl gax::options::internal::RequestBuilder for ListParticipants {
16989        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16990            &mut self.0.options
16991        }
16992    }
16993
16994    /// The request builder for [Participants::update_participant][crate::client::Participants::update_participant] calls.
16995    ///
16996    /// # Example
16997    /// ```no_run
16998    /// # use google_cloud_dialogflow_v2::builder;
16999    /// use builder::participants::UpdateParticipant;
17000    /// # tokio_test::block_on(async {
17001    ///
17002    /// let builder = prepare_request_builder();
17003    /// let response = builder.send().await?;
17004    /// # gax::Result::<()>::Ok(()) });
17005    ///
17006    /// fn prepare_request_builder() -> UpdateParticipant {
17007    ///   # panic!();
17008    ///   // ... details omitted ...
17009    /// }
17010    /// ```
17011    #[derive(Clone, Debug)]
17012    pub struct UpdateParticipant(RequestBuilder<crate::model::UpdateParticipantRequest>);
17013
17014    impl UpdateParticipant {
17015        pub(crate) fn new(
17016            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17017        ) -> Self {
17018            Self(RequestBuilder::new(stub))
17019        }
17020
17021        /// Sets the full request, replacing any prior values.
17022        pub fn with_request<V: Into<crate::model::UpdateParticipantRequest>>(
17023            mut self,
17024            v: V,
17025        ) -> Self {
17026            self.0.request = v.into();
17027            self
17028        }
17029
17030        /// Sets all the options, replacing any prior values.
17031        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17032            self.0.options = v.into();
17033            self
17034        }
17035
17036        /// Sends the request.
17037        pub async fn send(self) -> Result<crate::model::Participant> {
17038            (*self.0.stub)
17039                .update_participant(self.0.request, self.0.options)
17040                .await
17041                .map(gax::response::Response::into_body)
17042        }
17043
17044        /// Sets the value of [participant][crate::model::UpdateParticipantRequest::participant].
17045        ///
17046        /// This is a **required** field for requests.
17047        pub fn set_participant<T>(mut self, v: T) -> Self
17048        where
17049            T: std::convert::Into<crate::model::Participant>,
17050        {
17051            self.0.request.participant = std::option::Option::Some(v.into());
17052            self
17053        }
17054
17055        /// Sets or clears the value of [participant][crate::model::UpdateParticipantRequest::participant].
17056        ///
17057        /// This is a **required** field for requests.
17058        pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
17059        where
17060            T: std::convert::Into<crate::model::Participant>,
17061        {
17062            self.0.request.participant = v.map(|x| x.into());
17063            self
17064        }
17065
17066        /// Sets the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
17067        ///
17068        /// This is a **required** field for requests.
17069        pub fn set_update_mask<T>(mut self, v: T) -> Self
17070        where
17071            T: std::convert::Into<wkt::FieldMask>,
17072        {
17073            self.0.request.update_mask = std::option::Option::Some(v.into());
17074            self
17075        }
17076
17077        /// Sets or clears the value of [update_mask][crate::model::UpdateParticipantRequest::update_mask].
17078        ///
17079        /// This is a **required** field for requests.
17080        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17081        where
17082            T: std::convert::Into<wkt::FieldMask>,
17083        {
17084            self.0.request.update_mask = v.map(|x| x.into());
17085            self
17086        }
17087    }
17088
17089    #[doc(hidden)]
17090    impl gax::options::internal::RequestBuilder for UpdateParticipant {
17091        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17092            &mut self.0.options
17093        }
17094    }
17095
17096    /// The request builder for [Participants::analyze_content][crate::client::Participants::analyze_content] calls.
17097    ///
17098    /// # Example
17099    /// ```no_run
17100    /// # use google_cloud_dialogflow_v2::builder;
17101    /// use builder::participants::AnalyzeContent;
17102    /// # tokio_test::block_on(async {
17103    ///
17104    /// let builder = prepare_request_builder();
17105    /// let response = builder.send().await?;
17106    /// # gax::Result::<()>::Ok(()) });
17107    ///
17108    /// fn prepare_request_builder() -> AnalyzeContent {
17109    ///   # panic!();
17110    ///   // ... details omitted ...
17111    /// }
17112    /// ```
17113    #[derive(Clone, Debug)]
17114    pub struct AnalyzeContent(RequestBuilder<crate::model::AnalyzeContentRequest>);
17115
17116    impl AnalyzeContent {
17117        pub(crate) fn new(
17118            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17119        ) -> Self {
17120            Self(RequestBuilder::new(stub))
17121        }
17122
17123        /// Sets the full request, replacing any prior values.
17124        pub fn with_request<V: Into<crate::model::AnalyzeContentRequest>>(mut self, v: V) -> Self {
17125            self.0.request = v.into();
17126            self
17127        }
17128
17129        /// Sets all the options, replacing any prior values.
17130        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17131            self.0.options = v.into();
17132            self
17133        }
17134
17135        /// Sends the request.
17136        pub async fn send(self) -> Result<crate::model::AnalyzeContentResponse> {
17137            (*self.0.stub)
17138                .analyze_content(self.0.request, self.0.options)
17139                .await
17140                .map(gax::response::Response::into_body)
17141        }
17142
17143        /// Sets the value of [participant][crate::model::AnalyzeContentRequest::participant].
17144        ///
17145        /// This is a **required** field for requests.
17146        pub fn set_participant<T: Into<std::string::String>>(mut self, v: T) -> Self {
17147            self.0.request.participant = v.into();
17148            self
17149        }
17150
17151        /// Sets the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
17152        pub fn set_reply_audio_config<T>(mut self, v: T) -> Self
17153        where
17154            T: std::convert::Into<crate::model::OutputAudioConfig>,
17155        {
17156            self.0.request.reply_audio_config = std::option::Option::Some(v.into());
17157            self
17158        }
17159
17160        /// Sets or clears the value of [reply_audio_config][crate::model::AnalyzeContentRequest::reply_audio_config].
17161        pub fn set_or_clear_reply_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
17162        where
17163            T: std::convert::Into<crate::model::OutputAudioConfig>,
17164        {
17165            self.0.request.reply_audio_config = v.map(|x| x.into());
17166            self
17167        }
17168
17169        /// Sets the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
17170        pub fn set_query_params<T>(mut self, v: T) -> Self
17171        where
17172            T: std::convert::Into<crate::model::QueryParameters>,
17173        {
17174            self.0.request.query_params = std::option::Option::Some(v.into());
17175            self
17176        }
17177
17178        /// Sets or clears the value of [query_params][crate::model::AnalyzeContentRequest::query_params].
17179        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
17180        where
17181            T: std::convert::Into<crate::model::QueryParameters>,
17182        {
17183            self.0.request.query_params = v.map(|x| x.into());
17184            self
17185        }
17186
17187        /// Sets the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
17188        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
17189        where
17190            T: std::convert::Into<crate::model::AssistQueryParameters>,
17191        {
17192            self.0.request.assist_query_params = std::option::Option::Some(v.into());
17193            self
17194        }
17195
17196        /// Sets or clears the value of [assist_query_params][crate::model::AnalyzeContentRequest::assist_query_params].
17197        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
17198        where
17199            T: std::convert::Into<crate::model::AssistQueryParameters>,
17200        {
17201            self.0.request.assist_query_params = v.map(|x| x.into());
17202            self
17203        }
17204
17205        /// Sets the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
17206        pub fn set_cx_parameters<T>(mut self, v: T) -> Self
17207        where
17208            T: std::convert::Into<wkt::Struct>,
17209        {
17210            self.0.request.cx_parameters = std::option::Option::Some(v.into());
17211            self
17212        }
17213
17214        /// Sets or clears the value of [cx_parameters][crate::model::AnalyzeContentRequest::cx_parameters].
17215        pub fn set_or_clear_cx_parameters<T>(mut self, v: std::option::Option<T>) -> Self
17216        where
17217            T: std::convert::Into<wkt::Struct>,
17218        {
17219            self.0.request.cx_parameters = v.map(|x| x.into());
17220            self
17221        }
17222
17223        /// Sets the value of [request_id][crate::model::AnalyzeContentRequest::request_id].
17224        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17225            self.0.request.request_id = v.into();
17226            self
17227        }
17228
17229        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input].
17230        ///
17231        /// Note that all the setters affecting `input` are
17232        /// mutually exclusive.
17233        pub fn set_input<T: Into<Option<crate::model::analyze_content_request::Input>>>(
17234            mut self,
17235            v: T,
17236        ) -> Self {
17237            self.0.request.input = v.into();
17238            self
17239        }
17240
17241        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
17242        /// to hold a `TextInput`.
17243        ///
17244        /// Note that all the setters affecting `input` are
17245        /// mutually exclusive.
17246        pub fn set_text_input<T: std::convert::Into<std::boxed::Box<crate::model::TextInput>>>(
17247            mut self,
17248            v: T,
17249        ) -> Self {
17250            self.0.request = self.0.request.set_text_input(v);
17251            self
17252        }
17253
17254        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
17255        /// to hold a `AudioInput`.
17256        ///
17257        /// Note that all the setters affecting `input` are
17258        /// mutually exclusive.
17259        pub fn set_audio_input<T: std::convert::Into<std::boxed::Box<crate::model::AudioInput>>>(
17260            mut self,
17261            v: T,
17262        ) -> Self {
17263            self.0.request = self.0.request.set_audio_input(v);
17264            self
17265        }
17266
17267        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
17268        /// to hold a `EventInput`.
17269        ///
17270        /// Note that all the setters affecting `input` are
17271        /// mutually exclusive.
17272        pub fn set_event_input<T: std::convert::Into<std::boxed::Box<crate::model::EventInput>>>(
17273            mut self,
17274            v: T,
17275        ) -> Self {
17276            self.0.request = self.0.request.set_event_input(v);
17277            self
17278        }
17279
17280        /// Sets the value of [input][crate::model::AnalyzeContentRequest::input]
17281        /// to hold a `SuggestionInput`.
17282        ///
17283        /// Note that all the setters affecting `input` are
17284        /// mutually exclusive.
17285        pub fn set_suggestion_input<
17286            T: std::convert::Into<std::boxed::Box<crate::model::SuggestionInput>>,
17287        >(
17288            mut self,
17289            v: T,
17290        ) -> Self {
17291            self.0.request = self.0.request.set_suggestion_input(v);
17292            self
17293        }
17294    }
17295
17296    #[doc(hidden)]
17297    impl gax::options::internal::RequestBuilder for AnalyzeContent {
17298        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17299            &mut self.0.options
17300        }
17301    }
17302
17303    /// The request builder for [Participants::suggest_articles][crate::client::Participants::suggest_articles] calls.
17304    ///
17305    /// # Example
17306    /// ```no_run
17307    /// # use google_cloud_dialogflow_v2::builder;
17308    /// use builder::participants::SuggestArticles;
17309    /// # tokio_test::block_on(async {
17310    ///
17311    /// let builder = prepare_request_builder();
17312    /// let response = builder.send().await?;
17313    /// # gax::Result::<()>::Ok(()) });
17314    ///
17315    /// fn prepare_request_builder() -> SuggestArticles {
17316    ///   # panic!();
17317    ///   // ... details omitted ...
17318    /// }
17319    /// ```
17320    #[derive(Clone, Debug)]
17321    pub struct SuggestArticles(RequestBuilder<crate::model::SuggestArticlesRequest>);
17322
17323    impl SuggestArticles {
17324        pub(crate) fn new(
17325            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17326        ) -> Self {
17327            Self(RequestBuilder::new(stub))
17328        }
17329
17330        /// Sets the full request, replacing any prior values.
17331        pub fn with_request<V: Into<crate::model::SuggestArticlesRequest>>(mut self, v: V) -> Self {
17332            self.0.request = v.into();
17333            self
17334        }
17335
17336        /// Sets all the options, replacing any prior values.
17337        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17338            self.0.options = v.into();
17339            self
17340        }
17341
17342        /// Sends the request.
17343        pub async fn send(self) -> Result<crate::model::SuggestArticlesResponse> {
17344            (*self.0.stub)
17345                .suggest_articles(self.0.request, self.0.options)
17346                .await
17347                .map(gax::response::Response::into_body)
17348        }
17349
17350        /// Sets the value of [parent][crate::model::SuggestArticlesRequest::parent].
17351        ///
17352        /// This is a **required** field for requests.
17353        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17354            self.0.request.parent = v.into();
17355            self
17356        }
17357
17358        /// Sets the value of [latest_message][crate::model::SuggestArticlesRequest::latest_message].
17359        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
17360            self.0.request.latest_message = v.into();
17361            self
17362        }
17363
17364        /// Sets the value of [context_size][crate::model::SuggestArticlesRequest::context_size].
17365        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
17366            self.0.request.context_size = v.into();
17367            self
17368        }
17369
17370        /// Sets the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
17371        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
17372        where
17373            T: std::convert::Into<crate::model::AssistQueryParameters>,
17374        {
17375            self.0.request.assist_query_params = std::option::Option::Some(v.into());
17376            self
17377        }
17378
17379        /// Sets or clears the value of [assist_query_params][crate::model::SuggestArticlesRequest::assist_query_params].
17380        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
17381        where
17382            T: std::convert::Into<crate::model::AssistQueryParameters>,
17383        {
17384            self.0.request.assist_query_params = v.map(|x| x.into());
17385            self
17386        }
17387    }
17388
17389    #[doc(hidden)]
17390    impl gax::options::internal::RequestBuilder for SuggestArticles {
17391        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17392            &mut self.0.options
17393        }
17394    }
17395
17396    /// The request builder for [Participants::suggest_faq_answers][crate::client::Participants::suggest_faq_answers] calls.
17397    ///
17398    /// # Example
17399    /// ```no_run
17400    /// # use google_cloud_dialogflow_v2::builder;
17401    /// use builder::participants::SuggestFaqAnswers;
17402    /// # tokio_test::block_on(async {
17403    ///
17404    /// let builder = prepare_request_builder();
17405    /// let response = builder.send().await?;
17406    /// # gax::Result::<()>::Ok(()) });
17407    ///
17408    /// fn prepare_request_builder() -> SuggestFaqAnswers {
17409    ///   # panic!();
17410    ///   // ... details omitted ...
17411    /// }
17412    /// ```
17413    #[derive(Clone, Debug)]
17414    pub struct SuggestFaqAnswers(RequestBuilder<crate::model::SuggestFaqAnswersRequest>);
17415
17416    impl SuggestFaqAnswers {
17417        pub(crate) fn new(
17418            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17419        ) -> Self {
17420            Self(RequestBuilder::new(stub))
17421        }
17422
17423        /// Sets the full request, replacing any prior values.
17424        pub fn with_request<V: Into<crate::model::SuggestFaqAnswersRequest>>(
17425            mut self,
17426            v: V,
17427        ) -> Self {
17428            self.0.request = v.into();
17429            self
17430        }
17431
17432        /// Sets all the options, replacing any prior values.
17433        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17434            self.0.options = v.into();
17435            self
17436        }
17437
17438        /// Sends the request.
17439        pub async fn send(self) -> Result<crate::model::SuggestFaqAnswersResponse> {
17440            (*self.0.stub)
17441                .suggest_faq_answers(self.0.request, self.0.options)
17442                .await
17443                .map(gax::response::Response::into_body)
17444        }
17445
17446        /// Sets the value of [parent][crate::model::SuggestFaqAnswersRequest::parent].
17447        ///
17448        /// This is a **required** field for requests.
17449        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17450            self.0.request.parent = v.into();
17451            self
17452        }
17453
17454        /// Sets the value of [latest_message][crate::model::SuggestFaqAnswersRequest::latest_message].
17455        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
17456            self.0.request.latest_message = v.into();
17457            self
17458        }
17459
17460        /// Sets the value of [context_size][crate::model::SuggestFaqAnswersRequest::context_size].
17461        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
17462            self.0.request.context_size = v.into();
17463            self
17464        }
17465
17466        /// Sets the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
17467        pub fn set_assist_query_params<T>(mut self, v: T) -> Self
17468        where
17469            T: std::convert::Into<crate::model::AssistQueryParameters>,
17470        {
17471            self.0.request.assist_query_params = std::option::Option::Some(v.into());
17472            self
17473        }
17474
17475        /// Sets or clears the value of [assist_query_params][crate::model::SuggestFaqAnswersRequest::assist_query_params].
17476        pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
17477        where
17478            T: std::convert::Into<crate::model::AssistQueryParameters>,
17479        {
17480            self.0.request.assist_query_params = v.map(|x| x.into());
17481            self
17482        }
17483    }
17484
17485    #[doc(hidden)]
17486    impl gax::options::internal::RequestBuilder for SuggestFaqAnswers {
17487        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17488            &mut self.0.options
17489        }
17490    }
17491
17492    /// The request builder for [Participants::suggest_smart_replies][crate::client::Participants::suggest_smart_replies] calls.
17493    ///
17494    /// # Example
17495    /// ```no_run
17496    /// # use google_cloud_dialogflow_v2::builder;
17497    /// use builder::participants::SuggestSmartReplies;
17498    /// # tokio_test::block_on(async {
17499    ///
17500    /// let builder = prepare_request_builder();
17501    /// let response = builder.send().await?;
17502    /// # gax::Result::<()>::Ok(()) });
17503    ///
17504    /// fn prepare_request_builder() -> SuggestSmartReplies {
17505    ///   # panic!();
17506    ///   // ... details omitted ...
17507    /// }
17508    /// ```
17509    #[derive(Clone, Debug)]
17510    pub struct SuggestSmartReplies(RequestBuilder<crate::model::SuggestSmartRepliesRequest>);
17511
17512    impl SuggestSmartReplies {
17513        pub(crate) fn new(
17514            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17515        ) -> Self {
17516            Self(RequestBuilder::new(stub))
17517        }
17518
17519        /// Sets the full request, replacing any prior values.
17520        pub fn with_request<V: Into<crate::model::SuggestSmartRepliesRequest>>(
17521            mut self,
17522            v: V,
17523        ) -> Self {
17524            self.0.request = v.into();
17525            self
17526        }
17527
17528        /// Sets all the options, replacing any prior values.
17529        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17530            self.0.options = v.into();
17531            self
17532        }
17533
17534        /// Sends the request.
17535        pub async fn send(self) -> Result<crate::model::SuggestSmartRepliesResponse> {
17536            (*self.0.stub)
17537                .suggest_smart_replies(self.0.request, self.0.options)
17538                .await
17539                .map(gax::response::Response::into_body)
17540        }
17541
17542        /// Sets the value of [parent][crate::model::SuggestSmartRepliesRequest::parent].
17543        ///
17544        /// This is a **required** field for requests.
17545        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17546            self.0.request.parent = v.into();
17547            self
17548        }
17549
17550        /// Sets the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
17551        pub fn set_current_text_input<T>(mut self, v: T) -> Self
17552        where
17553            T: std::convert::Into<crate::model::TextInput>,
17554        {
17555            self.0.request.current_text_input = std::option::Option::Some(v.into());
17556            self
17557        }
17558
17559        /// Sets or clears the value of [current_text_input][crate::model::SuggestSmartRepliesRequest::current_text_input].
17560        pub fn set_or_clear_current_text_input<T>(mut self, v: std::option::Option<T>) -> Self
17561        where
17562            T: std::convert::Into<crate::model::TextInput>,
17563        {
17564            self.0.request.current_text_input = v.map(|x| x.into());
17565            self
17566        }
17567
17568        /// Sets the value of [latest_message][crate::model::SuggestSmartRepliesRequest::latest_message].
17569        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
17570            self.0.request.latest_message = v.into();
17571            self
17572        }
17573
17574        /// Sets the value of [context_size][crate::model::SuggestSmartRepliesRequest::context_size].
17575        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
17576            self.0.request.context_size = v.into();
17577            self
17578        }
17579    }
17580
17581    #[doc(hidden)]
17582    impl gax::options::internal::RequestBuilder for SuggestSmartReplies {
17583        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17584            &mut self.0.options
17585        }
17586    }
17587
17588    /// The request builder for [Participants::suggest_knowledge_assist][crate::client::Participants::suggest_knowledge_assist] calls.
17589    ///
17590    /// # Example
17591    /// ```no_run
17592    /// # use google_cloud_dialogflow_v2::builder;
17593    /// use builder::participants::SuggestKnowledgeAssist;
17594    /// # tokio_test::block_on(async {
17595    ///
17596    /// let builder = prepare_request_builder();
17597    /// let response = builder.send().await?;
17598    /// # gax::Result::<()>::Ok(()) });
17599    ///
17600    /// fn prepare_request_builder() -> SuggestKnowledgeAssist {
17601    ///   # panic!();
17602    ///   // ... details omitted ...
17603    /// }
17604    /// ```
17605    #[derive(Clone, Debug)]
17606    pub struct SuggestKnowledgeAssist(RequestBuilder<crate::model::SuggestKnowledgeAssistRequest>);
17607
17608    impl SuggestKnowledgeAssist {
17609        pub(crate) fn new(
17610            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17611        ) -> Self {
17612            Self(RequestBuilder::new(stub))
17613        }
17614
17615        /// Sets the full request, replacing any prior values.
17616        pub fn with_request<V: Into<crate::model::SuggestKnowledgeAssistRequest>>(
17617            mut self,
17618            v: V,
17619        ) -> Self {
17620            self.0.request = v.into();
17621            self
17622        }
17623
17624        /// Sets all the options, replacing any prior values.
17625        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17626            self.0.options = v.into();
17627            self
17628        }
17629
17630        /// Sends the request.
17631        pub async fn send(self) -> Result<crate::model::SuggestKnowledgeAssistResponse> {
17632            (*self.0.stub)
17633                .suggest_knowledge_assist(self.0.request, self.0.options)
17634                .await
17635                .map(gax::response::Response::into_body)
17636        }
17637
17638        /// Sets the value of [parent][crate::model::SuggestKnowledgeAssistRequest::parent].
17639        ///
17640        /// This is a **required** field for requests.
17641        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17642            self.0.request.parent = v.into();
17643            self
17644        }
17645
17646        /// Sets the value of [latest_message][crate::model::SuggestKnowledgeAssistRequest::latest_message].
17647        pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
17648            self.0.request.latest_message = v.into();
17649            self
17650        }
17651
17652        /// Sets the value of [context_size][crate::model::SuggestKnowledgeAssistRequest::context_size].
17653        pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
17654            self.0.request.context_size = v.into();
17655            self
17656        }
17657
17658        /// Sets the value of [previous_suggested_query][crate::model::SuggestKnowledgeAssistRequest::previous_suggested_query].
17659        pub fn set_previous_suggested_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
17660            self.0.request.previous_suggested_query = v.into();
17661            self
17662        }
17663    }
17664
17665    #[doc(hidden)]
17666    impl gax::options::internal::RequestBuilder for SuggestKnowledgeAssist {
17667        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17668            &mut self.0.options
17669        }
17670    }
17671
17672    /// The request builder for [Participants::list_locations][crate::client::Participants::list_locations] calls.
17673    ///
17674    /// # Example
17675    /// ```no_run
17676    /// # use google_cloud_dialogflow_v2::builder;
17677    /// use builder::participants::ListLocations;
17678    /// # tokio_test::block_on(async {
17679    /// use gax::paginator::ItemPaginator;
17680    ///
17681    /// let builder = prepare_request_builder();
17682    /// let mut items = builder.by_item();
17683    /// while let Some(result) = items.next().await {
17684    ///   let item = result?;
17685    /// }
17686    /// # gax::Result::<()>::Ok(()) });
17687    ///
17688    /// fn prepare_request_builder() -> ListLocations {
17689    ///   # panic!();
17690    ///   // ... details omitted ...
17691    /// }
17692    /// ```
17693    #[derive(Clone, Debug)]
17694    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
17695
17696    impl ListLocations {
17697        pub(crate) fn new(
17698            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17699        ) -> Self {
17700            Self(RequestBuilder::new(stub))
17701        }
17702
17703        /// Sets the full request, replacing any prior values.
17704        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
17705            mut self,
17706            v: V,
17707        ) -> Self {
17708            self.0.request = v.into();
17709            self
17710        }
17711
17712        /// Sets all the options, replacing any prior values.
17713        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17714            self.0.options = v.into();
17715            self
17716        }
17717
17718        /// Sends the request.
17719        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
17720            (*self.0.stub)
17721                .list_locations(self.0.request, self.0.options)
17722                .await
17723                .map(gax::response::Response::into_body)
17724        }
17725
17726        /// Streams each page in the collection.
17727        pub fn by_page(
17728            self,
17729        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
17730        {
17731            use std::clone::Clone;
17732            let token = self.0.request.page_token.clone();
17733            let execute = move |token: String| {
17734                let mut builder = self.clone();
17735                builder.0.request = builder.0.request.set_page_token(token);
17736                builder.send()
17737            };
17738            gax::paginator::internal::new_paginator(token, execute)
17739        }
17740
17741        /// Streams each item in the collection.
17742        pub fn by_item(
17743            self,
17744        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
17745        {
17746            use gax::paginator::Paginator;
17747            self.by_page().items()
17748        }
17749
17750        /// Sets the value of [name][location::model::ListLocationsRequest::name].
17751        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17752            self.0.request.name = v.into();
17753            self
17754        }
17755
17756        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
17757        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17758            self.0.request.filter = v.into();
17759            self
17760        }
17761
17762        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
17763        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17764            self.0.request.page_size = v.into();
17765            self
17766        }
17767
17768        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
17769        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17770            self.0.request.page_token = v.into();
17771            self
17772        }
17773    }
17774
17775    #[doc(hidden)]
17776    impl gax::options::internal::RequestBuilder for ListLocations {
17777        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17778            &mut self.0.options
17779        }
17780    }
17781
17782    /// The request builder for [Participants::get_location][crate::client::Participants::get_location] calls.
17783    ///
17784    /// # Example
17785    /// ```no_run
17786    /// # use google_cloud_dialogflow_v2::builder;
17787    /// use builder::participants::GetLocation;
17788    /// # tokio_test::block_on(async {
17789    ///
17790    /// let builder = prepare_request_builder();
17791    /// let response = builder.send().await?;
17792    /// # gax::Result::<()>::Ok(()) });
17793    ///
17794    /// fn prepare_request_builder() -> GetLocation {
17795    ///   # panic!();
17796    ///   // ... details omitted ...
17797    /// }
17798    /// ```
17799    #[derive(Clone, Debug)]
17800    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
17801
17802    impl GetLocation {
17803        pub(crate) fn new(
17804            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17805        ) -> Self {
17806            Self(RequestBuilder::new(stub))
17807        }
17808
17809        /// Sets the full request, replacing any prior values.
17810        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
17811            self.0.request = v.into();
17812            self
17813        }
17814
17815        /// Sets all the options, replacing any prior values.
17816        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17817            self.0.options = v.into();
17818            self
17819        }
17820
17821        /// Sends the request.
17822        pub async fn send(self) -> Result<location::model::Location> {
17823            (*self.0.stub)
17824                .get_location(self.0.request, self.0.options)
17825                .await
17826                .map(gax::response::Response::into_body)
17827        }
17828
17829        /// Sets the value of [name][location::model::GetLocationRequest::name].
17830        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17831            self.0.request.name = v.into();
17832            self
17833        }
17834    }
17835
17836    #[doc(hidden)]
17837    impl gax::options::internal::RequestBuilder for GetLocation {
17838        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17839            &mut self.0.options
17840        }
17841    }
17842
17843    /// The request builder for [Participants::list_operations][crate::client::Participants::list_operations] calls.
17844    ///
17845    /// # Example
17846    /// ```no_run
17847    /// # use google_cloud_dialogflow_v2::builder;
17848    /// use builder::participants::ListOperations;
17849    /// # tokio_test::block_on(async {
17850    /// use gax::paginator::ItemPaginator;
17851    ///
17852    /// let builder = prepare_request_builder();
17853    /// let mut items = builder.by_item();
17854    /// while let Some(result) = items.next().await {
17855    ///   let item = result?;
17856    /// }
17857    /// # gax::Result::<()>::Ok(()) });
17858    ///
17859    /// fn prepare_request_builder() -> ListOperations {
17860    ///   # panic!();
17861    ///   // ... details omitted ...
17862    /// }
17863    /// ```
17864    #[derive(Clone, Debug)]
17865    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
17866
17867    impl ListOperations {
17868        pub(crate) fn new(
17869            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17870        ) -> Self {
17871            Self(RequestBuilder::new(stub))
17872        }
17873
17874        /// Sets the full request, replacing any prior values.
17875        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
17876            mut self,
17877            v: V,
17878        ) -> Self {
17879            self.0.request = v.into();
17880            self
17881        }
17882
17883        /// Sets all the options, replacing any prior values.
17884        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17885            self.0.options = v.into();
17886            self
17887        }
17888
17889        /// Sends the request.
17890        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
17891            (*self.0.stub)
17892                .list_operations(self.0.request, self.0.options)
17893                .await
17894                .map(gax::response::Response::into_body)
17895        }
17896
17897        /// Streams each page in the collection.
17898        pub fn by_page(
17899            self,
17900        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
17901        {
17902            use std::clone::Clone;
17903            let token = self.0.request.page_token.clone();
17904            let execute = move |token: String| {
17905                let mut builder = self.clone();
17906                builder.0.request = builder.0.request.set_page_token(token);
17907                builder.send()
17908            };
17909            gax::paginator::internal::new_paginator(token, execute)
17910        }
17911
17912        /// Streams each item in the collection.
17913        pub fn by_item(
17914            self,
17915        ) -> impl gax::paginator::ItemPaginator<
17916            longrunning::model::ListOperationsResponse,
17917            gax::error::Error,
17918        > {
17919            use gax::paginator::Paginator;
17920            self.by_page().items()
17921        }
17922
17923        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
17924        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17925            self.0.request.name = v.into();
17926            self
17927        }
17928
17929        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
17930        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17931            self.0.request.filter = v.into();
17932            self
17933        }
17934
17935        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
17936        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17937            self.0.request.page_size = v.into();
17938            self
17939        }
17940
17941        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
17942        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17943            self.0.request.page_token = v.into();
17944            self
17945        }
17946
17947        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
17948        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17949            self.0.request.return_partial_success = v.into();
17950            self
17951        }
17952    }
17953
17954    #[doc(hidden)]
17955    impl gax::options::internal::RequestBuilder for ListOperations {
17956        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17957            &mut self.0.options
17958        }
17959    }
17960
17961    /// The request builder for [Participants::get_operation][crate::client::Participants::get_operation] calls.
17962    ///
17963    /// # Example
17964    /// ```no_run
17965    /// # use google_cloud_dialogflow_v2::builder;
17966    /// use builder::participants::GetOperation;
17967    /// # tokio_test::block_on(async {
17968    ///
17969    /// let builder = prepare_request_builder();
17970    /// let response = builder.send().await?;
17971    /// # gax::Result::<()>::Ok(()) });
17972    ///
17973    /// fn prepare_request_builder() -> GetOperation {
17974    ///   # panic!();
17975    ///   // ... details omitted ...
17976    /// }
17977    /// ```
17978    #[derive(Clone, Debug)]
17979    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
17980
17981    impl GetOperation {
17982        pub(crate) fn new(
17983            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17984        ) -> Self {
17985            Self(RequestBuilder::new(stub))
17986        }
17987
17988        /// Sets the full request, replacing any prior values.
17989        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
17990            mut self,
17991            v: V,
17992        ) -> Self {
17993            self.0.request = v.into();
17994            self
17995        }
17996
17997        /// Sets all the options, replacing any prior values.
17998        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17999            self.0.options = v.into();
18000            self
18001        }
18002
18003        /// Sends the request.
18004        pub async fn send(self) -> Result<longrunning::model::Operation> {
18005            (*self.0.stub)
18006                .get_operation(self.0.request, self.0.options)
18007                .await
18008                .map(gax::response::Response::into_body)
18009        }
18010
18011        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
18012        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18013            self.0.request.name = v.into();
18014            self
18015        }
18016    }
18017
18018    #[doc(hidden)]
18019    impl gax::options::internal::RequestBuilder for GetOperation {
18020        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18021            &mut self.0.options
18022        }
18023    }
18024
18025    /// The request builder for [Participants::cancel_operation][crate::client::Participants::cancel_operation] calls.
18026    ///
18027    /// # Example
18028    /// ```no_run
18029    /// # use google_cloud_dialogflow_v2::builder;
18030    /// use builder::participants::CancelOperation;
18031    /// # tokio_test::block_on(async {
18032    ///
18033    /// let builder = prepare_request_builder();
18034    /// let response = builder.send().await?;
18035    /// # gax::Result::<()>::Ok(()) });
18036    ///
18037    /// fn prepare_request_builder() -> CancelOperation {
18038    ///   # panic!();
18039    ///   // ... details omitted ...
18040    /// }
18041    /// ```
18042    #[derive(Clone, Debug)]
18043    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
18044
18045    impl CancelOperation {
18046        pub(crate) fn new(
18047            stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18048        ) -> Self {
18049            Self(RequestBuilder::new(stub))
18050        }
18051
18052        /// Sets the full request, replacing any prior values.
18053        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
18054            mut self,
18055            v: V,
18056        ) -> Self {
18057            self.0.request = v.into();
18058            self
18059        }
18060
18061        /// Sets all the options, replacing any prior values.
18062        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18063            self.0.options = v.into();
18064            self
18065        }
18066
18067        /// Sends the request.
18068        pub async fn send(self) -> Result<()> {
18069            (*self.0.stub)
18070                .cancel_operation(self.0.request, self.0.options)
18071                .await
18072                .map(gax::response::Response::into_body)
18073        }
18074
18075        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
18076        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18077            self.0.request.name = v.into();
18078            self
18079        }
18080    }
18081
18082    #[doc(hidden)]
18083    impl gax::options::internal::RequestBuilder for CancelOperation {
18084        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18085            &mut self.0.options
18086        }
18087    }
18088}
18089
18090#[cfg(feature = "sessions")]
18091#[cfg_attr(docsrs, doc(cfg(feature = "sessions")))]
18092pub mod sessions {
18093    use crate::Result;
18094
18095    /// A builder for [Sessions][crate::client::Sessions].
18096    ///
18097    /// ```
18098    /// # tokio_test::block_on(async {
18099    /// # use google_cloud_dialogflow_v2::*;
18100    /// # use builder::sessions::ClientBuilder;
18101    /// # use client::Sessions;
18102    /// let builder : ClientBuilder = Sessions::builder();
18103    /// let client = builder
18104    ///     .with_endpoint("https://dialogflow.googleapis.com")
18105    ///     .build().await?;
18106    /// # gax::client_builder::Result::<()>::Ok(()) });
18107    /// ```
18108    pub type ClientBuilder =
18109        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
18110
18111    pub(crate) mod client {
18112        use super::super::super::client::Sessions;
18113        pub struct Factory;
18114        impl gax::client_builder::internal::ClientFactory for Factory {
18115            type Client = Sessions;
18116            type Credentials = gaxi::options::Credentials;
18117            async fn build(
18118                self,
18119                config: gaxi::options::ClientConfig,
18120            ) -> gax::client_builder::Result<Self::Client> {
18121                Self::Client::new(config).await
18122            }
18123        }
18124    }
18125
18126    /// Common implementation for [crate::client::Sessions] request builders.
18127    #[derive(Clone, Debug)]
18128    pub(crate) struct RequestBuilder<R: std::default::Default> {
18129        stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>,
18130        request: R,
18131        options: gax::options::RequestOptions,
18132    }
18133
18134    impl<R> RequestBuilder<R>
18135    where
18136        R: std::default::Default,
18137    {
18138        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18139            Self {
18140                stub,
18141                request: R::default(),
18142                options: gax::options::RequestOptions::default(),
18143            }
18144        }
18145    }
18146
18147    /// The request builder for [Sessions::detect_intent][crate::client::Sessions::detect_intent] calls.
18148    ///
18149    /// # Example
18150    /// ```no_run
18151    /// # use google_cloud_dialogflow_v2::builder;
18152    /// use builder::sessions::DetectIntent;
18153    /// # tokio_test::block_on(async {
18154    ///
18155    /// let builder = prepare_request_builder();
18156    /// let response = builder.send().await?;
18157    /// # gax::Result::<()>::Ok(()) });
18158    ///
18159    /// fn prepare_request_builder() -> DetectIntent {
18160    ///   # panic!();
18161    ///   // ... details omitted ...
18162    /// }
18163    /// ```
18164    #[derive(Clone, Debug)]
18165    pub struct DetectIntent(RequestBuilder<crate::model::DetectIntentRequest>);
18166
18167    impl DetectIntent {
18168        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18169            Self(RequestBuilder::new(stub))
18170        }
18171
18172        /// Sets the full request, replacing any prior values.
18173        pub fn with_request<V: Into<crate::model::DetectIntentRequest>>(mut self, v: V) -> Self {
18174            self.0.request = v.into();
18175            self
18176        }
18177
18178        /// Sets all the options, replacing any prior values.
18179        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18180            self.0.options = v.into();
18181            self
18182        }
18183
18184        /// Sends the request.
18185        pub async fn send(self) -> Result<crate::model::DetectIntentResponse> {
18186            (*self.0.stub)
18187                .detect_intent(self.0.request, self.0.options)
18188                .await
18189                .map(gax::response::Response::into_body)
18190        }
18191
18192        /// Sets the value of [session][crate::model::DetectIntentRequest::session].
18193        ///
18194        /// This is a **required** field for requests.
18195        pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
18196            self.0.request.session = v.into();
18197            self
18198        }
18199
18200        /// Sets the value of [query_params][crate::model::DetectIntentRequest::query_params].
18201        pub fn set_query_params<T>(mut self, v: T) -> Self
18202        where
18203            T: std::convert::Into<crate::model::QueryParameters>,
18204        {
18205            self.0.request.query_params = std::option::Option::Some(v.into());
18206            self
18207        }
18208
18209        /// Sets or clears the value of [query_params][crate::model::DetectIntentRequest::query_params].
18210        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18211        where
18212            T: std::convert::Into<crate::model::QueryParameters>,
18213        {
18214            self.0.request.query_params = v.map(|x| x.into());
18215            self
18216        }
18217
18218        /// Sets the value of [query_input][crate::model::DetectIntentRequest::query_input].
18219        ///
18220        /// This is a **required** field for requests.
18221        pub fn set_query_input<T>(mut self, v: T) -> Self
18222        where
18223            T: std::convert::Into<crate::model::QueryInput>,
18224        {
18225            self.0.request.query_input = std::option::Option::Some(v.into());
18226            self
18227        }
18228
18229        /// Sets or clears the value of [query_input][crate::model::DetectIntentRequest::query_input].
18230        ///
18231        /// This is a **required** field for requests.
18232        pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
18233        where
18234            T: std::convert::Into<crate::model::QueryInput>,
18235        {
18236            self.0.request.query_input = v.map(|x| x.into());
18237            self
18238        }
18239
18240        /// Sets the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
18241        pub fn set_output_audio_config<T>(mut self, v: T) -> Self
18242        where
18243            T: std::convert::Into<crate::model::OutputAudioConfig>,
18244        {
18245            self.0.request.output_audio_config = std::option::Option::Some(v.into());
18246            self
18247        }
18248
18249        /// Sets or clears the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
18250        pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
18251        where
18252            T: std::convert::Into<crate::model::OutputAudioConfig>,
18253        {
18254            self.0.request.output_audio_config = v.map(|x| x.into());
18255            self
18256        }
18257
18258        /// Sets the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
18259        pub fn set_output_audio_config_mask<T>(mut self, v: T) -> Self
18260        where
18261            T: std::convert::Into<wkt::FieldMask>,
18262        {
18263            self.0.request.output_audio_config_mask = std::option::Option::Some(v.into());
18264            self
18265        }
18266
18267        /// Sets or clears the value of [output_audio_config_mask][crate::model::DetectIntentRequest::output_audio_config_mask].
18268        pub fn set_or_clear_output_audio_config_mask<T>(mut self, v: std::option::Option<T>) -> Self
18269        where
18270            T: std::convert::Into<wkt::FieldMask>,
18271        {
18272            self.0.request.output_audio_config_mask = v.map(|x| x.into());
18273            self
18274        }
18275
18276        /// Sets the value of [input_audio][crate::model::DetectIntentRequest::input_audio].
18277        pub fn set_input_audio<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
18278            self.0.request.input_audio = v.into();
18279            self
18280        }
18281    }
18282
18283    #[doc(hidden)]
18284    impl gax::options::internal::RequestBuilder for DetectIntent {
18285        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18286            &mut self.0.options
18287        }
18288    }
18289
18290    /// The request builder for [Sessions::list_locations][crate::client::Sessions::list_locations] calls.
18291    ///
18292    /// # Example
18293    /// ```no_run
18294    /// # use google_cloud_dialogflow_v2::builder;
18295    /// use builder::sessions::ListLocations;
18296    /// # tokio_test::block_on(async {
18297    /// use gax::paginator::ItemPaginator;
18298    ///
18299    /// let builder = prepare_request_builder();
18300    /// let mut items = builder.by_item();
18301    /// while let Some(result) = items.next().await {
18302    ///   let item = result?;
18303    /// }
18304    /// # gax::Result::<()>::Ok(()) });
18305    ///
18306    /// fn prepare_request_builder() -> ListLocations {
18307    ///   # panic!();
18308    ///   // ... details omitted ...
18309    /// }
18310    /// ```
18311    #[derive(Clone, Debug)]
18312    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
18313
18314    impl ListLocations {
18315        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18316            Self(RequestBuilder::new(stub))
18317        }
18318
18319        /// Sets the full request, replacing any prior values.
18320        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
18321            mut self,
18322            v: V,
18323        ) -> Self {
18324            self.0.request = v.into();
18325            self
18326        }
18327
18328        /// Sets all the options, replacing any prior values.
18329        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18330            self.0.options = v.into();
18331            self
18332        }
18333
18334        /// Sends the request.
18335        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
18336            (*self.0.stub)
18337                .list_locations(self.0.request, self.0.options)
18338                .await
18339                .map(gax::response::Response::into_body)
18340        }
18341
18342        /// Streams each page in the collection.
18343        pub fn by_page(
18344            self,
18345        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
18346        {
18347            use std::clone::Clone;
18348            let token = self.0.request.page_token.clone();
18349            let execute = move |token: String| {
18350                let mut builder = self.clone();
18351                builder.0.request = builder.0.request.set_page_token(token);
18352                builder.send()
18353            };
18354            gax::paginator::internal::new_paginator(token, execute)
18355        }
18356
18357        /// Streams each item in the collection.
18358        pub fn by_item(
18359            self,
18360        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
18361        {
18362            use gax::paginator::Paginator;
18363            self.by_page().items()
18364        }
18365
18366        /// Sets the value of [name][location::model::ListLocationsRequest::name].
18367        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18368            self.0.request.name = v.into();
18369            self
18370        }
18371
18372        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
18373        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18374            self.0.request.filter = v.into();
18375            self
18376        }
18377
18378        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
18379        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18380            self.0.request.page_size = v.into();
18381            self
18382        }
18383
18384        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
18385        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18386            self.0.request.page_token = v.into();
18387            self
18388        }
18389    }
18390
18391    #[doc(hidden)]
18392    impl gax::options::internal::RequestBuilder for ListLocations {
18393        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18394            &mut self.0.options
18395        }
18396    }
18397
18398    /// The request builder for [Sessions::get_location][crate::client::Sessions::get_location] calls.
18399    ///
18400    /// # Example
18401    /// ```no_run
18402    /// # use google_cloud_dialogflow_v2::builder;
18403    /// use builder::sessions::GetLocation;
18404    /// # tokio_test::block_on(async {
18405    ///
18406    /// let builder = prepare_request_builder();
18407    /// let response = builder.send().await?;
18408    /// # gax::Result::<()>::Ok(()) });
18409    ///
18410    /// fn prepare_request_builder() -> GetLocation {
18411    ///   # panic!();
18412    ///   // ... details omitted ...
18413    /// }
18414    /// ```
18415    #[derive(Clone, Debug)]
18416    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
18417
18418    impl GetLocation {
18419        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18420            Self(RequestBuilder::new(stub))
18421        }
18422
18423        /// Sets the full request, replacing any prior values.
18424        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
18425            self.0.request = v.into();
18426            self
18427        }
18428
18429        /// Sets all the options, replacing any prior values.
18430        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18431            self.0.options = v.into();
18432            self
18433        }
18434
18435        /// Sends the request.
18436        pub async fn send(self) -> Result<location::model::Location> {
18437            (*self.0.stub)
18438                .get_location(self.0.request, self.0.options)
18439                .await
18440                .map(gax::response::Response::into_body)
18441        }
18442
18443        /// Sets the value of [name][location::model::GetLocationRequest::name].
18444        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18445            self.0.request.name = v.into();
18446            self
18447        }
18448    }
18449
18450    #[doc(hidden)]
18451    impl gax::options::internal::RequestBuilder for GetLocation {
18452        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18453            &mut self.0.options
18454        }
18455    }
18456
18457    /// The request builder for [Sessions::list_operations][crate::client::Sessions::list_operations] calls.
18458    ///
18459    /// # Example
18460    /// ```no_run
18461    /// # use google_cloud_dialogflow_v2::builder;
18462    /// use builder::sessions::ListOperations;
18463    /// # tokio_test::block_on(async {
18464    /// use gax::paginator::ItemPaginator;
18465    ///
18466    /// let builder = prepare_request_builder();
18467    /// let mut items = builder.by_item();
18468    /// while let Some(result) = items.next().await {
18469    ///   let item = result?;
18470    /// }
18471    /// # gax::Result::<()>::Ok(()) });
18472    ///
18473    /// fn prepare_request_builder() -> ListOperations {
18474    ///   # panic!();
18475    ///   // ... details omitted ...
18476    /// }
18477    /// ```
18478    #[derive(Clone, Debug)]
18479    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
18480
18481    impl ListOperations {
18482        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18483            Self(RequestBuilder::new(stub))
18484        }
18485
18486        /// Sets the full request, replacing any prior values.
18487        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
18488            mut self,
18489            v: V,
18490        ) -> Self {
18491            self.0.request = v.into();
18492            self
18493        }
18494
18495        /// Sets all the options, replacing any prior values.
18496        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18497            self.0.options = v.into();
18498            self
18499        }
18500
18501        /// Sends the request.
18502        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
18503            (*self.0.stub)
18504                .list_operations(self.0.request, self.0.options)
18505                .await
18506                .map(gax::response::Response::into_body)
18507        }
18508
18509        /// Streams each page in the collection.
18510        pub fn by_page(
18511            self,
18512        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
18513        {
18514            use std::clone::Clone;
18515            let token = self.0.request.page_token.clone();
18516            let execute = move |token: String| {
18517                let mut builder = self.clone();
18518                builder.0.request = builder.0.request.set_page_token(token);
18519                builder.send()
18520            };
18521            gax::paginator::internal::new_paginator(token, execute)
18522        }
18523
18524        /// Streams each item in the collection.
18525        pub fn by_item(
18526            self,
18527        ) -> impl gax::paginator::ItemPaginator<
18528            longrunning::model::ListOperationsResponse,
18529            gax::error::Error,
18530        > {
18531            use gax::paginator::Paginator;
18532            self.by_page().items()
18533        }
18534
18535        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
18536        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18537            self.0.request.name = v.into();
18538            self
18539        }
18540
18541        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
18542        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18543            self.0.request.filter = v.into();
18544            self
18545        }
18546
18547        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
18548        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18549            self.0.request.page_size = v.into();
18550            self
18551        }
18552
18553        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
18554        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18555            self.0.request.page_token = v.into();
18556            self
18557        }
18558
18559        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
18560        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
18561            self.0.request.return_partial_success = v.into();
18562            self
18563        }
18564    }
18565
18566    #[doc(hidden)]
18567    impl gax::options::internal::RequestBuilder for ListOperations {
18568        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18569            &mut self.0.options
18570        }
18571    }
18572
18573    /// The request builder for [Sessions::get_operation][crate::client::Sessions::get_operation] calls.
18574    ///
18575    /// # Example
18576    /// ```no_run
18577    /// # use google_cloud_dialogflow_v2::builder;
18578    /// use builder::sessions::GetOperation;
18579    /// # tokio_test::block_on(async {
18580    ///
18581    /// let builder = prepare_request_builder();
18582    /// let response = builder.send().await?;
18583    /// # gax::Result::<()>::Ok(()) });
18584    ///
18585    /// fn prepare_request_builder() -> GetOperation {
18586    ///   # panic!();
18587    ///   // ... details omitted ...
18588    /// }
18589    /// ```
18590    #[derive(Clone, Debug)]
18591    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
18592
18593    impl GetOperation {
18594        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
18595            Self(RequestBuilder::new(stub))
18596        }
18597
18598        /// Sets the full request, replacing any prior values.
18599        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
18600            mut self,
18601            v: V,
18602        ) -> Self {
18603            self.0.request = v.into();
18604            self
18605        }
18606
18607        /// Sets all the options, replacing any prior values.
18608        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18609            self.0.options = v.into();
18610            self
18611        }
18612
18613        /// Sends the request.
18614        pub async fn send(self) -> Result<longrunning::model::Operation> {
18615            (*self.0.stub)
18616                .get_operation(self.0.request, self.0.options)
18617                .await
18618                .map(gax::response::Response::into_body)
18619        }
18620
18621        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
18622        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18623            self.0.request.name = v.into();
18624            self
18625        }
18626    }
18627
18628    #[doc(hidden)]
18629    impl gax::options::internal::RequestBuilder for GetOperation {
18630        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18631            &mut self.0.options
18632        }
18633    }
18634
18635    /// The request builder for [Sessions::cancel_operation][crate::client::Sessions::cancel_operation] calls.
18636    ///
18637    /// # Example
18638    /// ```no_run
18639    /// # use google_cloud_dialogflow_v2::builder;
18640    /// use builder::sessions::CancelOperation;
18641    /// # tokio_test::block_on(async {
18642    ///
18643    /// let builder = prepare_request_builder();
18644    /// let response = builder.send().await?;
18645    /// # gax::Result::<()>::Ok(()) });
18646    ///
18647    /// fn prepare_request_builder() -> CancelOperation {
18648    ///   # panic!();
18649    ///   // ... details omitted ...
18650    /// }
18651    /// ```
18652    #[derive(Clone, Debug)]
18653    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
18654
18655    impl CancelOperation {
18656        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> 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::CancelOperationRequest>>(
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<()> {
18677            (*self.0.stub)
18678                .cancel_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::CancelOperationRequest::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 CancelOperation {
18692        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18693            &mut self.0.options
18694        }
18695    }
18696}
18697
18698#[cfg(feature = "session-entity-types")]
18699#[cfg_attr(docsrs, doc(cfg(feature = "session-entity-types")))]
18700pub mod session_entity_types {
18701    use crate::Result;
18702
18703    /// A builder for [SessionEntityTypes][crate::client::SessionEntityTypes].
18704    ///
18705    /// ```
18706    /// # tokio_test::block_on(async {
18707    /// # use google_cloud_dialogflow_v2::*;
18708    /// # use builder::session_entity_types::ClientBuilder;
18709    /// # use client::SessionEntityTypes;
18710    /// let builder : ClientBuilder = SessionEntityTypes::builder();
18711    /// let client = builder
18712    ///     .with_endpoint("https://dialogflow.googleapis.com")
18713    ///     .build().await?;
18714    /// # gax::client_builder::Result::<()>::Ok(()) });
18715    /// ```
18716    pub type ClientBuilder =
18717        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
18718
18719    pub(crate) mod client {
18720        use super::super::super::client::SessionEntityTypes;
18721        pub struct Factory;
18722        impl gax::client_builder::internal::ClientFactory for Factory {
18723            type Client = SessionEntityTypes;
18724            type Credentials = gaxi::options::Credentials;
18725            async fn build(
18726                self,
18727                config: gaxi::options::ClientConfig,
18728            ) -> gax::client_builder::Result<Self::Client> {
18729                Self::Client::new(config).await
18730            }
18731        }
18732    }
18733
18734    /// Common implementation for [crate::client::SessionEntityTypes] request builders.
18735    #[derive(Clone, Debug)]
18736    pub(crate) struct RequestBuilder<R: std::default::Default> {
18737        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
18738        request: R,
18739        options: gax::options::RequestOptions,
18740    }
18741
18742    impl<R> RequestBuilder<R>
18743    where
18744        R: std::default::Default,
18745    {
18746        pub(crate) fn new(
18747            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
18748        ) -> Self {
18749            Self {
18750                stub,
18751                request: R::default(),
18752                options: gax::options::RequestOptions::default(),
18753            }
18754        }
18755    }
18756
18757    /// The request builder for [SessionEntityTypes::list_session_entity_types][crate::client::SessionEntityTypes::list_session_entity_types] calls.
18758    ///
18759    /// # Example
18760    /// ```no_run
18761    /// # use google_cloud_dialogflow_v2::builder;
18762    /// use builder::session_entity_types::ListSessionEntityTypes;
18763    /// # tokio_test::block_on(async {
18764    /// use gax::paginator::ItemPaginator;
18765    ///
18766    /// let builder = prepare_request_builder();
18767    /// let mut items = builder.by_item();
18768    /// while let Some(result) = items.next().await {
18769    ///   let item = result?;
18770    /// }
18771    /// # gax::Result::<()>::Ok(()) });
18772    ///
18773    /// fn prepare_request_builder() -> ListSessionEntityTypes {
18774    ///   # panic!();
18775    ///   // ... details omitted ...
18776    /// }
18777    /// ```
18778    #[derive(Clone, Debug)]
18779    pub struct ListSessionEntityTypes(RequestBuilder<crate::model::ListSessionEntityTypesRequest>);
18780
18781    impl ListSessionEntityTypes {
18782        pub(crate) fn new(
18783            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
18784        ) -> Self {
18785            Self(RequestBuilder::new(stub))
18786        }
18787
18788        /// Sets the full request, replacing any prior values.
18789        pub fn with_request<V: Into<crate::model::ListSessionEntityTypesRequest>>(
18790            mut self,
18791            v: V,
18792        ) -> Self {
18793            self.0.request = v.into();
18794            self
18795        }
18796
18797        /// Sets all the options, replacing any prior values.
18798        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18799            self.0.options = v.into();
18800            self
18801        }
18802
18803        /// Sends the request.
18804        pub async fn send(self) -> Result<crate::model::ListSessionEntityTypesResponse> {
18805            (*self.0.stub)
18806                .list_session_entity_types(self.0.request, self.0.options)
18807                .await
18808                .map(gax::response::Response::into_body)
18809        }
18810
18811        /// Streams each page in the collection.
18812        pub fn by_page(
18813            self,
18814        ) -> impl gax::paginator::Paginator<
18815            crate::model::ListSessionEntityTypesResponse,
18816            gax::error::Error,
18817        > {
18818            use std::clone::Clone;
18819            let token = self.0.request.page_token.clone();
18820            let execute = move |token: String| {
18821                let mut builder = self.clone();
18822                builder.0.request = builder.0.request.set_page_token(token);
18823                builder.send()
18824            };
18825            gax::paginator::internal::new_paginator(token, execute)
18826        }
18827
18828        /// Streams each item in the collection.
18829        pub fn by_item(
18830            self,
18831        ) -> impl gax::paginator::ItemPaginator<
18832            crate::model::ListSessionEntityTypesResponse,
18833            gax::error::Error,
18834        > {
18835            use gax::paginator::Paginator;
18836            self.by_page().items()
18837        }
18838
18839        /// Sets the value of [parent][crate::model::ListSessionEntityTypesRequest::parent].
18840        ///
18841        /// This is a **required** field for requests.
18842        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18843            self.0.request.parent = v.into();
18844            self
18845        }
18846
18847        /// Sets the value of [page_size][crate::model::ListSessionEntityTypesRequest::page_size].
18848        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18849            self.0.request.page_size = v.into();
18850            self
18851        }
18852
18853        /// Sets the value of [page_token][crate::model::ListSessionEntityTypesRequest::page_token].
18854        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18855            self.0.request.page_token = v.into();
18856            self
18857        }
18858    }
18859
18860    #[doc(hidden)]
18861    impl gax::options::internal::RequestBuilder for ListSessionEntityTypes {
18862        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18863            &mut self.0.options
18864        }
18865    }
18866
18867    /// The request builder for [SessionEntityTypes::get_session_entity_type][crate::client::SessionEntityTypes::get_session_entity_type] calls.
18868    ///
18869    /// # Example
18870    /// ```no_run
18871    /// # use google_cloud_dialogflow_v2::builder;
18872    /// use builder::session_entity_types::GetSessionEntityType;
18873    /// # tokio_test::block_on(async {
18874    ///
18875    /// let builder = prepare_request_builder();
18876    /// let response = builder.send().await?;
18877    /// # gax::Result::<()>::Ok(()) });
18878    ///
18879    /// fn prepare_request_builder() -> GetSessionEntityType {
18880    ///   # panic!();
18881    ///   // ... details omitted ...
18882    /// }
18883    /// ```
18884    #[derive(Clone, Debug)]
18885    pub struct GetSessionEntityType(RequestBuilder<crate::model::GetSessionEntityTypeRequest>);
18886
18887    impl GetSessionEntityType {
18888        pub(crate) fn new(
18889            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
18890        ) -> Self {
18891            Self(RequestBuilder::new(stub))
18892        }
18893
18894        /// Sets the full request, replacing any prior values.
18895        pub fn with_request<V: Into<crate::model::GetSessionEntityTypeRequest>>(
18896            mut self,
18897            v: V,
18898        ) -> Self {
18899            self.0.request = v.into();
18900            self
18901        }
18902
18903        /// Sets all the options, replacing any prior values.
18904        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18905            self.0.options = v.into();
18906            self
18907        }
18908
18909        /// Sends the request.
18910        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
18911            (*self.0.stub)
18912                .get_session_entity_type(self.0.request, self.0.options)
18913                .await
18914                .map(gax::response::Response::into_body)
18915        }
18916
18917        /// Sets the value of [name][crate::model::GetSessionEntityTypeRequest::name].
18918        ///
18919        /// This is a **required** field for requests.
18920        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18921            self.0.request.name = v.into();
18922            self
18923        }
18924    }
18925
18926    #[doc(hidden)]
18927    impl gax::options::internal::RequestBuilder for GetSessionEntityType {
18928        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18929            &mut self.0.options
18930        }
18931    }
18932
18933    /// The request builder for [SessionEntityTypes::create_session_entity_type][crate::client::SessionEntityTypes::create_session_entity_type] calls.
18934    ///
18935    /// # Example
18936    /// ```no_run
18937    /// # use google_cloud_dialogflow_v2::builder;
18938    /// use builder::session_entity_types::CreateSessionEntityType;
18939    /// # tokio_test::block_on(async {
18940    ///
18941    /// let builder = prepare_request_builder();
18942    /// let response = builder.send().await?;
18943    /// # gax::Result::<()>::Ok(()) });
18944    ///
18945    /// fn prepare_request_builder() -> CreateSessionEntityType {
18946    ///   # panic!();
18947    ///   // ... details omitted ...
18948    /// }
18949    /// ```
18950    #[derive(Clone, Debug)]
18951    pub struct CreateSessionEntityType(
18952        RequestBuilder<crate::model::CreateSessionEntityTypeRequest>,
18953    );
18954
18955    impl CreateSessionEntityType {
18956        pub(crate) fn new(
18957            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
18958        ) -> Self {
18959            Self(RequestBuilder::new(stub))
18960        }
18961
18962        /// Sets the full request, replacing any prior values.
18963        pub fn with_request<V: Into<crate::model::CreateSessionEntityTypeRequest>>(
18964            mut self,
18965            v: V,
18966        ) -> Self {
18967            self.0.request = v.into();
18968            self
18969        }
18970
18971        /// Sets all the options, replacing any prior values.
18972        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18973            self.0.options = v.into();
18974            self
18975        }
18976
18977        /// Sends the request.
18978        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
18979            (*self.0.stub)
18980                .create_session_entity_type(self.0.request, self.0.options)
18981                .await
18982                .map(gax::response::Response::into_body)
18983        }
18984
18985        /// Sets the value of [parent][crate::model::CreateSessionEntityTypeRequest::parent].
18986        ///
18987        /// This is a **required** field for requests.
18988        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18989            self.0.request.parent = v.into();
18990            self
18991        }
18992
18993        /// Sets the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
18994        ///
18995        /// This is a **required** field for requests.
18996        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
18997        where
18998            T: std::convert::Into<crate::model::SessionEntityType>,
18999        {
19000            self.0.request.session_entity_type = std::option::Option::Some(v.into());
19001            self
19002        }
19003
19004        /// Sets or clears the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
19005        ///
19006        /// This is a **required** field for requests.
19007        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
19008        where
19009            T: std::convert::Into<crate::model::SessionEntityType>,
19010        {
19011            self.0.request.session_entity_type = v.map(|x| x.into());
19012            self
19013        }
19014    }
19015
19016    #[doc(hidden)]
19017    impl gax::options::internal::RequestBuilder for CreateSessionEntityType {
19018        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19019            &mut self.0.options
19020        }
19021    }
19022
19023    /// The request builder for [SessionEntityTypes::update_session_entity_type][crate::client::SessionEntityTypes::update_session_entity_type] calls.
19024    ///
19025    /// # Example
19026    /// ```no_run
19027    /// # use google_cloud_dialogflow_v2::builder;
19028    /// use builder::session_entity_types::UpdateSessionEntityType;
19029    /// # tokio_test::block_on(async {
19030    ///
19031    /// let builder = prepare_request_builder();
19032    /// let response = builder.send().await?;
19033    /// # gax::Result::<()>::Ok(()) });
19034    ///
19035    /// fn prepare_request_builder() -> UpdateSessionEntityType {
19036    ///   # panic!();
19037    ///   // ... details omitted ...
19038    /// }
19039    /// ```
19040    #[derive(Clone, Debug)]
19041    pub struct UpdateSessionEntityType(
19042        RequestBuilder<crate::model::UpdateSessionEntityTypeRequest>,
19043    );
19044
19045    impl UpdateSessionEntityType {
19046        pub(crate) fn new(
19047            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19048        ) -> Self {
19049            Self(RequestBuilder::new(stub))
19050        }
19051
19052        /// Sets the full request, replacing any prior values.
19053        pub fn with_request<V: Into<crate::model::UpdateSessionEntityTypeRequest>>(
19054            mut self,
19055            v: V,
19056        ) -> Self {
19057            self.0.request = v.into();
19058            self
19059        }
19060
19061        /// Sets all the options, replacing any prior values.
19062        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19063            self.0.options = v.into();
19064            self
19065        }
19066
19067        /// Sends the request.
19068        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
19069            (*self.0.stub)
19070                .update_session_entity_type(self.0.request, self.0.options)
19071                .await
19072                .map(gax::response::Response::into_body)
19073        }
19074
19075        /// Sets the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
19076        ///
19077        /// This is a **required** field for requests.
19078        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
19079        where
19080            T: std::convert::Into<crate::model::SessionEntityType>,
19081        {
19082            self.0.request.session_entity_type = std::option::Option::Some(v.into());
19083            self
19084        }
19085
19086        /// Sets or clears the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
19087        ///
19088        /// This is a **required** field for requests.
19089        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
19090        where
19091            T: std::convert::Into<crate::model::SessionEntityType>,
19092        {
19093            self.0.request.session_entity_type = v.map(|x| x.into());
19094            self
19095        }
19096
19097        /// Sets the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
19098        pub fn set_update_mask<T>(mut self, v: T) -> Self
19099        where
19100            T: std::convert::Into<wkt::FieldMask>,
19101        {
19102            self.0.request.update_mask = std::option::Option::Some(v.into());
19103            self
19104        }
19105
19106        /// Sets or clears the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
19107        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19108        where
19109            T: std::convert::Into<wkt::FieldMask>,
19110        {
19111            self.0.request.update_mask = v.map(|x| x.into());
19112            self
19113        }
19114    }
19115
19116    #[doc(hidden)]
19117    impl gax::options::internal::RequestBuilder for UpdateSessionEntityType {
19118        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19119            &mut self.0.options
19120        }
19121    }
19122
19123    /// The request builder for [SessionEntityTypes::delete_session_entity_type][crate::client::SessionEntityTypes::delete_session_entity_type] calls.
19124    ///
19125    /// # Example
19126    /// ```no_run
19127    /// # use google_cloud_dialogflow_v2::builder;
19128    /// use builder::session_entity_types::DeleteSessionEntityType;
19129    /// # tokio_test::block_on(async {
19130    ///
19131    /// let builder = prepare_request_builder();
19132    /// let response = builder.send().await?;
19133    /// # gax::Result::<()>::Ok(()) });
19134    ///
19135    /// fn prepare_request_builder() -> DeleteSessionEntityType {
19136    ///   # panic!();
19137    ///   // ... details omitted ...
19138    /// }
19139    /// ```
19140    #[derive(Clone, Debug)]
19141    pub struct DeleteSessionEntityType(
19142        RequestBuilder<crate::model::DeleteSessionEntityTypeRequest>,
19143    );
19144
19145    impl DeleteSessionEntityType {
19146        pub(crate) fn new(
19147            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19148        ) -> Self {
19149            Self(RequestBuilder::new(stub))
19150        }
19151
19152        /// Sets the full request, replacing any prior values.
19153        pub fn with_request<V: Into<crate::model::DeleteSessionEntityTypeRequest>>(
19154            mut self,
19155            v: V,
19156        ) -> Self {
19157            self.0.request = v.into();
19158            self
19159        }
19160
19161        /// Sets all the options, replacing any prior values.
19162        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19163            self.0.options = v.into();
19164            self
19165        }
19166
19167        /// Sends the request.
19168        pub async fn send(self) -> Result<()> {
19169            (*self.0.stub)
19170                .delete_session_entity_type(self.0.request, self.0.options)
19171                .await
19172                .map(gax::response::Response::into_body)
19173        }
19174
19175        /// Sets the value of [name][crate::model::DeleteSessionEntityTypeRequest::name].
19176        ///
19177        /// This is a **required** field for requests.
19178        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19179            self.0.request.name = v.into();
19180            self
19181        }
19182    }
19183
19184    #[doc(hidden)]
19185    impl gax::options::internal::RequestBuilder for DeleteSessionEntityType {
19186        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19187            &mut self.0.options
19188        }
19189    }
19190
19191    /// The request builder for [SessionEntityTypes::list_locations][crate::client::SessionEntityTypes::list_locations] calls.
19192    ///
19193    /// # Example
19194    /// ```no_run
19195    /// # use google_cloud_dialogflow_v2::builder;
19196    /// use builder::session_entity_types::ListLocations;
19197    /// # tokio_test::block_on(async {
19198    /// use gax::paginator::ItemPaginator;
19199    ///
19200    /// let builder = prepare_request_builder();
19201    /// let mut items = builder.by_item();
19202    /// while let Some(result) = items.next().await {
19203    ///   let item = result?;
19204    /// }
19205    /// # gax::Result::<()>::Ok(()) });
19206    ///
19207    /// fn prepare_request_builder() -> ListLocations {
19208    ///   # panic!();
19209    ///   // ... details omitted ...
19210    /// }
19211    /// ```
19212    #[derive(Clone, Debug)]
19213    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
19214
19215    impl ListLocations {
19216        pub(crate) fn new(
19217            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19218        ) -> Self {
19219            Self(RequestBuilder::new(stub))
19220        }
19221
19222        /// Sets the full request, replacing any prior values.
19223        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
19224            mut self,
19225            v: V,
19226        ) -> Self {
19227            self.0.request = v.into();
19228            self
19229        }
19230
19231        /// Sets all the options, replacing any prior values.
19232        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19233            self.0.options = v.into();
19234            self
19235        }
19236
19237        /// Sends the request.
19238        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
19239            (*self.0.stub)
19240                .list_locations(self.0.request, self.0.options)
19241                .await
19242                .map(gax::response::Response::into_body)
19243        }
19244
19245        /// Streams each page in the collection.
19246        pub fn by_page(
19247            self,
19248        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
19249        {
19250            use std::clone::Clone;
19251            let token = self.0.request.page_token.clone();
19252            let execute = move |token: String| {
19253                let mut builder = self.clone();
19254                builder.0.request = builder.0.request.set_page_token(token);
19255                builder.send()
19256            };
19257            gax::paginator::internal::new_paginator(token, execute)
19258        }
19259
19260        /// Streams each item in the collection.
19261        pub fn by_item(
19262            self,
19263        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
19264        {
19265            use gax::paginator::Paginator;
19266            self.by_page().items()
19267        }
19268
19269        /// Sets the value of [name][location::model::ListLocationsRequest::name].
19270        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19271            self.0.request.name = v.into();
19272            self
19273        }
19274
19275        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
19276        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19277            self.0.request.filter = v.into();
19278            self
19279        }
19280
19281        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
19282        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19283            self.0.request.page_size = v.into();
19284            self
19285        }
19286
19287        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
19288        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19289            self.0.request.page_token = v.into();
19290            self
19291        }
19292    }
19293
19294    #[doc(hidden)]
19295    impl gax::options::internal::RequestBuilder for ListLocations {
19296        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19297            &mut self.0.options
19298        }
19299    }
19300
19301    /// The request builder for [SessionEntityTypes::get_location][crate::client::SessionEntityTypes::get_location] calls.
19302    ///
19303    /// # Example
19304    /// ```no_run
19305    /// # use google_cloud_dialogflow_v2::builder;
19306    /// use builder::session_entity_types::GetLocation;
19307    /// # tokio_test::block_on(async {
19308    ///
19309    /// let builder = prepare_request_builder();
19310    /// let response = builder.send().await?;
19311    /// # gax::Result::<()>::Ok(()) });
19312    ///
19313    /// fn prepare_request_builder() -> GetLocation {
19314    ///   # panic!();
19315    ///   // ... details omitted ...
19316    /// }
19317    /// ```
19318    #[derive(Clone, Debug)]
19319    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
19320
19321    impl GetLocation {
19322        pub(crate) fn new(
19323            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19324        ) -> Self {
19325            Self(RequestBuilder::new(stub))
19326        }
19327
19328        /// Sets the full request, replacing any prior values.
19329        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> 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<location::model::Location> {
19342            (*self.0.stub)
19343                .get_location(self.0.request, self.0.options)
19344                .await
19345                .map(gax::response::Response::into_body)
19346        }
19347
19348        /// Sets the value of [name][location::model::GetLocationRequest::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 GetLocation {
19357        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19358            &mut self.0.options
19359        }
19360    }
19361
19362    /// The request builder for [SessionEntityTypes::list_operations][crate::client::SessionEntityTypes::list_operations] calls.
19363    ///
19364    /// # Example
19365    /// ```no_run
19366    /// # use google_cloud_dialogflow_v2::builder;
19367    /// use builder::session_entity_types::ListOperations;
19368    /// # tokio_test::block_on(async {
19369    /// use gax::paginator::ItemPaginator;
19370    ///
19371    /// let builder = prepare_request_builder();
19372    /// let mut items = builder.by_item();
19373    /// while let Some(result) = items.next().await {
19374    ///   let item = result?;
19375    /// }
19376    /// # gax::Result::<()>::Ok(()) });
19377    ///
19378    /// fn prepare_request_builder() -> ListOperations {
19379    ///   # panic!();
19380    ///   // ... details omitted ...
19381    /// }
19382    /// ```
19383    #[derive(Clone, Debug)]
19384    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
19385
19386    impl ListOperations {
19387        pub(crate) fn new(
19388            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19389        ) -> Self {
19390            Self(RequestBuilder::new(stub))
19391        }
19392
19393        /// Sets the full request, replacing any prior values.
19394        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
19395            mut self,
19396            v: V,
19397        ) -> Self {
19398            self.0.request = v.into();
19399            self
19400        }
19401
19402        /// Sets all the options, replacing any prior values.
19403        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19404            self.0.options = v.into();
19405            self
19406        }
19407
19408        /// Sends the request.
19409        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
19410            (*self.0.stub)
19411                .list_operations(self.0.request, self.0.options)
19412                .await
19413                .map(gax::response::Response::into_body)
19414        }
19415
19416        /// Streams each page in the collection.
19417        pub fn by_page(
19418            self,
19419        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
19420        {
19421            use std::clone::Clone;
19422            let token = self.0.request.page_token.clone();
19423            let execute = move |token: String| {
19424                let mut builder = self.clone();
19425                builder.0.request = builder.0.request.set_page_token(token);
19426                builder.send()
19427            };
19428            gax::paginator::internal::new_paginator(token, execute)
19429        }
19430
19431        /// Streams each item in the collection.
19432        pub fn by_item(
19433            self,
19434        ) -> impl gax::paginator::ItemPaginator<
19435            longrunning::model::ListOperationsResponse,
19436            gax::error::Error,
19437        > {
19438            use gax::paginator::Paginator;
19439            self.by_page().items()
19440        }
19441
19442        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
19443        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19444            self.0.request.name = v.into();
19445            self
19446        }
19447
19448        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
19449        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19450            self.0.request.filter = v.into();
19451            self
19452        }
19453
19454        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
19455        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19456            self.0.request.page_size = v.into();
19457            self
19458        }
19459
19460        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
19461        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19462            self.0.request.page_token = v.into();
19463            self
19464        }
19465
19466        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
19467        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19468            self.0.request.return_partial_success = v.into();
19469            self
19470        }
19471    }
19472
19473    #[doc(hidden)]
19474    impl gax::options::internal::RequestBuilder for ListOperations {
19475        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19476            &mut self.0.options
19477        }
19478    }
19479
19480    /// The request builder for [SessionEntityTypes::get_operation][crate::client::SessionEntityTypes::get_operation] calls.
19481    ///
19482    /// # Example
19483    /// ```no_run
19484    /// # use google_cloud_dialogflow_v2::builder;
19485    /// use builder::session_entity_types::GetOperation;
19486    /// # tokio_test::block_on(async {
19487    ///
19488    /// let builder = prepare_request_builder();
19489    /// let response = builder.send().await?;
19490    /// # gax::Result::<()>::Ok(()) });
19491    ///
19492    /// fn prepare_request_builder() -> GetOperation {
19493    ///   # panic!();
19494    ///   // ... details omitted ...
19495    /// }
19496    /// ```
19497    #[derive(Clone, Debug)]
19498    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
19499
19500    impl GetOperation {
19501        pub(crate) fn new(
19502            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19503        ) -> Self {
19504            Self(RequestBuilder::new(stub))
19505        }
19506
19507        /// Sets the full request, replacing any prior values.
19508        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
19509            mut self,
19510            v: V,
19511        ) -> Self {
19512            self.0.request = v.into();
19513            self
19514        }
19515
19516        /// Sets all the options, replacing any prior values.
19517        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19518            self.0.options = v.into();
19519            self
19520        }
19521
19522        /// Sends the request.
19523        pub async fn send(self) -> Result<longrunning::model::Operation> {
19524            (*self.0.stub)
19525                .get_operation(self.0.request, self.0.options)
19526                .await
19527                .map(gax::response::Response::into_body)
19528        }
19529
19530        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
19531        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19532            self.0.request.name = v.into();
19533            self
19534        }
19535    }
19536
19537    #[doc(hidden)]
19538    impl gax::options::internal::RequestBuilder for GetOperation {
19539        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19540            &mut self.0.options
19541        }
19542    }
19543
19544    /// The request builder for [SessionEntityTypes::cancel_operation][crate::client::SessionEntityTypes::cancel_operation] calls.
19545    ///
19546    /// # Example
19547    /// ```no_run
19548    /// # use google_cloud_dialogflow_v2::builder;
19549    /// use builder::session_entity_types::CancelOperation;
19550    /// # tokio_test::block_on(async {
19551    ///
19552    /// let builder = prepare_request_builder();
19553    /// let response = builder.send().await?;
19554    /// # gax::Result::<()>::Ok(()) });
19555    ///
19556    /// fn prepare_request_builder() -> CancelOperation {
19557    ///   # panic!();
19558    ///   // ... details omitted ...
19559    /// }
19560    /// ```
19561    #[derive(Clone, Debug)]
19562    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
19563
19564    impl CancelOperation {
19565        pub(crate) fn new(
19566            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
19567        ) -> Self {
19568            Self(RequestBuilder::new(stub))
19569        }
19570
19571        /// Sets the full request, replacing any prior values.
19572        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
19573            mut self,
19574            v: V,
19575        ) -> Self {
19576            self.0.request = v.into();
19577            self
19578        }
19579
19580        /// Sets all the options, replacing any prior values.
19581        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19582            self.0.options = v.into();
19583            self
19584        }
19585
19586        /// Sends the request.
19587        pub async fn send(self) -> Result<()> {
19588            (*self.0.stub)
19589                .cancel_operation(self.0.request, self.0.options)
19590                .await
19591                .map(gax::response::Response::into_body)
19592        }
19593
19594        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
19595        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19596            self.0.request.name = v.into();
19597            self
19598        }
19599    }
19600
19601    #[doc(hidden)]
19602    impl gax::options::internal::RequestBuilder for CancelOperation {
19603        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19604            &mut self.0.options
19605        }
19606    }
19607}
19608
19609#[cfg(feature = "versions")]
19610#[cfg_attr(docsrs, doc(cfg(feature = "versions")))]
19611pub mod versions {
19612    use crate::Result;
19613
19614    /// A builder for [Versions][crate::client::Versions].
19615    ///
19616    /// ```
19617    /// # tokio_test::block_on(async {
19618    /// # use google_cloud_dialogflow_v2::*;
19619    /// # use builder::versions::ClientBuilder;
19620    /// # use client::Versions;
19621    /// let builder : ClientBuilder = Versions::builder();
19622    /// let client = builder
19623    ///     .with_endpoint("https://dialogflow.googleapis.com")
19624    ///     .build().await?;
19625    /// # gax::client_builder::Result::<()>::Ok(()) });
19626    /// ```
19627    pub type ClientBuilder =
19628        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19629
19630    pub(crate) mod client {
19631        use super::super::super::client::Versions;
19632        pub struct Factory;
19633        impl gax::client_builder::internal::ClientFactory for Factory {
19634            type Client = Versions;
19635            type Credentials = gaxi::options::Credentials;
19636            async fn build(
19637                self,
19638                config: gaxi::options::ClientConfig,
19639            ) -> gax::client_builder::Result<Self::Client> {
19640                Self::Client::new(config).await
19641            }
19642        }
19643    }
19644
19645    /// Common implementation for [crate::client::Versions] request builders.
19646    #[derive(Clone, Debug)]
19647    pub(crate) struct RequestBuilder<R: std::default::Default> {
19648        stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
19649        request: R,
19650        options: gax::options::RequestOptions,
19651    }
19652
19653    impl<R> RequestBuilder<R>
19654    where
19655        R: std::default::Default,
19656    {
19657        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
19658            Self {
19659                stub,
19660                request: R::default(),
19661                options: gax::options::RequestOptions::default(),
19662            }
19663        }
19664    }
19665
19666    /// The request builder for [Versions::list_versions][crate::client::Versions::list_versions] calls.
19667    ///
19668    /// # Example
19669    /// ```no_run
19670    /// # use google_cloud_dialogflow_v2::builder;
19671    /// use builder::versions::ListVersions;
19672    /// # tokio_test::block_on(async {
19673    /// use gax::paginator::ItemPaginator;
19674    ///
19675    /// let builder = prepare_request_builder();
19676    /// let mut items = builder.by_item();
19677    /// while let Some(result) = items.next().await {
19678    ///   let item = result?;
19679    /// }
19680    /// # gax::Result::<()>::Ok(()) });
19681    ///
19682    /// fn prepare_request_builder() -> ListVersions {
19683    ///   # panic!();
19684    ///   // ... details omitted ...
19685    /// }
19686    /// ```
19687    #[derive(Clone, Debug)]
19688    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
19689
19690    impl ListVersions {
19691        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
19692            Self(RequestBuilder::new(stub))
19693        }
19694
19695        /// Sets the full request, replacing any prior values.
19696        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
19697            self.0.request = v.into();
19698            self
19699        }
19700
19701        /// Sets all the options, replacing any prior values.
19702        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19703            self.0.options = v.into();
19704            self
19705        }
19706
19707        /// Sends the request.
19708        pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
19709            (*self.0.stub)
19710                .list_versions(self.0.request, self.0.options)
19711                .await
19712                .map(gax::response::Response::into_body)
19713        }
19714
19715        /// Streams each page in the collection.
19716        pub fn by_page(
19717            self,
19718        ) -> impl gax::paginator::Paginator<crate::model::ListVersionsResponse, gax::error::Error>
19719        {
19720            use std::clone::Clone;
19721            let token = self.0.request.page_token.clone();
19722            let execute = move |token: String| {
19723                let mut builder = self.clone();
19724                builder.0.request = builder.0.request.set_page_token(token);
19725                builder.send()
19726            };
19727            gax::paginator::internal::new_paginator(token, execute)
19728        }
19729
19730        /// Streams each item in the collection.
19731        pub fn by_item(
19732            self,
19733        ) -> impl gax::paginator::ItemPaginator<crate::model::ListVersionsResponse, gax::error::Error>
19734        {
19735            use gax::paginator::Paginator;
19736            self.by_page().items()
19737        }
19738
19739        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
19740        ///
19741        /// This is a **required** field for requests.
19742        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19743            self.0.request.parent = v.into();
19744            self
19745        }
19746
19747        /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
19748        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19749            self.0.request.page_size = v.into();
19750            self
19751        }
19752
19753        /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
19754        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19755            self.0.request.page_token = v.into();
19756            self
19757        }
19758    }
19759
19760    #[doc(hidden)]
19761    impl gax::options::internal::RequestBuilder for ListVersions {
19762        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19763            &mut self.0.options
19764        }
19765    }
19766
19767    /// The request builder for [Versions::get_version][crate::client::Versions::get_version] calls.
19768    ///
19769    /// # Example
19770    /// ```no_run
19771    /// # use google_cloud_dialogflow_v2::builder;
19772    /// use builder::versions::GetVersion;
19773    /// # tokio_test::block_on(async {
19774    ///
19775    /// let builder = prepare_request_builder();
19776    /// let response = builder.send().await?;
19777    /// # gax::Result::<()>::Ok(()) });
19778    ///
19779    /// fn prepare_request_builder() -> GetVersion {
19780    ///   # panic!();
19781    ///   // ... details omitted ...
19782    /// }
19783    /// ```
19784    #[derive(Clone, Debug)]
19785    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
19786
19787    impl GetVersion {
19788        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
19789            Self(RequestBuilder::new(stub))
19790        }
19791
19792        /// Sets the full request, replacing any prior values.
19793        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
19794            self.0.request = v.into();
19795            self
19796        }
19797
19798        /// Sets all the options, replacing any prior values.
19799        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19800            self.0.options = v.into();
19801            self
19802        }
19803
19804        /// Sends the request.
19805        pub async fn send(self) -> Result<crate::model::Version> {
19806            (*self.0.stub)
19807                .get_version(self.0.request, self.0.options)
19808                .await
19809                .map(gax::response::Response::into_body)
19810        }
19811
19812        /// Sets the value of [name][crate::model::GetVersionRequest::name].
19813        ///
19814        /// This is a **required** field for requests.
19815        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19816            self.0.request.name = v.into();
19817            self
19818        }
19819    }
19820
19821    #[doc(hidden)]
19822    impl gax::options::internal::RequestBuilder for GetVersion {
19823        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19824            &mut self.0.options
19825        }
19826    }
19827
19828    /// The request builder for [Versions::create_version][crate::client::Versions::create_version] calls.
19829    ///
19830    /// # Example
19831    /// ```no_run
19832    /// # use google_cloud_dialogflow_v2::builder;
19833    /// use builder::versions::CreateVersion;
19834    /// # tokio_test::block_on(async {
19835    ///
19836    /// let builder = prepare_request_builder();
19837    /// let response = builder.send().await?;
19838    /// # gax::Result::<()>::Ok(()) });
19839    ///
19840    /// fn prepare_request_builder() -> CreateVersion {
19841    ///   # panic!();
19842    ///   // ... details omitted ...
19843    /// }
19844    /// ```
19845    #[derive(Clone, Debug)]
19846    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
19847
19848    impl CreateVersion {
19849        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
19850            Self(RequestBuilder::new(stub))
19851        }
19852
19853        /// Sets the full request, replacing any prior values.
19854        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
19855            self.0.request = v.into();
19856            self
19857        }
19858
19859        /// Sets all the options, replacing any prior values.
19860        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19861            self.0.options = v.into();
19862            self
19863        }
19864
19865        /// Sends the request.
19866        pub async fn send(self) -> Result<crate::model::Version> {
19867            (*self.0.stub)
19868                .create_version(self.0.request, self.0.options)
19869                .await
19870                .map(gax::response::Response::into_body)
19871        }
19872
19873        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
19874        ///
19875        /// This is a **required** field for requests.
19876        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19877            self.0.request.parent = v.into();
19878            self
19879        }
19880
19881        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
19882        ///
19883        /// This is a **required** field for requests.
19884        pub fn set_version<T>(mut self, v: T) -> Self
19885        where
19886            T: std::convert::Into<crate::model::Version>,
19887        {
19888            self.0.request.version = std::option::Option::Some(v.into());
19889            self
19890        }
19891
19892        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
19893        ///
19894        /// This is a **required** field for requests.
19895        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
19896        where
19897            T: std::convert::Into<crate::model::Version>,
19898        {
19899            self.0.request.version = v.map(|x| x.into());
19900            self
19901        }
19902    }
19903
19904    #[doc(hidden)]
19905    impl gax::options::internal::RequestBuilder for CreateVersion {
19906        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
19907            &mut self.0.options
19908        }
19909    }
19910
19911    /// The request builder for [Versions::update_version][crate::client::Versions::update_version] calls.
19912    ///
19913    /// # Example
19914    /// ```no_run
19915    /// # use google_cloud_dialogflow_v2::builder;
19916    /// use builder::versions::UpdateVersion;
19917    /// # tokio_test::block_on(async {
19918    ///
19919    /// let builder = prepare_request_builder();
19920    /// let response = builder.send().await?;
19921    /// # gax::Result::<()>::Ok(()) });
19922    ///
19923    /// fn prepare_request_builder() -> UpdateVersion {
19924    ///   # panic!();
19925    ///   // ... details omitted ...
19926    /// }
19927    /// ```
19928    #[derive(Clone, Debug)]
19929    pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
19930
19931    impl UpdateVersion {
19932        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
19933            Self(RequestBuilder::new(stub))
19934        }
19935
19936        /// Sets the full request, replacing any prior values.
19937        pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
19938            self.0.request = v.into();
19939            self
19940        }
19941
19942        /// Sets all the options, replacing any prior values.
19943        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
19944            self.0.options = v.into();
19945            self
19946        }
19947
19948        /// Sends the request.
19949        pub async fn send(self) -> Result<crate::model::Version> {
19950            (*self.0.stub)
19951                .update_version(self.0.request, self.0.options)
19952                .await
19953                .map(gax::response::Response::into_body)
19954        }
19955
19956        /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
19957        ///
19958        /// This is a **required** field for requests.
19959        pub fn set_version<T>(mut self, v: T) -> Self
19960        where
19961            T: std::convert::Into<crate::model::Version>,
19962        {
19963            self.0.request.version = std::option::Option::Some(v.into());
19964            self
19965        }
19966
19967        /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
19968        ///
19969        /// This is a **required** field for requests.
19970        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
19971        where
19972            T: std::convert::Into<crate::model::Version>,
19973        {
19974            self.0.request.version = v.map(|x| x.into());
19975            self
19976        }
19977
19978        /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
19979        ///
19980        /// This is a **required** field for requests.
19981        pub fn set_update_mask<T>(mut self, v: T) -> Self
19982        where
19983            T: std::convert::Into<wkt::FieldMask>,
19984        {
19985            self.0.request.update_mask = std::option::Option::Some(v.into());
19986            self
19987        }
19988
19989        /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
19990        ///
19991        /// This is a **required** field for requests.
19992        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19993        where
19994            T: std::convert::Into<wkt::FieldMask>,
19995        {
19996            self.0.request.update_mask = v.map(|x| x.into());
19997            self
19998        }
19999    }
20000
20001    #[doc(hidden)]
20002    impl gax::options::internal::RequestBuilder for UpdateVersion {
20003        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20004            &mut self.0.options
20005        }
20006    }
20007
20008    /// The request builder for [Versions::delete_version][crate::client::Versions::delete_version] calls.
20009    ///
20010    /// # Example
20011    /// ```no_run
20012    /// # use google_cloud_dialogflow_v2::builder;
20013    /// use builder::versions::DeleteVersion;
20014    /// # tokio_test::block_on(async {
20015    ///
20016    /// let builder = prepare_request_builder();
20017    /// let response = builder.send().await?;
20018    /// # gax::Result::<()>::Ok(()) });
20019    ///
20020    /// fn prepare_request_builder() -> DeleteVersion {
20021    ///   # panic!();
20022    ///   // ... details omitted ...
20023    /// }
20024    /// ```
20025    #[derive(Clone, Debug)]
20026    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
20027
20028    impl DeleteVersion {
20029        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20030            Self(RequestBuilder::new(stub))
20031        }
20032
20033        /// Sets the full request, replacing any prior values.
20034        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
20035            self.0.request = v.into();
20036            self
20037        }
20038
20039        /// Sets all the options, replacing any prior values.
20040        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20041            self.0.options = v.into();
20042            self
20043        }
20044
20045        /// Sends the request.
20046        pub async fn send(self) -> Result<()> {
20047            (*self.0.stub)
20048                .delete_version(self.0.request, self.0.options)
20049                .await
20050                .map(gax::response::Response::into_body)
20051        }
20052
20053        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
20054        ///
20055        /// This is a **required** field for requests.
20056        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20057            self.0.request.name = v.into();
20058            self
20059        }
20060    }
20061
20062    #[doc(hidden)]
20063    impl gax::options::internal::RequestBuilder for DeleteVersion {
20064        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20065            &mut self.0.options
20066        }
20067    }
20068
20069    /// The request builder for [Versions::list_locations][crate::client::Versions::list_locations] calls.
20070    ///
20071    /// # Example
20072    /// ```no_run
20073    /// # use google_cloud_dialogflow_v2::builder;
20074    /// use builder::versions::ListLocations;
20075    /// # tokio_test::block_on(async {
20076    /// use gax::paginator::ItemPaginator;
20077    ///
20078    /// let builder = prepare_request_builder();
20079    /// let mut items = builder.by_item();
20080    /// while let Some(result) = items.next().await {
20081    ///   let item = result?;
20082    /// }
20083    /// # gax::Result::<()>::Ok(()) });
20084    ///
20085    /// fn prepare_request_builder() -> ListLocations {
20086    ///   # panic!();
20087    ///   // ... details omitted ...
20088    /// }
20089    /// ```
20090    #[derive(Clone, Debug)]
20091    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
20092
20093    impl ListLocations {
20094        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20095            Self(RequestBuilder::new(stub))
20096        }
20097
20098        /// Sets the full request, replacing any prior values.
20099        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
20100            mut self,
20101            v: V,
20102        ) -> Self {
20103            self.0.request = v.into();
20104            self
20105        }
20106
20107        /// Sets all the options, replacing any prior values.
20108        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20109            self.0.options = v.into();
20110            self
20111        }
20112
20113        /// Sends the request.
20114        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
20115            (*self.0.stub)
20116                .list_locations(self.0.request, self.0.options)
20117                .await
20118                .map(gax::response::Response::into_body)
20119        }
20120
20121        /// Streams each page in the collection.
20122        pub fn by_page(
20123            self,
20124        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
20125        {
20126            use std::clone::Clone;
20127            let token = self.0.request.page_token.clone();
20128            let execute = move |token: String| {
20129                let mut builder = self.clone();
20130                builder.0.request = builder.0.request.set_page_token(token);
20131                builder.send()
20132            };
20133            gax::paginator::internal::new_paginator(token, execute)
20134        }
20135
20136        /// Streams each item in the collection.
20137        pub fn by_item(
20138            self,
20139        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
20140        {
20141            use gax::paginator::Paginator;
20142            self.by_page().items()
20143        }
20144
20145        /// Sets the value of [name][location::model::ListLocationsRequest::name].
20146        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20147            self.0.request.name = v.into();
20148            self
20149        }
20150
20151        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
20152        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20153            self.0.request.filter = v.into();
20154            self
20155        }
20156
20157        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
20158        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20159            self.0.request.page_size = v.into();
20160            self
20161        }
20162
20163        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
20164        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20165            self.0.request.page_token = v.into();
20166            self
20167        }
20168    }
20169
20170    #[doc(hidden)]
20171    impl gax::options::internal::RequestBuilder for ListLocations {
20172        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20173            &mut self.0.options
20174        }
20175    }
20176
20177    /// The request builder for [Versions::get_location][crate::client::Versions::get_location] calls.
20178    ///
20179    /// # Example
20180    /// ```no_run
20181    /// # use google_cloud_dialogflow_v2::builder;
20182    /// use builder::versions::GetLocation;
20183    /// # tokio_test::block_on(async {
20184    ///
20185    /// let builder = prepare_request_builder();
20186    /// let response = builder.send().await?;
20187    /// # gax::Result::<()>::Ok(()) });
20188    ///
20189    /// fn prepare_request_builder() -> GetLocation {
20190    ///   # panic!();
20191    ///   // ... details omitted ...
20192    /// }
20193    /// ```
20194    #[derive(Clone, Debug)]
20195    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
20196
20197    impl GetLocation {
20198        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20199            Self(RequestBuilder::new(stub))
20200        }
20201
20202        /// Sets the full request, replacing any prior values.
20203        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
20204            self.0.request = v.into();
20205            self
20206        }
20207
20208        /// Sets all the options, replacing any prior values.
20209        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20210            self.0.options = v.into();
20211            self
20212        }
20213
20214        /// Sends the request.
20215        pub async fn send(self) -> Result<location::model::Location> {
20216            (*self.0.stub)
20217                .get_location(self.0.request, self.0.options)
20218                .await
20219                .map(gax::response::Response::into_body)
20220        }
20221
20222        /// Sets the value of [name][location::model::GetLocationRequest::name].
20223        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20224            self.0.request.name = v.into();
20225            self
20226        }
20227    }
20228
20229    #[doc(hidden)]
20230    impl gax::options::internal::RequestBuilder for GetLocation {
20231        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20232            &mut self.0.options
20233        }
20234    }
20235
20236    /// The request builder for [Versions::list_operations][crate::client::Versions::list_operations] calls.
20237    ///
20238    /// # Example
20239    /// ```no_run
20240    /// # use google_cloud_dialogflow_v2::builder;
20241    /// use builder::versions::ListOperations;
20242    /// # tokio_test::block_on(async {
20243    /// use gax::paginator::ItemPaginator;
20244    ///
20245    /// let builder = prepare_request_builder();
20246    /// let mut items = builder.by_item();
20247    /// while let Some(result) = items.next().await {
20248    ///   let item = result?;
20249    /// }
20250    /// # gax::Result::<()>::Ok(()) });
20251    ///
20252    /// fn prepare_request_builder() -> ListOperations {
20253    ///   # panic!();
20254    ///   // ... details omitted ...
20255    /// }
20256    /// ```
20257    #[derive(Clone, Debug)]
20258    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
20259
20260    impl ListOperations {
20261        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20262            Self(RequestBuilder::new(stub))
20263        }
20264
20265        /// Sets the full request, replacing any prior values.
20266        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
20267            mut self,
20268            v: V,
20269        ) -> Self {
20270            self.0.request = v.into();
20271            self
20272        }
20273
20274        /// Sets all the options, replacing any prior values.
20275        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20276            self.0.options = v.into();
20277            self
20278        }
20279
20280        /// Sends the request.
20281        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
20282            (*self.0.stub)
20283                .list_operations(self.0.request, self.0.options)
20284                .await
20285                .map(gax::response::Response::into_body)
20286        }
20287
20288        /// Streams each page in the collection.
20289        pub fn by_page(
20290            self,
20291        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
20292        {
20293            use std::clone::Clone;
20294            let token = self.0.request.page_token.clone();
20295            let execute = move |token: String| {
20296                let mut builder = self.clone();
20297                builder.0.request = builder.0.request.set_page_token(token);
20298                builder.send()
20299            };
20300            gax::paginator::internal::new_paginator(token, execute)
20301        }
20302
20303        /// Streams each item in the collection.
20304        pub fn by_item(
20305            self,
20306        ) -> impl gax::paginator::ItemPaginator<
20307            longrunning::model::ListOperationsResponse,
20308            gax::error::Error,
20309        > {
20310            use gax::paginator::Paginator;
20311            self.by_page().items()
20312        }
20313
20314        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
20315        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20316            self.0.request.name = v.into();
20317            self
20318        }
20319
20320        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
20321        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20322            self.0.request.filter = v.into();
20323            self
20324        }
20325
20326        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
20327        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20328            self.0.request.page_size = v.into();
20329            self
20330        }
20331
20332        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
20333        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20334            self.0.request.page_token = v.into();
20335            self
20336        }
20337
20338        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
20339        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20340            self.0.request.return_partial_success = v.into();
20341            self
20342        }
20343    }
20344
20345    #[doc(hidden)]
20346    impl gax::options::internal::RequestBuilder for ListOperations {
20347        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20348            &mut self.0.options
20349        }
20350    }
20351
20352    /// The request builder for [Versions::get_operation][crate::client::Versions::get_operation] calls.
20353    ///
20354    /// # Example
20355    /// ```no_run
20356    /// # use google_cloud_dialogflow_v2::builder;
20357    /// use builder::versions::GetOperation;
20358    /// # tokio_test::block_on(async {
20359    ///
20360    /// let builder = prepare_request_builder();
20361    /// let response = builder.send().await?;
20362    /// # gax::Result::<()>::Ok(()) });
20363    ///
20364    /// fn prepare_request_builder() -> GetOperation {
20365    ///   # panic!();
20366    ///   // ... details omitted ...
20367    /// }
20368    /// ```
20369    #[derive(Clone, Debug)]
20370    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
20371
20372    impl GetOperation {
20373        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20374            Self(RequestBuilder::new(stub))
20375        }
20376
20377        /// Sets the full request, replacing any prior values.
20378        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
20379            mut self,
20380            v: V,
20381        ) -> Self {
20382            self.0.request = v.into();
20383            self
20384        }
20385
20386        /// Sets all the options, replacing any prior values.
20387        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20388            self.0.options = v.into();
20389            self
20390        }
20391
20392        /// Sends the request.
20393        pub async fn send(self) -> Result<longrunning::model::Operation> {
20394            (*self.0.stub)
20395                .get_operation(self.0.request, self.0.options)
20396                .await
20397                .map(gax::response::Response::into_body)
20398        }
20399
20400        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
20401        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20402            self.0.request.name = v.into();
20403            self
20404        }
20405    }
20406
20407    #[doc(hidden)]
20408    impl gax::options::internal::RequestBuilder for GetOperation {
20409        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20410            &mut self.0.options
20411        }
20412    }
20413
20414    /// The request builder for [Versions::cancel_operation][crate::client::Versions::cancel_operation] calls.
20415    ///
20416    /// # Example
20417    /// ```no_run
20418    /// # use google_cloud_dialogflow_v2::builder;
20419    /// use builder::versions::CancelOperation;
20420    /// # tokio_test::block_on(async {
20421    ///
20422    /// let builder = prepare_request_builder();
20423    /// let response = builder.send().await?;
20424    /// # gax::Result::<()>::Ok(()) });
20425    ///
20426    /// fn prepare_request_builder() -> CancelOperation {
20427    ///   # panic!();
20428    ///   // ... details omitted ...
20429    /// }
20430    /// ```
20431    #[derive(Clone, Debug)]
20432    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
20433
20434    impl CancelOperation {
20435        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20436            Self(RequestBuilder::new(stub))
20437        }
20438
20439        /// Sets the full request, replacing any prior values.
20440        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
20441            mut self,
20442            v: V,
20443        ) -> Self {
20444            self.0.request = v.into();
20445            self
20446        }
20447
20448        /// Sets all the options, replacing any prior values.
20449        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
20450            self.0.options = v.into();
20451            self
20452        }
20453
20454        /// Sends the request.
20455        pub async fn send(self) -> Result<()> {
20456            (*self.0.stub)
20457                .cancel_operation(self.0.request, self.0.options)
20458                .await
20459                .map(gax::response::Response::into_body)
20460        }
20461
20462        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
20463        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20464            self.0.request.name = v.into();
20465            self
20466        }
20467    }
20468
20469    #[doc(hidden)]
20470    impl gax::options::internal::RequestBuilder for CancelOperation {
20471        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
20472            &mut self.0.options
20473        }
20474    }
20475}